DXD Vesting Factory

Hola a todos, I created a TokenVesting factory that can be used for DXD vesting, the source code of the vesting contract is https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.0.0/contracts/drafts/TokenVesting.sol.

How it works

1.- Create the token vesting with the desired parameters calling the create function in the vesting factory contract.
2.- Send the DXD tokens to the contract.
3.- Claim the tokens till the vesting ends, beware that you will have to wait for the cliff time to be reached and that the vesting might be able to be revoked by the organization.

How to deploy my vesting

You will need an ETH account where you will receive the tokens, the start time in format of unix timestamp, the duration of the cliff period in seconds, the total duration of the vesting in seconds and if your contract can be terminated by the DXdao or not.
Once you have everything you need you go to https://etherscan.io/address/0x9a75944ed8b1fff381f1ebf9dd0a75ea72f75727#writeContract where you want to execute the create function.

For example, a vesting the address 0xed6fA573B2ddB34F6a9a6941b53f7833bF283b02, starting the 07/01/2020 with a vesting of six months (which would be the timestamp of the starting date minus the timestamp in seconds adding six months, that would be 01/01/2021), it will end the 07/01/2021 and not revocable by DXdao will have the next values:

To calculate UNIX timestamps you can use https://www.unixtimestamp.com/

Calculated timestamps using UTC 12:00am for all dates:

Vesting starts on 07/01/2020 @ 12:00am (UTC) = 1593561600
Cliff ends on 01/01/2021 @ 12:00am (UTC) = 1609459200
Vesting ends on 01/01/2021 @ 12:00am (UTC) = 1625097600
1609459200 - 1593561600 = 15897600 <- Cliff duration
1625097600 - 1593561600 = 31536000 <- Vesting duration

My creation parameters:

0xed6fA573B2ddB34F6a9a6941b53f7833bF283b02, 1593561600, 15897600, 31536000, false

Once the transaction is mined go to the event logs and look for the event VestingCreated

And that would be the address of your vesting contract, the one you can use to vest your tokens.

Next you will have to send your DXD there and wait for the start time plus cliff duration time to be reached, once that happens you can execute the release function.

Thats everything, feel free to ask any questions, the process is very straightforward it is not too complex, just create your vesting, send your DXD and receive it over time.

6 Likes

What do you mean by this?

This will allow the vesting contract owner (DXdao avatar by default) to revoke the vesting of the token and receive the remaining tokens that hasnt been claimed. I guess this applied to long vesting contracts were the distribution of the token depends on the relation of the token receiver and the organization.
The payment vesting contract that I created (and the one I will use for my payment) is not revocable because I consider the payment vesting to be used only with the intention to not inject all the tokens I received directly into the circulating supply, just to release it gradually into it. In my eyes the tokens are already mine but I commit myself to receive it through a vesting contract because of what I mentioned before, release it more gradually into the circulating supply.

This should be “Vesting ends on 07/01/2021 @ 12:00am (UTC)

The UNIX timestamp used was right but the date I wrote was wrong I shared on the example was wrong.

1 Like