Created
July 9, 2019 17:18
-
-
Save alerdenisov/457c4614d375d996fbc2faef0f280be0 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.5.10+commit.5a6ea5b1.js&optimize=false&gist=
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.10; | |
contract Foo { | |
function bar() public { | |
} | |
} |
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.10; | |
contract Gateway { | |
bool open; | |
function accessCard() public { | |
open = true; | |
} | |
function passthrough() public { | |
open = false; | |
} | |
function getState() public view returns (bool) { | |
return open; | |
} | |
} |
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.10; | |
contract StorageMaps { | |
mapping (address => uint) storages; | |
function set(uint x) public { | |
storages[msg.sender] = x; | |
} | |
function getUserValue(address user) internal view returns (uint) { | |
return storages[user]; | |
} | |
function getMy() public view returns (uint) { | |
return getUserValue(msg.sender); | |
} | |
function getFor(address user) public view returns (uint) { | |
return getUserValue(user); | |
} | |
} |
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.10; | |
contract DummyEvent { | |
event Hooray(); | |
function () external { | |
emit Hooray(); | |
} | |
} |
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.10; | |
contract DummyEvent { | |
event SmartEvent(address indexed caller, uint256 value); | |
function () payable external { | |
emit SmartEvent(msg.sender, msg.value); | |
} | |
} |
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.10; | |
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; | |
contract Token is ERC20Mintable, ERC20Detailed { | |
constructor() ERC20Detailed("Test Token", "TST", 18) public {} | |
} |
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.10; | |
contract Parent { | |
event ParentPick(); | |
function pickFromKindergarten() internal { | |
emit ParentPick(); | |
} | |
} | |
contract Dad is Parent { | |
event DadPick(); | |
function pickFromKindergarten() internal { | |
emit DadPick(); | |
super.pickFromKindergarten(); | |
} | |
} | |
contract Mother is Parent { | |
event MomPick(); | |
function pickFromKindergarten() internal { | |
emit MomPick(); | |
super.pickFromKindergarten(); | |
} | |
} | |
contract Son is Mother, Dad { | |
function goToHome() payable public { | |
super.pickFromKindergarten(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment