Hi
I use TokenTimelock to lock tokens for a specific amount of time (my code can be found here)
But in my usecase the beneficiary is not a normal account, it is a Vesting Contract which will make the token in it with other business rules releasable after the TokenTimelock has expired and was released into the Vesting contract.
What I am doing so far in a test is:
this.vesting = await TeamVesting.new();
await this.vesting.initialize(owner);
await this.vesting.addBeneficiaries([vestor1, vestor2], [93, 7], {from: owner});
In my TokenSale-Contract a function can receive this contracts address this way:
function assignTeamVesting(address teamVesting) public {
require(teamVesting != address(0));
_teamVesting = teamVesting;
emit TeamVestingAssigned(_teamVesting);
}
When timelocking of tokens comes into the game, this code is used:
TokenTimelock timeLock = new TokenTimelock();
timeLock.initialize(_token, _teamVesting, releaseTime );
The address of _teamVesting is the beneficiary for TokenTimelock.
However, there seems to be no way to release the tokens as the owner is a contract and not a simple account. Or am I wrong here?
I have tried out:
const tx = await tokenLock.release({from: this.vesting.address});
which will throw Returned error: sender account not recognized
Any ideas available?
(The root cause of having a TokenTimelock AND another TeamVesting contract on top of this is that Team tokens first are locked for 12 month and then only 10% per month can be transfered to team members)