Skip to content

Commit a6f087e

Browse files
committed
Marking integration points for TACo app rewards
1 parent 8264be8 commit a6f087e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/hooks/useFetchStakingRewards.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ export const useFetchStakingRewards = () => {
3535
return
3636
}
3737

38+
// TODO:
39+
// - Integration of new Merkle contract + TACo automated rewards here.
40+
// TLDR: stakingRewards = merkle_rewards + taco_rewards
41+
// See https://github.com/threshold-network/token-dashboard/issues/756
42+
// - There's a more efficient way to check Merkle's claimed rewards.
43+
// See https://github.com/threshold-network/token-dashboard/issues/765
44+
// - Note also that TACo rewards now accrue on each block. They can be
45+
// calculated via TACoApp.availableRewards(address _stakingProvider)
3846
const claimedEvents = await getContractPastEvents(merkleDropContract, {
3947
eventName: "Claimed",
4048
fromBlock: DEPLOYMENT_BLOCK,
@@ -71,10 +79,14 @@ export const useFetchStakingRewards = () => {
7179
claimedRewardsInCurrentMerkleRoot.has(stakingProvider)
7280
) {
7381
// If the JSON file doesn't contain proofs for a given staking
74-
// provider it means this staking provider has no rewards- we can skip
75-
// this iteration. If the `Claimed` event exists with a current merkle
82+
// provider it means this staking provider has no Merkle rewards -
83+
// we can skip this iteration.
84+
// TODO: ^ But there's going to be TACo rewards
85+
86+
// If the `Claimed` event exists with a current merkle
7687
// root for a given staking provider it means that rewards have
77-
// already been claimed- we can skip this iteration.
88+
// already been claimed - we can skip this iteration.
89+
// TODO: ^ Same, there can be TACo rewards
7890
continue
7991
}
8092

src/web3/hooks/useClaimMerkleRewardsTransaction.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export const useClaimMerkleRewardsTransaction = (
3434
])
3535
}
3636

37+
// TODO:
38+
// - This only signals no Merkle rewards, but there may be TACo rewards
39+
// - We can still call the new Merkle contract with a claim with an empty
40+
// merkle proof, signalling to not try to claim Merkle rewards. This
41+
// will still try to claim TACo rewards automatically.
3742
if (availableRewardsToClaim.length === 0) {
3843
throw new Error("No rewards to claim.")
3944
}

src/web3/hooks/useMerkleDropContract.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { AddressZero } from "../utils"
66

77
export const DEPLOYMENT_BLOCK = supportedChainId === "1" ? 15146501 : 0
88

9+
// TODO:
10+
// - Update new MerkleRewards contract address here
911
const CONTRACT_ADDRESSESS = {
1012
// https://etherscan.io/address/0xea7ca290c7811d1cc2e79f8d706bd05d8280bd37
1113
[ChainID.Ethereum.valueOf().toString()]:

0 commit comments

Comments
 (0)