Lock any ERC20, release in periods!
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'
Just
yarn install && yarn test
-
Inherit and deploy the LinearCliffTimelock.sol.
NOTE The deployer will be granted
DEFAULT_ADMIN_ROLE
andINITIALIZE_ROLE
so that only the admin can call initialize function. -
Approve the contract for the amount you want to lock.
-
Call initialize to setup the vesting.
It will transfer given amount from
_sender
to vesting contract.Anyone with
WITHDRAW_ROLE
can call withdraw to transfer the claimable amount to the beneficiary.
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:
Network | Address |
---|---|
Polygon | 0xFD6378CfFC8aD8036987835dd01Bf186d94e0268 |
Ethereum | TBD |
BNB Chain | TBD |
All of the timings are in seconds.
Vesting test will deploy MockTimelock.sol
instead of the timelock contract to have control over block.timestamp