Release an ERC-20 token automatically instead of calling release method after locking period?

Hello Team,

I’m new to the block chain development.
I’m looking for ERC-20 token implementation with Timevesting.
Below is my requirements regarding the release tokens:

  1. Seed Sale: 600,000,000 tokens (10% released from day one, 9% monthly for 10 subsequent months)
  2. Private Sale: 1,800,000,000 tokens (15% released from day one, 17% monthly for 5 subsequent months)
  3. Early Investors: 800,000,000 (6 month lock at which point 25% released, 12.5% released every 3 months for 18 subsequent months)

Now I’m trying to manage this thing using Openzeppelin’s token investing feature.
However, my concern is to call the release method every time the release period has expired.
So, is there any way to automatically release these tokens once the release period has expired and they will be credited to the recipient’s address?
Please suggest the approach.

In this case we have multiple beneficiaries and also vesting should be apply on them accordingly.

Below is the configuration details:
Truffle v5.1.10 (core: 5.1.10)
Solidity v0.5.16 (solc-js)
Node v12.18.1
Web3.js v1.2.1
Openzeppelin SDK : 2.8.0
Openzeppelin-contract: 2.5.1

Thanks in advance :slight_smile:

1 Like

Hi @Nikunj,

Welcome to the forum :wave:.

Unless you were to add in functionality to your token which restricted transfer until a certain date had passed, then a transaction to release tokens per holder is required. (as we can’t loop through a large number of holders to release as we would run out of gas).

My preference is that a token should only have functionality that is required for the life of the token and not contain short term functionality. So any locking should be done in a separate contract.

You could look at the vault idea in PostDeliveryCrowdsale to do some of your locking.


When ever anyone is creating a token, I suggest reading: Points to consider when creating a fungible token (ERC20, ERC777)

1 Like

Hi @abcoathup ,

Could you please share some tutorial link where I can find a reference related to the timely release token?

I mean some blog or openzeppelin community discussion where someone has practically explained how we can achieve this functionality.

Suppose if I am transferring 1000 tokens to any beneficiary, then some percentage of the amount should be released every month.

1 Like

Hi @Nikunj,

You could use multiple TokenTimelocks: https://docs.openzeppelin.com/contracts/3.x/api/token/erc20#TokenTimelock

Otherwise you would need to create your own.

There was a TokenVesting contract but it was removed:

You may want to look at what some of the token based projects used for vesting.

Any solution should be appropriately tested and audited.

When creating token timelocks you should also consider: Bypassing Smart Contract Timelocks

1 Like