Using TokenTimelock with Remix

Hey, I just launched a token on the main net for fun

I was wondering how to lock any erc20 token into a contract address
I came to this article but still don’t know how to implement it, Do I use mew, or deploy a new contract with remix Ethereum IDE and send it to the contract address.

Can someone help me go through it step by step if you would.
Thank you!

1 Like

Welcome to the community @btc58

Congratulations on deploying an ERC20 token to mainnet.

The tests are a good place to start for contracts where there isn’t a guide yet.

Do you use Truffle?
Have a look at this similar question in the forum:

If you need step by step instructions for Remix I can try to put something together early next week.

Hey thanks for the reply, very helpful.
I use remix not truffle.
If you don’t mind doing a step by step instruction for remix, that would great.
Thanks for the help!

1 Like

Hi @btc58

You can use the following instructions to deploy OpenZeppelin TokenTimelock with Remix

I deployed the example SimpleToken ERC20 to Ropsten testnet and then deployed TokenTimelock. I recommend deploying on a testnet first before deploying to mainnet.

Setup

Remix documentation: https://remix.readthedocs.io

For the new version of Remix you will need to activate some plugins (if you haven’t already).
Activate “Solidity Compiler” module plugin
Activate “Deploy & Run Transactions” module plugin

From the home tab, File: “Import From”: GitHub the following files: (TokenTimelock and its dependencies)

Compile

In the Remix File Explorer select the smart contract, TokenTimelock.sol

Select the Solidity Compiler module (Activate the module if you haven’t already)
Choose a compiler e.g. 0.5.9+commit.e560f70d
Press Compile
The compiler will advise if you are missing any imported contracts or libraries

Deploy

Select the “Deploy & Run Transactions” module (Activate the module if you haven’t already)
If using MetaMask, change the Environment to InjectedWeb3.
Recommend always first deploying to a testnet

Select the contract and specify any constructor values.
For TokenTimelock specify:
token address e.g. ERC20 token address
beneficiary address e.g. External account to release tokens to
releaseTime (seconds since unix epoch) e.g. 1569925800 (you can use an online converter such as https://www.epochconvert.com/)

Press Transact to deploy

Transfer

Transfer the tokens to lock up for the beneficiary to the deployed TokenTimelock contract. I used Remix to transfer the tokens.

Release

After the releaseTime has passed, anyone can call release on the deployed TokenTimelock contract, which transfers the tokens to the beneficiary.

I used Remix to call release.


Let me know if you have any problems with the instructions above.

Hi @btc58

Just checking that you were able to deploy using the instructions for Remix?

Let me know if you have any questions.

Housekeeping, marking my reply as the solution.

Hey again, thanks for the instruction. Sorry for the late reply but I wasn’t able to comment because of a review of my account. But thanks again, will try it out this weekend.

2 Likes