Skip to content

clearpool-finance/CPOOL

Repository files navigation

CPOOL

Compile

Copy example.env to a new file called .env and fill the values in it.

npx hardhat compile

Test

npx hardhat test

Deploy

npx hardhat run scripts/deploy.js --network [Your Network]

CPOOL

Token Parameter Value
Token name Clearpool
Symbol CPOOL
Decimals 18
Total Supply 1 000 000 000

Vesting

Hold Tokens

To hold tokens for some recipient - firstly tokens should be transferred to Vesting Contract and then Vesting Contract's owner should use function holdTokens

function holdTokens(
        address recipient_,
        uint amount_,
        uint vestingBegin_,
        uint vestingCliff_
        uint vestingEnd_
    )

Parameters

  • address recipient_ - recipient's address
  • uint amount_ - amount that should be vested
  • uint vestingBegin_ - timestamp of the beginning of vesting
  • uint vestingCliff_ - timestamp of the end of the Cliff (since this moment tokens become available to claim)
  • uint vestingEnd_ - timestamp of the end of the vesting

Claim Tokens

function claim(address recipient_

function to claim tokens

Getters

function getAvailableBalance(address recipient_) public view returns(uint)

returns amount available to claim for user

mapping (address => VestingParams) public recipients;

returns structure with following params:

  • amount - initial amount of Vested tokens
  • uint vestingBegin_ - timestamp of the beginning of vesting
  • uint vestingCliff_ - timestamp of the end of the Cliff (since this moment tokens become available to claim)
  • uint vestingEnd_ - timestamp of the end of the vesting
  • lastUpdate - timeStamp of last claim
  • claimed - token's amount that was already claimed

AutoVesting

Hold Tokens

Used to transfer tokens to the contract and hold tokens to a batch of accounts. Only owner can call this function.

function holdTokens(HoldParams[] memory params) external

Parameters

  • params: an array of HoldParams structure. The structure contains:
    • address recipient - recipient's address
    • uint256 amount - amount that should be vested
    • uint256 unlocked - the number of tokens transferred to accounts immediately
    • uint256 vestingCliff - timestamp of the end of the Cliff (since this moment tokens become available to claim)

Claim Tokens

function claim(address account) external

function to claim unclaimed tokens

Getters

function getAvailableBalance(address account) public view returns(uint)

returns the amount of tokens available to claim for the given account

mapping (address => VestingParams) public vestings;

returns structure with following params for the given address:

  • amount - initial amount of Vested tokens
  • vestingCliff - timestamp of the end of the Cliff (since this moment tokens become available to claim)
  • lastUpdate - timeStamp of last claim
  • claimed - token's amount that was already claimed
mapping(address => uint256[]) public vestingIds;

Mapping of addresses to lists of their vesting IDs. Returns the list of vesting IDs for the given address.

uint256 public immutable vestingBegin;

Timestamp of the vesting begin time

uint256 public immutable vestingEnd;

Timestamp of the vesting end time

uint256 public totalVest;

Total amount of vested tokens

IERC20 public immutable cpool;

CPOOL token contract

About

Source code of Clearpool (CPOOL) token

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published