Skip to content

Commit

Permalink
fix vote gas refund
Browse files Browse the repository at this point in the history
we accidentally used the old V2 code that refunds msg.sender
it should be tx.origin
to refund gas payers of multisigs
  • Loading branch information
eladmallel committed Nov 7, 2023
1 parent b7bf7e9 commit add8aca
Show file tree
Hide file tree
Showing 3 changed files with 466 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ library NounsDAOV3Votes {
uint256 gasPrice = min(tx.gasprice, basefee + MAX_REFUND_PRIORITY_FEE);
uint256 gasUsed = min(startGas - gasleft() + REFUND_BASE_GAS, MAX_REFUND_GAS_USED);
uint256 refundAmount = min(gasPrice * gasUsed, balance);
(bool refundSent, ) = msg.sender.call{ value: refundAmount }('');
emit RefundableVote(msg.sender, refundAmount, refundSent);
(bool refundSent, ) = tx.origin.call{ value: refundAmount }('');
emit RefundableVote(tx.origin, refundAmount, refundSent);
}
}

Expand Down
Loading

0 comments on commit add8aca

Please sign in to comment.