Some ERC20 tokens do not implement correctly EIP-20 standard. They just do not return a boolean in transfer/transferFrom functions and just return void. Asking them for a boolean will always revert and you will be unable to use VotingEscrow for those tokens.
Lines of code
https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L546 https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L657 https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L676 https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L426 https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L486
Vulnerability details
Impact
Protocol unusable for USDT and other bad tokens
Proof of Concept
Some ERC20 tokens do not implement correctly EIP-20 standard. They just do not return a boolean in
transfer/transferFrom
functions and just returnvoid
. Asking them for a boolean will always revert and you will be unable to useVotingEscrow
for those tokens.Recommended Mitigation Steps
Consider use
safeERC20
library from OZ