Contract that allows pool masters to let pool members claim their designated rewards trustlessly and update fees with sufficient notice times while maintaining full trustlessness.
For pool operators who prefer a trustless mechanism for reward distribution, they can choose to deploy this smart contract, that will store the rewards in the proxy contract and allow their pool members to claim the rewards directly from the proxy contract.
The current KyberDao delegation model allows for non-custodial delegation of KNC, but requires pool masters to have a mechanism for storing, tracking and distributing the rewards for members.
- Store the rewards trustlessly in the smart contract
- Allow the users to claim their rewards from the smart contracts
- Track the rewards that have been claimed by the users
Find v1.0.0 audits results here
- If you deploy this smart contract, KNC holders can delegate their KNC voting power to the contract where you act as pool operator.
- You can vote on behalf of pool members, but you will have no control over their KNC or ETH rewards.
- After you vote, the subsequent ETH rewards are stored trustlessly in the smart contract and pool members can claim it themselves anytime.
- Rewards can be tracked on-chain.
This sets a new delegation fee to be applied in a future epoch, lengthening the notice given to Pool members on any fee changes on the PoolMaster Contract to epochNotice
epochs.
The fee change notice is a public state variable epochNotice
that can be configured on init, so that poolMasters have more flexibility.
- Only 1 pending fee at any given time
- If at the moment of committing a new fee there is a delegation fee pending to be applied:
- The pending fee still not able to applied, due to deadline not reached, the new fee will replace the pending one as the new pending, renewing its deadline as well
- The pending fee can be applied then mark as
applied
and add the new one as pending. Emit NewFees event
- Emit CommitedNewFee event
This is used for noticing that a new fee has been applied.
- Only mark a fee as applied if current epoch is greater or equal to
fromEpoch
- Mark a fee as applied when a new one is committed an the pending one can be applied
- Mark a fee as applied when claiming reward for an epoch which needs to use the pending fee
- Create a
configs.json
file using configs.json.example and set:
INFURA_PROJECT_ID
your Infura project idDEPLOYMENT_ACCOUNT_PK
your deploying address private keyGAS_PRICE
gas price to be used, denominated in weiKYBER_DAO_ADDRESS
KyberDao addressKYBER_FEE_HANDLERS_ADDRESS
[KyberFeeHandlers addresses]
REWARD_TOKENS
[address]
, ERC20 token address each FeeHandler transfers on reward claim, or0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
for ETHEPOCH_NOTICE
Delegation fee change notice. Integer parameter, for example EPOCH_NOTICE=2, then on the epoch #10 if you change the delegation fee (commitNewFee), that new fee starts on epoch #12INITIAL_DELEGATION_FEE
Initial delegation fee, denominated in 1e4 units - 100 = 1%
In order to support the plan of KyberDAO of having miltiple FeeHandlers KYBER_FEE_HANDLERS_ADDRESS
and REWARD_TOKENS
should be arrays with the same size. So REWARD_TOKENS[k]
will be set as the reward token for KYBER_FEE_HANDLERS_ADDRESS[k]
.
- Install dependencies
$ npm install
- Run deployment script, where NETWORK is
ropsten
ormainnet
$ npm run deploy:NETWORK
- Staking, Voting Examples
- Delegating Overview And Example
- Kyber Team as DAO Maintainer
- Staking and Delegating APIs
- KyberDao FAQs
npm install
npm test
npm run coverage
Fattened contracts can be used to verify the contract code in a block explorer like BlockScout or Etherscan. The following command will prepare flattened version of the contract:
npm run flatten
The flattened contracts can be found in the flats
directory.
Please do not hesitate to reach out to us through http://protofire.io
This project is licensed under the MIT License. See the LICENSE file for details.