-
-
Save EdsonAlcala/58216ebab46a0b95bb47db644fa39b61 to your computer and use it in GitHub Desktop.
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.5.3; | |
contract SimpleStorage { | |
function getValue() public pure returns(uint256){ | |
uint256 value = 1000; | |
return value; | |
} | |
} |
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.5.3; | |
contract SimpleStorage { | |
uint256 value; | |
constructor() public { | |
value = 1000; | |
} | |
function getValue() public view returns(uint256){ | |
return value; | |
} | |
} |
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.5.3; | |
contract SimpleStorage { | |
uint256 value; | |
constructor() public { | |
value = 1000; | |
} | |
function getValue() public view returns(uint256){ | |
return value; | |
} | |
function setValue(uint256 _newValue) public { | |
value = _newValue; | |
} | |
} |
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.5.3; | |
contract SimpleStorage { | |
uint256 value; | |
address owner; | |
constructor() public { | |
value = 1000; | |
owner = msg.sender; | |
} | |
function getValue() public view returns(uint256){ | |
return value; | |
} | |
function setValue(uint256 _newValue) public { | |
require(owner == msg.sender, 'Only owner can set value'); | |
value = _newValue; | |
} | |
} |
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.5.3; | |
contract PromiseContract { | |
string promiseValue; | |
address owner; | |
address friend; | |
constructor() public { | |
owner = msg.sender; | |
friend = 0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C; // TODO Replace with the address of your friend | |
} | |
function whatIsThePromise() public view returns(string memory){ | |
return promiseValue; | |
} | |
function makePromise(string memory _promise) public { | |
require(friend == msg.sender, 'Only a friend can make a promise'); | |
promiseValue = _promise; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment