How to call timelock contract and use it inside my ERC20 token

Hello lovely people
am still in solidity learning curve, and i need your help please

am trying to import this contract to my token smart contract

I have imported the contract by : import { Timelock } from "./Timelock.sol";

and then called it in my contract declaration by :slight_smile:
contract XXX is Context, IERC20, Timelock {

am lost here how to write the function inside my contract that will call the timelock contract

the time lock should be called when i want to lock someone from selling their tokens for a specific

my contract is standard ERC20 token

thanks

The Timelock contract is typically not inherited by an ERC20 contract. Usually its deployed by itself and then used in conjunction with a multisig contract or a DOA. The OpenZeppelin Governor example shows how to use it pretty well.

So, you would:

  1. Deploy the Timelock contract by itself.
  2. Deploy your multisig/DOA/Governor contract
  3. Make the multisig/DOA/Governor have both the proposer role and executor role in the Timelock.
  4. Have the account that deployed the contract renounce its TIMELOCK_ADMIN_ROLE role in the Timelock.
  5. Multisig/Doa/Governor queues tasks and then executes tasks from the Timelock.

Technically, you certainly could use the timelock as a parent class of your ERC20, that's just not a common pattern I've seen before.

3 Likes