@raac/rpc 1.2.0-beta.5 → 1.2.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RPCLibrary.js +38 -97
- package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +2 -2
- package/dist/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +155 -144
- package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +119 -335
- package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +104 -325
- package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +167 -146
- package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +167 -146
- package/dist/artifacts/core/governance/proposals/Governance.sol/Governance.json +2 -2
- package/dist/artifacts/core/lockers/RAACLiquidLocker.sol/RAACLiquidLocker.json +2 -2
- package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +66 -32
- package/dist/configs/chains/11155111.json +72 -16
- package/dist/configs/chains/8453.json +6 -6
- package/dist/contracts/getContractAddress.js +1 -0
- package/dist/contracts/governance/distributor/claimAll.js +25 -0
- package/dist/contracts/governance/distributor/claimForGauge.js +26 -0
- package/dist/contracts/governance/distributor/deposit.js +12 -21
- package/dist/contracts/governance/distributor/getClaimableForGauge.js +29 -0
- package/dist/contracts/governance/distributor/getClaimedAtEpoch.js +30 -0
- package/dist/contracts/governance/distributor/getDepositedAtEpoch.js +30 -0
- package/dist/contracts/governance/distributor/getGaugeController.js +28 -0
- package/dist/contracts/governance/distributor/getLastClaimedEpoch.js +29 -0
- package/dist/contracts/governance/distributor/getPeriodDuration.js +28 -0
- package/dist/contracts/governance/distributor/{getRewardTokens.js → getRewardToken.js} +10 -9
- package/dist/contracts/governance/distributor/getRewardTokenInfo.js +9 -19
- package/dist/contracts/governance/distributor/getRewardTokenStats.js +30 -0
- package/dist/contracts/governance/{gaugeController/isGauge.js → distributor/getStartEpoch.js} +10 -10
- package/dist/contracts/governance/distributor/index.js +31 -17
- package/dist/contracts/governance/distributor/setController.js +26 -0
- package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +27 -0
- package/dist/contracts/governance/distributor/withdrawUnallocatedRewards.js +26 -0
- package/dist/contracts/governance/gauge/addRewardToken.js +34 -0
- package/dist/contracts/governance/gauge/claimExtraReward.js +34 -0
- package/dist/contracts/governance/gauge/claimExtraRewards.js +33 -0
- package/dist/contracts/governance/gauge/claimOnBehalfOf.js +36 -0
- package/dist/contracts/governance/gauge/claimRewardToken.js +3 -4
- package/dist/contracts/governance/gauge/claimRewardsFor.js +34 -0
- package/dist/contracts/governance/gauge/depositRewardToken.js +35 -0
- package/dist/contracts/governance/gauge/getAllPendingExtraRewards.js +36 -0
- package/dist/contracts/governance/gauge/getControllerAddress.js +34 -0
- package/dist/contracts/governance/gauge/getDecimalAdjustment.js +35 -0
- package/dist/contracts/governance/gauge/getDepositRAACOnClaim.js +34 -0
- package/dist/contracts/governance/gauge/getDistributorData.js +36 -0
- package/dist/contracts/governance/gauge/getDistributors.js +34 -0
- package/dist/contracts/governance/gauge/getEarnedReward.js +11 -19
- package/dist/contracts/governance/gauge/getExtraRewardTokens.js +34 -0
- package/dist/contracts/governance/gauge/getGaugeRewardTokenData.js +44 -0
- package/dist/contracts/governance/gauge/getPendingExtraRewards.js +36 -0
- package/dist/contracts/governance/gauge/getPendingRewards.js +11 -19
- package/dist/contracts/governance/gauge/getRaacAutolockMin.js +34 -0
- package/dist/contracts/governance/gauge/getUserRewardTokenData.js +37 -0
- package/dist/contracts/governance/gauge/getUserWeight.js +35 -0
- package/dist/contracts/governance/gauge/index.js +53 -35
- package/dist/contracts/governance/gauge/isPaused.js +34 -0
- package/dist/contracts/governance/gauge/manageDistributor.js +35 -0
- package/dist/contracts/governance/gauge/setController.js +34 -0
- package/dist/contracts/governance/gauge/setDepositRAACOnClaim.js +34 -0
- package/dist/contracts/governance/gauge/setDistributorApproval.js +35 -0
- package/dist/contracts/governance/gauge/setEmergencyPaused.js +34 -0
- package/dist/contracts/governance/gauge/setGaugeRewardDistributor.js +34 -0
- package/dist/contracts/governance/gauge/setRaacAutolockMin.js +34 -0
- package/dist/contracts/governance/gauge/updateUserRewards.js +3 -2
- package/dist/contracts/governance/gaugeController/addGauge.js +24 -0
- package/dist/contracts/governance/gaugeController/batchVote.js +25 -0
- package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +24 -0
- package/dist/contracts/governance/gaugeController/getConstants.js +45 -0
- package/dist/contracts/governance/gaugeController/getCurrentEpoch.js +27 -0
- package/dist/contracts/governance/gaugeController/getGauge.js +29 -0
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +29 -0
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeightView.js +30 -0
- package/dist/contracts/governance/gaugeController/getLastVoteTime.js +29 -0
- package/dist/contracts/governance/gaugeController/getNextEpoch.js +27 -0
- package/dist/contracts/governance/gaugeController/getUserGaugeVotePower.js +29 -0
- package/dist/contracts/governance/gaugeController/getVeToken.js +27 -0
- package/dist/contracts/governance/gaugeController/getVoteUserPower.js +28 -0
- package/dist/contracts/governance/gaugeController/getVoteUserSlope.js +30 -0
- package/dist/contracts/governance/gaugeController/index.js +43 -23
- package/dist/contracts/governance/gaugeController/isPaused.js +27 -0
- package/dist/contracts/governance/gaugeController/kick.js +24 -0
- package/dist/contracts/governance/gaugeController/removeGauge.js +24 -0
- package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +24 -0
- package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +25 -0
- package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +25 -0
- package/dist/contracts/governance/gaugeController/setEmergencyPause.js +24 -0
- package/dist/contracts/lockers/botLocker/unlock.js +4 -1
- package/dist/contracts/lockers/maturityVault/harvest.js +3 -2
- package/dist/types/RPCLibrary.d.ts +6 -64
- package/dist/types/contracts/governance/distributor/claimAll.d.ts +11 -0
- package/dist/types/contracts/governance/distributor/claimForGauge.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/deposit.d.ts +6 -7
- package/dist/types/contracts/governance/distributor/getClaimableForGauge.d.ts +11 -0
- package/dist/types/contracts/governance/distributor/getClaimedAtEpoch.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/getDepositedAtEpoch.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/getGaugeController.d.ts +10 -0
- package/dist/types/contracts/governance/distributor/getLastClaimedEpoch.d.ts +11 -0
- package/dist/types/contracts/governance/distributor/getPeriodDuration.d.ts +10 -0
- package/dist/types/contracts/governance/distributor/{getRewardTokens.d.ts → getRewardToken.d.ts} +3 -3
- package/dist/types/contracts/governance/distributor/getRewardTokenInfo.d.ts +8 -10
- package/dist/types/contracts/governance/distributor/getRewardTokenStats.d.ts +15 -0
- package/dist/types/contracts/governance/distributor/getStartEpoch.d.ts +10 -0
- package/dist/types/contracts/governance/distributor/index.d.ts +16 -8
- package/dist/types/contracts/governance/distributor/setController.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/withdrawRemovedGaugeRewards.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/withdrawUnallocatedRewards.d.ts +12 -0
- package/dist/types/contracts/governance/gauge/addRewardToken.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/claimExtraReward.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/claimExtraRewards.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/claimOnBehalfOf.d.ts +12 -0
- package/dist/types/contracts/governance/gauge/claimRewardToken.d.ts +1 -2
- package/dist/types/contracts/governance/gauge/claimRewardsFor.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/depositRewardToken.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/getAllPendingExtraRewards.d.ts +13 -0
- package/dist/types/contracts/governance/gauge/getControllerAddress.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getDecimalAdjustment.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/getDepositRAACOnClaim.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getDistributorData.d.ts +13 -0
- package/dist/types/contracts/governance/gauge/{getRewardTokens.d.ts → getDistributors.d.ts} +3 -5
- package/dist/types/contracts/governance/gauge/getEarnedReward.d.ts +4 -5
- package/dist/types/contracts/governance/gauge/getExtraRewardTokens.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getGaugeRewardTokenData.d.ts +18 -0
- package/dist/types/contracts/governance/gauge/getPendingExtraRewards.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/getPendingRewards.d.ts +4 -5
- package/dist/types/contracts/governance/gauge/getRaacAutolockMin.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getUserRewardTokenData.d.ts +17 -0
- package/dist/types/contracts/governance/gauge/getUserWeight.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/index.d.ts +38 -17
- package/dist/types/contracts/governance/gauge/isPaused.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/manageDistributor.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/setController.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setDepositRAACOnClaim.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setDistributorApproval.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/setEmergencyPaused.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setGaugeRewardDistributor.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setRaacAutolockMin.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/updateUserRewards.d.ts +2 -1
- package/dist/types/contracts/governance/gaugeController/addGauge.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/batchVote.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/forceCompleteCheckpoint.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/getConstants.d.ts +18 -0
- package/dist/types/contracts/governance/gaugeController/getCurrentEpoch.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/getGauge.d.ts +15 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeight.d.ts +15 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeightView.d.ts +14 -0
- package/dist/types/contracts/governance/gaugeController/getLastVoteTime.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/getNextEpoch.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/getUserGaugeVotePower.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/getVeToken.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/getVoteUserPower.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/getVoteUserSlope.d.ts +15 -0
- package/dist/types/contracts/governance/gaugeController/index.d.ts +28 -11
- package/dist/types/contracts/governance/gaugeController/isPaused.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/kick.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/removeGauge.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/removePowerFromGauge.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/setBoostAmplificationEnabled.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePause.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyPause.d.ts +10 -0
- package/dist/types/contracts/lockers/botLocker/unlock.d.ts +3 -0
- package/dist/types/contracts/lockers/maturityVault/harvest.d.ts +1 -1
- package/dist/utils/contracts.js +1 -1
- package/package.json +1 -1
- package/dist/contracts/governance/distributor/getAvailableBalance.js +0 -29
- package/dist/contracts/governance/distributor/getGaugeRewardTokens.js +0 -28
- package/dist/contracts/governance/distributor/getTransferableBalance.js +0 -30
- package/dist/contracts/governance/distributor/isRewardTokenApproved.js +0 -29
- package/dist/contracts/governance/distributor/isTokenApproved.js +0 -29
- package/dist/contracts/governance/gauge/claimReward.js +0 -44
- package/dist/contracts/governance/gauge/getAllEarnedRewards.js +0 -51
- package/dist/contracts/governance/gauge/getAllPendingRewards.js +0 -41
- package/dist/contracts/governance/gauge/getRewardTokens.js +0 -41
- package/dist/contracts/governance/gauge/getUserGaugeVoteWeight.js +0 -42
- package/dist/contracts/governance/gauge/getWorkingBalance.js +0 -43
- package/dist/contracts/governance/gauge/syncRewardTokens.js +0 -51
- package/dist/contracts/governance/gaugeController/checkpoint.js +0 -33
- package/dist/contracts/governance/gaugeController/checkpointGauge.js +0 -34
- package/dist/contracts/governance/gaugeController/getUserGaugeVoteWeight.js +0 -30
- package/dist/tests/liquidLocker.test.js +0 -262
- package/dist/tests/test.js +0 -32
- package/dist/types/contracts/governance/distributor/getAvailableBalance.d.ts +0 -11
- package/dist/types/contracts/governance/distributor/getGaugeRewardTokens.d.ts +0 -11
- package/dist/types/contracts/governance/distributor/getTransferableBalance.d.ts +0 -12
- package/dist/types/contracts/governance/distributor/isRewardTokenApproved.d.ts +0 -12
- package/dist/types/contracts/governance/distributor/isTokenApproved.d.ts +0 -11
- package/dist/types/contracts/governance/gauge/claimReward.d.ts +0 -11
- package/dist/types/contracts/governance/gauge/getAllEarnedRewards.d.ts +0 -17
- package/dist/types/contracts/governance/gauge/getAllPendingRewards.d.ts +0 -19
- package/dist/types/contracts/governance/gauge/getUserGaugeVoteWeight.d.ts +0 -14
- package/dist/types/contracts/governance/gauge/getWorkingBalance.d.ts +0 -12
- package/dist/types/contracts/governance/gauge/syncRewardTokens.d.ts +0 -13
- package/dist/types/contracts/governance/gaugeController/checkpoint.d.ts +0 -11
- package/dist/types/contracts/governance/gaugeController/checkpointGauge.d.ts +0 -12
- package/dist/types/contracts/governance/gaugeController/getUserGaugeVoteWeight.d.ts +0 -12
- package/dist/types/contracts/governance/gaugeController/isGauge.d.ts +0 -11
- package/dist/types/tests/liquidLocker.test.d.ts +0 -18
- package/dist/types/tests/test.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"chainId": 11155111,
|
|
3
3
|
"name": "sepolia",
|
|
4
|
-
"rpcs": ["https://
|
|
4
|
+
"rpcs": ["https://ethereum-sepolia-rpc.publicnode.com", "https://1rpc.io/sepolia"],
|
|
5
5
|
"nativeCurrency": {
|
|
6
6
|
"name": "ETH",
|
|
7
7
|
"symbol": "ETH",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"raacminter": {
|
|
33
33
|
"id": "raacminter",
|
|
34
34
|
"name": "RAAC Minter",
|
|
35
|
-
"contract": "
|
|
35
|
+
"contract": "0x46CCfE1D93a5448BC31103617D676Dab321f7401"
|
|
36
36
|
},
|
|
37
37
|
"feecollector": {
|
|
38
38
|
"id": "feecollector",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"treasury": {
|
|
43
43
|
"id": "treasury",
|
|
44
44
|
"name": "Treasury",
|
|
45
|
-
"contract": "
|
|
45
|
+
"contract": "0x1bCE0e1C1aB90936C5975d9755FBAc4a00c3f145"
|
|
46
46
|
},
|
|
47
47
|
"pmtreasury": {
|
|
48
48
|
"id": "pmtreasury",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"complianceregistry": {
|
|
78
78
|
"id": "complianceregistry",
|
|
79
79
|
"name": "Compliance Registry",
|
|
80
|
-
"contract": "
|
|
80
|
+
"contract": "0x0cFF98a49D62541eBb990C2B397297d477D3Ef34"
|
|
81
81
|
},
|
|
82
82
|
"rwaindextokencollector": {
|
|
83
83
|
"id": "rwaindextokencollector",
|
|
@@ -109,12 +109,12 @@
|
|
|
109
109
|
"gaugerewardsdistributor": {
|
|
110
110
|
"id": "gaugerewardsdistributor",
|
|
111
111
|
"name": "Gauge Rewards Distributor",
|
|
112
|
-
"contract": "
|
|
112
|
+
"contract": "0xe4E0600af62588E60B460012C65E39fD8158e4a2"
|
|
113
113
|
},
|
|
114
114
|
"gaugecontroller": {
|
|
115
115
|
"id": "gaugecontroller",
|
|
116
116
|
"name": "Gauge Controller",
|
|
117
|
-
"contract": "
|
|
117
|
+
"contract": "0xbE8A81ab91e779da07d1E5E13e5be29B30Ad58Af"
|
|
118
118
|
},
|
|
119
119
|
"gauge": {
|
|
120
120
|
"id": "gauge",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
},
|
|
124
124
|
"raacgauge": {
|
|
125
125
|
"id": "raacgauge",
|
|
126
|
-
"name": "RAAC Gauge",
|
|
127
|
-
"contract": "
|
|
126
|
+
"name": "RAAC Gauge (alias: primary crvUSD/RAAC LP gauge)",
|
|
127
|
+
"contract": "0x04F3e12A814b21B9F947c726be512719a41b980f"
|
|
128
128
|
},
|
|
129
129
|
"rwagauge": {
|
|
130
130
|
"id": "rwagauge",
|
|
@@ -134,12 +134,12 @@
|
|
|
134
134
|
"governance": {
|
|
135
135
|
"id": "governance",
|
|
136
136
|
"name": "Governance",
|
|
137
|
-
"contract": "
|
|
137
|
+
"contract": "0x3b5A1aEa6FFdF9e2a7eCad2F7cB7a2f20324Bc6b"
|
|
138
138
|
},
|
|
139
139
|
"timelockcontroller": {
|
|
140
140
|
"id": "timelockcontroller",
|
|
141
141
|
"name": "Timelock Controller",
|
|
142
|
-
"contract": "
|
|
142
|
+
"contract": "0x88CeA6036f003D6307A334bA472cD84342023532"
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
145
|
"pools": {
|
|
@@ -151,7 +151,12 @@
|
|
|
151
151
|
"lendingpool": {
|
|
152
152
|
"id": "lendingpool",
|
|
153
153
|
"name": "Lending Pool",
|
|
154
|
-
"contract": "
|
|
154
|
+
"contract": "0xE281dB3E652f1c649F324aa621Fc1917f74a5243"
|
|
155
|
+
},
|
|
156
|
+
"crvusdraacpool": {
|
|
157
|
+
"id": "crvusdraacpool",
|
|
158
|
+
"name": "Curve crvUSD/RAAC twocrypto-ng Pool",
|
|
159
|
+
"contract": "0xCfDBbad91770fb7Fd57e623A59dcbD14670164c7"
|
|
155
160
|
}
|
|
156
161
|
},
|
|
157
162
|
"nfts": {
|
|
@@ -159,6 +164,11 @@
|
|
|
159
164
|
"id": "raacnft",
|
|
160
165
|
"name": "RAAC NFT",
|
|
161
166
|
"contract": "0xbac60A20C0B932b65E18F636C94e9f4b41F3A426"
|
|
167
|
+
},
|
|
168
|
+
"raacbotnft": {
|
|
169
|
+
"id": "raacbotnft",
|
|
170
|
+
"name": "RAAC Bot NFT (mock)",
|
|
171
|
+
"contract": "0xef6F57a37D2Ff59371716F673Eaf43e940CC4fc8"
|
|
162
172
|
}
|
|
163
173
|
},
|
|
164
174
|
"assets": {
|
|
@@ -184,13 +194,13 @@
|
|
|
184
194
|
"id": "crvusd",
|
|
185
195
|
"name": "CRVUSD",
|
|
186
196
|
"decimals": 18,
|
|
187
|
-
"contract": "
|
|
197
|
+
"contract": "0x990c1Aa9162d2c5B51378F86420f1752874e034B"
|
|
188
198
|
},
|
|
189
199
|
"rtoken": {
|
|
190
200
|
"id": "rtoken",
|
|
191
201
|
"name": "RToken",
|
|
192
202
|
"decimals": 18,
|
|
193
|
-
"contract": "
|
|
203
|
+
"contract": "0x062a641EF54810B321f123487fFf083cadB50989"
|
|
194
204
|
},
|
|
195
205
|
"detoken": {
|
|
196
206
|
"id": "detoken",
|
|
@@ -202,13 +212,19 @@
|
|
|
202
212
|
"id": "raactoken",
|
|
203
213
|
"name": "RAAC",
|
|
204
214
|
"decimals": 18,
|
|
205
|
-
"contract": "
|
|
215
|
+
"contract": "0x6F858708bDBB1551aA910e5a7AdE27467EAf6Bc6"
|
|
206
216
|
},
|
|
207
217
|
"veraac": {
|
|
208
218
|
"id": "veraac",
|
|
209
219
|
"name": "VERAAC",
|
|
210
220
|
"decimals": 18,
|
|
211
|
-
"contract": "
|
|
221
|
+
"contract": "0xE01eCF9FDF78D7F675a73E09633726BfcF2dfd56"
|
|
222
|
+
},
|
|
223
|
+
"leraac": {
|
|
224
|
+
"id": "leraac",
|
|
225
|
+
"name": "Liquid Escrowed RAAC",
|
|
226
|
+
"decimals": 18,
|
|
227
|
+
"contract": "0x50f4ad0db57474480E87D49E3993B7e9653c9ff0"
|
|
212
228
|
},
|
|
213
229
|
"debttoken": {
|
|
214
230
|
"id": "debttoken",
|
|
@@ -220,7 +236,7 @@
|
|
|
220
236
|
"id": "rwaindextoken",
|
|
221
237
|
"name": "RWA Index Token",
|
|
222
238
|
"decimals": 18,
|
|
223
|
-
"contract": "
|
|
239
|
+
"contract": "0x531b322933ebc65b4A139a11139534A3872bEB1a"
|
|
224
240
|
}
|
|
225
241
|
},
|
|
226
242
|
"adapters": {
|
|
@@ -252,5 +268,45 @@
|
|
|
252
268
|
"type": "ERC20"
|
|
253
269
|
}
|
|
254
270
|
}
|
|
271
|
+
},
|
|
272
|
+
"lockers": {
|
|
273
|
+
"raacliquidlocker": {
|
|
274
|
+
"id": "raacliquidlocker",
|
|
275
|
+
"name": "RAAC Liquid Locker",
|
|
276
|
+
"contract": "0xf0F8d028bB7590889f7d183e1eB95a3e71715fE6"
|
|
277
|
+
},
|
|
278
|
+
"raacmaturityvault": {
|
|
279
|
+
"id": "raacmaturityvault",
|
|
280
|
+
"name": "RAAC Maturity Vault",
|
|
281
|
+
"contract": "0xCD069A826E8001D8FA1Bb26eed83ad4aE6b63651"
|
|
282
|
+
},
|
|
283
|
+
"raacbotlocker": {
|
|
284
|
+
"id": "raacbotlocker",
|
|
285
|
+
"name": "RAAC Bot Locker",
|
|
286
|
+
"contract": "0xF7F7e841bc123f6e11aE5144852c43882289AdBD"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"zap": {
|
|
290
|
+
"aladdinzap": {
|
|
291
|
+
"id": "aladdinzap",
|
|
292
|
+
"name": "Aladdin Zap",
|
|
293
|
+
"contract": "0x3b1325d1D220f2b78d4EFF8786654572193112d1"
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"gauges": {
|
|
297
|
+
"raac_rcrvusd": {
|
|
298
|
+
"id": "RAAC_RcrvUSD",
|
|
299
|
+
"name": "RAAC RcrvUSD Gauge",
|
|
300
|
+
"type": "RAACGauge",
|
|
301
|
+
"contract": "0xE8eBe8294542d47f481c17036C8165CB8935554a",
|
|
302
|
+
"stakingToken": "0x062a641EF54810B321f123487fFf083cadB50989"
|
|
303
|
+
},
|
|
304
|
+
"raac_crvusd_lp": {
|
|
305
|
+
"id": "RAAC_crvUSD_LP",
|
|
306
|
+
"name": "RAAC crvUSD/RAAC LP Gauge",
|
|
307
|
+
"type": "RAACGauge",
|
|
308
|
+
"contract": "0x04F3e12A814b21B9F947c726be512719a41b980f",
|
|
309
|
+
"stakingToken": "0xCfDBbad91770fb7Fd57e623A59dcbD14670164c7"
|
|
310
|
+
}
|
|
255
311
|
}
|
|
256
312
|
}
|
|
@@ -111,12 +111,12 @@
|
|
|
111
111
|
"gaugerewardsdistributor": {
|
|
112
112
|
"id": "gaugerewardsdistributor",
|
|
113
113
|
"name": "Gauge Rewards Distributor",
|
|
114
|
-
"contract": "
|
|
114
|
+
"contract": "0xB06c856C8eaBd1d8321b687E188204C1018BC4E5"
|
|
115
115
|
},
|
|
116
116
|
"gaugecontroller": {
|
|
117
117
|
"id": "gaugecontroller",
|
|
118
118
|
"name": "Gauge Controller",
|
|
119
|
-
"contract": "
|
|
119
|
+
"contract": "0xddE78e6202518FF4936b5302cC2891ec180E8bFf"
|
|
120
120
|
},
|
|
121
121
|
"gauge": {
|
|
122
122
|
"id": "gauge",
|
|
@@ -126,12 +126,12 @@
|
|
|
126
126
|
"raacgauge": {
|
|
127
127
|
"id": "raacgauge",
|
|
128
128
|
"name": "RAAC Gauge",
|
|
129
|
-
"contract": "
|
|
129
|
+
"contract": "0xaB7B4c595d3cE8C85e16DA86630f2fc223B05057"
|
|
130
130
|
},
|
|
131
131
|
"rwagauge": {
|
|
132
132
|
"id": "rwagauge",
|
|
133
133
|
"name": "RWA Gauge",
|
|
134
|
-
"contract": "
|
|
134
|
+
"contract": "0xAD523115cd35a8d4E60B3C0953E0E0ac10418309"
|
|
135
135
|
},
|
|
136
136
|
"governance": {
|
|
137
137
|
"id": "governance",
|
|
@@ -204,13 +204,13 @@
|
|
|
204
204
|
"id": "raactoken",
|
|
205
205
|
"name": "RAAC",
|
|
206
206
|
"decimals": 18,
|
|
207
|
-
"contract": "
|
|
207
|
+
"contract": "0xe1Fd27F4390DcBE165f4D60DBF821e4B9Bb02dEd"
|
|
208
208
|
},
|
|
209
209
|
"veraac": {
|
|
210
210
|
"id": "veraac",
|
|
211
211
|
"name": "VERAAC",
|
|
212
212
|
"decimals": 18,
|
|
213
|
-
"contract": "
|
|
213
|
+
"contract": "0x8bCe54ff8aB45CB075b044AE117b8fD91F9351aB"
|
|
214
214
|
},
|
|
215
215
|
"debttoken": {
|
|
216
216
|
"id": "debttoken",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.claimAll = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Claims accrued rewards for multiple gauges in a single transaction.
|
|
9
|
+
*
|
|
10
|
+
* @param chainId - The chain/network to use.
|
|
11
|
+
* @param gauges - Array of gauge addresses.
|
|
12
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
13
|
+
* @returns Transaction after it has been mined.
|
|
14
|
+
*/
|
|
15
|
+
const claimAll = async (chainId, gauges, signer) => {
|
|
16
|
+
if (!signer)
|
|
17
|
+
throw new Error("Signer is required");
|
|
18
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
19
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
20
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
21
|
+
const tx = await contract.claimAll(gauges);
|
|
22
|
+
await tx.wait();
|
|
23
|
+
return tx;
|
|
24
|
+
};
|
|
25
|
+
exports.claimAll = claimAll;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.claimForGauge = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Claims accrued rewards for a gauge.
|
|
9
|
+
* Note: only callable by the gauge contract itself (msg.sender must == gauge).
|
|
10
|
+
*
|
|
11
|
+
* @param chainId - The chain/network to use.
|
|
12
|
+
* @param gauge - Address of the gauge.
|
|
13
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
14
|
+
* @returns Transaction after it has been mined.
|
|
15
|
+
*/
|
|
16
|
+
const claimForGauge = async (chainId, gauge, signer) => {
|
|
17
|
+
if (!signer)
|
|
18
|
+
throw new Error("Signer is required");
|
|
19
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
20
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
21
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
22
|
+
const tx = await contract.claimForGauge(gauge);
|
|
23
|
+
await tx.wait();
|
|
24
|
+
return tx;
|
|
25
|
+
};
|
|
26
|
+
exports.claimForGauge = claimForGauge;
|
|
@@ -6,31 +6,22 @@ const getContractAddress_1 = require("../../getContractAddress");
|
|
|
6
6
|
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
7
|
/**
|
|
8
8
|
* Deposits reward tokens into the distributor.
|
|
9
|
-
*
|
|
10
|
-
* Rewards are distributed to gauges based on their weights.
|
|
9
|
+
* The reward token must be pre-approved by the caller before calling.
|
|
11
10
|
*
|
|
12
11
|
* @param chainId - The chain/network to use.
|
|
13
|
-
* @param
|
|
12
|
+
* @param token - Address of the reward token.
|
|
14
13
|
* @param amount - Amount of reward tokens to deposit.
|
|
15
|
-
* @param signer - An ethers.js Signer instance (
|
|
16
|
-
* @returns Transaction
|
|
14
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
15
|
+
* @returns Transaction after it has been mined.
|
|
17
16
|
*/
|
|
18
|
-
const deposit = async (chainId,
|
|
19
|
-
if (!signer)
|
|
17
|
+
const deposit = async (chainId, token, amount, signer) => {
|
|
18
|
+
if (!signer)
|
|
20
19
|
throw new Error("Signer is required");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
await tx.wait();
|
|
28
|
-
console.log(`Deposited ${amount} of ${tokenAddress} to distributor`);
|
|
29
|
-
return tx;
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error("Error depositing:", error);
|
|
33
|
-
throw new Error(`Failed to deposit: ${error.message}`);
|
|
34
|
-
}
|
|
20
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
21
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
22
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
23
|
+
const tx = await contract.deposit(token, amount);
|
|
24
|
+
await tx.wait();
|
|
25
|
+
return tx;
|
|
35
26
|
};
|
|
36
27
|
exports.deposit = deposit;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getClaimableForGauge = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Gets the amount of rewards currently claimable for a gauge.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param gauge - Address of the gauge.
|
|
16
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
17
|
+
* @returns Claimable reward amount (bigint).
|
|
18
|
+
*/
|
|
19
|
+
const getClaimableForGauge = async (chainId, gauge, provider) => {
|
|
20
|
+
if (!provider) {
|
|
21
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
22
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
23
|
+
}
|
|
24
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
25
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
26
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
27
|
+
return contract.getClaimableForGauge(gauge);
|
|
28
|
+
};
|
|
29
|
+
exports.getClaimableForGauge = getClaimableForGauge;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getClaimedAtEpoch = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Gets the amount claimed by a gauge at a specific epoch.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param gauge - Address of the gauge.
|
|
16
|
+
* @param epoch - The epoch to query.
|
|
17
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
18
|
+
* @returns Amount claimed at the epoch (bigint).
|
|
19
|
+
*/
|
|
20
|
+
const getClaimedAtEpoch = async (chainId, gauge, epoch, provider) => {
|
|
21
|
+
if (!provider) {
|
|
22
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
23
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
24
|
+
}
|
|
25
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
26
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
27
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
28
|
+
return contract.claimedAtEpoch(gauge, epoch);
|
|
29
|
+
};
|
|
30
|
+
exports.getClaimedAtEpoch = getClaimedAtEpoch;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDepositedAtEpoch = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Gets the amount of a token deposited at a specific epoch.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param token - Address of the reward token.
|
|
16
|
+
* @param epoch - The epoch to query.
|
|
17
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
18
|
+
* @returns Amount deposited at the epoch (bigint).
|
|
19
|
+
*/
|
|
20
|
+
const getDepositedAtEpoch = async (chainId, token, epoch, provider) => {
|
|
21
|
+
if (!provider) {
|
|
22
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
23
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
24
|
+
}
|
|
25
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
26
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
27
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
28
|
+
return contract.depositedAtEpoch(token, epoch);
|
|
29
|
+
};
|
|
30
|
+
exports.getDepositedAtEpoch = getDepositedAtEpoch;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getGaugeController = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Gets the gauge controller address used by the distributor.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
16
|
+
* @returns Gauge controller address (string).
|
|
17
|
+
*/
|
|
18
|
+
const getGaugeController = async (chainId, provider) => {
|
|
19
|
+
if (!provider) {
|
|
20
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
21
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
22
|
+
}
|
|
23
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
24
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
25
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
26
|
+
return contract.gaugeController();
|
|
27
|
+
};
|
|
28
|
+
exports.getGaugeController = getGaugeController;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getLastClaimedEpoch = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Gets the last epoch claimed for a gauge.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param gauge - Address of the gauge.
|
|
16
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
17
|
+
* @returns Last claimed epoch (bigint).
|
|
18
|
+
*/
|
|
19
|
+
const getLastClaimedEpoch = async (chainId, gauge, provider) => {
|
|
20
|
+
if (!provider) {
|
|
21
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
22
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
23
|
+
}
|
|
24
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
25
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
26
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
27
|
+
return contract.lastClaimedEpoch(gauge);
|
|
28
|
+
};
|
|
29
|
+
exports.getLastClaimedEpoch = getLastClaimedEpoch;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getPeriodDuration = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Gets the distributor's period (epoch) duration in seconds.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
16
|
+
* @returns Period duration in seconds (bigint).
|
|
17
|
+
*/
|
|
18
|
+
const getPeriodDuration = async (chainId, provider) => {
|
|
19
|
+
if (!provider) {
|
|
20
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
21
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
22
|
+
}
|
|
23
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
24
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
25
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
26
|
+
return contract.PERIOD_DURATION();
|
|
27
|
+
};
|
|
28
|
+
exports.getPeriodDuration = getPeriodDuration;
|
|
@@ -3,25 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getRewardToken = void 0;
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
9
|
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
-
const
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
11
|
/**
|
|
12
|
-
* Gets
|
|
12
|
+
* Gets the reward token address used by the distributor.
|
|
13
13
|
*
|
|
14
14
|
* @param chainId - The chain/network to use.
|
|
15
15
|
* @param provider - Optional ethers.js Provider instance.
|
|
16
|
-
* @returns
|
|
16
|
+
* @returns Reward token address (string).
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const getRewardToken = async (chainId, provider) => {
|
|
19
19
|
if (!provider) {
|
|
20
20
|
const rpc = chains_1.default[chainId].rpcs[0];
|
|
21
21
|
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
24
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
25
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
26
|
+
return contract.rewardToken();
|
|
26
27
|
};
|
|
27
|
-
exports.
|
|
28
|
+
exports.getRewardToken = getRewardToken;
|
|
@@ -7,33 +7,23 @@ exports.getRewardTokenInfo = void 0;
|
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
9
|
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
-
const
|
|
11
|
-
uint256 totalDeposited,
|
|
12
|
-
uint256 totalDistributed,
|
|
13
|
-
uint256 totalClaimable,
|
|
14
|
-
uint256 balance
|
|
15
|
-
)`;
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
16
11
|
/**
|
|
17
|
-
* Gets
|
|
12
|
+
* Gets aggregate statistics for the distributor's reward token.
|
|
18
13
|
*
|
|
19
14
|
* @param chainId - The chain/network to use.
|
|
20
|
-
* @param tokenAddress - Address of the reward token.
|
|
21
15
|
* @param provider - Optional ethers.js Provider instance.
|
|
22
|
-
* @returns
|
|
16
|
+
* @returns Object with totalDeposited, totalDistributed, totalClaimable and balance (all bigint).
|
|
23
17
|
*/
|
|
24
|
-
const getRewardTokenInfo = async (chainId,
|
|
18
|
+
const getRewardTokenInfo = async (chainId, provider) => {
|
|
25
19
|
if (!provider) {
|
|
26
20
|
const rpc = chains_1.default[chainId].rpcs[0];
|
|
27
21
|
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
28
22
|
}
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
totalDistributed: ethers_1.ethers.formatEther(totalDistributed),
|
|
35
|
-
totalClaimable: ethers_1.ethers.formatEther(totalClaimable),
|
|
36
|
-
balance: ethers_1.ethers.formatEther(balance),
|
|
37
|
-
};
|
|
23
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
24
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
25
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
26
|
+
const [totalDeposited, totalDistributed, totalClaimable, balance] = await contract.getRewardTokenInfo();
|
|
27
|
+
return { totalDeposited, totalDistributed, totalClaimable, balance };
|
|
38
28
|
};
|
|
39
29
|
exports.getRewardTokenInfo = getRewardTokenInfo;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getRewardTokenStats = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
11
|
+
/**
|
|
12
|
+
* Reads the rewardTokenInfo mapping entry for a given token.
|
|
13
|
+
*
|
|
14
|
+
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param token - Address of the reward token.
|
|
16
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
17
|
+
* @returns Object with totalDeposited, totalDistributed and totalClaimable (all bigint).
|
|
18
|
+
*/
|
|
19
|
+
const getRewardTokenStats = async (chainId, token, provider) => {
|
|
20
|
+
if (!provider) {
|
|
21
|
+
const rpc = chains_1.default[chainId].rpcs[0];
|
|
22
|
+
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
23
|
+
}
|
|
24
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugerewardsdistributor");
|
|
25
|
+
const abi = (0, artifacts_1.getABI)("gaugerewardsdistributor");
|
|
26
|
+
const contract = new ethers_1.ethers.Contract(address, abi, provider);
|
|
27
|
+
const [totalDeposited, totalDistributed, totalClaimable] = await contract.rewardTokenInfo(token);
|
|
28
|
+
return { totalDeposited, totalDistributed, totalClaimable };
|
|
29
|
+
};
|
|
30
|
+
exports.getRewardTokenStats = getRewardTokenStats;
|