Skip to content

Commit

Permalink
fix: also check in GasRefundEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Oct 2, 2024
1 parent d30adb0 commit 191c404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libraries/GasRefundEnabled.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract contract GasRefundEnabled {
// if triggered in a contract call, the spender may be overrefunded by appending dummy data to the call
// so we check if it is a top level call, which would mean the sender paid calldata as part of tx.input
// solhint-disable-next-line avoid-tx-origin
if (msg.sender != tx.origin) {
if (msg.sender != tx.origin || msg.sender.code.length != 0) {
// We can't be sure if this calldata came from the top level tx,
// so to be safe we tell the gas refunder there was no calldata.
calldataSize = 0;
Expand Down

0 comments on commit 191c404

Please sign in to comment.