Skip to content

Instantly share code, notes, and snippets.

@0GiS0
Created June 25, 2019 14:27
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 0GiS0/aa3bc42f2cf29bc987dca9cf98d1d759 to your computer and use it in GitHub Desktop.
Save 0GiS0/aa3bc42f2cf29bc987dca9cf98d1d759 to your computer and use it in GitHub Desktop.
pragma solidity ^0.5.8;
contract TimeControl{
address private owner;
mapping (address => uint[]) private employeeRecords;
constructor() public{
owner = msg.sender;
}
function Register() public{
employeeRecords[msg.sender].push(now);
}
function GetMyRegistries() public view returns (uint[] memory){
uint[] memory result = new uint[] (employeeRecords[msg.sender].length);
for (uint i = 0;i < employeeRecords[msg.sender].length; i++) {
result[i] = employeeRecords[msg.sender][i];
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment