Created
April 21, 2017 06:36
-
-
Save babedev/2f5d9db84b5d3cd036c46d9401b1b5c0 to your computer and use it in GitHub Desktop.
Sample report contract
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.4.7; | |
contract Report { | |
struct report { | |
uint id; | |
string detail; | |
} | |
mapping(uint => report) public reports; | |
function write(uint id, string detail) { | |
report memory newReport = report(id, detail); | |
reports[id] = newReport; | |
} | |
function getReport(uint id) constant returns (string detail) { | |
return reports[id].detail; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment