Skip to content

CallistoEnterprise/SalaryVesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CoreTeamDAO

CoreTeamDAO manage employees payments accordingly rules.

Company sets an employee salary in USD, and sets payouts rules: the percentage of salary that pays monthly, quarterly, yearly.

When an employee claim payment, the salary converts from USD to CLO by current CLO/BUSDT price on the Soy.Finance, then amount in CLO splits amount monthly, quarterly, and yearly parts.

For example, if salary is 1000 USD, and it splits by 20/40/40 for monthly/quarterly/yearly payments accordingly, and CLO price is 0.001 USD, then on claim an employee receives 200K CLO instantly, and 400K will be locked for quarterly payment, and 400K will be locked for yearly payment.

Transferring to CLO to contract address add it to payouts budget.

Main functions

claim

Allow to employee to claim unlocked CLO, and fix CLO/USD price on moment of claim.

getUnlockedAmount

Using function getUnlockedAmount an employee can see, how much CLO is unlocked and how much is reserved for quarterly and yearly payment (he should enter his address in the parameter field). This function shows estimated amount on moment of call. It uses current CLO price from SOY finance. After claim the CLO price will be fixed.

employees

The function employees returns info about specific employee.

getAllocatedAmount

Using function getAllocatedAmount is possible to see if contract has enough CLO for salaries. It returns positive or negative balance. The negative amount shows how many CLO is needed to add to contract.

  • allocatedToClaim: contract balance - unlocked amount of all employees. If it's negative employees can't receive their CLO.
  • totalAllocated: contract balance - total amount of CLO reserved for salaries. If it's negative, then not enough CLO to cover all salaries (including pending parts).

Owner's privileges

The owner of CoreTeamDAO is a multisig contract and it can:

  1. Rescue all CLO or tokens from contract.
  2. Change employee's salary, start time, percentage for monthly/quarterly/yearly payments.
  3. Stop payment for specific employee.
  4. Pause entire contract (stop payments for all).
  5. Upgrade contract.

SalaryVesting

Salary Vasting contract allows to allocation specific amount of CLO for an employee and pays his salary and bonuses from this amount every specific period of time. Salary and bonuses are set in BUSTD, so payouts in CLO are calculated based on Soy.Finance CLO-BUSDT pool (fee and slippage isn't counted).

To allocate CLO for an employee it should be transferred to his Salary Vasting contract.

If the contract has less CLO than should be paid to the employee, then all available CLO will be transferred to the employee and the rest will be saved to the pending variable.

On deployment should be set:

  • _employee - address of employee wallet
  • _salary - salary in BUSDT without decimals (i.e. 1000 means 1000 BUSDT). Salary can be claimed each salaryPeriod (30 days by default).
  • _bonus - bonus in BUSDT without decimals. Bonus can be claimed each bonusPeriod (91 days by default).
  • _startTimestamp - UNIX timestamp from which start each period.
  • _newOwner - address of the owner, who can change parameters and withdraw tokens from the contract.

The owner can:

  • change employee address, salary and bonus amounts

    // Set salary in BUSDT without decimals
    function setSalary(address _employee, uint256 _salary, uint256 _bonus) external onlyOwner {

  • change start timestamp, salary and bonus periods

    // Set periods in days and start timestamp
    function setPeriods(uint256 _salaryPeriod, uint256 _bonusPeriod, uint256 _startTimestamp) external onlyOwner {

  • pause/unpause employee payouts

    function setPause(bool pause) external onlyOwner {

  • rescue any tokens / CLO from the contract (to rescue CLO, the _token should be 0x0000000000000000000000000000000000000000)

    function rescueTokens(address _token) onlyOwner external {

An employee can:

  • Claim CLO for completed periods.

    // claim unlocked salary and bonus to employee address
    function claim() external {

  • View the unlocked amount of CLO (that he can claim). But if the contract has less CLO than the unlocked amount, he will claim all available CLO from the contract.

    // return unlocked amount of CLO
    function getUnlockedAmount() public view returns(uint256 unlockedAmount) {

  • View the allocated amount of CLO (which is contract balance - unlocked amount).

    // return allocated amount of CLO
    function getAllocatedAmount() public view returns(uint256 amount) {

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published