According to the documentation Sablier doesn't support ERC777 tokens.
But currently there is no check that prevents a malicious user to add an ERC777 token. Besides, there is no check against reentrancy. Here's the function used to transfer funds when creating a stream from SablierV2BatchLockup
:
The SafeERC20 doesn't prevent the use of ERC777. ERC777 has the same functions as a standard ERC20 token. Look at the snippet code below:
As the contract doesn't have any check to prevent that, ERC777 tokens will be introduced in the system and will allow malicious users to use the hook _callTokensReceived
when receiving those tokens.
ERC-777 is used but the system it is supposed to support only ERC20.
Hooks are introduced and malicious users has the possibility to use reentrancy as the contracts don't check for that.
Manual Review
A function could be add to check whether the token is an ERC777 or not. As the ERC777 token has specific functions that doesn't conform with the ERC20 standard like granularity
and send
for instance, this could be added as a safety check.
Additionally, using the nonReentrant
modifier from OZ could reinforce the safety against reentrancy.
Ref: https://docs.openzeppelin.com/contracts/2.x/api/token/erc777
https://www.codehawks.com/contests/clvb9njmy00012dqjyaavpl44
https://www.codehawks.com/contests/clvb9njmy00012dqjyaavpl44
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.