Configurable Time-locked rewards smart contract for WAX Blockchain (or any Antelope-based chain).
This contract is useful for rewarding users/team members with tokens by slowly unlocking them over a period of time to avoid sharp selloffs which might affect the token price negatively.
This contract is designed to work out-of-the-box, without the need to modify the source code.
All the main features are configurable by the contract owner.
- configurable reward token contract and symbol
- pause/unpause the contract functionalities
- add rewards for recipients with configurable unlock time/rate
- claim the rewarded tokens gradually over time
The contract is fully tested using proton's VeRT
- To build the contract for testing blanc is required.
npm install # or yarn or pnpm
npm run build:dev # to compile the contract using blanc++
npm test
npm build:prod # to compile the contract using cdt-cpp
# deploy the contract
cleos -u <your_api_endpoint> set contract <account> $PWD contract/timelyreward.wasm contract/timelyreward.abi -p <account>@active
# dont forget to add eosio.code permission
cleos -u <your_api_endpoint> set account permission <account> active --add-code
After deploying the contract call the following actions:
setpaused
with argumentpaused: false
(used in this instance just to initiate the config table)
Parameter | Type | Description |
---|---|---|
paused |
boolean |
Whether the contract is paused or not |
settoken
Parameter | Type | Description |
---|---|---|
recipients |
name[] |
Account names of the recipients |
quantity |
asset |
The token quantity each recipient will get |
unlock_start |
time_point_sec |
Timestamp of when the rewards should unlock |
unlock_days |
uint16 |
Number of days until all the rewards are unlocked |
claim
Parameter | Type | Description |
---|---|---|
user |
name |
Account name of the claiming user |
Hire me ;)