Skip to content

Instantly share code, notes, and snippets.

@alexroan
Created June 10, 2018 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexroan/aea327019af2ca67861659aabbc3c944 to your computer and use it in GitHub Desktop.
Save alexroan/aea327019af2ca67861659aabbc3c944 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
contract TestThrows{
//Assert takes boolean.
//Used in concept of checking data values
function testAssert(){
assert(1==2);
}
//Require takes boolean
//More parameter requirement
function testRequire(){
require(1==2);
}
//Doesn't require any params
//Reverts gas cost of the message sent
//Run out of coins to sell? revert the gas - unfair
function testRevert(){
revert();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment