A contract for vesting Savedroid-token and a web-based GUI to interact with the Token Vesting contract.
This is strongly based on the [Token Vesting Dapp|https://github.com/OpenZeppelin/token-vesting-ui] from Open Zeppelin
In the vesting contract ("trustee"), the contract owner defines grants to an Ethereum address ("vestee"), according to which a certain amount of token can be transferred during time. Each address can have only one grant. A grant has the following parameters:
Name | Type | Description |
---|---|---|
value | uint256 |
the total value to be vested to the vestee |
start | uint256 |
the start date of the vesting period |
cliff | uint256 |
point in time of the end of the cliff period (when the first installment is made) |
end | uint256 |
the end date of the vesting period |
installmentLength | uint256 |
the length of period of each installment (in seconds) |
transferred | uint256 |
the value that transferred to the vestee so far |
revocable | bool |
indicates whether the grant can be revoked by the owner |
After the time has passed cliff, the vestee can unlock vested tokens. Thereby, tokens can be unlocked only if a new installment was generated by the trustee (i.e. when installmentLength has passed since the last unlock).
Make sure you have Metamask installed, pointing to the right network and your account is unlocked.
Install parity from https://www.parity.io/. Open a terminal, go to the parity directory and run
parity
Alternatively start your own local network using ganache or ganache-cli.
Open a terminal and run
git clone git@github.com:d-fine/svd-vesting.git
Run
npm install
npm install -g truffle
First, compile the vesting contract:
truffle compile
To deploy the vesting contract on the development network, run:
truffle migrate --network development
Note that the deploying address must own some ether in order to execute the command. The output will display the address of the deployed vesting contract.
Be careful! Every deploy on the same network replaces metadata (including the contract address) stored in the build
directory.
A comprehensive test suite is available and can be ran by:
truffle test --network development
The usage of the contract can also be seen at
truffle exec scripts/end2end_ganache.js --network development
Be sure to adapt all addresses in order for the scripts to run with your local setup
Open a new terminal and run
git clone git@github.com:savedroid/svd-vesting.git
Run
npm install
truffle compile
Note: the
npx
command comes with npm as of npm@5.2.0 version.
npm run start
Go to http://localhost:3000/<token-vesting-address>/<beneficiary-address>
When setting Metamask to Rinkeby, you can check following addresses:
or
for the contract deployed and veryfied here