@curvefi/api 2.54.4 → 2.54.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.
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const tricryptoDeployImplementations: {
|
|
2
|
+
1: {
|
|
3
|
+
amm_native_transfers_disabled: string;
|
|
4
|
+
amm_native_transfers_enabled: string;
|
|
5
|
+
implementationIdx: number;
|
|
6
|
+
};
|
|
7
|
+
10: {
|
|
8
|
+
amm_native_transfers_disabled: string;
|
|
9
|
+
amm_native_transfers_enabled: string;
|
|
10
|
+
implementationIdx: number;
|
|
11
|
+
};
|
|
12
|
+
56: {
|
|
13
|
+
amm_native_transfers_disabled: string;
|
|
14
|
+
amm_native_transfers_enabled: string;
|
|
15
|
+
implementationIdx: number;
|
|
16
|
+
};
|
|
17
|
+
100: {
|
|
18
|
+
amm_native_transfers_disabled: string;
|
|
19
|
+
amm_native_transfers_enabled: string;
|
|
20
|
+
implementationIdx: number;
|
|
21
|
+
};
|
|
22
|
+
137: {
|
|
23
|
+
amm_native_transfers_disabled: string;
|
|
24
|
+
amm_native_transfers_enabled: string;
|
|
25
|
+
implementationIdx: number;
|
|
26
|
+
};
|
|
27
|
+
250: {
|
|
28
|
+
amm_native_transfers_disabled: string;
|
|
29
|
+
amm_native_transfers_enabled: string;
|
|
30
|
+
implementationIdx: number;
|
|
31
|
+
};
|
|
32
|
+
324: {
|
|
33
|
+
implementationIdx: number;
|
|
34
|
+
};
|
|
35
|
+
1284: {
|
|
36
|
+
implementationIdx: number;
|
|
37
|
+
};
|
|
38
|
+
2222: {
|
|
39
|
+
amm_native_transfers_disabled: string;
|
|
40
|
+
amm_native_transfers_enabled: string;
|
|
41
|
+
implementationIdx: number;
|
|
42
|
+
};
|
|
43
|
+
8453: {
|
|
44
|
+
amm_native_transfers_disabled: string;
|
|
45
|
+
amm_native_transfers_enabled: string;
|
|
46
|
+
implementationIdx: number;
|
|
47
|
+
};
|
|
48
|
+
42161: {
|
|
49
|
+
amm_native_transfers_disabled: string;
|
|
50
|
+
amm_native_transfers_enabled: string;
|
|
51
|
+
implementationIdx: number;
|
|
52
|
+
};
|
|
53
|
+
42220: {
|
|
54
|
+
amm_native_transfers_disabled: string;
|
|
55
|
+
amm_native_transfers_enabled: string;
|
|
56
|
+
implementationIdx: number;
|
|
57
|
+
};
|
|
58
|
+
43114: {
|
|
59
|
+
amm_native_transfers_disabled: string;
|
|
60
|
+
amm_native_transfers_enabled: string;
|
|
61
|
+
implementationIdx: number;
|
|
62
|
+
};
|
|
63
|
+
1313161554: {
|
|
64
|
+
amm_native_transfers_disabled: string;
|
|
65
|
+
amm_native_transfers_enabled: string;
|
|
66
|
+
implementationIdx: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export var tricryptoDeployImplementations = {
|
|
2
|
+
1: {
|
|
3
|
+
amm_native_transfers_disabled: '0x0000000000000000000000000000000000000000',
|
|
4
|
+
amm_native_transfers_enabled: '0x66442B0C5260B92cAa9c234ECf2408CBf6b19a6f',
|
|
5
|
+
implementationIdx: 0,
|
|
6
|
+
},
|
|
7
|
+
10: {
|
|
8
|
+
amm_native_transfers_disabled: '0x0458ea5F4CD00E873264Be2031Ceb8f9d9b3116c',
|
|
9
|
+
amm_native_transfers_enabled: '0x1FE2a06c8bd81AE65FD1C5036451890b37976369',
|
|
10
|
+
implementationIdx: 1,
|
|
11
|
+
},
|
|
12
|
+
56: {
|
|
13
|
+
amm_native_transfers_disabled: '0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf',
|
|
14
|
+
amm_native_transfers_enabled: '0xBff334F8D5912AC5c4f2c590A2396d1C5d990123',
|
|
15
|
+
implementationIdx: 1,
|
|
16
|
+
},
|
|
17
|
+
100: {
|
|
18
|
+
amm_native_transfers_disabled: '0x3f445D38E820c010a7A6E33c5F80cBEBE6930f61',
|
|
19
|
+
amm_native_transfers_enabled: '0xa54f3c1dfa5f7dbf2564829d14b3b74a65d26ae2',
|
|
20
|
+
implementationIdx: 1,
|
|
21
|
+
},
|
|
22
|
+
137: {
|
|
23
|
+
amm_native_transfers_disabled: '0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a',
|
|
24
|
+
amm_native_transfers_enabled: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf',
|
|
25
|
+
implementationIdx: 1,
|
|
26
|
+
},
|
|
27
|
+
250: {
|
|
28
|
+
amm_native_transfers_disabled: '0xd125E7a0cEddF89c6473412d85835450897be6Dc',
|
|
29
|
+
amm_native_transfers_enabled: '0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D',
|
|
30
|
+
implementationIdx: 1,
|
|
31
|
+
},
|
|
32
|
+
324: {
|
|
33
|
+
implementationIdx: 0,
|
|
34
|
+
},
|
|
35
|
+
1284: {
|
|
36
|
+
implementationIdx: 0,
|
|
37
|
+
},
|
|
38
|
+
2222: {
|
|
39
|
+
amm_native_transfers_disabled: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf',
|
|
40
|
+
amm_native_transfers_enabled: '0xFAbC421e3368D158d802684A217a83c083c94CeB',
|
|
41
|
+
implementationIdx: 1,
|
|
42
|
+
},
|
|
43
|
+
8453: {
|
|
44
|
+
amm_native_transfers_disabled: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf',
|
|
45
|
+
amm_native_transfers_enabled: '0xa274c88e09fDF1798a7517096557e6c1bEa1f65A',
|
|
46
|
+
implementationIdx: 1,
|
|
47
|
+
},
|
|
48
|
+
42161: {
|
|
49
|
+
amm_native_transfers_disabled: '0x1f7C86AffE5bCF7a1D74a8c8E2ef9E03BF31c1BD',
|
|
50
|
+
amm_native_transfers_enabled: '0xd7E72f3615aa65b92A4DBdC211E296a35512988B',
|
|
51
|
+
implementationIdx: 1,
|
|
52
|
+
},
|
|
53
|
+
42220: {
|
|
54
|
+
amm_native_transfers_disabled: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf',
|
|
55
|
+
amm_native_transfers_enabled: '0xFAbC421e3368D158d802684A217a83c083c94CeB',
|
|
56
|
+
implementationIdx: 1,
|
|
57
|
+
},
|
|
58
|
+
43114: {
|
|
59
|
+
amm_native_transfers_disabled: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf',
|
|
60
|
+
amm_native_transfers_enabled: '0xFAbC421e3368D158d802684A217a83c083c94CeB',
|
|
61
|
+
implementationIdx: 1,
|
|
62
|
+
},
|
|
63
|
+
1313161554: {
|
|
64
|
+
amm_native_transfers_disabled: '0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a',
|
|
65
|
+
amm_native_transfers_enabled: '0x0c59d36b23f809f8b6C7cb4c8C590a0AC103baEf',
|
|
66
|
+
implementationIdx: 1,
|
|
67
|
+
},
|
|
68
|
+
};
|
package/lib/curve.js
CHANGED
|
@@ -74,7 +74,6 @@ import feeDistributorABI from './constants/abis/fee_distributor.json' assert { t
|
|
|
74
74
|
import gaugeControllerABI from './constants/abis/gaugecontroller.json' assert { type: 'json' };
|
|
75
75
|
import depositAndStakeABI from './constants/abis/deposit_and_stake.json' assert { type: 'json' };
|
|
76
76
|
import cryptoCalcZapABI from './constants/abis/crypto_calc.json' assert { type: 'json' };
|
|
77
|
-
import depositAndStake6CoinsABI from './constants/abis/deposit_and_stake_6coins.json' assert { type: 'json' };
|
|
78
77
|
import StableCalcZapABI from './constants/abis/stable_calc.json' assert { type: 'json' };
|
|
79
78
|
import routerABI from './constants/abis/router.json' assert { type: 'json' };
|
|
80
79
|
import routerPolygonABI from './constants/abis/routerPolygon.json' assert { type: 'json' };
|
|
@@ -530,8 +529,8 @@ var Curve = /** @class */ (function () {
|
|
|
530
529
|
return __generator(this, function (_k) {
|
|
531
530
|
switch (_k.label) {
|
|
532
531
|
case 0:
|
|
533
|
-
if (
|
|
534
|
-
return [2 /*return*/];
|
|
532
|
+
if ([324, 1284].includes(this.chainId))
|
|
533
|
+
return [2 /*return*/];
|
|
535
534
|
if (!useApi) return [3 /*break*/, 2];
|
|
536
535
|
_a = this.constants;
|
|
537
536
|
_b = lowerCasePoolDataAddresses;
|
|
@@ -673,8 +672,8 @@ var Curve = /** @class */ (function () {
|
|
|
673
672
|
return __generator(this, function (_b) {
|
|
674
673
|
switch (_b.label) {
|
|
675
674
|
case 0:
|
|
676
|
-
if (
|
|
677
|
-
return [2 /*return*/, []];
|
|
675
|
+
if ([324, 1284].includes(this.chainId))
|
|
676
|
+
return [2 /*return*/, []];
|
|
678
677
|
currentPoolIds = Object.keys(this.constants.TRICRYPTO_FACTORY_POOLS_DATA);
|
|
679
678
|
lastPoolIdx = currentPoolIds.length === 0 ? -1 : Number(currentPoolIds[currentPoolIds.length - 1].split("-")[2]);
|
|
680
679
|
_a = lowerCasePoolDataAddresses;
|
|
@@ -743,8 +742,8 @@ var Curve = /** @class */ (function () {
|
|
|
743
742
|
return __generator(this, function (_b) {
|
|
744
743
|
switch (_b.label) {
|
|
745
744
|
case 0:
|
|
746
|
-
if (
|
|
747
|
-
return [2 /*return*/, ''];
|
|
745
|
+
if ([324, 1284].includes(this.chainId))
|
|
746
|
+
return [2 /*return*/, ''];
|
|
748
747
|
_a = lowerCasePoolDataAddresses;
|
|
749
748
|
return [4 /*yield*/, getTricryptoFactoryPoolData.call(this, 0, poolAddress)];
|
|
750
749
|
case 1:
|
|
@@ -1008,12 +1007,7 @@ var Curve = /** @class */ (function () {
|
|
|
1008
1007
|
else {
|
|
1009
1008
|
this.setContract(this.constants.ALIASES.router, routerABI);
|
|
1010
1009
|
}
|
|
1011
|
-
|
|
1012
|
-
this.setContract(this.constants.ALIASES.deposit_and_stake, depositAndStake6CoinsABI);
|
|
1013
|
-
}
|
|
1014
|
-
else {
|
|
1015
|
-
this.setContract(this.constants.ALIASES.deposit_and_stake, depositAndStakeABI);
|
|
1016
|
-
}
|
|
1010
|
+
this.setContract(this.constants.ALIASES.deposit_and_stake, depositAndStakeABI);
|
|
1017
1011
|
this.setContract(this.constants.ALIASES.crypto_calc, cryptoCalcZapABI);
|
|
1018
1012
|
this.setContract(this.constants.ALIASES.stable_calc, StableCalcZapABI);
|
|
1019
1013
|
this.setContract(this.constants.ALIASES.factory, factoryABI);
|
package/lib/factory/deploy.js
CHANGED
|
@@ -60,6 +60,7 @@ import { getPool } from "../pools/index.js";
|
|
|
60
60
|
import { parseUnits, BN, mulBy1_3, getPoolIdBySwapAddress, DIGas, smartNumber } from '../utils.js';
|
|
61
61
|
import CurveLpTokenV5ABI from "../constants/abis/curve_lp_token_v5.json" assert { type: 'json' };
|
|
62
62
|
import Plain2ETHOracleABIABI from "../constants/abis/factory-v2/Plain2ETHOracle.json" assert { type: 'json' };
|
|
63
|
+
import { tricryptoDeployImplementations } from "../constants/tricryptoDeployImplementations.js";
|
|
63
64
|
// ------- STABLE PLAIN POOLS -------
|
|
64
65
|
var _deployStablePlainPool = function (name, symbol, coins, A, fee, // %
|
|
65
66
|
assetType, // 0 = USD, 1 = ETH, 2 = BTC, 3 = Other
|
|
@@ -636,7 +637,7 @@ initialPrices, estimateGas) { return __awaiter(void 0, void 0, void 0, function
|
|
|
636
637
|
_emaTime = parseUnits(Math.floor(emaTime / Math.log(2)), 0);
|
|
637
638
|
_initialPrices = [parseUnits(initialPrices[0]), parseUnits(initialPrices[1])];
|
|
638
639
|
contract = curve.contracts[curve.constants.ALIASES.tricrypto_factory].contract;
|
|
639
|
-
return [4 /*yield*/, contract.deploy_pool.estimateGas(name, symbol, coins, curve.constants.ZERO_ADDRESS,
|
|
640
|
+
return [4 /*yield*/, contract.deploy_pool.estimateGas(name, symbol, coins, curve.constants.ZERO_ADDRESS, tricryptoDeployImplementations[curve.chainId].implementationIdx, _A, _gamma, _midFee, _outFee, _feeGamma, _allowedExtraProfit, _adjustmentStep, _emaTime, _initialPrices, curve.constantOptions)];
|
|
640
641
|
case 1:
|
|
641
642
|
gas = _a.sent();
|
|
642
643
|
if (estimateGas)
|
|
@@ -645,7 +646,7 @@ initialPrices, estimateGas) { return __awaiter(void 0, void 0, void 0, function
|
|
|
645
646
|
return [4 /*yield*/, curve.updateFeeData()];
|
|
646
647
|
case 2:
|
|
647
648
|
_a.sent();
|
|
648
|
-
return [4 /*yield*/, contract.deploy_pool(name, symbol, coins, curve.constants.NATIVE_TOKEN.wrappedAddress,
|
|
649
|
+
return [4 /*yield*/, contract.deploy_pool(name, symbol, coins, curve.constants.NATIVE_TOKEN.wrappedAddress, tricryptoDeployImplementations[curve.chainId].implementationIdx, _A, _gamma, _midFee, _outFee, _feeGamma, _allowedExtraProfit, _adjustmentStep, _emaTime, _initialPrices, __assign(__assign({}, curve.options), { gasLimit: gasLimit }))];
|
|
649
650
|
case 3: return [2 /*return*/, _a.sent()];
|
|
650
651
|
}
|
|
651
652
|
});
|
package/package.json
CHANGED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"stateMutability": "payable",
|
|
4
|
-
"type": "function",
|
|
5
|
-
"name": "deposit_and_stake",
|
|
6
|
-
"inputs": [
|
|
7
|
-
{
|
|
8
|
-
"name": "deposit",
|
|
9
|
-
"type": "address"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"name": "lp_token",
|
|
13
|
-
"type": "address"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "gauge",
|
|
17
|
-
"type": "address"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"name": "n_coins",
|
|
21
|
-
"type": "uint256"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "coins",
|
|
25
|
-
"type": "address[6]"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "amounts",
|
|
29
|
-
"type": "uint256[6]"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"name": "min_mint_amount",
|
|
33
|
-
"type": "uint256"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"name": "use_underlying",
|
|
37
|
-
"type": "bool"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "pool",
|
|
41
|
-
"type": "address"
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"outputs": [],
|
|
45
|
-
"gas": "409532"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"stateMutability": "payable",
|
|
49
|
-
"type": "fallback"
|
|
50
|
-
}
|
|
51
|
-
]
|