18: Revert
revert(message);contract RevertExample {
function deposit() public payable {
if (msg.value < 100) {
revert("Deposit must be at least 100.");
} // ...
}
}contract RevertExample {
uint256 private ownerBalance;
function withdraw() public {
if (msg.value > ownerBalance) {
revert("Insufficient funds.");
} // ...
}
}Last updated