Last active
January 22, 2019 17:21
-
-
Save yakkomajuri/d90f010d8568eb5d16daed68118a9b04 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.4.21; | |
contract VaccineRegistration { | |
address owner; | |
address secondary; | |
address tertiary; | |
constructor(address _secondary, address _tertiary) public { | |
owner = msg.sender; | |
secondary = _secondary; | |
tertiary = _tertiary; | |
} | |
modifier onlyOwners() { | |
require(msg.sender == owner || | |
msg.sender == secondary || | |
msg.sender == tertiary); | |
_; | |
} | |
string[] vaccines; | |
function registerData(string _data) public onlyOwners { | |
vaccines.push(_data); | |
} | |
function getData(uint _index) public view returns(string _data) { | |
return vaccines[_index]; | |
} | |
function dataLength() public view returns(uint _length) { | |
return vaccines.length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment