In the SablierV2BatchLockup contract, there are several instances where the contract uses safeTransferFrom
for ERC-20 tokens. This method is compatible with most ERC-20 tokens, including the standard WETH9 implementation on Ethereum, Optimism, Polygon, and BSC.
However, on networks like Blast, it uses different WETH implementation that do not handle the
src == msg.sender
case, the safeTransferFrom
method can fail, causing the creation of streams to be unsuccessful.
In the SablierV2BatchLockup contract, the _handleTransfer function uses safeTransferFrom to transfer tokens from the user to the contract.
This function assumes the safeTransferFrom method will handle the transfer correctly if the sender has approved the necessary allowance.
On networks like Blast, Wrapped Arbitrum, Wrapped Fantom and the WETH implementations do not handle the src == msg.sender case.
When the _handleTransfer
function fails, the streams cannot be created, causing the entire batch
lockup process to fail.
The issue arises because asset.safeTransferFrom
expects the WETH contract to handle the src == msg.sender
case,
which is not implemented in some WETH contracts on certain networks ie BLAST.
https://blastscan.io/address/0x4300000000000000000000000000000000000004#code
POC
Make sure to run this test with this flag:
forge test --match-test testPoC_TransferFromRevert --fork-url https://rpc.blast.io
Foundry/Forge
Use this implementation instead.
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.