Skip to content

Instantly share code, notes, and snippets.

@matYang
Created August 6, 2018 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matYang/9245b82aa6ccf947b6f27f44e6c659ac to your computer and use it in GitHub Desktop.
Save matYang/9245b82aa6ccf947b6f27f44e6c659ac to your computer and use it in GitHub Desktop.
copy & paste into Remix for contract invocation, contract deployed at 0xbf305049bcefe28777104d5cbbcc8f58e6b21f69 Ethereum mainnet
pragma solidity ^0.4.24;
contract BestWeddingWishes {
string public constant groom = "Shuo, Chang";
string public constant bride = "Yanyan, Zhang";
string public constant dateStr = "Aug 5th, 2018";
string[] public wishes;
function add(string _message) external returns (bool) {
wishes.push(_message);
return true;
}
function read(uint256 idx) external view returns (string) {
return wishes[idx];
}
function count() external view returns (uint256) {
return wishes.length;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment