This file contains 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.4.19; | |
contract storeFavoriteNumber{ | |
mapping (address => uint) favoriteNumber; | |
function setMyNumber(uint _myNumber) public { | |
favoriteNumber[msg.sender] = _myNumber; | |
} | |
function returnNumber() public view returns (uint) { |
This file contains 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.4.19; | |
contract helloWorld{ | |
string word = "Hello World!"; | |
function getWord() public view returns(string){ | |
return word; | |
} | |
function setWord(string newWord) public returns(string){ |
This file contains 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.4.19; | |
contract helloWorld{ | |
string word = "Hello World!"; | |
address owner; | |
function helloWorld() public { | |
owner = msg.sender; | |
} |
This file contains 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.4.19; | |
contract payableContract { | |
function payableContract() public { | |
} | |
function receive() public payable { | |
This file contains 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.4.19; | |
contract callerContract { | |
calledContract toBeCalled = new calledContract(); | |
function receive() public constant returns (uint) { | |
return toBeCalled.getNumber(); | |
} | |
} |
This file contains 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.4.19; | |
contract mortal { | |
address public owner; | |
function mortal() { | |
owner = msg.sender; | |
} | |
modifier onlyOwner { |
This file contains 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.4.19; | |
contract Calculator { | |
Math math = new Math(); | |
function TwoPlusFour() public view returns (int) { | |
return math.add(2,4); | |
} | |
function TwoTimesFour() public view returns (int) { | |
return math.multiply(2,4); |
This file contains 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.4.18; | |
contract Paycheck { | |
address[] Employees = [0xd2dE66A09F48A96b8cd429951ca70F79715beBCc, 0x80bFb3c5C9386e687936868A79f2e626F38a4AC2, randomaddress, randomaddress]; | |
mapping (address => uint) WithdrawnAmount; | |
function Paycheck() public payable { | |
} | |
This file contains 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.4.18; | |
contract SavingsAccount { | |
address owner; | |
event UpdateStatus(string msg); | |
event UserStatus(string msg, address user, uint amount); | |
function SavingsAccount() public { | |
owner = msg.sender; | |
} |
This file contains 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.4.18; | |
contract Course { | |
address owner; | |
uint fee; | |
struct personalInfo { | |
string name; | |
uint age; | |
bool active; |
OlderNewer