Skip to content

Instantly share code, notes, and snippets.

@emurmotol
Created July 4, 2018 09:48
Show Gist options
  • Save emurmotol/5626ed0f13ef3d94ab98d3805ecd99ae to your computer and use it in GitHub Desktop.
Save emurmotol/5626ed0f13ef3d94ab98d3805ecd99ae 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=
pragma solidity ^0.4.22;
contract Purchase {
address public seller;
modifier onlySeller() { // Modifier
require(
msg.sender == seller,
"Only seller can call this."
);
_;
}
function abort() public onlySeller { // Modifier usage
// ...
}
}
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment