π€Avoid using "transfer" to send ERC20s
Avoid using "transfer" on your smart contract, instead use "call".
function withdraw(uint256 amount) external {
msg.sender.transfer(amount);
}function withdraw(uint256 amount) external {
(bool success, ) = msg.sender.call.value(amount)(""); // HERE's the "CALL"
require(success, "Transfer failed."); // Confirm the transaction
}

Last updated