Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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