【Revert】
pragma solidity ^0.8.11;
contract error {
function testRevert(uint _i) public pure {
if (_i <= 10) {
if (_i != 10){
revert("Input must be equal 10");
}
}
}
}if (amount > msg.value ether){
revert("Not Enough Ether Provided");
}
// Alternative way to fdo it:
require(amount <= msg.value ether, "Not Enough Ether Provided");Last updated