This repository has been archived by the owner on May 22, 2023. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pdyraga
suggested changes
Nov 26, 2020
I am fine with having the contract code in |
pdyraga
reviewed
Nov 27, 2020
pdyraga
reviewed
Nov 27, 2020
dimpar
commented
Nov 30, 2020
pdyraga
reviewed
Dec 1, 2020
pdyraga
reviewed
Dec 1, 2020
Allocate amount of KEEP for the given merkle root. Calling receiveApproval with the onlyOwner modifier results in error because caller is msg.sender which is the KEEP Token. But what we need is the caller (owner) who is the owner of Distributor contract as well. We need to replace it with a seperate function where the owner can be set explicitly.
pdyraga
reviewed
Dec 2, 2020
There is no point of checking if the rewards were claimed first if the inspected merkle root was not allocated with KEEP rewards.
It is better to have a fork of the Uniswap/merkle-distributor project in case anything bad happens with the original project (ex. deleted). We remove this dependency which is going to be replace with a local copy.
pdyraga
reviewed
Dec 3, 2020
pdyraga
reviewed
Dec 3, 2020
pdyraga
reviewed
Dec 3, 2020
Tested locally, works as advertised. Four outstanding comments and I am good to merge. |
- Added better coverage for cases where we check if a reward was claimed - Added coverage for a case when merkle root is not in the merkle roots map
pdyraga
approved these changes
Dec 4, 2020
nkuba
added a commit
that referenced
this pull request
Dec 10, 2020
…neficiary Keep rewards distributor beneficiary Introducing a new token holder contract allowing the contract owner to allocate rewards to `ECDSARewardsDistributor` in phases. Each phase corresponds to a new reward interval allocated with its own Merkle root used by stakers to withdraw their rewards. The contract can receive funds from any other `PhasedEscrow` with `ECDSARewardsEscrowBeneficiary`. ECDSA staker rewards have been withdrawn from `ECDSARewards` contract to a `PhasedEscrow` (https://etherscan.io/address/0x973005c57872bd7bffb2157e88a6408d428a0f0a). The team initiated the upgrade in interval 2 and finalized it after interval 2 ended to implement [updates to the rewards mechanism](https://blog.keep.network/a-new-rewards-mechanism-deef3412c3e1). `ECDSARewardsDistributor` introduced in #627 will be allocated each interval with an allocation and Merkle root corresponding to that interval's rewards. The missing building block is `ECDSARewardsDistributorEscrow` introduced in this PR. `ECDSARewardsDistributorEscrow` should receive all funds from `PhasedEscrow` contract that holds now ECDSA staker KEEP rewards. Then, for each new reward interval, the contract owner will call `allocateInterval(bytes32 merkleRoot, uint256 amount)` function to allocate a new reward interval on `ECDSARewardsDistributor` from the tokens held by the contract. To withdraw funds from `PhasedEscrow` to `ECDSARewardsDistributorEscrow`, it is enough to deploy `ECDSARewardsEscrowBeneficiary` pointing to `ECDSARewardsDistributorEscrow` and set it as a beneficiary of `PhasedEscrow`. This scenario is exercised in `"funding"` describe in unit tests.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs: #602
This PR will add a functionality to claim KEEP rewards by the stakers. Rewards distribution is verified using a merkle tree structure. Merkle tree is generated for each interval (ex. every week) and the next step is allocating KEEP rewards where merkle root is the key for that given interval. The end result of a merkle tree generation
.json
will consist of:Merkle tree is generated thanks to the Uniswap merkle-distributor source
Generation of merkle root & proofs:
./rewards-merkle-generator.sh --input path/to/file
./rewards-merkle-generator.sh
if no path was provided, default path is used (now it is an example file)