Skip to content

Commit 6eda3ba

Browse files
authored
Update ERC2771Forwarder.sol
1 parent a2c44f0 commit 6eda3ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contracts/metatx/ERC2771Forwarder.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ contract ERC2771Forwarder is EIP712, Nonces {
181181
refundValue += requests[i].value;
182182
}
183183
}
184-
if (atomic && refundValue > 0) revert ERC2771ForwarderFailureInAtomicBatch();
185184

186185
// The batch should revert if there's a mismatched msg.value provided
187186
// to avoid request value tampering
@@ -192,6 +191,8 @@ contract ERC2771Forwarder is EIP712, Nonces {
192191
// Some requests with value were invalid (possibly due to frontrunning).
193192
// To avoid leaving ETH in the contract this value is refunded.
194193
if (refundValue != 0) {
194+
if (atomic) revert ERC2771ForwarderFailureInAtomicBatch();
195+
195196
// We know refundReceiver != address(0) && requestsValue == msg.value
196197
// meaning we can ensure refundValue is not taken from the original contract's balance
197198
// and refundReceiver is a known account.

0 commit comments

Comments
 (0)