@gearbox-protocol/sdk 9.11.1 → 9.12.1
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/cjs/plugins/adapters/AdaptersPlugin.js +127 -0
- package/dist/cjs/plugins/adapters/abi/actionAbi.js +95 -0
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +154 -0
- package/dist/cjs/plugins/adapters/abi/conctructorAbiPatterns.js +99 -0
- package/dist/cjs/plugins/adapters/abi/index.js +26 -0
- package/dist/cjs/plugins/adapters/abi/utils.js +86 -0
- package/dist/cjs/plugins/adapters/contracts/AbstractAdapter.js +39 -0
- package/dist/cjs/plugins/adapters/contracts/BalancerV2VaultAdapterContract.js +51 -0
- package/dist/cjs/plugins/adapters/contracts/BalancerV3RouterAdapterContract.js +46 -0
- package/dist/cjs/plugins/adapters/contracts/CamelotV3AdapterContract.js +56 -0
- package/dist/cjs/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.js +60 -0
- package/dist/cjs/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.js +60 -0
- package/dist/cjs/plugins/adapters/contracts/Curve2AssetsAdapterContract.js +66 -0
- package/dist/cjs/plugins/adapters/contracts/Curve3AssetsAdapterContract.js +66 -0
- package/dist/cjs/plugins/adapters/contracts/Curve4AssetsAdapterContract.js +66 -0
- package/dist/cjs/plugins/adapters/contracts/CurveV1AdapterDeposit.js +69 -0
- package/dist/cjs/plugins/adapters/contracts/CurveV1AdapterStETHContract.js +61 -0
- package/dist/cjs/plugins/adapters/contracts/CurveV1StableNGAdapterContract.js +69 -0
- package/dist/cjs/plugins/adapters/contracts/DaiUsdsAdapterContract.js +49 -0
- package/dist/cjs/plugins/adapters/contracts/ERC4626AdapterContract.js +63 -0
- package/dist/cjs/plugins/adapters/contracts/ERC4626ReferralAdapterContract.js +49 -0
- package/dist/cjs/plugins/adapters/contracts/EqualizerRouterAdapterContract.js +58 -0
- package/dist/cjs/plugins/adapters/contracts/FluidDexAdapterContract.js +49 -0
- package/dist/cjs/plugins/adapters/contracts/InfraredVaultAdapterContract.js +49 -0
- package/dist/cjs/plugins/adapters/contracts/KodiakIslandGatewayAdapterContract.js +56 -0
- package/dist/cjs/plugins/adapters/contracts/LidoV1AdapterContract.js +52 -0
- package/dist/cjs/plugins/adapters/contracts/MellowClaimerAdapterContract.js +46 -0
- package/dist/cjs/plugins/adapters/contracts/MellowDVVAdapterContract.js +49 -0
- package/dist/cjs/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.js +78 -0
- package/dist/cjs/plugins/adapters/contracts/MellowVaultAdapterContract.js +46 -0
- package/dist/cjs/plugins/adapters/contracts/MellowWrapperAdapterContract.js +46 -0
- package/dist/cjs/plugins/adapters/contracts/PendleRouterAdapterContract.js +60 -0
- package/dist/cjs/plugins/adapters/contracts/StakingRewardsAdapterContract.js +73 -0
- package/dist/cjs/plugins/adapters/contracts/TraderJoeRouterAdapterContract.js +60 -0
- package/dist/cjs/plugins/adapters/contracts/UniswapV2AdapterContract.js +77 -0
- package/dist/cjs/plugins/adapters/contracts/UniswapV3AdapterContract.js +177 -0
- package/dist/cjs/plugins/adapters/contracts/UpshiftVaultAdapterContract.js +52 -0
- package/dist/cjs/plugins/adapters/contracts/VelodromeV2AdapterContract.js +60 -0
- package/dist/cjs/plugins/adapters/contracts/WstETHV1AdapterContract.js +46 -0
- package/dist/cjs/plugins/adapters/contracts/YearnV2AdapterContract.js +46 -0
- package/dist/cjs/plugins/adapters/contracts/index.js +90 -0
- package/dist/cjs/plugins/adapters/contracts/types.js +60 -0
- package/dist/cjs/plugins/adapters/index.js +28 -0
- package/dist/cjs/plugins/adapters/package.json +1 -0
- package/dist/cjs/plugins/adapters/types.js +63 -0
- package/dist/cjs/sdk/sdk-legacy/core/transactions.js +1 -1
- package/dist/esm/plugins/adapters/AdaptersPlugin.js +137 -0
- package/dist/esm/plugins/adapters/abi/actionAbi.js +69 -0
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +141 -0
- package/dist/esm/plugins/adapters/abi/conctructorAbiPatterns.js +66 -0
- package/dist/esm/plugins/adapters/abi/index.js +3 -0
- package/dist/esm/plugins/adapters/abi/utils.js +64 -0
- package/dist/esm/plugins/adapters/contracts/AbstractAdapter.js +15 -0
- package/dist/esm/plugins/adapters/contracts/BalancerV2VaultAdapterContract.js +27 -0
- package/dist/esm/plugins/adapters/contracts/BalancerV3RouterAdapterContract.js +22 -0
- package/dist/esm/plugins/adapters/contracts/CamelotV3AdapterContract.js +32 -0
- package/dist/esm/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.js +36 -0
- package/dist/esm/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.js +36 -0
- package/dist/esm/plugins/adapters/contracts/Curve2AssetsAdapterContract.js +42 -0
- package/dist/esm/plugins/adapters/contracts/Curve3AssetsAdapterContract.js +42 -0
- package/dist/esm/plugins/adapters/contracts/Curve4AssetsAdapterContract.js +42 -0
- package/dist/esm/plugins/adapters/contracts/CurveV1AdapterDeposit.js +45 -0
- package/dist/esm/plugins/adapters/contracts/CurveV1AdapterStETHContract.js +37 -0
- package/dist/esm/plugins/adapters/contracts/CurveV1StableNGAdapterContract.js +45 -0
- package/dist/esm/plugins/adapters/contracts/DaiUsdsAdapterContract.js +25 -0
- package/dist/esm/plugins/adapters/contracts/ERC4626AdapterContract.js +39 -0
- package/dist/esm/plugins/adapters/contracts/ERC4626ReferralAdapterContract.js +25 -0
- package/dist/esm/plugins/adapters/contracts/EqualizerRouterAdapterContract.js +34 -0
- package/dist/esm/plugins/adapters/contracts/FluidDexAdapterContract.js +25 -0
- package/dist/esm/plugins/adapters/contracts/InfraredVaultAdapterContract.js +25 -0
- package/dist/esm/plugins/adapters/contracts/KodiakIslandGatewayAdapterContract.js +32 -0
- package/dist/esm/plugins/adapters/contracts/LidoV1AdapterContract.js +28 -0
- package/dist/esm/plugins/adapters/contracts/MellowClaimerAdapterContract.js +22 -0
- package/dist/esm/plugins/adapters/contracts/MellowDVVAdapterContract.js +25 -0
- package/dist/esm/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.js +54 -0
- package/dist/esm/plugins/adapters/contracts/MellowVaultAdapterContract.js +22 -0
- package/dist/esm/plugins/adapters/contracts/MellowWrapperAdapterContract.js +22 -0
- package/dist/esm/plugins/adapters/contracts/PendleRouterAdapterContract.js +36 -0
- package/dist/esm/plugins/adapters/contracts/StakingRewardsAdapterContract.js +49 -0
- package/dist/esm/plugins/adapters/contracts/TraderJoeRouterAdapterContract.js +36 -0
- package/dist/esm/plugins/adapters/contracts/UniswapV2AdapterContract.js +55 -0
- package/dist/esm/plugins/adapters/contracts/UniswapV3AdapterContract.js +155 -0
- package/dist/esm/plugins/adapters/contracts/UpshiftVaultAdapterContract.js +28 -0
- package/dist/esm/plugins/adapters/contracts/VelodromeV2AdapterContract.js +36 -0
- package/dist/esm/plugins/adapters/contracts/WstETHV1AdapterContract.js +22 -0
- package/dist/esm/plugins/adapters/contracts/YearnV2AdapterContract.js +22 -0
- package/dist/esm/plugins/adapters/contracts/index.js +35 -0
- package/dist/esm/plugins/adapters/contracts/types.js +33 -0
- package/dist/esm/plugins/adapters/index.js +4 -0
- package/dist/esm/plugins/adapters/package.json +1 -0
- package/dist/esm/plugins/adapters/types.js +39 -0
- package/dist/esm/sdk/sdk-legacy/core/transactions.js +1 -1
- package/dist/types/plugins/adapters/AdaptersPlugin.d.ts +11 -0
- package/dist/types/plugins/adapters/abi/actionAbi.d.ts +21 -0
- package/dist/types/plugins/adapters/abi/conctructorAbi.d.ts +7 -0
- package/dist/types/plugins/adapters/abi/conctructorAbiPatterns.d.ts +112 -0
- package/dist/types/plugins/adapters/abi/index.d.ts +3 -0
- package/dist/types/plugins/adapters/abi/utils.d.ts +30 -0
- package/dist/types/plugins/adapters/contracts/AbstractAdapter.d.ts +13 -0
- package/dist/types/plugins/adapters/contracts/BalancerV2VaultAdapterContract.d.ts +482 -0
- package/dist/types/plugins/adapters/contracts/BalancerV3RouterAdapterContract.d.ts +198 -0
- package/dist/types/plugins/adapters/contracts/CamelotV3AdapterContract.d.ts +441 -0
- package/dist/types/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.d.ts +284 -0
- package/dist/types/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.d.ts +208 -0
- package/dist/types/plugins/adapters/contracts/Curve2AssetsAdapterContract.d.ts +534 -0
- package/dist/types/plugins/adapters/contracts/Curve3AssetsAdapterContract.d.ts +534 -0
- package/dist/types/plugins/adapters/contracts/Curve4AssetsAdapterContract.d.ts +534 -0
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterDeposit.d.ts +481 -0
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterStETHContract.d.ts +534 -0
- package/dist/types/plugins/adapters/contracts/CurveV1StableNGAdapterContract.d.ts +535 -0
- package/dist/types/plugins/adapters/contracts/DaiUsdsAdapterContract.d.ts +146 -0
- package/dist/types/plugins/adapters/contracts/ERC4626AdapterContract.d.ts +190 -0
- package/dist/types/plugins/adapters/contracts/ERC4626ReferralAdapterContract.d.ts +242 -0
- package/dist/types/plugins/adapters/contracts/EqualizerRouterAdapterContract.d.ts +225 -0
- package/dist/types/plugins/adapters/contracts/FluidDexAdapterContract.d.ts +130 -0
- package/dist/types/plugins/adapters/contracts/InfraredVaultAdapterContract.d.ts +198 -0
- package/dist/types/plugins/adapters/contracts/KodiakIslandGatewayAdapterContract.d.ts +396 -0
- package/dist/types/plugins/adapters/contracts/LidoV1AdapterContract.d.ts +121 -0
- package/dist/types/plugins/adapters/contracts/MellowClaimerAdapterContract.d.ts +257 -0
- package/dist/types/plugins/adapters/contracts/MellowDVVAdapterContract.d.ts +232 -0
- package/dist/types/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.d.ts +195 -0
- package/dist/types/plugins/adapters/contracts/MellowVaultAdapterContract.d.ts +203 -0
- package/dist/types/plugins/adapters/contracts/MellowWrapperAdapterContract.d.ts +161 -0
- package/dist/types/plugins/adapters/contracts/PendleRouterAdapterContract.d.ts +823 -0
- package/dist/types/plugins/adapters/contracts/StakingRewardsAdapterContract.d.ts +210 -0
- package/dist/types/plugins/adapters/contracts/TraderJoeRouterAdapterContract.d.ts +349 -0
- package/dist/types/plugins/adapters/contracts/UniswapV2AdapterContract.d.ts +216 -0
- package/dist/types/plugins/adapters/contracts/UniswapV3AdapterContract.d.ts +384 -0
- package/dist/types/plugins/adapters/contracts/UpshiftVaultAdapterContract.d.ts +269 -0
- package/dist/types/plugins/adapters/contracts/VelodromeV2AdapterContract.d.ts +247 -0
- package/dist/types/plugins/adapters/contracts/WstETHV1AdapterContract.d.ts +127 -0
- package/dist/types/plugins/adapters/contracts/YearnV2AdapterContract.d.ts +185 -0
- package/dist/types/plugins/adapters/contracts/index.d.ts +35 -0
- package/dist/types/plugins/adapters/contracts/types.d.ts +23 -0
- package/dist/types/plugins/adapters/index.d.ts +4 -0
- package/dist/types/plugins/adapters/types.d.ts +39 -0
- package/package.json +2 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { iKodiakIslandGatewayAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iKodiakIslandGatewayAdapterAbi;
|
|
5
|
+
class KodiakIslandGatewayAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
allowedIslands;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{
|
|
14
|
+
type: "tuple[]",
|
|
15
|
+
name: "allowedIslands",
|
|
16
|
+
components: [
|
|
17
|
+
{ type: "address", name: "island" },
|
|
18
|
+
{ type: "uint8", name: "status" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
args.baseParams.serializedParams
|
|
23
|
+
);
|
|
24
|
+
this.allowedIslands = decoded[2].map(({ island, status }) => ({
|
|
25
|
+
island,
|
|
26
|
+
status
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
KodiakIslandGatewayAdapterContract
|
|
32
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { iLidoV1AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iLidoV1AdapterAbi;
|
|
5
|
+
class LidoV1AdapterContract extends AbstractAdapterContract {
|
|
6
|
+
stETH;
|
|
7
|
+
weth;
|
|
8
|
+
treasury;
|
|
9
|
+
constructor(sdk, args) {
|
|
10
|
+
super(sdk, { ...args, abi });
|
|
11
|
+
const decoded = decodeAbiParameters(
|
|
12
|
+
[
|
|
13
|
+
{ type: "address", name: "creditManager" },
|
|
14
|
+
{ type: "address", name: "targetContract" },
|
|
15
|
+
{ type: "address", name: "stETH" },
|
|
16
|
+
{ type: "address", name: "weth" },
|
|
17
|
+
{ type: "address", name: "treasury" }
|
|
18
|
+
],
|
|
19
|
+
args.baseParams.serializedParams
|
|
20
|
+
);
|
|
21
|
+
this.stETH = decoded[2];
|
|
22
|
+
this.weth = decoded[3];
|
|
23
|
+
this.treasury = decoded[4];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
LidoV1AdapterContract
|
|
28
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { iMellowClaimerAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iMellowClaimerAdapterAbi;
|
|
5
|
+
class MellowClaimerAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
allowedMultiVaults;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{ type: "address[]", name: "allowedMultiVaults" }
|
|
14
|
+
],
|
|
15
|
+
args.baseParams.serializedParams
|
|
16
|
+
);
|
|
17
|
+
this.allowedMultiVaults = [...decoded[2]];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
MellowClaimerAdapterContract
|
|
22
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mellowDvvAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = mellowDvvAdapterAbi;
|
|
5
|
+
class MellowDVVAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
vault;
|
|
7
|
+
asset;
|
|
8
|
+
constructor(sdk, args) {
|
|
9
|
+
super(sdk, { ...args, abi });
|
|
10
|
+
const decoded = decodeAbiParameters(
|
|
11
|
+
[
|
|
12
|
+
{ type: "address", name: "creditManager" },
|
|
13
|
+
{ type: "address", name: "targetContract" },
|
|
14
|
+
{ type: "address", name: "vault" },
|
|
15
|
+
{ type: "address", name: "asset" }
|
|
16
|
+
],
|
|
17
|
+
args.baseParams.serializedParams
|
|
18
|
+
);
|
|
19
|
+
this.vault = decoded[2];
|
|
20
|
+
this.asset = decoded[3];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
MellowDVVAdapterContract
|
|
25
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { iMellow4626VaultAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters, zeroAddress } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iMellow4626VaultAdapterAbi;
|
|
5
|
+
class MellowERC4626VaultAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
vault;
|
|
7
|
+
asset;
|
|
8
|
+
stakedPhantomToken;
|
|
9
|
+
constructor(sdk, args) {
|
|
10
|
+
super(sdk, { ...args, abi });
|
|
11
|
+
this.asset = zeroAddress;
|
|
12
|
+
this.vault = zeroAddress;
|
|
13
|
+
this.stakedPhantomToken = zeroAddress;
|
|
14
|
+
const version = Number(args.baseParams.version);
|
|
15
|
+
if (version === 310) {
|
|
16
|
+
const decoded = decodeAbiParameters(
|
|
17
|
+
[
|
|
18
|
+
{ type: "address", name: "creditManager" },
|
|
19
|
+
{ type: "address", name: "targetContract" },
|
|
20
|
+
{ type: "address", name: "asset" }
|
|
21
|
+
],
|
|
22
|
+
args.baseParams.serializedParams
|
|
23
|
+
);
|
|
24
|
+
this.asset = decoded[2];
|
|
25
|
+
} else if (version === 311) {
|
|
26
|
+
const decoded = decodeAbiParameters(
|
|
27
|
+
[
|
|
28
|
+
{ type: "address", name: "creditManager" },
|
|
29
|
+
{ type: "address", name: "targetContract" },
|
|
30
|
+
{ type: "address", name: "asset" },
|
|
31
|
+
{ type: "address", name: "stakedPhantomToken" }
|
|
32
|
+
],
|
|
33
|
+
args.baseParams.serializedParams
|
|
34
|
+
);
|
|
35
|
+
this.asset = decoded[2];
|
|
36
|
+
this.stakedPhantomToken = decoded[3];
|
|
37
|
+
} else {
|
|
38
|
+
const decoded = decodeAbiParameters(
|
|
39
|
+
[
|
|
40
|
+
{ type: "address", name: "creditManager" },
|
|
41
|
+
{ type: "address", name: "targetContract" },
|
|
42
|
+
{ type: "address", name: "vault" },
|
|
43
|
+
{ type: "address", name: "asset" }
|
|
44
|
+
],
|
|
45
|
+
args.baseParams.serializedParams
|
|
46
|
+
);
|
|
47
|
+
this.vault = decoded[2];
|
|
48
|
+
this.asset = decoded[3];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
MellowERC4626VaultAdapterContract
|
|
54
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { iMellowVaultAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iMellowVaultAdapterAbi;
|
|
5
|
+
class MellowVaultAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
allowedUnderlyings;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{ type: "address[]", name: "allowedUnderlyings" }
|
|
14
|
+
],
|
|
15
|
+
args.baseParams.serializedParams
|
|
16
|
+
);
|
|
17
|
+
this.allowedUnderlyings = [...decoded[2]];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
MellowVaultAdapterContract
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { iMellowWrapperAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iMellowWrapperAdapterAbi;
|
|
5
|
+
class MellowWrapperAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
allowedVaults;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{ type: "address[]", name: "allowedVaults" }
|
|
14
|
+
],
|
|
15
|
+
args.baseParams.serializedParams
|
|
16
|
+
);
|
|
17
|
+
this.allowedVaults = [...decoded[2]];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
MellowWrapperAdapterContract
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { iPendleRouterAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iPendleRouterAdapterAbi;
|
|
5
|
+
class PendleRouterAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
allowedPairs;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{
|
|
14
|
+
type: "tuple[]",
|
|
15
|
+
name: "allowedPairs",
|
|
16
|
+
components: [
|
|
17
|
+
{ type: "address", name: "market" },
|
|
18
|
+
{ type: "address", name: "inputToken" },
|
|
19
|
+
{ type: "address", name: "pendleToken" },
|
|
20
|
+
{ type: "uint8", name: "status" }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
args.baseParams.serializedParams
|
|
25
|
+
);
|
|
26
|
+
this.allowedPairs = decoded[2].map((pair) => ({
|
|
27
|
+
market: pair.market,
|
|
28
|
+
inputToken: pair.inputToken,
|
|
29
|
+
pendleToken: pair.pendleToken,
|
|
30
|
+
status: pair.status
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
PendleRouterAdapterContract
|
|
36
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { iStakingRewardsAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iStakingRewardsAdapterAbi;
|
|
5
|
+
class StakingRewardsAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
stakingToken;
|
|
7
|
+
rewardsToken;
|
|
8
|
+
stakedPhantomToken;
|
|
9
|
+
referral;
|
|
10
|
+
constructor(sdk, args) {
|
|
11
|
+
super(sdk, { ...args, abi });
|
|
12
|
+
const version = Number(args.baseParams.version);
|
|
13
|
+
if (version === 310) {
|
|
14
|
+
const decoded = decodeAbiParameters(
|
|
15
|
+
[
|
|
16
|
+
{ type: "address", name: "creditManager" },
|
|
17
|
+
{ type: "address", name: "targetContract" },
|
|
18
|
+
{ type: "address", name: "stakingToken" },
|
|
19
|
+
{ type: "address", name: "rewardsToken" },
|
|
20
|
+
{ type: "address", name: "stakedPhantomToken" }
|
|
21
|
+
],
|
|
22
|
+
args.baseParams.serializedParams
|
|
23
|
+
);
|
|
24
|
+
this.stakingToken = decoded[2];
|
|
25
|
+
this.rewardsToken = decoded[3];
|
|
26
|
+
this.stakedPhantomToken = decoded[4];
|
|
27
|
+
this.referral = 0;
|
|
28
|
+
} else {
|
|
29
|
+
const decoded = decodeAbiParameters(
|
|
30
|
+
[
|
|
31
|
+
{ type: "address", name: "creditManager" },
|
|
32
|
+
{ type: "address", name: "targetContract" },
|
|
33
|
+
{ type: "address", name: "stakingToken" },
|
|
34
|
+
{ type: "address", name: "rewardsToken" },
|
|
35
|
+
{ type: "address", name: "stakedPhantomToken" },
|
|
36
|
+
{ type: "uint16", name: "referral" }
|
|
37
|
+
],
|
|
38
|
+
args.baseParams.serializedParams
|
|
39
|
+
);
|
|
40
|
+
this.stakingToken = decoded[2];
|
|
41
|
+
this.rewardsToken = decoded[3];
|
|
42
|
+
this.stakedPhantomToken = decoded[4];
|
|
43
|
+
this.referral = decoded[5];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
StakingRewardsAdapterContract
|
|
49
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { iTraderJoeRouterAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iTraderJoeRouterAdapterAbi;
|
|
5
|
+
class TraderJoeRouterAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
supportedPools;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{
|
|
14
|
+
type: "tuple[]",
|
|
15
|
+
name: "supportedPools",
|
|
16
|
+
components: [
|
|
17
|
+
{ type: "address", name: "token0" },
|
|
18
|
+
{ type: "address", name: "token1" },
|
|
19
|
+
{ type: "uint256", name: "binStep" },
|
|
20
|
+
{ type: "uint8", name: "poolVersion" }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
args.baseParams.serializedParams
|
|
25
|
+
);
|
|
26
|
+
this.supportedPools = decoded[2].map((pool) => ({
|
|
27
|
+
token0: pool.token0,
|
|
28
|
+
token1: pool.token1,
|
|
29
|
+
binStep: Number(pool.binStep),
|
|
30
|
+
poolVersion: pool.poolVersion
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
TraderJoeRouterAdapterContract
|
|
36
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { iUniswapV2AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import {
|
|
3
|
+
decodeAbiParameters
|
|
4
|
+
} from "viem";
|
|
5
|
+
import { formatBN } from "../../../sdk/index.js";
|
|
6
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
7
|
+
const abi = iUniswapV2AdapterAbi;
|
|
8
|
+
class UniswapV2AdapterContract extends AbstractAdapterContract {
|
|
9
|
+
supportedPairs;
|
|
10
|
+
constructor(sdk, args) {
|
|
11
|
+
super(sdk, { ...args, abi });
|
|
12
|
+
const decoded = decodeAbiParameters(
|
|
13
|
+
[
|
|
14
|
+
{ type: "address", name: "creditManager" },
|
|
15
|
+
{ type: "address", name: "targetContract" },
|
|
16
|
+
{
|
|
17
|
+
type: "tuple[]",
|
|
18
|
+
name: "supportedPairs",
|
|
19
|
+
components: [
|
|
20
|
+
{ type: "address", name: "token0" },
|
|
21
|
+
{ type: "address", name: "token1" }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
args.baseParams.serializedParams
|
|
26
|
+
);
|
|
27
|
+
this.supportedPairs = decoded[2].map((pair) => ({
|
|
28
|
+
token0: pair.token0,
|
|
29
|
+
token1: pair.token1
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
parseFunctionParams(params) {
|
|
33
|
+
switch (params.functionName) {
|
|
34
|
+
case "swapDiffTokensForTokens": {
|
|
35
|
+
const [leftoverAmount, rateMinRAY, path, _deadline] = params.args;
|
|
36
|
+
const leftoverAmountStr = this.sdk.tokensMeta.formatBN(
|
|
37
|
+
path[0],
|
|
38
|
+
leftoverAmount
|
|
39
|
+
);
|
|
40
|
+
const pathStr = path.map((t) => this.labelAddress(t)).join(" => ");
|
|
41
|
+
return [
|
|
42
|
+
`(leftoverAmount: ${leftoverAmountStr}, rate: ${formatBN(
|
|
43
|
+
rateMinRAY,
|
|
44
|
+
27
|
|
45
|
+
)}, path: ${pathStr}`
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
default:
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
UniswapV2AdapterContract
|
|
55
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { iUniswapV3AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import {
|
|
3
|
+
decodeAbiParameters
|
|
4
|
+
} from "viem";
|
|
5
|
+
import { formatBN } from "../../../sdk/index.js";
|
|
6
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
7
|
+
const abi = iUniswapV3AdapterAbi;
|
|
8
|
+
class UniswapV3AdapterContract extends AbstractAdapterContract {
|
|
9
|
+
supportedPools;
|
|
10
|
+
constructor(sdk, args) {
|
|
11
|
+
super(sdk, { ...args, abi });
|
|
12
|
+
const decoded = decodeAbiParameters(
|
|
13
|
+
[
|
|
14
|
+
{ type: "address", name: "creditManager" },
|
|
15
|
+
{ type: "address", name: "targetContract" },
|
|
16
|
+
{
|
|
17
|
+
type: "tuple[]",
|
|
18
|
+
name: "supportedPools",
|
|
19
|
+
components: [
|
|
20
|
+
{ type: "address", name: "token0" },
|
|
21
|
+
{ type: "address", name: "token1" },
|
|
22
|
+
{ type: "uint24", name: "fee" }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
args.baseParams.serializedParams
|
|
27
|
+
);
|
|
28
|
+
this.supportedPools = decoded[2].map((pool) => ({
|
|
29
|
+
token0: pool.token0,
|
|
30
|
+
token1: pool.token1,
|
|
31
|
+
fee: pool.fee
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
parseFunctionParams(params) {
|
|
35
|
+
switch (params.functionName) {
|
|
36
|
+
case "exactInputSingle": {
|
|
37
|
+
const [{ tokenIn, tokenOut, fee, amountIn, amountOutMinimum }] = params.args;
|
|
38
|
+
const tokenInSym = this.sdk.tokensMeta.symbol(tokenIn);
|
|
39
|
+
const tokenOutSym = this.sdk.tokensMeta.symbol(tokenOut);
|
|
40
|
+
const amountInStr = this.sdk.tokensMeta.formatBN(tokenIn, amountIn);
|
|
41
|
+
const amountOutMinimumStr = this.sdk.tokensMeta.formatBN(
|
|
42
|
+
tokenOut,
|
|
43
|
+
amountOutMinimum
|
|
44
|
+
);
|
|
45
|
+
return [
|
|
46
|
+
`(amountIn: ${amountInStr}, amountOutMinimum: ${amountOutMinimumStr}, path: ${tokenInSym} ==(fee: ${fee})==> ${tokenOutSym})`
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
case "exactDiffInputSingle": {
|
|
50
|
+
const [{ tokenIn, tokenOut, fee, leftoverAmount, rateMinRAY }] = params.args;
|
|
51
|
+
const tokenInSym = this.sdk.tokensMeta.symbol(tokenIn);
|
|
52
|
+
const tokenOutSym = this.sdk.tokensMeta.symbol(tokenOut);
|
|
53
|
+
const leftoverAmountStr = this.sdk.tokensMeta.formatBN(
|
|
54
|
+
tokenIn,
|
|
55
|
+
leftoverAmount
|
|
56
|
+
);
|
|
57
|
+
const rateStr = formatBN(rateMinRAY, 27);
|
|
58
|
+
return [
|
|
59
|
+
`(leftoverAmount: ${leftoverAmountStr}, rate: ${rateStr}, path: ${tokenInSym} ==(fee: ${fee})==> ${tokenOutSym})`
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
case "exactInput": {
|
|
63
|
+
const [{ amountIn, amountOutMinimum, path }] = params.args;
|
|
64
|
+
const pathStr = this.trackInputPath(path);
|
|
65
|
+
const token = `0x${path.replace("0x", "").slice(0, 40)}`;
|
|
66
|
+
const amountInStr = this.sdk.tokensMeta.formatBN(token, amountIn);
|
|
67
|
+
const amountOutMinimumStr = this.sdk.tokensMeta.formatBN(
|
|
68
|
+
`0x${path.slice(-40, path.length)}`,
|
|
69
|
+
amountOutMinimum
|
|
70
|
+
);
|
|
71
|
+
return [
|
|
72
|
+
`(amountIn: ${amountInStr}, amountOutMinimum: ${amountOutMinimumStr}, path: ${pathStr}`
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
case "exactDiffInput": {
|
|
76
|
+
const [{ leftoverAmount, rateMinRAY, path }] = params.args;
|
|
77
|
+
const leftoverAmountStr = this.sdk.tokensMeta.formatBN(
|
|
78
|
+
`0x${path.replace("0x", "").slice(0, 40)}`,
|
|
79
|
+
leftoverAmount
|
|
80
|
+
);
|
|
81
|
+
const pathStr = this.trackInputPath(path);
|
|
82
|
+
return [
|
|
83
|
+
`(leftoverAmount: ${leftoverAmountStr}, rate: ${formatBN(
|
|
84
|
+
rateMinRAY,
|
|
85
|
+
27
|
|
86
|
+
)}, path: ${pathStr}`
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
case "exactOutput": {
|
|
90
|
+
const [{ amountInMaximum, amountOut, path }] = params.args;
|
|
91
|
+
const pathStr = this.trackOutputPath(path);
|
|
92
|
+
const amountInMaximumStr = this.sdk.tokensMeta.formatBN(
|
|
93
|
+
`0x${path.slice(-40, path.length)}`,
|
|
94
|
+
amountInMaximum
|
|
95
|
+
);
|
|
96
|
+
const amountOutStr = this.sdk.tokensMeta.formatBN(
|
|
97
|
+
`0x${path.replace("0x", "").slice(0, 40)}`,
|
|
98
|
+
amountOut
|
|
99
|
+
);
|
|
100
|
+
return [
|
|
101
|
+
`(amountInMaximum: ${amountInMaximumStr}, amountOut: ${amountOutStr}, path: ${pathStr}`
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
case "exactOutputSingle": {
|
|
105
|
+
const [{ tokenIn, tokenOut, fee, amountOut, amountInMaximum }] = params.args;
|
|
106
|
+
const tokenInSym = this.sdk.tokensMeta.symbol(tokenIn);
|
|
107
|
+
const tokenOutSym = this.sdk.tokensMeta.symbol(tokenOut);
|
|
108
|
+
const amountInMaximumStr = this.sdk.tokensMeta.formatBN(
|
|
109
|
+
tokenIn,
|
|
110
|
+
amountInMaximum
|
|
111
|
+
);
|
|
112
|
+
const amountOutStr = this.sdk.tokensMeta.formatBN(tokenOut, amountOut);
|
|
113
|
+
return [
|
|
114
|
+
`(amountInMaximum: ${amountInMaximumStr}, amountOut: ${amountOutStr}, path: ${tokenInSym} ==(fee: ${fee})==> ${tokenOutSym})`
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
default:
|
|
118
|
+
return void 0;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
trackInputPath(path) {
|
|
122
|
+
let result = "";
|
|
123
|
+
let pointer = path.startsWith("0x") ? 2 : 0;
|
|
124
|
+
while (pointer <= path.length - 40) {
|
|
125
|
+
const from = `0x${path.slice(
|
|
126
|
+
pointer,
|
|
127
|
+
pointer + 40
|
|
128
|
+
)}`.toLowerCase();
|
|
129
|
+
result += this.sdk.tokensMeta.symbol(from) || from;
|
|
130
|
+
pointer += 40;
|
|
131
|
+
if (pointer > path.length - 6) return result;
|
|
132
|
+
const fee = parseInt(path.slice(pointer, pointer + 6), 16);
|
|
133
|
+
pointer += 6;
|
|
134
|
+
result += ` ==(fee: ${fee})==> `;
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
trackOutputPath(path) {
|
|
139
|
+
let result = "";
|
|
140
|
+
let pointer = path.length;
|
|
141
|
+
while (pointer >= 40) {
|
|
142
|
+
pointer -= 40;
|
|
143
|
+
const from = `0x${path.slice(pointer, pointer + 40)}`;
|
|
144
|
+
result += this.sdk.tokensMeta.symbol(from) || from;
|
|
145
|
+
if (pointer < 6) return result;
|
|
146
|
+
pointer -= 6;
|
|
147
|
+
const fee = parseInt(path.slice(pointer, pointer + 6), 16);
|
|
148
|
+
result += ` ==(fee: ${fee})==> `;
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
UniswapV3AdapterContract
|
|
155
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { iUpshiftVaultAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iUpshiftVaultAdapterAbi;
|
|
5
|
+
class UpshiftVaultAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
vault;
|
|
7
|
+
asset;
|
|
8
|
+
stakedPhantomToken;
|
|
9
|
+
constructor(sdk, args) {
|
|
10
|
+
super(sdk, { ...args, abi });
|
|
11
|
+
const decoded = decodeAbiParameters(
|
|
12
|
+
[
|
|
13
|
+
{ type: "address", name: "creditManager" },
|
|
14
|
+
{ type: "address", name: "targetContract" },
|
|
15
|
+
{ type: "address", name: "vault" },
|
|
16
|
+
{ type: "address", name: "asset" },
|
|
17
|
+
{ type: "address", name: "stakedPhantomToken" }
|
|
18
|
+
],
|
|
19
|
+
args.baseParams.serializedParams
|
|
20
|
+
);
|
|
21
|
+
this.vault = decoded[2];
|
|
22
|
+
this.asset = decoded[3];
|
|
23
|
+
this.stakedPhantomToken = decoded[4];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
UpshiftVaultAdapterContract
|
|
28
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { iVelodromeV2RouterAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iVelodromeV2RouterAdapterAbi;
|
|
5
|
+
class VelodromeV2RouterAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
supportedPools;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{
|
|
14
|
+
type: "tuple[]",
|
|
15
|
+
name: "supportedPools",
|
|
16
|
+
components: [
|
|
17
|
+
{ type: "address", name: "token0" },
|
|
18
|
+
{ type: "address", name: "token1" },
|
|
19
|
+
{ type: "bool", name: "stable" },
|
|
20
|
+
{ type: "address", name: "factory" }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
args.baseParams.serializedParams
|
|
25
|
+
);
|
|
26
|
+
this.supportedPools = decoded[2].map((pool) => ({
|
|
27
|
+
token0: pool.token0,
|
|
28
|
+
token1: pool.token1,
|
|
29
|
+
stable: pool.stable,
|
|
30
|
+
factory: pool.factory
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
VelodromeV2RouterAdapterContract
|
|
36
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { iwstEthv1AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iwstEthv1AdapterAbi;
|
|
5
|
+
class WstETHV1AdapterContract extends AbstractAdapterContract {
|
|
6
|
+
stETH;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{ type: "address", name: "stETH" }
|
|
14
|
+
],
|
|
15
|
+
args.baseParams.serializedParams
|
|
16
|
+
);
|
|
17
|
+
this.stETH = decoded[2];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
WstETHV1AdapterContract
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { iYearnV2AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iYearnV2AdapterAbi;
|
|
5
|
+
class YearnV2RouterAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
token;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{ type: "address", name: "token" }
|
|
14
|
+
],
|
|
15
|
+
args.baseParams.serializedParams
|
|
16
|
+
);
|
|
17
|
+
this.token = decoded[2];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
YearnV2RouterAdapterContract
|
|
22
|
+
};
|