Skip to content

Commit

Permalink
Merge pull request #400 from curvefi/feat/add-support-old-gauge-factory
Browse files Browse the repository at this point in the history
fix: _deployGaugeMirror
  • Loading branch information
fedorovdg authored Oct 10, 2024
2 parents 948fba3 + 69fede2 commit a0a672d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "2.63.8",
"version": "2.63.9",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"author": "Macket",
Expand Down
4 changes: 2 additions & 2 deletions src/factory/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ const _deployGaugeSidechain = async (pool: string, salt: string, estimateGas: bo

const _deployGaugeMirror = async (chainId: number, salt: string, estimateGas: boolean): Promise<ethers.ContractTransactionResponse | number | number[]> => {
if (curve.chainId !== 1) throw Error("There is no deployGaugeMirror method on sidechain network");
const rootGaugeFactory = chainId !== 42161? NETWORK_CONSTANTS[chainId].root_gauge_factory: NETWORK_CONSTANTS[chainId].root_gauge_factory_arbitrum;
const rootGaugeFactory = chainId !== 42161? NETWORK_CONSTANTS[curve.chainId].root_gauge_factory: NETWORK_CONSTANTS[curve.chainId].root_gauge_factory_arbitrum;
const contract = curve.contracts[rootGaugeFactory].contract;
const _salt = ethers.encodeBytes32String(salt)
const gas = await contract.deploy_gauge.estimateGas(chainId, Typed.bytes32(_salt), curve.constantOptions);
Expand Down Expand Up @@ -924,7 +924,7 @@ export const getDeployedGaugeMirrorAddressByTx = async (tx: ethers.ContractTrans

export const getDeployedGaugeMirrorAddress = async (chainId: number): Promise<string> => {
if (curve.chainId !== 1) throw Error("There is no getDeployedGaugeMirrorAddress method on sidechain network");
const rootGaugeFactory = chainId !== 42161? NETWORK_CONSTANTS[chainId].root_gauge_factory: NETWORK_CONSTANTS[chainId].root_gauge_factory_arbitrum;
const rootGaugeFactory = chainId !== 42161? NETWORK_CONSTANTS[curve.chainId].root_gauge_factory: NETWORK_CONSTANTS[curve.chainId].root_gauge_factory_arbitrum;
const contract = curve.contracts[rootGaugeFactory].contract;
const gaugeCount = await contract.get_gauge_count(chainId);
const currentIndex: number = Number(gaugeCount) - 1;
Expand Down

0 comments on commit a0a672d

Please sign in to comment.