Skip to content

Commit

Permalink
Merge pull request #2806 from keep-network/backport-new-allocation
Browse files Browse the repository at this point in the history
[Backport] tBTC reward allocation 2021-12-21 -> 2022-01-22

Adding tBTC rewards merkle tree.

Also adjusts the tBTC Rewards page to the proposal that extends stakedrop 
rewards for an additional 4 months. We will have two more allocations so to 
simplify calculating the period of the reward we hardcoded the merkleRoot in 
the ExtendedECDSARewards.intervalsDates array. After generating the new merkle 
tree we must add the merkleRoot hash to a given interval.
  • Loading branch information
michalsmiarowski authored Feb 1, 2022
2 parents 4363db2 + 830bc85 commit 4f09e7c
Show file tree
Hide file tree
Showing 4 changed files with 850 additions and 20 deletions.
15 changes: 9 additions & 6 deletions solidity-v1/dashboard/src/pages/rewards/TBTCRewardsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SubmitButton } from "../../components/Button"
// import ProgressBar from "../../components/ProgressBar"
import Timer from "../../components/Timer"
import TBTCRewardsDataTable from "../../components/TBTCRewardsDataTable"
import { ECDSARewardsHelper } from "../../utils/rewardsHelper"
import { ExtendedECDSARewardsHelper } from "../../utils/rewardsHelper"
import { useWeb3Address } from "../../components/WithWeb3Context"
import {
TokenAmountSkeleton,
Expand All @@ -22,9 +22,9 @@ import EmptyStatePage from "./EmptyStatePage"
const TBTCRewardsPage = () => {
const dispatch = useDispatch()
const yourAddress = useWeb3Address()
const currentIntervalEndOf = ECDSARewardsHelper.intervalEndOf(
ECDSARewardsHelper.currentInterval
).unix()
const currentIntervalEndOf = ExtendedECDSARewardsHelper.intervalEndOf(
ExtendedECDSARewardsHelper.currentInterval
)

const {
ecdsaAvailableRewardsFetching,
Expand Down Expand Up @@ -78,7 +78,8 @@ const TBTCRewardsPage = () => {

const RewardsOverview = ({ balance, isBalanceFetching, withdrawRewards }) => {
const remainingPeriods =
ECDSARewardsHelper.intervals - ECDSARewardsHelper.currentInterval
ExtendedECDSARewardsHelper.intervals -
ExtendedECDSARewardsHelper.currentInterval

return (
<section className="tile rewards__overview--tbtc">
Expand All @@ -93,7 +94,9 @@ const RewardsOverview = ({ balance, isBalanceFetching, withdrawRewards }) => {
<div className="rewards__overview__period">
<h5 className="text-grey-70">current rewards period</h5>
<span className="rewards-period__date">
{ECDSARewardsHelper.periodOf(ECDSARewardsHelper.currentInterval)}
{ExtendedECDSARewardsHelper.periodOf(
ExtendedECDSARewardsHelper.currentInterval
)}
</span>
<div className="rewards-period__remaining-periods">
<Icons.Time width="16" height="16" className="time-icon--grey-30" />
Expand Down
Loading

0 comments on commit 4f09e7c

Please sign in to comment.