safeTransfer is recommended instead of transfer (2) #44
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
invalid
This doesn't seem right
Lines of code
https://github.com/code-423n4/2022-04-mimo/blob/b18670f44d595483df2c0f76d1c57a7bfbfbc083/supervaults/contracts/SuperVault.sol#L237
Vulnerability details
Impact
ERC20 standard allows transfer function of some contracts to return bool or return nothing. Using safeTransfer of SafeERC20.sol is recommended instead.
Proof of Concept
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/4a9cc8b4918ef3736229a5cc5a310bdc17bf759f/contracts/token/ERC20/utils/SafeERC20.sol
Tools Used
Recommended Mitigation Steps
Recommended code:
collateral.safeTransfer(msg.sender, collateral.balanceOf(address(this)));
The text was updated successfully, but these errors were encountered: