code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Handle transfers of different ERC20 tokens #275

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Impact

Some ERC20 transfers have require checks, e.g.: require(iERC20(_token).transfer(_member, _amount)); some don't, e.g.: iERC20(_token).transfer(_recipient, _amount); It is a good practice to think about all the possible variations of ERC20s ( see: https://github.com/xwvvvvwx/weird-erc20 ).

Recommended Mitigation Steps

The current most common solution is to use SafeERC20 transfers: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol

dmvt commented 3 years ago

duplicate of #231