using unchecked w/o require
Integer overflow/underflow
Typical Implementation
function deposit(uint256 amount) public {
balances[msg.sender] += amount;
bool successful = token.transferFrom(msg.sender, address(this), amount);
require(successful, "Deposit failed!");
emit Deposited(msg.sender, amount);
}Could you use unchecked here?
unchecked here? new implementation
Last updated