Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PayrollInterface #3

Merged
merged 1 commit into from
May 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions contracts/Payroll.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pragma solidity ^0.4.11;

import "zeppelin/lifecycle/TokenDestructible.sol";

// For the sake of simplicity lets asume USD is a ERC20 token
// Also lets asume we can 100% trust the exchange rate oracle
contract PayrollInterface {
/* OWNER ONLY */
function addEmployee(address accountAddress, address[] allowedTokens, uint256 initialYearlyUSDSalary);
function setEmployeeSalary(uint256 employeeId, uint256 yearlyUSDSalary);
function removeEmployee(uint256 employeeId);

function addFunds() payable;
function scapeHatch();
// function addTokenFunds()? // Use approveAndCall or ERC223 tokenFallback

function getEmployeeCount() constant returns (uint256);
function getEmployee(uint256 employeeId) constant returns (address employee); // Return all important info too

function calculatePayrollBurnrate() constant returns (uint256); // Monthly usd amount spent in salaries
function calculatePayrollRunway() constant returns (uint256); // Days until the contract can run out of funds

/* EMPLOYEE ONLY */
function determineAllocation(address[] tokens, uint256[] distribution); // only callable once every 6 months
function payday(); // only callable once a month

/* ORACLE ONLY */
function setExchangeRate(address token, uint256 usdExchangeRate); // uses decimals from token
}

contract Payroll is PayrollInterface, TokenDestructible {}