@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.
Files changed (194) hide show
  1. package/dist/RPCLibrary.js +38 -97
  2. package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +2 -2
  3. package/dist/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +155 -144
  4. package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +119 -335
  5. package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +104 -325
  6. package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +167 -146
  7. package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +167 -146
  8. package/dist/artifacts/core/governance/proposals/Governance.sol/Governance.json +2 -2
  9. package/dist/artifacts/core/lockers/RAACLiquidLocker.sol/RAACLiquidLocker.json +2 -2
  10. package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +66 -32
  11. package/dist/configs/chains/11155111.json +72 -16
  12. package/dist/configs/chains/8453.json +6 -6
  13. package/dist/contracts/getContractAddress.js +1 -0
  14. package/dist/contracts/governance/distributor/claimAll.js +25 -0
  15. package/dist/contracts/governance/distributor/claimForGauge.js +26 -0
  16. package/dist/contracts/governance/distributor/deposit.js +12 -21
  17. package/dist/contracts/governance/distributor/getClaimableForGauge.js +29 -0
  18. package/dist/contracts/governance/distributor/getClaimedAtEpoch.js +30 -0
  19. package/dist/contracts/governance/distributor/getDepositedAtEpoch.js +30 -0
  20. package/dist/contracts/governance/distributor/getGaugeController.js +28 -0
  21. package/dist/contracts/governance/distributor/getLastClaimedEpoch.js +29 -0
  22. package/dist/contracts/governance/distributor/getPeriodDuration.js +28 -0
  23. package/dist/contracts/governance/distributor/{getRewardTokens.js → getRewardToken.js} +10 -9
  24. package/dist/contracts/governance/distributor/getRewardTokenInfo.js +9 -19
  25. package/dist/contracts/governance/distributor/getRewardTokenStats.js +30 -0
  26. package/dist/contracts/governance/{gaugeController/isGauge.js → distributor/getStartEpoch.js} +10 -10
  27. package/dist/contracts/governance/distributor/index.js +31 -17
  28. package/dist/contracts/governance/distributor/setController.js +26 -0
  29. package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +27 -0
  30. package/dist/contracts/governance/distributor/withdrawUnallocatedRewards.js +26 -0
  31. package/dist/contracts/governance/gauge/addRewardToken.js +34 -0
  32. package/dist/contracts/governance/gauge/claimExtraReward.js +34 -0
  33. package/dist/contracts/governance/gauge/claimExtraRewards.js +33 -0
  34. package/dist/contracts/governance/gauge/claimOnBehalfOf.js +36 -0
  35. package/dist/contracts/governance/gauge/claimRewardToken.js +3 -4
  36. package/dist/contracts/governance/gauge/claimRewardsFor.js +34 -0
  37. package/dist/contracts/governance/gauge/depositRewardToken.js +35 -0
  38. package/dist/contracts/governance/gauge/getAllPendingExtraRewards.js +36 -0
  39. package/dist/contracts/governance/gauge/getControllerAddress.js +34 -0
  40. package/dist/contracts/governance/gauge/getDecimalAdjustment.js +35 -0
  41. package/dist/contracts/governance/gauge/getDepositRAACOnClaim.js +34 -0
  42. package/dist/contracts/governance/gauge/getDistributorData.js +36 -0
  43. package/dist/contracts/governance/gauge/getDistributors.js +34 -0
  44. package/dist/contracts/governance/gauge/getEarnedReward.js +11 -19
  45. package/dist/contracts/governance/gauge/getExtraRewardTokens.js +34 -0
  46. package/dist/contracts/governance/gauge/getGaugeRewardTokenData.js +44 -0
  47. package/dist/contracts/governance/gauge/getPendingExtraRewards.js +36 -0
  48. package/dist/contracts/governance/gauge/getPendingRewards.js +11 -19
  49. package/dist/contracts/governance/gauge/getRaacAutolockMin.js +34 -0
  50. package/dist/contracts/governance/gauge/getUserRewardTokenData.js +37 -0
  51. package/dist/contracts/governance/gauge/getUserWeight.js +35 -0
  52. package/dist/contracts/governance/gauge/index.js +53 -35
  53. package/dist/contracts/governance/gauge/isPaused.js +34 -0
  54. package/dist/contracts/governance/gauge/manageDistributor.js +35 -0
  55. package/dist/contracts/governance/gauge/setController.js +34 -0
  56. package/dist/contracts/governance/gauge/setDepositRAACOnClaim.js +34 -0
  57. package/dist/contracts/governance/gauge/setDistributorApproval.js +35 -0
  58. package/dist/contracts/governance/gauge/setEmergencyPaused.js +34 -0
  59. package/dist/contracts/governance/gauge/setGaugeRewardDistributor.js +34 -0
  60. package/dist/contracts/governance/gauge/setRaacAutolockMin.js +34 -0
  61. package/dist/contracts/governance/gauge/updateUserRewards.js +3 -2
  62. package/dist/contracts/governance/gaugeController/addGauge.js +24 -0
  63. package/dist/contracts/governance/gaugeController/batchVote.js +25 -0
  64. package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +24 -0
  65. package/dist/contracts/governance/gaugeController/getConstants.js +45 -0
  66. package/dist/contracts/governance/gaugeController/getCurrentEpoch.js +27 -0
  67. package/dist/contracts/governance/gaugeController/getGauge.js +29 -0
  68. package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +29 -0
  69. package/dist/contracts/governance/gaugeController/getGaugeRelativeWeightView.js +30 -0
  70. package/dist/contracts/governance/gaugeController/getLastVoteTime.js +29 -0
  71. package/dist/contracts/governance/gaugeController/getNextEpoch.js +27 -0
  72. package/dist/contracts/governance/gaugeController/getUserGaugeVotePower.js +29 -0
  73. package/dist/contracts/governance/gaugeController/getVeToken.js +27 -0
  74. package/dist/contracts/governance/gaugeController/getVoteUserPower.js +28 -0
  75. package/dist/contracts/governance/gaugeController/getVoteUserSlope.js +30 -0
  76. package/dist/contracts/governance/gaugeController/index.js +43 -23
  77. package/dist/contracts/governance/gaugeController/isPaused.js +27 -0
  78. package/dist/contracts/governance/gaugeController/kick.js +24 -0
  79. package/dist/contracts/governance/gaugeController/removeGauge.js +24 -0
  80. package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +24 -0
  81. package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +25 -0
  82. package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +25 -0
  83. package/dist/contracts/governance/gaugeController/setEmergencyPause.js +24 -0
  84. package/dist/contracts/lockers/botLocker/unlock.js +4 -1
  85. package/dist/contracts/lockers/maturityVault/harvest.js +3 -2
  86. package/dist/types/RPCLibrary.d.ts +6 -64
  87. package/dist/types/contracts/governance/distributor/claimAll.d.ts +11 -0
  88. package/dist/types/contracts/governance/distributor/claimForGauge.d.ts +12 -0
  89. package/dist/types/contracts/governance/distributor/deposit.d.ts +6 -7
  90. package/dist/types/contracts/governance/distributor/getClaimableForGauge.d.ts +11 -0
  91. package/dist/types/contracts/governance/distributor/getClaimedAtEpoch.d.ts +12 -0
  92. package/dist/types/contracts/governance/distributor/getDepositedAtEpoch.d.ts +12 -0
  93. package/dist/types/contracts/governance/distributor/getGaugeController.d.ts +10 -0
  94. package/dist/types/contracts/governance/distributor/getLastClaimedEpoch.d.ts +11 -0
  95. package/dist/types/contracts/governance/distributor/getPeriodDuration.d.ts +10 -0
  96. package/dist/types/contracts/governance/distributor/{getRewardTokens.d.ts → getRewardToken.d.ts} +3 -3
  97. package/dist/types/contracts/governance/distributor/getRewardTokenInfo.d.ts +8 -10
  98. package/dist/types/contracts/governance/distributor/getRewardTokenStats.d.ts +15 -0
  99. package/dist/types/contracts/governance/distributor/getStartEpoch.d.ts +10 -0
  100. package/dist/types/contracts/governance/distributor/index.d.ts +16 -8
  101. package/dist/types/contracts/governance/distributor/setController.d.ts +12 -0
  102. package/dist/types/contracts/governance/distributor/withdrawRemovedGaugeRewards.d.ts +13 -0
  103. package/dist/types/contracts/governance/distributor/withdrawUnallocatedRewards.d.ts +12 -0
  104. package/dist/types/contracts/governance/gauge/addRewardToken.d.ts +10 -0
  105. package/dist/types/contracts/governance/gauge/claimExtraReward.d.ts +10 -0
  106. package/dist/types/contracts/governance/gauge/claimExtraRewards.d.ts +9 -0
  107. package/dist/types/contracts/governance/gauge/claimOnBehalfOf.d.ts +12 -0
  108. package/dist/types/contracts/governance/gauge/claimRewardToken.d.ts +1 -2
  109. package/dist/types/contracts/governance/gauge/claimRewardsFor.d.ts +10 -0
  110. package/dist/types/contracts/governance/gauge/depositRewardToken.d.ts +11 -0
  111. package/dist/types/contracts/governance/gauge/getAllPendingExtraRewards.d.ts +13 -0
  112. package/dist/types/contracts/governance/gauge/getControllerAddress.d.ts +9 -0
  113. package/dist/types/contracts/governance/gauge/getDecimalAdjustment.d.ts +10 -0
  114. package/dist/types/contracts/governance/gauge/getDepositRAACOnClaim.d.ts +9 -0
  115. package/dist/types/contracts/governance/gauge/getDistributorData.d.ts +13 -0
  116. package/dist/types/contracts/governance/gauge/{getRewardTokens.d.ts → getDistributors.d.ts} +3 -5
  117. package/dist/types/contracts/governance/gauge/getEarnedReward.d.ts +4 -5
  118. package/dist/types/contracts/governance/gauge/getExtraRewardTokens.d.ts +9 -0
  119. package/dist/types/contracts/governance/gauge/getGaugeRewardTokenData.d.ts +18 -0
  120. package/dist/types/contracts/governance/gauge/getPendingExtraRewards.d.ts +11 -0
  121. package/dist/types/contracts/governance/gauge/getPendingRewards.d.ts +4 -5
  122. package/dist/types/contracts/governance/gauge/getRaacAutolockMin.d.ts +9 -0
  123. package/dist/types/contracts/governance/gauge/getUserRewardTokenData.d.ts +17 -0
  124. package/dist/types/contracts/governance/gauge/getUserWeight.d.ts +10 -0
  125. package/dist/types/contracts/governance/gauge/index.d.ts +38 -17
  126. package/dist/types/contracts/governance/gauge/isPaused.d.ts +9 -0
  127. package/dist/types/contracts/governance/gauge/manageDistributor.d.ts +11 -0
  128. package/dist/types/contracts/governance/gauge/setController.d.ts +10 -0
  129. package/dist/types/contracts/governance/gauge/setDepositRAACOnClaim.d.ts +10 -0
  130. package/dist/types/contracts/governance/gauge/setDistributorApproval.d.ts +11 -0
  131. package/dist/types/contracts/governance/gauge/setEmergencyPaused.d.ts +10 -0
  132. package/dist/types/contracts/governance/gauge/setGaugeRewardDistributor.d.ts +10 -0
  133. package/dist/types/contracts/governance/gauge/setRaacAutolockMin.d.ts +10 -0
  134. package/dist/types/contracts/governance/gauge/updateUserRewards.d.ts +2 -1
  135. package/dist/types/contracts/governance/gaugeController/addGauge.d.ts +10 -0
  136. package/dist/types/contracts/governance/gaugeController/batchVote.d.ts +11 -0
  137. package/dist/types/contracts/governance/gaugeController/forceCompleteCheckpoint.d.ts +10 -0
  138. package/dist/types/contracts/governance/gaugeController/getConstants.d.ts +18 -0
  139. package/dist/types/contracts/governance/gaugeController/getCurrentEpoch.d.ts +9 -0
  140. package/dist/types/contracts/governance/gaugeController/getGauge.d.ts +15 -0
  141. package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeight.d.ts +15 -0
  142. package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeightView.d.ts +14 -0
  143. package/dist/types/contracts/governance/gaugeController/getLastVoteTime.d.ts +11 -0
  144. package/dist/types/contracts/governance/gaugeController/getNextEpoch.d.ts +9 -0
  145. package/dist/types/contracts/governance/gaugeController/getUserGaugeVotePower.d.ts +11 -0
  146. package/dist/types/contracts/governance/gaugeController/getVeToken.d.ts +9 -0
  147. package/dist/types/contracts/governance/gaugeController/getVoteUserPower.d.ts +10 -0
  148. package/dist/types/contracts/governance/gaugeController/getVoteUserSlope.d.ts +15 -0
  149. package/dist/types/contracts/governance/gaugeController/index.d.ts +28 -11
  150. package/dist/types/contracts/governance/gaugeController/isPaused.d.ts +9 -0
  151. package/dist/types/contracts/governance/gaugeController/kick.d.ts +10 -0
  152. package/dist/types/contracts/governance/gaugeController/removeGauge.d.ts +10 -0
  153. package/dist/types/contracts/governance/gaugeController/removePowerFromGauge.d.ts +10 -0
  154. package/dist/types/contracts/governance/gaugeController/setBoostAmplificationEnabled.d.ts +11 -0
  155. package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePause.d.ts +11 -0
  156. package/dist/types/contracts/governance/gaugeController/setEmergencyPause.d.ts +10 -0
  157. package/dist/types/contracts/lockers/botLocker/unlock.d.ts +3 -0
  158. package/dist/types/contracts/lockers/maturityVault/harvest.d.ts +1 -1
  159. package/dist/utils/contracts.js +1 -1
  160. package/package.json +1 -1
  161. package/dist/contracts/governance/distributor/getAvailableBalance.js +0 -29
  162. package/dist/contracts/governance/distributor/getGaugeRewardTokens.js +0 -28
  163. package/dist/contracts/governance/distributor/getTransferableBalance.js +0 -30
  164. package/dist/contracts/governance/distributor/isRewardTokenApproved.js +0 -29
  165. package/dist/contracts/governance/distributor/isTokenApproved.js +0 -29
  166. package/dist/contracts/governance/gauge/claimReward.js +0 -44
  167. package/dist/contracts/governance/gauge/getAllEarnedRewards.js +0 -51
  168. package/dist/contracts/governance/gauge/getAllPendingRewards.js +0 -41
  169. package/dist/contracts/governance/gauge/getRewardTokens.js +0 -41
  170. package/dist/contracts/governance/gauge/getUserGaugeVoteWeight.js +0 -42
  171. package/dist/contracts/governance/gauge/getWorkingBalance.js +0 -43
  172. package/dist/contracts/governance/gauge/syncRewardTokens.js +0 -51
  173. package/dist/contracts/governance/gaugeController/checkpoint.js +0 -33
  174. package/dist/contracts/governance/gaugeController/checkpointGauge.js +0 -34
  175. package/dist/contracts/governance/gaugeController/getUserGaugeVoteWeight.js +0 -30
  176. package/dist/tests/liquidLocker.test.js +0 -262
  177. package/dist/tests/test.js +0 -32
  178. package/dist/types/contracts/governance/distributor/getAvailableBalance.d.ts +0 -11
  179. package/dist/types/contracts/governance/distributor/getGaugeRewardTokens.d.ts +0 -11
  180. package/dist/types/contracts/governance/distributor/getTransferableBalance.d.ts +0 -12
  181. package/dist/types/contracts/governance/distributor/isRewardTokenApproved.d.ts +0 -12
  182. package/dist/types/contracts/governance/distributor/isTokenApproved.d.ts +0 -11
  183. package/dist/types/contracts/governance/gauge/claimReward.d.ts +0 -11
  184. package/dist/types/contracts/governance/gauge/getAllEarnedRewards.d.ts +0 -17
  185. package/dist/types/contracts/governance/gauge/getAllPendingRewards.d.ts +0 -19
  186. package/dist/types/contracts/governance/gauge/getUserGaugeVoteWeight.d.ts +0 -14
  187. package/dist/types/contracts/governance/gauge/getWorkingBalance.d.ts +0 -12
  188. package/dist/types/contracts/governance/gauge/syncRewardTokens.d.ts +0 -13
  189. package/dist/types/contracts/governance/gaugeController/checkpoint.d.ts +0 -11
  190. package/dist/types/contracts/governance/gaugeController/checkpointGauge.d.ts +0 -12
  191. package/dist/types/contracts/governance/gaugeController/getUserGaugeVoteWeight.d.ts +0 -12
  192. package/dist/types/contracts/governance/gaugeController/isGauge.d.ts +0 -11
  193. package/dist/types/tests/liquidLocker.test.d.ts +0 -18
  194. package/dist/types/tests/test.d.ts +0 -1
@@ -0,0 +1,34 @@
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.setGaugeRewardDistributor = void 0;
7
+ const ethers_1 = require("ethers");
8
+ const artifacts_1 = require("../../../utils/artifacts");
9
+ const getContractAddress_1 = __importDefault(require("../../getContractAddress"));
10
+ /**
11
+ * Sets the gauge reward distributor address (requires DEFAULT_ADMIN_ROLE).
12
+ * @param chainId - The chain/network to use.
13
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
14
+ * @param rewardDistributor - Address of the new reward distributor.
15
+ * @param signer - An ethers.js Signer instance (required).
16
+ */
17
+ const setGaugeRewardDistributor = async (chainId, gaugeAddressOrId, rewardDistributor, signer) => {
18
+ if (!signer)
19
+ throw new Error("Signer is required");
20
+ let gaugeAddress;
21
+ if ((0, ethers_1.isAddress)(gaugeAddressOrId)) {
22
+ gaugeAddress = gaugeAddressOrId;
23
+ }
24
+ else {
25
+ // @ts-ignore
26
+ gaugeAddress = (0, getContractAddress_1.default)(chainId, gaugeAddressOrId.toLowerCase());
27
+ }
28
+ const abi = (0, artifacts_1.getABI)("basegauge");
29
+ const contract = new ethers_1.ethers.Contract(gaugeAddress, abi, signer);
30
+ const tx = await contract.setGaugeRewardDistributor(rewardDistributor);
31
+ await tx.wait();
32
+ return tx;
33
+ };
34
+ exports.setGaugeRewardDistributor = setGaugeRewardDistributor;
@@ -0,0 +1,34 @@
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.setRaacAutolockMin = void 0;
7
+ const ethers_1 = require("ethers");
8
+ const artifacts_1 = require("../../../utils/artifacts");
9
+ const getContractAddress_1 = __importDefault(require("../../getContractAddress"));
10
+ /**
11
+ * Sets the minimum RAAC amount required to trigger an autolock on claim (requires DEFAULT_ADMIN_ROLE).
12
+ * @param chainId - The chain/network to use.
13
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
14
+ * @param amount - The new minimum autolock amount.
15
+ * @param signer - An ethers.js Signer instance (required).
16
+ */
17
+ const setRaacAutolockMin = async (chainId, gaugeAddressOrId, amount, signer) => {
18
+ if (!signer)
19
+ throw new Error("Signer is required");
20
+ let gaugeAddress;
21
+ if ((0, ethers_1.isAddress)(gaugeAddressOrId)) {
22
+ gaugeAddress = gaugeAddressOrId;
23
+ }
24
+ else {
25
+ // @ts-ignore
26
+ gaugeAddress = (0, getContractAddress_1.default)(chainId, gaugeAddressOrId.toLowerCase());
27
+ }
28
+ const abi = (0, artifacts_1.getABI)("basegauge");
29
+ const contract = new ethers_1.ethers.Contract(gaugeAddress, abi, signer);
30
+ const tx = await contract.setRaacAutolockMin(amount);
31
+ await tx.wait();
32
+ return tx;
33
+ };
34
+ exports.setRaacAutolockMin = setRaacAutolockMin;
@@ -13,10 +13,11 @@ const getContractAddress_1 = __importDefault(require("../../getContractAddress")
13
13
  *
14
14
  * @param chainId - The chain/network to use.
15
15
  * @param gaugeAddressOrId - Address of the gauge contract or ID of the gauge.
16
+ * @param user - Address of the user whose reward state should be settled/kicked.
16
17
  * @param signer - An ethers.js Signer instance (must be connected to wallet).
17
18
  * @returns Transaction receipt after the update is complete.
18
19
  */
19
- const updateUserRewards = async (chainId, gaugeAddressOrId, signer) => {
20
+ const updateUserRewards = async (chainId, gaugeAddressOrId, user, signer) => {
20
21
  if (!signer) {
21
22
  throw new Error("Signer is required");
22
23
  }
@@ -37,7 +38,7 @@ const updateUserRewards = async (chainId, gaugeAddressOrId, signer) => {
37
38
  try {
38
39
  const gaugeABI = (0, artifacts_1.getABI)("basegauge");
39
40
  const contract = new ethers_1.ethers.Contract(gaugeAddress, gaugeABI, signer);
40
- const tx = await contract.updateUserRewards();
41
+ const tx = await contract.updateUserRewards(user);
41
42
  await tx.wait();
42
43
  console.log(`Updated user rewards for gauge: ${gaugeAddress}`);
43
44
  return tx;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addGauge = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const getContractAddress_1 = require("../../getContractAddress");
6
+ const artifacts_1 = require("../../../utils/artifacts");
7
+ /**
8
+ * Adds a new gauge to the GaugeController. Requires the GAUGE_ADMIN role.
9
+ * @param chainId - The chain/network to use.
10
+ * @param gauge - Address of the gauge to add.
11
+ * @param signer - An ethers.js Signer instance (required).
12
+ * @returns The transaction response.
13
+ */
14
+ const addGauge = async (chainId, gauge, signer) => {
15
+ if (!signer)
16
+ throw new Error("Signer is required");
17
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
18
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
19
+ const contract = new ethers_1.ethers.Contract(address, abi, signer);
20
+ const tx = await contract.addGauge(gauge);
21
+ await tx.wait();
22
+ return tx;
23
+ };
24
+ exports.addGauge = addGauge;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.batchVote = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const getContractAddress_1 = require("../../getContractAddress");
6
+ const artifacts_1 = require("../../../utils/artifacts");
7
+ /**
8
+ * Casts votes on multiple gauges in a single transaction.
9
+ * @param chainId - The chain/network to use.
10
+ * @param gaugeAddresses - Array of gauge addresses to vote on.
11
+ * @param voteWeights - Array of vote weights (basis points) aligned with gaugeAddresses.
12
+ * @param signer - An ethers.js Signer instance (required).
13
+ * @returns The transaction response.
14
+ */
15
+ const batchVote = async (chainId, gaugeAddresses, voteWeights, signer) => {
16
+ if (!signer)
17
+ throw new Error("Signer is required");
18
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
19
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
20
+ const contract = new ethers_1.ethers.Contract(address, abi, signer);
21
+ const tx = await contract.batchVote(gaugeAddresses, voteWeights);
22
+ await tx.wait();
23
+ return tx;
24
+ };
25
+ exports.batchVote = batchVote;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.forceCompleteCheckpoint = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const getContractAddress_1 = require("../../getContractAddress");
6
+ const artifacts_1 = require("../../../utils/artifacts");
7
+ /**
8
+ * Forces completion of a pending checkpoint for a gauge.
9
+ * @param chainId - The chain/network to use.
10
+ * @param gauge - Address of the gauge to checkpoint.
11
+ * @param signer - An ethers.js Signer instance (required).
12
+ * @returns The transaction response.
13
+ */
14
+ const forceCompleteCheckpoint = async (chainId, gauge, signer) => {
15
+ if (!signer)
16
+ throw new Error("Signer is required");
17
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
18
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
19
+ const contract = new ethers_1.ethers.Contract(address, abi, signer);
20
+ const tx = await contract.forceCompleteCheckpoint(gauge);
21
+ await tx.wait();
22
+ return tx;
23
+ };
24
+ exports.forceCompleteCheckpoint = forceCompleteCheckpoint;
@@ -0,0 +1,45 @@
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.getConstants = 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 immutable/constant configuration values from the GaugeController.
13
+ * @param chainId - The chain/network to use.
14
+ * @param provider - Optional ethers.js Provider instance.
15
+ * @returns An object with maxBoost, minBoost, weightPrecision, week, weightVoteDelay,
16
+ * minVoteWeight and maxVoteWeight, all bigint.
17
+ */
18
+ const getConstants = 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, "gaugecontroller");
24
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
25
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
26
+ const [maxBoost, minBoost, weightPrecision, week, weightVoteDelay, minVoteWeight, maxVoteWeight,] = await Promise.all([
27
+ contract.MAX_BOOST(),
28
+ contract.MIN_BOOST(),
29
+ contract.WEIGHT_PRECISION(),
30
+ contract.WEEK(),
31
+ contract.WEIGHT_VOTE_DELAY(),
32
+ contract.MIN_VOTE_WEIGHT(),
33
+ contract.MAX_VOTE_WEIGHT(),
34
+ ]);
35
+ return {
36
+ maxBoost,
37
+ minBoost,
38
+ weightPrecision,
39
+ week,
40
+ weightVoteDelay,
41
+ minVoteWeight,
42
+ maxVoteWeight,
43
+ };
44
+ };
45
+ exports.getConstants = getConstants;
@@ -0,0 +1,27 @@
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.getCurrentEpoch = 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 current epoch boundary (rounded down to the week) from the GaugeController.
13
+ * @param chainId - The chain/network to use.
14
+ * @param provider - Optional ethers.js Provider instance.
15
+ * @returns Current epoch timestamp as a bigint.
16
+ */
17
+ const getCurrentEpoch = async (chainId, provider) => {
18
+ if (!provider) {
19
+ const rpc = chains_1.default[chainId].rpcs[0];
20
+ provider = new ethers_1.ethers.JsonRpcProvider(rpc);
21
+ }
22
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
23
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
24
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
25
+ return contract.getCurrentEpoch();
26
+ };
27
+ exports.getCurrentEpoch = getCurrentEpoch;
@@ -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.getGauge = 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 gauge config struct from the public `gauges` mapping on the GaugeController.
13
+ * @param chainId - The chain/network to use.
14
+ * @param gauge - Address of the gauge.
15
+ * @param provider - Optional ethers.js Provider instance.
16
+ * @returns An object with isActive, isBoostAmplificationEnabled (booleans), weight and lastUpdateTime (bigint).
17
+ */
18
+ const getGauge = async (chainId, gauge, 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, "gaugecontroller");
24
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
25
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
26
+ const [isActive, isBoostAmplificationEnabled, weight, lastUpdateTime] = await contract.gauges(gauge);
27
+ return { isActive, isBoostAmplificationEnabled, weight, lastUpdateTime };
28
+ };
29
+ exports.getGauge = getGauge;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGaugeRelativeWeight = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const getContractAddress_1 = require("../../getContractAddress");
6
+ const artifacts_1 = require("../../../utils/artifacts");
7
+ /**
8
+ * Computes and checkpoints a gauge's relative weight at a given epoch.
9
+ *
10
+ * This is a state-modifying call (it writes checkpoints), so it requires a Signer.
11
+ * For a pure read with no state changes, use getGaugeRelativeWeightView instead.
12
+ *
13
+ * @param chainId - The chain/network to use.
14
+ * @param gauge - Address of the gauge.
15
+ * @param epoch - Epoch timestamp to checkpoint.
16
+ * @param signer - An ethers.js Signer instance (required).
17
+ * @returns The transaction response.
18
+ */
19
+ const getGaugeRelativeWeight = async (chainId, gauge, epoch, signer) => {
20
+ if (!signer)
21
+ throw new Error("Signer is required");
22
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
23
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
24
+ const contract = new ethers_1.ethers.Contract(address, abi, signer);
25
+ const tx = await contract.getGaugeRelativeWeight(gauge, epoch);
26
+ await tx.wait();
27
+ return tx;
28
+ };
29
+ exports.getGaugeRelativeWeight = getGaugeRelativeWeight;
@@ -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.getGaugeRelativeWeightView = 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 a gauge's relative weight at a given epoch without modifying state.
13
+ * @param chainId - The chain/network to use.
14
+ * @param gauge - Address of the gauge.
15
+ * @param epoch - Epoch timestamp to query.
16
+ * @param provider - Optional ethers.js Provider instance.
17
+ * @returns An object with relativeWeight (1e18-scaled, where 1e18 = 100%) and totalWeight, both bigint.
18
+ */
19
+ const getGaugeRelativeWeightView = async (chainId, gauge, epoch, 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, "gaugecontroller");
25
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
26
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
27
+ const [relativeWeight, totalWeight] = await contract.getGaugeRelativeWeightView(gauge, epoch);
28
+ return { relativeWeight, totalWeight };
29
+ };
30
+ exports.getGaugeRelativeWeightView = getGaugeRelativeWeightView;
@@ -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.getLastVoteTime = 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 timestamp of a user's last vote on a given gauge.
13
+ * @param chainId - The chain/network to use.
14
+ * @param user - Address of the user.
15
+ * @param gauge - Address of the gauge.
16
+ * @param provider - Optional ethers.js Provider instance.
17
+ * @returns The last vote timestamp as a bigint.
18
+ */
19
+ const getLastVoteTime = async (chainId, user, 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, "gaugecontroller");
25
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
26
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
27
+ return contract.lastVoteTime(user, gauge);
28
+ };
29
+ exports.getLastVoteTime = getLastVoteTime;
@@ -0,0 +1,27 @@
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.getNextEpoch = 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 next epoch boundary (current epoch plus one week) from the GaugeController.
13
+ * @param chainId - The chain/network to use.
14
+ * @param provider - Optional ethers.js Provider instance.
15
+ * @returns Next epoch timestamp as a bigint.
16
+ */
17
+ const getNextEpoch = async (chainId, provider) => {
18
+ if (!provider) {
19
+ const rpc = chains_1.default[chainId].rpcs[0];
20
+ provider = new ethers_1.ethers.JsonRpcProvider(rpc);
21
+ }
22
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
23
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
24
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
25
+ return contract.getNextEpoch();
26
+ };
27
+ exports.getNextEpoch = getNextEpoch;
@@ -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.getUserGaugeVotePower = 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 vote weight (in basis points) a user has allocated to a gauge.
13
+ * @param chainId - The chain/network to use.
14
+ * @param user - Address of the user.
15
+ * @param gauge - Address of the gauge.
16
+ * @param provider - Optional ethers.js Provider instance.
17
+ * @returns Vote weight in basis points as a bigint.
18
+ */
19
+ const getUserGaugeVotePower = async (chainId, user, 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, "gaugecontroller");
25
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
26
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
27
+ return contract.getUserGaugeVotePower(user, gauge);
28
+ };
29
+ exports.getUserGaugeVotePower = getUserGaugeVotePower;
@@ -0,0 +1,27 @@
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.getVeToken = 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 veToken (voting escrow token) address used by the GaugeController.
13
+ * @param chainId - The chain/network to use.
14
+ * @param provider - Optional ethers.js Provider instance.
15
+ * @returns The veToken contract address as a string.
16
+ */
17
+ const getVeToken = async (chainId, provider) => {
18
+ if (!provider) {
19
+ const rpc = chains_1.default[chainId].rpcs[0];
20
+ provider = new ethers_1.ethers.JsonRpcProvider(rpc);
21
+ }
22
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
23
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
24
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
25
+ return contract.veToken();
26
+ };
27
+ exports.getVeToken = getVeToken;
@@ -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.getVoteUserPower = 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 total vote power a user has currently allocated across all gauges.
13
+ * @param chainId - The chain/network to use.
14
+ * @param user - Address of the user.
15
+ * @param provider - Optional ethers.js Provider instance.
16
+ * @returns The user's allocated vote power as a bigint.
17
+ */
18
+ const getVoteUserPower = async (chainId, user, 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, "gaugecontroller");
24
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
25
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
26
+ return contract.voteUserPower(user);
27
+ };
28
+ exports.getVoteUserPower = getVoteUserPower;
@@ -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.getVoteUserSlope = 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 a user's vote slope for a gauge from the public `voteUserSlopes` mapping.
13
+ * @param chainId - The chain/network to use.
14
+ * @param user - Address of the user.
15
+ * @param gauge - Address of the gauge.
16
+ * @param provider - Optional ethers.js Provider instance.
17
+ * @returns An object with locked, power and end, all bigint.
18
+ */
19
+ const getVoteUserSlope = async (chainId, user, 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, "gaugecontroller");
25
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
26
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
27
+ const [locked, power, end] = await contract.voteUserSlopes(user, gauge);
28
+ return { locked, power, end };
29
+ };
30
+ exports.getVoteUserSlope = getVoteUserSlope;
@@ -1,25 +1,45 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkpointGauge = exports.checkpoint = exports.vote = exports.getUserGaugeVoteWeight = exports.getUserVotePowerRemaining = exports.getActiveGauges = exports.getTotalWeight = exports.getGaugeWeight = exports.isGaugeActive = exports.isGauge = exports.calculateBoost = void 0;
4
- var calculateBoost_1 = require("./calculateBoost");
5
- Object.defineProperty(exports, "calculateBoost", { enumerable: true, get: function () { return calculateBoost_1.calculateBoost; } });
6
- var isGauge_1 = require("./isGauge");
7
- Object.defineProperty(exports, "isGauge", { enumerable: true, get: function () { return isGauge_1.isGauge; } });
8
- var isGaugeActive_1 = require("./isGaugeActive");
9
- Object.defineProperty(exports, "isGaugeActive", { enumerable: true, get: function () { return isGaugeActive_1.isGaugeActive; } });
10
- var getGaugeWeight_1 = require("./getGaugeWeight");
11
- Object.defineProperty(exports, "getGaugeWeight", { enumerable: true, get: function () { return getGaugeWeight_1.getGaugeWeight; } });
12
- var getTotalWeight_1 = require("./getTotalWeight");
13
- Object.defineProperty(exports, "getTotalWeight", { enumerable: true, get: function () { return getTotalWeight_1.getTotalWeight; } });
14
- var getActiveGauges_1 = require("./getActiveGauges");
15
- Object.defineProperty(exports, "getActiveGauges", { enumerable: true, get: function () { return getActiveGauges_1.getActiveGauges; } });
16
- var getUserVotePowerRemaining_1 = require("./getUserVotePowerRemaining");
17
- Object.defineProperty(exports, "getUserVotePowerRemaining", { enumerable: true, get: function () { return getUserVotePowerRemaining_1.getUserVotePowerRemaining; } });
18
- var getUserGaugeVoteWeight_1 = require("./getUserGaugeVoteWeight");
19
- Object.defineProperty(exports, "getUserGaugeVoteWeight", { enumerable: true, get: function () { return getUserGaugeVoteWeight_1.getUserGaugeVoteWeight; } });
20
- var vote_1 = require("./vote");
21
- Object.defineProperty(exports, "vote", { enumerable: true, get: function () { return vote_1.vote; } });
22
- var checkpoint_1 = require("./checkpoint");
23
- Object.defineProperty(exports, "checkpoint", { enumerable: true, get: function () { return checkpoint_1.checkpoint; } });
24
- var checkpointGauge_1 = require("./checkpointGauge");
25
- Object.defineProperty(exports, "checkpointGauge", { enumerable: true, get: function () { return checkpointGauge_1.checkpointGauge; } });
17
+ // Auto-generated barrel: re-exports every method in this namespace.
18
+ __exportStar(require("./addGauge"), exports);
19
+ __exportStar(require("./batchVote"), exports);
20
+ __exportStar(require("./calculateBoost"), exports);
21
+ __exportStar(require("./forceCompleteCheckpoint"), exports);
22
+ __exportStar(require("./getActiveGauges"), exports);
23
+ __exportStar(require("./getConstants"), exports);
24
+ __exportStar(require("./getCurrentEpoch"), exports);
25
+ __exportStar(require("./getGauge"), exports);
26
+ __exportStar(require("./getGaugeRelativeWeight"), exports);
27
+ __exportStar(require("./getGaugeRelativeWeightView"), exports);
28
+ __exportStar(require("./getGaugeWeight"), exports);
29
+ __exportStar(require("./getLastVoteTime"), exports);
30
+ __exportStar(require("./getNextEpoch"), exports);
31
+ __exportStar(require("./getTotalWeight"), exports);
32
+ __exportStar(require("./getUserGaugeVotePower"), exports);
33
+ __exportStar(require("./getUserVotePowerRemaining"), exports);
34
+ __exportStar(require("./getVeToken"), exports);
35
+ __exportStar(require("./getVoteUserPower"), exports);
36
+ __exportStar(require("./getVoteUserSlope"), exports);
37
+ __exportStar(require("./isGaugeActive"), exports);
38
+ __exportStar(require("./isPaused"), exports);
39
+ __exportStar(require("./kick"), exports);
40
+ __exportStar(require("./removeGauge"), exports);
41
+ __exportStar(require("./removePowerFromGauge"), exports);
42
+ __exportStar(require("./setBoostAmplificationEnabled"), exports);
43
+ __exportStar(require("./setEmergencyGaugePause"), exports);
44
+ __exportStar(require("./setEmergencyPause"), exports);
45
+ __exportStar(require("./vote"), exports);
@@ -0,0 +1,27 @@
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.isPaused = 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
+ * Checks whether the GaugeController is currently paused.
13
+ * @param chainId - The chain/network to use.
14
+ * @param provider - Optional ethers.js Provider instance.
15
+ * @returns True if the contract is paused, false otherwise.
16
+ */
17
+ const isPaused = async (chainId, provider) => {
18
+ if (!provider) {
19
+ const rpc = chains_1.default[chainId].rpcs[0];
20
+ provider = new ethers_1.ethers.JsonRpcProvider(rpc);
21
+ }
22
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
23
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
24
+ const contract = new ethers_1.ethers.Contract(address, abi, provider);
25
+ return contract.paused();
26
+ };
27
+ exports.isPaused = isPaused;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.kick = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const getContractAddress_1 = require("../../getContractAddress");
6
+ const artifacts_1 = require("../../../utils/artifacts");
7
+ /**
8
+ * Kicks a user, forcing a re-checkpoint of their vote power (e.g. after their veToken lock expired).
9
+ * @param chainId - The chain/network to use.
10
+ * @param user - Address of the user to kick.
11
+ * @param signer - An ethers.js Signer instance (required).
12
+ * @returns The transaction response.
13
+ */
14
+ const kick = async (chainId, user, signer) => {
15
+ if (!signer)
16
+ throw new Error("Signer is required");
17
+ const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
18
+ const abi = (0, artifacts_1.getABI)("gaugecontroller");
19
+ const contract = new ethers_1.ethers.Contract(address, abi, signer);
20
+ const tx = await contract.kick(user);
21
+ await tx.wait();
22
+ return tx;
23
+ };
24
+ exports.kick = kick;