Skip to content

Commit

Permalink
TOK-489: backer rewards table (#391)
Browse files Browse the repository at this point in the history
* feat(cr_v2): backer rewards table

* refactor: rename
  • Loading branch information
franciscotobar authored Nov 21, 2024
1 parent c6fa62d commit db737e2
Show file tree
Hide file tree
Showing 68 changed files with 1,020 additions and 1,130 deletions.
22 changes: 13 additions & 9 deletions .env.testnet.local
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ NEXT_PUBLIC_BUILD_ID=

NEXT_PUBLIC_RIF_ADDRESS=0x19f64674d8a5b4e652319f5e239efd3bc969a1fe
NEXT_PUBLIC_STRIF_ADDRESS=0xC4b091d97AD25ceA5922f09fe80711B7ACBbb16f
NEXT_PUBLIC_GOVERNOR_ADDRESS=0x8F10473F1c2f1dA76F6E921aA6eE8c54aD43F7b7
NEXT_PUBLIC_EA_NFT_ADDRESS=0x979deF73ec80B8AE24Ae46765b81D9aF7b1C9327
NEXT_PUBLIC_GOVERNOR_ADDRESS=0xB1A39B8f57A55d1429324EEb1564122806eb297F
NEXT_PUBLIC_EA_NFT_ADDRESS=0x0Ee4e11f2F2B551cA31Ea7873c7bA675cb51A59d
NEXT_PUBLIC_MULTICALL_ADDRESS=0xcA11bde05977b3631167028862bE2a173976CA11
NEXT_PUBLIC_GRANTS_BUCKET_ADDRESS=0xfaca664c661af7e0e630c8f92b401012cd2a30ef
NEXT_PUBLIC_GRANTS_ACTIVE_BUCKET_ADDRESS=0x2217E4d3Ae0A6E30075D1B5a7b8C1520E8009f49
Expand All @@ -17,14 +17,18 @@ NEXT_PUBLIC_GENERAL_BUCKET_ADDRESS=0x72Ed7d7b7835Ad62B1f9b6280bAd62618aA71461
NEXT_PUBLIC_CHAIN_ID=31

# CR-related env variables
NEXT_PUBLIC_SIMPLIFIED_REWARD_DISTRIBUTOR_ADDRESS=0x4e84FCc953dE129C6C47c5B0AD7E57B226093Ae1
NEXT_PUBLIC_BACKERS_MANAGER_ADDRESS=0xC2857F402096BfF24E8E05C2E047F8461d1af927
NEXT_PUBLIC_REWARD_DISTRIBUTOR_ADDRESS=0x21534EaE65041b85cA309C3258E967f305917F8F
NEXT_PUBLIC_GOVERNANCE_MANAGER_ADDRESS=0xAEdD29bebb0dd8e29702DD1e32346365F96aA016

NEXT_PUBLIC_CYCLE_DURATION_IN_DAYS=2
NEXT_PUBLIC_BACKERS_MANAGER_ADDRESS=0xec0a29Df5180A6B04496dfAf2D827e36F4a0A52F
NEXT_PUBLIC_REWARD_DISTRIBUTOR_ADDRESS=0xD476E4804551595687C1f6F0a9C22dd1Bbfa0319
NEXT_PUBLIC_GOVERNANCE_MANAGER_ADDRESS=0xb7C6918d6aE6df2e147FF464271a94EAfF027E5D
NEXT_PUBLIC_CYCLE_DURATION_IN_DAYS=7
NEXT_PUBLIC_FIRST_CYCLE_START_DATE_ISO="1970-01-01T00:00:00Z"

NEXT_PUBLIC_ENV_DATA_URL="https://raw.githubusercontent.com/RootstockCollective/dao-frontend/develop/data.testnet.local.json"
NEXT_PUBLIC_ENV_DATA_URL="https://raw.githubusercontent.com/RootstockCollective/dao-frontend/develop/data.testnet.qa.json"

# OG NFT Contracts
NEXT_PUBLIC_OG_FOUNDERS=0x7E6d9969CAC008bAe5f7b144df3c955515404538
NEXT_PUBLIC_OG_PARTNERS=0x285046a90fb322E6BaCa4F38Bb884e3C0904F7EB
NEXT_PUBLIC_OG_CONTRIBUTORS=0xDC03B8fb7E47E4651f5008bD718a804726424A75

NEXT_PUBLIC_ENABLE_CORS_BYPASS=true
NEXT_PUBLIC_ENABLE_FEATURE_V2_REWARDS=true
3 changes: 0 additions & 3 deletions .env.testnet.qa
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ NEXT_PUBLIC_GENERAL_BUCKET_ADDRESS=0x72Ed7d7b7835Ad62B1f9b6280bAd62618aA71461
NEXT_PUBLIC_CHAIN_ID=31

# CR-related env variables
# TODO: To be removed
NEXT_PUBLIC_SIMPLIFIED_REWARD_DISTRIBUTOR_ADDRESS=0xc469Cc2579De5C16210e9063B4E628bF8C46bA02

NEXT_PUBLIC_BACKERS_MANAGER_ADDRESS=0xec0a29Df5180A6B04496dfAf2D827e36F4a0A52F
NEXT_PUBLIC_REWARD_DISTRIBUTOR_ADDRESS=0xD476E4804551595687C1f6F0a9C22dd1Bbfa0319
NEXT_PUBLIC_GOVERNANCE_MANAGER_ADDRESS=0xb7C6918d6aE6df2e147FF464271a94EAfF027E5D
Expand Down
3 changes: 0 additions & 3 deletions .env.testnet.staging
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ NEXT_PUBLIC_GENERAL_BUCKET_ADDRESS=0x72Ed7d7b7835Ad62B1f9b6280bAd62618aA71461
NEXT_PUBLIC_CHAIN_ID=31

# CR-related env variables
# TODO: To be removed
NEXT_PUBLIC_SIMPLIFIED_REWARD_DISTRIBUTOR_ADDRESS=0x4447EC87854651ECdce3E91e581c34641C91eC46

# TODO: To be changed once we deploy the contracts for staging
NEXT_PUBLIC_BACKERS_MANAGER_ADDRESS=0xec0a29Df5180A6B04496dfAf2D827e36F4a0A52F
NEXT_PUBLIC_REWARD_DISTRIBUTOR_ADDRESS=0xD476E4804551595687C1f6F0a9C22dd1Bbfa0319
Expand Down
14 changes: 1 addition & 13 deletions src/app/collective-rewards/actions.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import { Address } from 'viem'
import { BackersManagerAddress, SimplifiedRewardDistributorAddress } from '@/lib/contracts'
import { BackersManagerAddress } from '@/lib/contracts'
import { axiosInstance } from '@/lib/utils'
import {
fetchBackerRewardsClaimedLogsByAddress,
fetchBuilderRewardsClaimedLogsByAddress,
fetchGaugeNotifyRewardLogsByAddress,
fetchNotifyRewardLogsByAddress,
fetchRewardDistributedLogsByAddress,
} from '@/lib/endpoints'

export const fetchRewardDistributedLogs = (fromBlock = 0) => {
return axiosInstance.get(
fetchRewardDistributedLogsByAddress
.replace('{{address}}', SimplifiedRewardDistributorAddress)
.replace('{{fromBlock}}', fromBlock.toString()),
)
}

export const fetchRewardDistributedCached = () =>
axiosInstance.get('/reward-distributed/api', { baseURL: '/' })

export const fetchNotifyRewardLogs = (fromBlock = 0) => {
return axiosInstance.get(
fetchNotifyRewardLogsByAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { withSpinner } from '@/components/LoadingSpinner/withLoadingSpinner'
import { Paragraph } from '@/components/Typography'
import { ethers } from 'ethers'
import { useAccount } from 'wagmi'
import { useHandleErrors } from '../utils'
import { useHandleErrors } from '@/app/collective-rewards/utils'
import { useBackerTotalAllocation } from './useBackerTotalAllocation'

type ValueProps = {
Expand Down
1 change: 0 additions & 1 deletion src/app/collective-rewards/hooks/index.ts

This file was deleted.

65 changes: 0 additions & 65 deletions src/app/collective-rewards/hooks/useGaugesGetFunction.ts

This file was deleted.

Loading

0 comments on commit db737e2

Please sign in to comment.