Revert function
function myFunction() public {
require(msg.sender == owner, "Only the contract owner can call this function");
if (someCondition) {
revert("Invalid condition");
}
// Rest of the function logic
}Last updated
function myFunction() public {
require(msg.sender == owner, "Only the contract owner can call this function");
if (someCondition) {
revert("Invalid condition");
}
// Rest of the function logic
}Last updated