Certain ERC-20
tokens revert when attempting to approve a very large amount (e.g., type(uint256).max
). This behavior can prevent the SablierV2MerkleLT
and SablierV2MerkleLL
contracts from deploying successfully, as it includes a large approval in their constructors.
The SablierV2MerkleLT
and SablierV2MerkleLL
contracts approve the maximum value of type(uint256)
in their constructors:
SablierV2MerkleLT
:
SablierV2MerkleLL
:
The problem is that some tokens revert on large approval or transfer:
Some tokens (e.g. UNI, COMP) revert if the value passed to approve or transfer is larger than uint96.
https://github.com/d-xo/weird-erc20?tab=readme-ov-file#revert-on-large-approvals--transfers
If the asset is some of these tokens (that is possible because the protocol will work with any ERC20 tokens), the forceApprove
function in SablierV2MerkleLL
and SablierV2MerkleLT
will revert. That will lead to unability the contracts to be deployed.
If the contracts SablierV2MerkleLL
and SablierV2MerkleLT
appove asset that reverts by large approval, the contracts can not be deployed disrupting the functionality of the protocol.
Manual Review
Approve a small amount of asset in the constructor and then when it is needed approve more before the transaction.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.