ERC20 return values not checked #212
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
cmichel
Vulnerability details
The
ERC20.transfer()
andERC20.transferFrom()
functions return a boolean value indicating success. This parameter should checked for success.Some functions perform ERC20 transfers without checking for the return value:
BasicSale._processWithdrawal
AirdropDistribution.claim
InvestorDistribution.dev_rugpull
Impact
As the trusted
mainToken
token is used which supposedly reverts on failed transfers, not checking the return value does not lead to any security issues.We still recommend checking it to abide by the EIP20 standard.
Recommended Mitigation Steps
Consider using
require(mainToken.transfer(_member, v_value), "transfer failed")
instead.The text was updated successfully, but these errors were encountered: