@raac/rpc 1.2.0-beta.10 → 1.2.0-beta.11
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 +2 -0
- package/dist/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +113 -20
- package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +259 -31
- package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +159 -31
- package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +115 -22
- package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +115 -22
- package/dist/configs/chains/1.json +22 -25
- package/dist/configs/chains/11155111.json +56 -71
- package/dist/configs/chains/17000.json +22 -25
- package/dist/configs/chains/18453.json +22 -25
- package/dist/configs/chains/8453.json +61 -31
- package/dist/contracts/findContract.js +11 -4
- package/dist/contracts/getContractAddress.js +0 -1
- package/dist/contracts/governance/distributor/claimAll.js +18 -11
- package/dist/contracts/governance/distributor/claimForGauge.js +18 -12
- package/dist/contracts/governance/distributor/deposit.js +17 -12
- package/dist/contracts/governance/distributor/getClaimableForGauge.js +10 -9
- package/dist/contracts/governance/distributor/getClaimedAtEpoch.js +11 -10
- package/dist/contracts/governance/distributor/getDepositedAtEpoch.js +8 -8
- package/dist/contracts/governance/distributor/getDustLastProcessedEpoch.js +28 -0
- package/dist/contracts/governance/distributor/getGaugeController.js +7 -7
- package/dist/contracts/governance/distributor/getLastClaimedEpoch.js +10 -9
- package/dist/contracts/governance/distributor/getMaxClaimBound.js +29 -0
- package/dist/contracts/governance/distributor/getPeriodDuration.js +7 -7
- package/dist/contracts/governance/distributor/getRewardToken.js +7 -7
- package/dist/contracts/governance/distributor/getRewardTokenInfo.js +7 -7
- package/dist/contracts/governance/distributor/getRewardTokenStats.js +7 -7
- package/dist/contracts/governance/distributor/index.js +5 -2
- package/dist/contracts/governance/distributor/setController.js +17 -12
- package/dist/contracts/governance/distributor/setLastClaimedEpoch.js +32 -0
- package/dist/contracts/governance/distributor/setMaxClaimBound.js +31 -0
- package/dist/contracts/governance/distributor/withdrawDust.js +31 -0
- package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +19 -13
- package/dist/contracts/governance/gauge/_apy.js +122 -0
- package/dist/contracts/governance/gauge/_tokens.js +36 -0
- package/dist/contracts/governance/gauge/addRewardToken.js +2 -12
- package/dist/contracts/governance/gauge/approveGaugeToken.js +31 -0
- package/dist/contracts/governance/gauge/claimExtraReward.js +2 -12
- package/dist/contracts/governance/gauge/claimExtraRewards.js +2 -12
- package/dist/contracts/governance/gauge/claimOnBehalfOf.js +2 -12
- package/dist/contracts/governance/gauge/claimRewardToken.js +3 -13
- package/dist/contracts/governance/gauge/claimRewardsFor.js +2 -12
- package/dist/contracts/governance/gauge/depositRewardToken.js +2 -12
- package/dist/contracts/governance/gauge/getAllPendingExtraRewards.js +2 -9
- package/dist/contracts/governance/gauge/getApy.js +44 -0
- package/dist/contracts/governance/gauge/getBalanceOf.js +2 -15
- package/dist/contracts/governance/gauge/getControllerAddress.js +2 -9
- package/dist/contracts/governance/gauge/getDecimalAdjustment.js +2 -9
- package/dist/contracts/governance/gauge/getDepositRAACOnClaim.js +2 -9
- package/dist/contracts/governance/gauge/getDistributorData.js +2 -9
- package/dist/contracts/governance/gauge/getDistributors.js +2 -9
- package/dist/contracts/governance/gauge/getEarnedExtraReward.js +30 -0
- package/dist/contracts/governance/gauge/getEarnedReward.js +8 -14
- package/dist/contracts/governance/gauge/getExtraRewardTokens.js +2 -9
- package/dist/contracts/governance/gauge/getGaugeData.js +39 -0
- package/dist/contracts/governance/gauge/getGaugeRewardTokenData.js +2 -9
- package/dist/contracts/governance/gauge/getPauseStatus.js +31 -0
- package/dist/contracts/governance/gauge/getPendingExtraRewards.js +2 -9
- package/dist/contracts/governance/gauge/getPendingRewards.js +8 -14
- package/dist/contracts/governance/gauge/getPeriodBoundaries.js +2 -15
- package/dist/contracts/governance/gauge/getPeriodDuration.js +2 -15
- package/dist/contracts/governance/gauge/getRaacAutolockMin.js +2 -9
- package/dist/contracts/governance/gauge/getRawBalanceOf.js +2 -15
- package/dist/contracts/governance/gauge/getRawTotalSupply.js +2 -15
- package/dist/contracts/governance/gauge/getRewardTokens.js +28 -0
- package/dist/contracts/governance/gauge/getTotalSupply.js +2 -15
- package/dist/contracts/governance/gauge/getUserApy.js +71 -0
- package/dist/contracts/governance/gauge/getUserClaimableRewards.js +21 -73
- package/dist/contracts/governance/gauge/getUserGaugeState.js +44 -0
- package/dist/contracts/governance/gauge/getUserRewardTokenData.js +2 -9
- package/dist/contracts/governance/gauge/getUserWeight.js +2 -9
- package/dist/contracts/governance/gauge/index.js +11 -1
- package/dist/contracts/governance/gauge/isPaused.js +4 -11
- package/dist/contracts/governance/gauge/manageDistributor.js +2 -12
- package/dist/contracts/governance/gauge/pullRewardsFromDistributor.js +30 -0
- package/dist/contracts/governance/gauge/setController.js +2 -12
- package/dist/contracts/governance/gauge/setDepositRAACOnClaim.js +2 -12
- package/dist/contracts/governance/gauge/setEmergencyPaused.js +2 -12
- package/dist/contracts/governance/gauge/setGaugeRewardDistributor.js +2 -12
- package/dist/contracts/governance/gauge/setRaacAutolockMin.js +2 -12
- package/dist/contracts/governance/gauge/stake.js +2 -18
- package/dist/contracts/governance/gauge/unwrapStakingToken.js +28 -0
- package/dist/contracts/governance/gauge/updateUserRewards.js +2 -18
- package/dist/contracts/governance/gauge/withdraw.js +2 -18
- package/dist/contracts/governance/gauge/wrapStakingToken.js +28 -0
- package/dist/contracts/governance/gaugeController/addGauge.js +19 -11
- package/dist/contracts/governance/gaugeController/batchVote.js +20 -12
- package/dist/contracts/governance/gaugeController/calculateBoost.js +20 -23
- package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +19 -11
- package/dist/contracts/governance/gaugeController/getActiveGaugeCount.js +28 -0
- package/dist/contracts/governance/gaugeController/getActiveGauges.js +10 -13
- package/dist/contracts/governance/gaugeController/getConstants.js +10 -18
- package/dist/contracts/governance/gaugeController/getCurrentEpoch.js +8 -7
- package/dist/contracts/governance/gaugeController/getExpiredGaugeVotePower.js +30 -0
- package/dist/contracts/governance/gaugeController/getGauge.js +11 -9
- package/dist/contracts/governance/gaugeController/getGaugeDistributor.js +28 -0
- package/dist/contracts/governance/gaugeController/getGaugeEmissions.js +15 -9
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +19 -15
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeightView.js +12 -10
- package/dist/contracts/governance/gaugeController/getGaugeWeight.js +10 -8
- package/dist/contracts/governance/gaugeController/getLastVoteTime.js +11 -9
- package/dist/contracts/governance/gaugeController/getMaxVoteBuckets.js +28 -0
- package/dist/contracts/governance/gaugeController/getNextEpoch.js +8 -7
- package/dist/contracts/governance/gaugeController/getRegisteredGaugeList.js +28 -0
- package/dist/contracts/governance/gaugeController/getTotalWeight.js +8 -7
- package/dist/contracts/governance/gaugeController/getUserGaugeVotePower.js +11 -9
- package/dist/contracts/governance/gaugeController/getUserVotePowerRemaining.js +10 -9
- package/dist/contracts/governance/gaugeController/getVeToken.js +8 -7
- package/dist/contracts/governance/gaugeController/getVoteUserLocks.js +32 -0
- package/dist/contracts/governance/gaugeController/getVoteUserPower.js +8 -7
- package/dist/contracts/governance/gaugeController/getVoteUserSlope.js +12 -10
- package/dist/contracts/governance/gaugeController/index.js +10 -1
- package/dist/contracts/governance/gaugeController/isGaugeActive.js +11 -9
- package/dist/contracts/governance/gaugeController/isPaused.js +9 -8
- package/dist/contracts/governance/gaugeController/kick.js +17 -10
- package/dist/contracts/governance/gaugeController/removeGauge.js +20 -11
- package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +19 -11
- package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +20 -12
- package/dist/contracts/governance/gaugeController/setDistributor.js +31 -0
- package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +20 -12
- package/dist/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.js +33 -0
- package/dist/contracts/governance/gaugeController/setEmergencyPause.js +18 -11
- package/dist/contracts/governance/gaugeController/setMaxVoteBuckets.js +31 -0
- package/dist/contracts/governance/gaugeController/vote.js +15 -16
- package/dist/contracts/governance/gaugeSystems/_helpers.js +123 -0
- package/dist/contracts/governance/gaugeSystems/findGauge.js +14 -0
- package/dist/contracts/governance/gaugeSystems/getGaugeSystem.js +14 -0
- package/dist/contracts/governance/gaugeSystems/getGaugeSystems.js +13 -0
- package/dist/contracts/governance/gaugeSystems/getGauges.js +15 -0
- package/dist/contracts/governance/gaugeSystems/index.js +21 -0
- package/dist/types/RPCLibrary.d.ts +2 -0
- package/dist/types/configs/chains/index.d.ts +36 -46
- package/dist/types/configs/index.d.ts +18 -23
- package/dist/types/contracts/governance/distributor/claimAll.d.ts +7 -5
- package/dist/types/contracts/governance/distributor/claimForGauge.d.ts +7 -6
- package/dist/types/contracts/governance/distributor/deposit.d.ts +7 -6
- package/dist/types/contracts/governance/distributor/getClaimableForGauge.d.ts +6 -4
- package/dist/types/contracts/governance/distributor/getClaimedAtEpoch.d.ts +7 -5
- package/dist/types/contracts/governance/distributor/getDepositedAtEpoch.d.ts +6 -4
- package/dist/types/contracts/governance/distributor/getDustLastProcessedEpoch.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/getGaugeController.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getLastClaimedEpoch.d.ts +6 -4
- package/dist/types/contracts/governance/distributor/getMaxClaimBound.d.ts +15 -0
- package/dist/types/contracts/governance/distributor/getPeriodDuration.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getRewardToken.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getRewardTokenInfo.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getRewardTokenStats.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/index.d.ts +5 -2
- package/dist/types/contracts/governance/distributor/setController.d.ts +7 -6
- package/dist/types/contracts/governance/distributor/setLastClaimedEpoch.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/setMaxClaimBound.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/withdrawDust.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/withdrawRemovedGaugeRewards.d.ts +8 -7
- package/dist/types/contracts/governance/gauge/_apy.d.ts +61 -0
- package/dist/types/contracts/governance/gauge/_tokens.d.ts +14 -0
- package/dist/types/contracts/governance/gauge/approveGaugeToken.d.ts +14 -0
- package/dist/types/contracts/governance/gauge/claimRewardToken.d.ts +1 -1
- package/dist/types/contracts/governance/gauge/getApy.d.ts +41 -0
- package/dist/types/contracts/governance/gauge/getEarnedExtraReward.d.ts +13 -0
- package/dist/types/contracts/governance/gauge/getEarnedReward.d.ts +3 -2
- package/dist/types/contracts/governance/gauge/getGaugeData.d.ts +23 -0
- package/dist/types/contracts/governance/gauge/getPauseStatus.d.ts +19 -0
- package/dist/types/contracts/governance/gauge/getPendingRewards.d.ts +3 -2
- package/dist/types/contracts/governance/gauge/getRewardTokens.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/getUserApy.d.ts +44 -0
- package/dist/types/contracts/governance/gauge/getUserClaimableRewards.d.ts +14 -12
- package/dist/types/contracts/governance/gauge/getUserGaugeState.d.ts +31 -0
- package/dist/types/contracts/governance/gauge/index.d.ts +11 -1
- package/dist/types/contracts/governance/gauge/isPaused.d.ts +1 -1
- package/dist/types/contracts/governance/gauge/pullRewardsFromDistributor.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/unwrapStakingToken.d.ts +12 -0
- package/dist/types/contracts/governance/gauge/wrapStakingToken.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeController/addGauge.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/batchVote.d.ts +9 -6
- package/dist/types/contracts/governance/gaugeController/calculateBoost.d.ts +10 -8
- package/dist/types/contracts/governance/gaugeController/forceCompleteCheckpoint.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/getActiveGaugeCount.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getActiveGauges.d.ts +7 -3
- package/dist/types/contracts/governance/gaugeController/getConstants.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/getCurrentEpoch.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getExpiredGaugeVotePower.d.ts +16 -0
- package/dist/types/contracts/governance/gaugeController/getGauge.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/getGaugeDistributor.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeEmissions.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeight.d.ts +8 -9
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeightView.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/getGaugeWeight.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/getLastVoteTime.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/getMaxVoteBuckets.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getNextEpoch.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getRegisteredGaugeList.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getTotalWeight.d.ts +5 -3
- package/dist/types/contracts/governance/gaugeController/getUserGaugeVotePower.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/getUserVotePowerRemaining.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/getVeToken.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getVoteUserLocks.d.ts +17 -0
- package/dist/types/contracts/governance/gaugeController/getVoteUserPower.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getVoteUserSlope.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/index.d.ts +10 -1
- package/dist/types/contracts/governance/gaugeController/isGaugeActive.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/isPaused.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/kick.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/removeGauge.d.ts +9 -5
- package/dist/types/contracts/governance/gaugeController/removePowerFromGauge.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/setBoostAmplificationEnabled.d.ts +9 -6
- package/dist/types/contracts/governance/gaugeController/setDistributor.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePause.d.ts +9 -6
- package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.d.ts +14 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyPause.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/setMaxVoteBuckets.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeController/vote.d.ts +9 -7
- package/dist/types/contracts/governance/gaugeSystems/_helpers.d.ts +71 -0
- package/dist/types/contracts/governance/gaugeSystems/findGauge.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeSystems/getGaugeSystem.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeSystems/getGaugeSystems.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeSystems/getGauges.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeSystems/index.d.ts +5 -0
- package/dist/types/typechain-types/contracts/core/governance/gauges/BaseGauge.d.ts +176 -105
- package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeController.d.ts +260 -213
- package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeRewardsDistributor.d.ts +173 -212
- package/dist/types/typechain-types/contracts/core/governance/gauges/RAACGauge.d.ts +176 -105
- package/dist/types/typechain-types/contracts/core/governance/gauges/RWAGauge.d.ts +176 -105
- package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IBaseGauge.d.ts +111 -108
- package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeController.d.ts +210 -34
- package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeRewardsDistributor.d.ts +112 -151
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/BaseGauge__factory.d.ts +174 -95
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeController__factory.d.ts +243 -227
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeRewardsDistributor__factory.d.ts +164 -232
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RAACGauge__factory.d.ts +185 -98
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RWAGauge__factory.d.ts +185 -98
- package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IBaseGauge__factory.d.ts +104 -95
- package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeController__factory.d.ts +241 -22
- package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeRewardsDistributor__factory.d.ts +72 -158
- package/dist/types/utils/artifacts.d.ts +40 -0
- package/dist/types/utils/contracts.d.ts +34 -44
- package/dist/utils/contracts.js +1 -1
- package/package.json +1 -1
- package/dist/contracts/governance/distributor/getStartEpoch.js +0 -28
- package/dist/contracts/governance/distributor/withdrawUnallocatedRewards.js +0 -26
- package/dist/contracts/governance/gauge/setDistributorApproval.js +0 -35
- package/dist/types/contracts/governance/distributor/getStartEpoch.d.ts +0 -10
- package/dist/types/contracts/governance/distributor/withdrawUnallocatedRewards.d.ts +0 -12
- package/dist/types/contracts/governance/gauge/setDistributorApproval.d.ts +0 -11
|
@@ -105,31 +105,62 @@
|
|
|
105
105
|
"contract": "0x627897baf46851500F116cec76346921C3292246"
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"id": "
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
"gauges": {
|
|
109
|
+
"raacgauges": {
|
|
110
|
+
"id": "raacgauges",
|
|
111
|
+
"label": "RAAC Gauges",
|
|
112
|
+
"gaugeType": "RAACGauge",
|
|
113
|
+
"controller": "0xbE8A81ab91e779da07d1E5E13e5be29B30Ad58Af",
|
|
114
|
+
"distributor": "0xe4E0600af62588E60B460012C65E39fD8158e4a2",
|
|
115
|
+
"gauges": [
|
|
116
|
+
{
|
|
117
|
+
"id": "RAAC_pmUSD",
|
|
118
|
+
"name": "RAAC pmUSD Gauge",
|
|
119
|
+
"contract": "0xc6471c956a6f77Af1D35Ea639a46544eE9340838",
|
|
120
|
+
"stakingToken": "0x0bd4E860e5e7A0C7c9d221Fa336976bF001F81fa",
|
|
121
|
+
"wrapped": true,
|
|
122
|
+
"underlying": "0x6F713079002a0a485E91fB276E4682CB01d18439",
|
|
123
|
+
"wrapper": "0x0bd4E860e5e7A0C7c9d221Fa336976bF001F81fa"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "RAAC_pmUSD_LP",
|
|
127
|
+
"name": "RAAC pmUSD/RAAC LP Gauge",
|
|
128
|
+
"contract": "0xac6A07DEbbc683042478987f7BceEdb934161311",
|
|
129
|
+
"stakingToken": "0xAe98A7EF8557491fD34b45036Aada075c9385c6C"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "RAAC_RcrvUSD",
|
|
133
|
+
"name": "RAAC RcrvUSD Gauge (deprecated)",
|
|
134
|
+
"contract": "0xc6e49678e7a7D797Cb11EE5D2834A3896200096D",
|
|
135
|
+
"stakingToken": "0xa610498F28448Eb379BFD3179381F6f094ad110b",
|
|
136
|
+
"wrapped": true,
|
|
137
|
+
"underlying": "0x062a641EF54810B321f123487fFf083cadB50989",
|
|
138
|
+
"wrapper": "0xa610498F28448Eb379BFD3179381F6f094ad110b",
|
|
139
|
+
"_note": "Deprecated — being removed from the controller (replaced by raac_pmusd). Reclaim stuck votes via removePowerFromGauge."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "RAAC_crvUSD_LP",
|
|
143
|
+
"name": "RAAC crvUSD/RAAC LP Gauge (deprecated)",
|
|
144
|
+
"contract": "0x04F3e12A814b21B9F947c726be512719a41b980f",
|
|
145
|
+
"stakingToken": "0xCfDBbad91770fb7Fd57e623A59dcbD14670164c7",
|
|
146
|
+
"_note": "Deprecated — being removed from the controller (replaced by raac_pmusd_lp). Reclaim stuck votes via removePowerFromGauge."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "RAAC_RcrvUSD_old",
|
|
150
|
+
"name": "RAAC RcrvUSD Gauge (raw rebasing, removed)",
|
|
151
|
+
"contract": "0xE8eBe8294542d47f481c17036C8165CB8935554a",
|
|
152
|
+
"stakingToken": "0x062a641EF54810B321f123487fFf083cadB50989",
|
|
153
|
+
"_note": "Already removed from controller. Reclaim stuck votes via removePowerFromGauge."
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"rwagauges": {
|
|
158
|
+
"id": "rwagauges",
|
|
159
|
+
"label": "RWA Gauges",
|
|
160
|
+
"gaugeType": "RWAGauge",
|
|
161
|
+
"controller": "0x0000000000000000000000000000000000000000",
|
|
162
|
+
"distributor": "0x0000000000000000000000000000000000000000",
|
|
163
|
+
"gauges": []
|
|
133
164
|
}
|
|
134
165
|
},
|
|
135
166
|
"proposals": [
|
|
@@ -295,51 +326,5 @@
|
|
|
295
326
|
"name": "Aladdin Zap",
|
|
296
327
|
"contract": "0x3b1325d1D220f2b78d4EFF8786654572193112d1"
|
|
297
328
|
}
|
|
298
|
-
},
|
|
299
|
-
"gauges": {
|
|
300
|
-
"raac_pmusd": {
|
|
301
|
-
"id": "RAAC_pmUSD",
|
|
302
|
-
"name": "RAAC pmUSD Gauge",
|
|
303
|
-
"type": "RAACGauge",
|
|
304
|
-
"contract": "0xc6471c956a6f77Af1D35Ea639a46544eE9340838",
|
|
305
|
-
"stakingToken": "0x0bd4E860e5e7A0C7c9d221Fa336976bF001F81fa",
|
|
306
|
-
"wrapped": true,
|
|
307
|
-
"underlying": "0x6F713079002a0a485E91fB276E4682CB01d18439",
|
|
308
|
-
"wrapper": "0x0bd4E860e5e7A0C7c9d221Fa336976bF001F81fa"
|
|
309
|
-
},
|
|
310
|
-
"raac_pmusd_lp": {
|
|
311
|
-
"id": "RAAC_pmUSD_LP",
|
|
312
|
-
"name": "RAAC pmUSD/RAAC LP Gauge",
|
|
313
|
-
"type": "RAACGauge",
|
|
314
|
-
"contract": "0xac6A07DEbbc683042478987f7BceEdb934161311",
|
|
315
|
-
"stakingToken": "0xAe98A7EF8557491fD34b45036Aada075c9385c6C"
|
|
316
|
-
},
|
|
317
|
-
"raac_rcrvusd": {
|
|
318
|
-
"id": "RAAC_RcrvUSD",
|
|
319
|
-
"name": "RAAC RcrvUSD Gauge (deprecated)",
|
|
320
|
-
"type": "RAACGauge",
|
|
321
|
-
"contract": "0xc6e49678e7a7D797Cb11EE5D2834A3896200096D",
|
|
322
|
-
"stakingToken": "0xa610498F28448Eb379BFD3179381F6f094ad110b",
|
|
323
|
-
"wrapped": true,
|
|
324
|
-
"underlying": "0x062a641EF54810B321f123487fFf083cadB50989",
|
|
325
|
-
"wrapper": "0xa610498F28448Eb379BFD3179381F6f094ad110b",
|
|
326
|
-
"_note": "Deprecated — being removed from the controller (replaced by raac_pmusd). Reclaim stuck votes via removePowerFromGauge."
|
|
327
|
-
},
|
|
328
|
-
"raac_crvusd_lp": {
|
|
329
|
-
"id": "RAAC_crvUSD_LP",
|
|
330
|
-
"name": "RAAC crvUSD/RAAC LP Gauge (deprecated)",
|
|
331
|
-
"type": "RAACGauge",
|
|
332
|
-
"contract": "0x04F3e12A814b21B9F947c726be512719a41b980f",
|
|
333
|
-
"stakingToken": "0xCfDBbad91770fb7Fd57e623A59dcbD14670164c7",
|
|
334
|
-
"_note": "Deprecated — being removed from the controller (replaced by raac_pmusd_lp). Reclaim stuck votes via removePowerFromGauge."
|
|
335
|
-
},
|
|
336
|
-
"raac_rcrvusd_old": {
|
|
337
|
-
"id": "RAAC_RcrvUSD_old",
|
|
338
|
-
"name": "RAAC RcrvUSD Gauge (raw rebasing, removed)",
|
|
339
|
-
"type": "RAACGauge",
|
|
340
|
-
"contract": "0xE8eBe8294542d47f481c17036C8165CB8935554a",
|
|
341
|
-
"stakingToken": "0x062a641EF54810B321f123487fFf083cadB50989",
|
|
342
|
-
"_note": "Already removed from controller. Reclaim stuck votes via removePowerFromGauge."
|
|
343
|
-
}
|
|
344
329
|
}
|
|
345
330
|
}
|
|
@@ -110,31 +110,28 @@
|
|
|
110
110
|
"contract": "0x352b225A9f96ad9d90A1e8db4f1908943729b511"
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"id": "
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"id": "rwagauge",
|
|
136
|
-
"name": "RWA Gauge",
|
|
137
|
-
"contract": "0x0000000000000000000000000000000000000000"
|
|
113
|
+
"gauges": {
|
|
114
|
+
"raacgauges": {
|
|
115
|
+
"id": "raacgauges",
|
|
116
|
+
"label": "RAAC Gauges",
|
|
117
|
+
"gaugeType": "RAACGauge",
|
|
118
|
+
"controller": "0x045857BDEAE7C1c7252d611eB24eB55564198b4C",
|
|
119
|
+
"distributor": "0x7a7f847fb60b0000e24cce07298dc73df8b8e56a",
|
|
120
|
+
"gauges": [
|
|
121
|
+
{
|
|
122
|
+
"id": "raacgauge",
|
|
123
|
+
"name": "RAAC Gauge",
|
|
124
|
+
"contract": "0xB6B18cae509Fcf3542FF6975C2Da06CAAc9773c5"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"rwagauges": {
|
|
129
|
+
"id": "rwagauges",
|
|
130
|
+
"label": "RWA Gauges",
|
|
131
|
+
"gaugeType": "RWAGauge",
|
|
132
|
+
"controller": "0x0000000000000000000000000000000000000000",
|
|
133
|
+
"distributor": "0x0000000000000000000000000000000000000000",
|
|
134
|
+
"gauges": []
|
|
138
135
|
}
|
|
139
136
|
},
|
|
140
137
|
"proposals": [],
|
|
@@ -110,31 +110,28 @@
|
|
|
110
110
|
"contract": "0x352b225A9f96ad9d90A1e8db4f1908943729b511"
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"id": "
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"id": "rwagauge",
|
|
136
|
-
"name": "RWA Gauge",
|
|
137
|
-
"contract": "0x0000000000000000000000000000000000000000"
|
|
113
|
+
"gauges": {
|
|
114
|
+
"raacgauges": {
|
|
115
|
+
"id": "raacgauges",
|
|
116
|
+
"label": "RAAC Gauges",
|
|
117
|
+
"gaugeType": "RAACGauge",
|
|
118
|
+
"controller": "0x045857BDEAE7C1c7252d611eB24eB55564198b4C",
|
|
119
|
+
"distributor": "0x7a7f847fb60b0000e24cce07298dc73df8b8e56a",
|
|
120
|
+
"gauges": [
|
|
121
|
+
{
|
|
122
|
+
"id": "raacgauge",
|
|
123
|
+
"name": "RAAC Gauge",
|
|
124
|
+
"contract": "0xB6B18cae509Fcf3542FF6975C2Da06CAAc9773c5"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"rwagauges": {
|
|
129
|
+
"id": "rwagauges",
|
|
130
|
+
"label": "RWA Gauges",
|
|
131
|
+
"gaugeType": "RWAGauge",
|
|
132
|
+
"controller": "0x0000000000000000000000000000000000000000",
|
|
133
|
+
"distributor": "0x0000000000000000000000000000000000000000",
|
|
134
|
+
"gauges": []
|
|
138
135
|
}
|
|
139
136
|
},
|
|
140
137
|
"proposals": [],
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"chainId": 8453,
|
|
3
3
|
"name": "localhost",
|
|
4
|
-
"rpcs": [
|
|
5
|
-
"http://127.0.0.1:8545"
|
|
6
|
-
],
|
|
4
|
+
"rpcs": ["http://127.0.0.1:8545"],
|
|
7
5
|
"nativeCurrency": {
|
|
8
6
|
"name": "ETH",
|
|
9
7
|
"symbol": "ETH",
|
|
@@ -34,7 +32,7 @@
|
|
|
34
32
|
"raacminter": {
|
|
35
33
|
"id": "raacminter",
|
|
36
34
|
"name": "RAAC Minter",
|
|
37
|
-
"contract": "
|
|
35
|
+
"contract": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
|
|
38
36
|
},
|
|
39
37
|
"feecollector": {
|
|
40
38
|
"id": "feecollector",
|
|
@@ -107,31 +105,63 @@
|
|
|
107
105
|
"contract": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
|
|
108
106
|
}
|
|
109
107
|
},
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"id": "
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
108
|
+
"gauges": {
|
|
109
|
+
"raacgauges": {
|
|
110
|
+
"id": "raacgauges",
|
|
111
|
+
"label": "RAAC Gauges",
|
|
112
|
+
"gaugeType": "RAACGauge",
|
|
113
|
+
"controller": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c",
|
|
114
|
+
"distributor": "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d",
|
|
115
|
+
"gauges": [
|
|
116
|
+
{
|
|
117
|
+
"id": "RAAC_pmUSDcrvUSD_LP",
|
|
118
|
+
"name": "RAAC pmUSD/crvUSD LP Gauge",
|
|
119
|
+
"contract": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44",
|
|
120
|
+
"stakingToken": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "RAAC_RAACpmUSD_LP",
|
|
124
|
+
"name": "RAAC RAAC/pmUSD LP Gauge",
|
|
125
|
+
"contract": "0x4A679253410272dd5232B3Ff7cF5dbB88f295319",
|
|
126
|
+
"stakingToken": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "RAAC_depmUSD",
|
|
130
|
+
"name": "RAAC Stability Pool Gauge",
|
|
131
|
+
"contract": "0x09635F643e140090A9A8Dcd712eD6285858ceBef",
|
|
132
|
+
"stakingToken": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"id": "RAAC_pmUSD",
|
|
136
|
+
"name": "RAAC pmUSD Gauge",
|
|
137
|
+
"contract": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933",
|
|
138
|
+
"stakingToken": "0x9A676e781A523b5d0C0e43731313A708CB607508",
|
|
139
|
+
"wrapped": true,
|
|
140
|
+
"underlying": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
|
|
141
|
+
"wrapper": "0x9A676e781A523b5d0C0e43731313A708CB607508"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "RAAC_RAACWETH_LP",
|
|
145
|
+
"name": "RAAC RAAC/WETH LP Gauge",
|
|
146
|
+
"contract": "0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690",
|
|
147
|
+
"stakingToken": "0x0B306BF915C4d645ff596e518fAf3F9669b97016"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"rwagauges": {
|
|
152
|
+
"id": "rwagauges",
|
|
153
|
+
"label": "RWA Gauges",
|
|
154
|
+
"gaugeType": "RWAGauge",
|
|
155
|
+
"controller": "0x0000000000000000000000000000000000000000",
|
|
156
|
+
"distributor": "0x0000000000000000000000000000000000000000",
|
|
157
|
+
"gauges": [
|
|
158
|
+
{
|
|
159
|
+
"id": "rwagauge",
|
|
160
|
+
"name": "RWA Gauge",
|
|
161
|
+
"contract": "0xAD523115cd35a8d4E60B3C0953E0E0ac10418309",
|
|
162
|
+
"_note": "Deployed against the shared controller before the RAAC/RWA split; not wired to an RWA controller."
|
|
163
|
+
}
|
|
164
|
+
]
|
|
135
165
|
}
|
|
136
166
|
},
|
|
137
167
|
"proposals": [
|
|
@@ -208,13 +238,13 @@
|
|
|
208
238
|
"id": "raactoken",
|
|
209
239
|
"name": "RAAC",
|
|
210
240
|
"decimals": 18,
|
|
211
|
-
"contract": "
|
|
241
|
+
"contract": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
|
|
212
242
|
},
|
|
213
243
|
"veraac": {
|
|
214
244
|
"id": "veraac",
|
|
215
245
|
"name": "VERAAC",
|
|
216
246
|
"decimals": 18,
|
|
217
|
-
"contract": "
|
|
247
|
+
"contract": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
|
|
218
248
|
},
|
|
219
249
|
"debttoken": {
|
|
220
250
|
"id": "debttoken",
|
|
@@ -7,8 +7,8 @@ exports.findContract = void 0;
|
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const chains_1 = __importDefault(require("../configs/chains"));
|
|
9
9
|
const artifacts_1 = require("../utils/artifacts");
|
|
10
|
-
/** Sections scanned in order; the first match wins
|
|
11
|
-
const FLAT_SECTIONS = ["
|
|
10
|
+
/** Sections scanned in order; the first match wins. */
|
|
11
|
+
const FLAT_SECTIONS = ["contracts", "governance", "pools", "lockers", "zap", "nfts", "assets"];
|
|
12
12
|
const abiKey = (key) => (key in artifacts_1.ABIS ? key : null);
|
|
13
13
|
const isDeployed = (address) => !!address && ethers_1.ethers.isAddress(address) && address !== ethers_1.ethers.ZeroAddress;
|
|
14
14
|
/** Builds every configured contract on the chain with its name and ABI key. */
|
|
@@ -22,10 +22,17 @@ function listContracts(chainId) {
|
|
|
22
22
|
if (isDeployed(entry.address))
|
|
23
23
|
found.push({ ...entry, address: ethers_1.ethers.getAddress(entry.address) });
|
|
24
24
|
};
|
|
25
|
+
// gauges: { <system>: { label, gaugeType, controller, distributor, gauges: [{ id, name, contract }] } }
|
|
26
|
+
for (const [key, system] of Object.entries((config.gauges ?? {}))) {
|
|
27
|
+
push({ address: system.controller, id: `${key}.controller`, name: `${system.label} Controller`, section: "gauges", abi: "gaugecontroller" });
|
|
28
|
+
push({ address: system.distributor, id: `${key}.distributor`, name: `${system.label} Distributor`, section: "gauges", abi: "gaugerewardsdistributor" });
|
|
29
|
+
for (const gauge of system.gauges ?? []) {
|
|
30
|
+
push({ address: gauge.contract, id: gauge.id, name: gauge.name, section: "gauges", abi: abiKey(system.gaugeType.toLowerCase()) });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
25
33
|
for (const section of FLAT_SECTIONS) {
|
|
26
34
|
for (const [key, value] of Object.entries((config[section] ?? {}))) {
|
|
27
|
-
|
|
28
|
-
push({ address: value.contract, id: value.id ?? key, name: value.name ?? key, section, abi });
|
|
35
|
+
push({ address: value.contract, id: value.id ?? key, name: value.name ?? key, section, abi: abiKey(key.toLowerCase()) });
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
38
|
// adapters: { <pool or vault>: { <adapter>: { contract, type: "ERC20" | "ERC721" } } }
|
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.claimAll = void 0;
|
|
4
4
|
const ethers_1 = require("ethers");
|
|
5
|
-
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
5
|
const artifacts_1 = require("../../../utils/artifacts");
|
|
6
|
+
const _helpers_1 = require("../gaugeSystems/_helpers");
|
|
7
|
+
const _helpers_2 = require("../_helpers");
|
|
7
8
|
/**
|
|
8
|
-
* Claims
|
|
9
|
+
* Claims rewards for the caller on several gauges. Each gauge must be active.
|
|
9
10
|
*
|
|
10
11
|
* @param chainId - The chain/network to use.
|
|
11
|
-
* @param
|
|
12
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
|
|
13
|
+
* @param gaugeAddressesOrIds - Addresses or config ids of the gauges.
|
|
12
14
|
* @param signer - An ethers.js Signer instance (required).
|
|
13
|
-
* @returns
|
|
15
|
+
* @returns The transaction after it has been mined.
|
|
14
16
|
*/
|
|
15
|
-
const claimAll = async (chainId,
|
|
17
|
+
const claimAll = async (chainId, gaugeSystem, gaugeAddressesOrIds, signer) => {
|
|
16
18
|
if (!signer)
|
|
17
19
|
throw new Error("Signer is required");
|
|
18
|
-
const address = (0,
|
|
19
|
-
const
|
|
20
|
-
const contract = new ethers_1.ethers.Contract(address,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const address = (0, _helpers_1.resolveGaugeDistributor)(chainId, gaugeSystem);
|
|
21
|
+
const gaugeAddresses = gaugeAddressesOrIds.map((g) => (0, _helpers_1.resolveGauge)(chainId, g));
|
|
22
|
+
const contract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("gaugerewardsdistributor"), signer);
|
|
23
|
+
try {
|
|
24
|
+
const tx = await contract.claimAll(gaugeAddresses);
|
|
25
|
+
await tx.wait();
|
|
26
|
+
return tx;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw (0, _helpers_2.toGovernanceTxError)("Failed to claim all", error);
|
|
30
|
+
}
|
|
24
31
|
};
|
|
25
32
|
exports.claimAll = claimAll;
|
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.claimForGauge = void 0;
|
|
4
4
|
const ethers_1 = require("ethers");
|
|
5
|
-
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
5
|
const artifacts_1 = require("../../../utils/artifacts");
|
|
6
|
+
const _helpers_1 = require("../gaugeSystems/_helpers");
|
|
7
|
+
const _helpers_2 = require("../_helpers");
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Note: only callable by the gauge contract itself (msg.sender must == gauge).
|
|
9
|
+
* Transfers a gauge's accrued share from the distributor to the gauge.
|
|
10
10
|
*
|
|
11
11
|
* @param chainId - The chain/network to use.
|
|
12
|
-
* @param
|
|
12
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
|
|
13
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
13
14
|
* @param signer - An ethers.js Signer instance (required).
|
|
14
|
-
* @returns
|
|
15
|
+
* @returns The transaction after it has been mined.
|
|
15
16
|
*/
|
|
16
|
-
const claimForGauge = async (chainId,
|
|
17
|
+
const claimForGauge = async (chainId, gaugeSystem, gaugeAddressOrId, signer) => {
|
|
17
18
|
if (!signer)
|
|
18
19
|
throw new Error("Signer is required");
|
|
19
|
-
const address = (0,
|
|
20
|
-
const
|
|
21
|
-
const contract = new ethers_1.ethers.Contract(address,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const address = (0, _helpers_1.resolveGaugeDistributor)(chainId, gaugeSystem);
|
|
21
|
+
const gaugeAddress = (0, _helpers_1.resolveGauge)(chainId, gaugeAddressOrId);
|
|
22
|
+
const contract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("gaugerewardsdistributor"), signer);
|
|
23
|
+
try {
|
|
24
|
+
const tx = await contract.claimForGauge(gaugeAddress);
|
|
25
|
+
await tx.wait();
|
|
26
|
+
return tx;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw (0, _helpers_2.toGovernanceTxError)("Failed to claim for gauge", error);
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
exports.claimForGauge = claimForGauge;
|
|
@@ -2,26 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deposit = void 0;
|
|
4
4
|
const ethers_1 = require("ethers");
|
|
5
|
-
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
5
|
const artifacts_1 = require("../../../utils/artifacts");
|
|
6
|
+
const _helpers_1 = require("../gaugeSystems/_helpers");
|
|
7
|
+
const _helpers_2 = require("../_helpers");
|
|
7
8
|
/**
|
|
8
|
-
* Deposits reward tokens into the distributor.
|
|
9
|
-
* The reward token must be pre-approved by the caller before calling.
|
|
9
|
+
* Deposits reward tokens into the distributor for the current epoch. The token must be the distributor's reward token and pre-approved. Reverts when no gauge is registered.
|
|
10
10
|
*
|
|
11
11
|
* @param chainId - The chain/network to use.
|
|
12
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
|
|
12
13
|
* @param token - Address of the reward token.
|
|
13
|
-
* @param amount - Amount
|
|
14
|
+
* @param amount - Amount to deposit, base units.
|
|
14
15
|
* @param signer - An ethers.js Signer instance (required).
|
|
15
|
-
* @returns
|
|
16
|
+
* @returns The transaction after it has been mined.
|
|
16
17
|
*/
|
|
17
|
-
const deposit = async (chainId, token, amount, signer) => {
|
|
18
|
+
const deposit = async (chainId, gaugeSystem, token, amount, signer) => {
|
|
18
19
|
if (!signer)
|
|
19
20
|
throw new Error("Signer is required");
|
|
20
|
-
const address = (0,
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const address = (0, _helpers_1.resolveGaugeDistributor)(chainId, gaugeSystem);
|
|
22
|
+
const contract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("gaugerewardsdistributor"), signer);
|
|
23
|
+
try {
|
|
24
|
+
const tx = await contract.deposit(token, amount);
|
|
25
|
+
await tx.wait();
|
|
26
|
+
return tx;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw (0, _helpers_2.toGovernanceTxError)("Failed to deposit rewards", error);
|
|
30
|
+
}
|
|
26
31
|
};
|
|
27
32
|
exports.deposit = deposit;
|
|
@@ -6,24 +6,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getClaimableForGauge = void 0;
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
-
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
9
|
const artifacts_1 = require("../../../utils/artifacts");
|
|
10
|
+
const _helpers_1 = require("../gaugeSystems/_helpers");
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Estimates the rewards a gauge can still pull from the distributor.
|
|
13
13
|
*
|
|
14
14
|
* @param chainId - The chain/network to use.
|
|
15
|
-
* @param
|
|
15
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
|
|
16
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
16
17
|
* @param provider - Optional ethers.js Provider instance.
|
|
17
|
-
* @returns
|
|
18
|
+
* @returns The claimable amount, base units.
|
|
18
19
|
*/
|
|
19
|
-
const getClaimableForGauge = async (chainId,
|
|
20
|
+
const getClaimableForGauge = async (chainId, gaugeSystem, gaugeAddressOrId, provider) => {
|
|
20
21
|
if (!provider) {
|
|
21
22
|
const rpc = chains_1.default[chainId].rpcs[0];
|
|
22
23
|
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
23
24
|
}
|
|
24
|
-
const address = (0,
|
|
25
|
-
const
|
|
26
|
-
const contract = new ethers_1.ethers.Contract(address,
|
|
27
|
-
return contract.getClaimableForGauge(
|
|
25
|
+
const address = (0, _helpers_1.resolveGaugeDistributor)(chainId, gaugeSystem);
|
|
26
|
+
const gaugeAddress = (0, _helpers_1.resolveGauge)(chainId, gaugeAddressOrId);
|
|
27
|
+
const contract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("gaugerewardsdistributor"), provider);
|
|
28
|
+
return contract.getClaimableForGauge(gaugeAddress);
|
|
28
29
|
};
|
|
29
30
|
exports.getClaimableForGauge = getClaimableForGauge;
|
|
@@ -6,25 +6,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getClaimedAtEpoch = void 0;
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const chains_1 = __importDefault(require("../../../configs/chains"));
|
|
9
|
-
const getContractAddress_1 = require("../../getContractAddress");
|
|
10
9
|
const artifacts_1 = require("../../../utils/artifacts");
|
|
10
|
+
const _helpers_1 = require("../gaugeSystems/_helpers");
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Returns how much a gauge has already pulled for an epoch.
|
|
13
13
|
*
|
|
14
14
|
* @param chainId - The chain/network to use.
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
15
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
|
|
16
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
17
|
+
* @param epoch - Epoch start timestamp, seconds.
|
|
17
18
|
* @param provider - Optional ethers.js Provider instance.
|
|
18
|
-
* @returns
|
|
19
|
+
* @returns The claimed amount, base units.
|
|
19
20
|
*/
|
|
20
|
-
const getClaimedAtEpoch = async (chainId,
|
|
21
|
+
const getClaimedAtEpoch = async (chainId, gaugeSystem, gaugeAddressOrId, epoch, provider) => {
|
|
21
22
|
if (!provider) {
|
|
22
23
|
const rpc = chains_1.default[chainId].rpcs[0];
|
|
23
24
|
provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
24
25
|
}
|
|
25
|
-
const address = (0,
|
|
26
|
-
const
|
|
27
|
-
const contract = new ethers_1.ethers.Contract(address,
|
|
28
|
-
return contract.claimedAtEpoch(
|
|
26
|
+
const address = (0, _helpers_1.resolveGaugeDistributor)(chainId, gaugeSystem);
|
|
27
|
+
const gaugeAddress = (0, _helpers_1.resolveGauge)(chainId, gaugeAddressOrId);
|
|
28
|
+
const contract = new ethers_1.ethers.Contract(address, (0, artifacts_1.getABI)("gaugerewardsdistributor"), provider);
|
|
29
|
+
return contract.claimedAtEpoch(gaugeAddress, epoch);
|
|
29
30
|
};
|
|
30
31
|
exports.getClaimedAtEpoch = getClaimedAtEpoch;
|