Skip to content

Instantly share code, notes, and snippets.

@yakkomajuri
Last active January 22, 2019 17:21
Show Gist options
  • Save yakkomajuri/d90f010d8568eb5d16daed68118a9b04 to your computer and use it in GitHub Desktop.
Save yakkomajuri/d90f010d8568eb5d16daed68118a9b04 to your computer and use it in GitHub Desktop.
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