Last active
March 24, 2020 12:39
-
-
Save alexroan/c965192e3f35710f62d778cc3febc5da to your computer and use it in GitHub Desktop.
examples/solidity-require-statements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
contract RequireStatements { | |
function someFunction(address _anAddress) external { | |
// Require that the address given as a parameter is not equal to an empty addess. | |
// If the address is empty, the whole transaction will not be completed and will be reverted | |
require(_anAddress != address(0), "Not a valid address"); | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment