Skip to content

Commit 263dcd9

Browse files
committed
Remove MAX_ERC20_TRANSFER_GAS_COST
1 parent 214b792 commit 263dcd9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

contracts/SpokePool.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ abstract contract SpokePool is
165165
// exclusivityDeadline in a deposit event will be set to the current time plus this value.
166166
uint32 public constant MAX_EXCLUSIVITY_PERIOD_SECONDS = 31_536_000;
167167

168-
// This is a conservative limit equal to ~3x the average gas cost of a transfer() call on an ERC20 token.
169-
// This value is used as a cap to protect refund leaf executors from executing any refund leaf that calls
170-
// transfer() on a token that attempts to grief the executor by charging them a lot of gas.
171-
uint256 public constant MAX_ERC20_TRANSFER_GAS_COST = 300_000;
172168
/****************************************
173169
* EVENTS *
174170
****************************************/
@@ -1498,7 +1494,7 @@ abstract contract SpokePool is
14981494
uint256 returnValue;
14991495
bytes memory data = abi.encodeCall(IERC20Upgradeable.transfer, (to, amount));
15001496
assembly {
1501-
success := call(MAX_ERC20_TRANSFER_GAS_COST, token, 0, add(data, 0x20), mload(data), 0, 0x20)
1497+
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
15021498
returnSize := returndatasize()
15031499
returnValue := mload(0)
15041500
}

0 commit comments

Comments
 (0)