@curvefi/api 2.67.0 → 2.67.2
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/lib/constants/network_constants.js +2 -2
- package/lib/curve.d.ts +1 -1
- package/lib/curve.js +2 -6
- package/lib/factory/deploy.js +2 -2
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ const ALIASES_ETHEREUM = lowerCaseValues({
|
|
|
5
5
|
"crv": "0xD533a949740bb3306d119CC777fa900bA034cd52", // <--- CHANGE
|
|
6
6
|
"minter": '0xd061D61a4d941c39E5453435B6345Dc261C2fcE0', // <--- RECOVERED
|
|
7
7
|
"root_gauge_factory": "0x306A45a1478A000dC701A6e1f7a569afb8D9DCD6",
|
|
8
|
-
"root_gauge_factory_arbitrum": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
9
8
|
"voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
|
|
10
9
|
"fee_distributor": "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc",
|
|
11
10
|
"fee_distributor_crvusd": "0xD16d5eC345Dd86Fb63C6a9C43c517210F1027914",
|
|
@@ -86,7 +85,8 @@ const ALIASES_AVALANCHE = lowerCaseValues({
|
|
|
86
85
|
});
|
|
87
86
|
const ALIASES_ARBITRUM = lowerCaseValues({
|
|
88
87
|
"crv": "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",
|
|
89
|
-
"child_gauge_factory": "
|
|
88
|
+
"child_gauge_factory": "0x988d1037e9608B21050A8EFba0c6C45e01A3Bce7",
|
|
89
|
+
"child_gauge_factory_old": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
90
90
|
"voting_escrow": "0x98c80fa823759b642c3e02f40533c164f40727ae",
|
|
91
91
|
"fee_distributor": "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc", // <-- DUMMY
|
|
92
92
|
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
package/lib/curve.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumberish, BrowserProvider, Contract, ethers, JsonRpcProvider, Networkish, Numeric, Signer } from "ethers";
|
|
2
2
|
import { Contract as MulticallContract, Provider as MulticallProvider } from "@curvefi/ethcall";
|
|
3
|
-
import {
|
|
3
|
+
import { Abi, IChainId, ICurve, IDict, IExtendedPoolDataFromApi, IFactoryPoolType, INetworkConstants, IPoolData, IPoolType } from "./interfaces";
|
|
4
4
|
export declare const OLD_CHAINS: number[];
|
|
5
5
|
export declare const memoizedContract: () => (address: string, abi: any, provider: BrowserProvider | JsonRpcProvider | Signer) => Contract;
|
|
6
6
|
export declare const memoizedMulticallContract: () => (address: string, abi: any) => MulticallContract;
|
package/lib/curve.js
CHANGED
|
@@ -555,8 +555,6 @@ export class Curve {
|
|
|
555
555
|
this.setContract(this.constants.ALIASES.minter, minterMainnetABI);
|
|
556
556
|
this.setContract(this.constants.ALIASES.fee_distributor_crvusd, feeDistributorCrvUSDABI);
|
|
557
557
|
this.setContract(this.constants.ALIASES.root_gauge_factory, rootGaugeFactoryABI);
|
|
558
|
-
//TODO should be deleted
|
|
559
|
-
this.setContract(this.constants.ALIASES.root_gauge_factory_arbitrum, rootGaugeFactoryABI);
|
|
560
558
|
}
|
|
561
559
|
else {
|
|
562
560
|
this.setContract(this.constants.ALIASES.child_gauge_factory, childGaugeFactoryABI);
|
|
@@ -621,20 +619,18 @@ export class Curve {
|
|
|
621
619
|
AbstractProvider.prototype.estimateGas = AbstractProvider.prototype.originalEstimate;
|
|
622
620
|
}
|
|
623
621
|
const originalEstimate = AbstractProvider.prototype.estimateGas;
|
|
624
|
-
const oldEstimate = originalEstimate.bind(this);
|
|
625
622
|
//Override
|
|
626
623
|
const newEstimate = function (arg) {
|
|
627
624
|
return __awaiter(this, void 0, void 0, function* () {
|
|
628
|
-
const L2EstimateGas = oldEstimate;
|
|
629
625
|
const L1GasUsed = yield curveInstance.contracts[curveInstance.constants.ALIASES.gas_oracle_blob].contract.getL1GasUsed(arg.data);
|
|
630
626
|
const L1Fee = yield curveInstance.contracts[curveInstance.constants.ALIASES.gas_oracle_blob].contract.getL1Fee(arg.data);
|
|
631
627
|
curveInstance.L1WeightedGasPrice = Number(L1Fee) / Number(L1GasUsed);
|
|
632
|
-
const L2GasUsed = yield
|
|
628
|
+
const L2GasUsed = yield originalEstimate.call(this, arg);
|
|
633
629
|
return [L2GasUsed, L1GasUsed];
|
|
634
630
|
});
|
|
635
631
|
};
|
|
636
632
|
AbstractProvider.prototype.estimateGas = newEstimate;
|
|
637
|
-
AbstractProvider.prototype.originalEstimate =
|
|
633
|
+
AbstractProvider.prototype.originalEstimate = originalEstimate;
|
|
638
634
|
}
|
|
639
635
|
else {
|
|
640
636
|
if ('originalEstimate' in AbstractProvider.prototype) {
|
package/lib/factory/deploy.js
CHANGED
|
@@ -620,7 +620,7 @@ function _deployGaugeMirror(chainId, salt, estimateGas) {
|
|
|
620
620
|
return __awaiter(this, void 0, void 0, function* () {
|
|
621
621
|
if (this.chainId !== 1)
|
|
622
622
|
throw Error("There is no deployGaugeMirror method on sidechain network");
|
|
623
|
-
const rootGaugeFactory =
|
|
623
|
+
const rootGaugeFactory = NETWORK_CONSTANTS[this.chainId].ALIASES.root_gauge_factory;
|
|
624
624
|
const contract = this.contracts[rootGaugeFactory].contract;
|
|
625
625
|
const _salt = ethers.encodeBytes32String(salt);
|
|
626
626
|
const gas = yield contract.deploy_gauge.estimateGas(chainId, Typed.bytes32(_salt), this.constantOptions);
|
|
@@ -673,7 +673,7 @@ export function getDeployedGaugeMirrorAddress(chainId) {
|
|
|
673
673
|
return __awaiter(this, void 0, void 0, function* () {
|
|
674
674
|
if (this.chainId !== 1)
|
|
675
675
|
throw Error("There is no getDeployedGaugeMirrorAddress method on sidechain network");
|
|
676
|
-
const rootGaugeFactory =
|
|
676
|
+
const rootGaugeFactory = NETWORK_CONSTANTS[this.chainId].ALIASES.root_gauge_factory;
|
|
677
677
|
const contract = this.contracts[rootGaugeFactory].contract;
|
|
678
678
|
const gaugeCount = yield contract.get_gauge_count(chainId);
|
|
679
679
|
const currentIndex = Number(gaugeCount) - 1;
|