Skip to content

Instantly share code, notes, and snippets.

Created November 25, 2017 16:11
Show Gist options
  • Select an option

  • Save anonymous/7d8875b744432f0a7a997c7171424847 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/7d8875b744432f0a7a997c7171424847 to your computer and use it in GitHub Desktop.
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=undefined&gist=
pragma solidity ^0.4.11;
contract ViewCounter {
address public donator;
function ViewCounter() {
donator = msg.sender;
}
function () payable {
donator = msg.sender;
}
function setDonator (address _donator) internal {
donator = _donator;
}
}
pragma solidity ^0.4.18;
contract HelloWorld {
string name;
uint age;
function getData() public constant returns (string) {
return name;
}
function setData(string newData) public {
name = newData;
}
function getData() public constant return (age) {
return age;
}
function setData(uint newData) public {
age = newData;
}
}
pragma solidity ^0.4.11;
contract ParentContract {
address public donator;
function ParentContract() {
donator = msg.sender;
}
function () payable {
donator = msg.sender;
}
function setDonator(address _donator) internal {
donator = _donator;
}
}
contract ChildContract is ParentContract {
function setRealDonator(address _donator) payable {
if (msg.value > 1 * 1 ether){
donator = _donator;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment