This repository contains smart contracts used by Relevant APP to reward content curation.
install dependencies:
yarn
add an INFURA_API_KEY
to your local .env file
fork mainnet and deploy:
yarn fork
Users of the Relevant App are able to earn REL tokens for curating content on the Relevant App. REL tokens are allocated for rewards via releaseTokens
. REL token admin
distributes the tokens as balances in the web2 database of the Relevant App. Users can then claimTokens
by requesting an attestation by the admin
account and submitting it to the REL smart contract.
There is currently a limit to how many tokens can be claimed this way by any individual account. Balances over the limit can be claimed as unvested sRel
tokens. These tokens are not transferrable but can otherwise be used for governance and within the app.
inflation
is the yearly inflation rate in basis points.allocatedRewards
are the tokens that are still in the smart contract but are allocated to users as Curation rewards. These tokens can either be claimed or vested by the users.admin
is a designated hot wallet address that signs user's token claims. Security note: if this account is compromised the attacker can drain theallocatedRewards
but not more. This address should be rotated periodically by the contractowner
.
releaseTokens
can be called by anyone to either mint or allocate existing tokens. If there are enough tokens in the smart contract that are not part of theallocatedRewards
, they will be used, otherwise new tokens will be minted.claimTokens
can be used by users to claim REL fromallocatedRewards
vestAllocatedTokens
sends a portion of theallocatedTokens
to a vesting smart contract. This method should be called bafore initializing any specific vesting account.updateAllocatedRewards
updatesallocatedRewards
- we may need to do this to ensure app rewards match up with allocated rewards.setInflation
sets yearly inflation rate in basis points.setAdmin
updates the token claim signer.burn
can burn an amount of tokens that are not part of theallocatedRewards
. We might want to do this in the future to simplify accounting. Note: yearly inflation rate should be adjusted if a significant number of tokens is burned.
sREL is governance wrapper for REL tokens and allows staking and vesting.
owner
(this will eventually be a DAO)- can initialize initial vesting accounts
- can set
vestAdmin
role
vestAdmin
is designed to be a hotwallet that allows automated vesting initialization via the Relevant App
- REL tokens can be staked via the contract in exchange for sRel
- sRel cannot be transferred or exchanged back to REL unless they are 'unlocked' (unstaked) and unvested
lockPeriod
determines the time it takes to unstake the tokens
- Unvested tokens can be added by the
owner
of the contract or via a signature from the `vestAdmin' - There are two vesting schedules - short and long, exact params TBD, likely 4 and 16 years respectively
- The params are global - meant to distribute a set amount of tokens to users
- Unvested tokens can be used to cast governance votes
- The full amount of unvested tokens can be transferred to a new account
Openzeppelin Governor contract that can self-modify the votingPeriod
, proposalThreshhold
and votingDelay
.
Openzeppelin Timelock that adds a delay to all governance decisions.
- Governor is a Timelock
propser
- Timelock is REL
owner
- Timelock is sREL
owner
- Timelock is REL
proxyAdmin
owner