1.1.0 • Published 2 years ago

@difof/lct v1.1.0

Weekly downloads
-
License
AGPL-3.0-only
Repository
github
Last release
2 years ago

LinearCliffTimelock

Lock any ERC20, release in periods!

Usage

npm install @difof/lct

Then import in Solidity:

import "@difof/lct/contracts/LinearCliffTimelock.sol"

Or use the typechain in TypeScript:

import { LinearCliffTimelock } from '@difof/lct/typechain'

Build and test

Just

yarn install && yarn test

Deploy

  1. Inherit and deploy the LinearCliffTimelock.sol.

    NOTE The deployer will be granted DEFAULT_ADMIN_ROLE and INITIALIZE_ROLE so that only the admin can call initialize function.

  2. Transfer funds to the timelock contract.

  3. Call initialize to setup the vesting.

Anyone with WITHDRAW_ROLE can call withdraw to transfer the claimable amount to the beneficiary.

Registry

The TLPublicRegistry contract is a registry for any deployed timelock to map beneficiaries to their timelocks for easier lookup. The contract is deployed on supported networks to be used by the LCT user interface.

Call the addTimelock function of the registry to map a beneficiary to a timelock on same network.

Here is a list of registry addresses on supported networks:

NetworkAddress
Polygon0xFD6378CfFC8aD8036987835dd01Bf186d94e0268
EthereumTBD
BNB ChainTBD

Notes

All of the timings are in seconds.

Vesting test will deploy MockTimelock.sol instead of the timelock contract to have control over block.timestamp