pragma solidity 0.5.7;
contract CuratorsInterface {
function checkRole(address _operator, string memory _permission) public view;
}
contract pDNA {
CuratorsInterface public curators = CuratorsInterface(0x2D1711aDA9DD2Bf8792AD29DD4E307D6527f2Ad5);
string public name;
string public symbol;
mapping(string => string) private files;
event FilePut(address indexed curator, string hash, string name);
constructor(string memory _eGrid, string memory _grundstuck) public {
curators.checkRole(msg.sender, "authorized");
name = _eGrid;
symbol = _grundstuck;
}
function getFile(string memory _name) public view returns (string memory) {
return files[_name];
}
function putFile(string memory _hash, string memory _name) public {
curators.checkRole(msg.sender, "authorized");
files[_name] = _hash;
emit FilePut(msg.sender, _hash, _name);
}
}
{
"compilationTarget": {
"pDNA.sol": "pDNA"
},
"evmVersion": "petersburg",
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"string"},{"name":"_name","type":"string"}],"name":"putFile","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"curators","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"string"}],"name":"getFile","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_eGrid","type":"string"},{"name":"_grundstuck","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"curator","type":"address"},{"indexed":false,"name":"hash","type":"string"},{"indexed":false,"name":"name","type":"string"}],"name":"FilePut","type":"event"}]