Consider using safeTransfer
/safeTransferFrom
instead of transfer
/transferFrom
.
Using safeTransfer()
instead of transfer()
is a best practice in Solidity because safeTransfer()
includes extra checks and error handling that ensure compatibility with both standard and non-standard ERC20 tokens.
transfer()
may not revert on failure while safeTransfer()
reverts if the transfer fails. Using safeTransfer()
ensures that the contract is robust and compatible with a broader range of ERC20 tokens, reducing the risk of failed transfers and enhancing security.
Manual audit
Import SafeERC20 library from OpenZeppelin:
Use safeTransfer()
/ safeTransferFrom()
with IERC20 casting:
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.