@defisaver/sdk 1.3.27-midnight-dev → 1.3.28
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/esm/src/Action.js +5 -23
- package/esm/src/actions/aaveV3/AaveV3DelegateCredit.d.ts +1 -1
- package/esm/src/actions/aaveV3/AaveV3DelegateCredit.js +1 -1
- package/esm/src/actions/etherfi/EtherFiStakeFromLidoAction.d.ts +20 -0
- package/esm/src/actions/etherfi/EtherFiStakeFromLidoAction.js +41 -0
- package/esm/src/actions/etherfi/index.d.ts +1 -0
- package/esm/src/actions/etherfi/index.js +1 -0
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.d.ts +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.js +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.d.ts +2 -4
- package/esm/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.js +6 -12
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.d.ts +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.js +1 -1
- package/esm/src/actions/index.d.ts +1 -2
- package/esm/src/actions/index.js +1 -2
- package/esm/src/actions/uniswap/UniswapClaimAction.d.ts +16 -0
- package/esm/src/actions/uniswap/UniswapClaimAction.js +23 -0
- package/esm/src/actions/uniswap/index.d.ts +1 -0
- package/esm/src/actions/uniswap/index.js +1 -0
- package/esm/src/addresses.d.ts +20 -44
- package/esm/src/addresses.js +29 -25
- package/esm/src/index.d.ts +80 -176
- package/package.json +1 -1
- package/src/Action.ts +5 -21
- package/src/actions/aaveV3/AaveV3DelegateCredit.ts +1 -1
- package/src/actions/etherfi/EtherFiStakeFromLidoAction.ts +38 -0
- package/src/actions/etherfi/index.ts +2 -1
- package/src/actions/flashloan/AaveV3FlashLoanAction.ts +1 -1
- package/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.ts +7 -13
- package/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.ts +1 -1
- package/src/actions/index.ts +0 -2
- package/src/actions/uniswap/UniswapClaimAction.ts +31 -0
- package/src/actions/uniswap/index.ts +2 -1
- package/src/addresses.ts +29 -26
- package/test/actions/etherFi/EtherFiStakeFromLidoAction.js +40 -0
- package/test/actions/uniswap/UniswapClaimAction.js +31 -0
- package/umd/index.js +796 -915
- package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.d.ts +0 -18
- package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.js +0 -28
- package/esm/src/actions/midnight/MidnightPaybackDirectAction.d.ts +0 -16
- package/esm/src/actions/midnight/MidnightPaybackDirectAction.js +0 -24
- package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.d.ts +0 -18
- package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.js +0 -28
- package/esm/src/actions/midnight/MidnightSupplyCollateralAction.d.ts +0 -17
- package/esm/src/actions/midnight/MidnightSupplyCollateralAction.js +0 -26
- package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.d.ts +0 -17
- package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.js +0 -26
- package/esm/src/actions/midnight/index.d.ts +0 -5
- package/esm/src/actions/midnight/index.js +0 -5
- package/src/actions/midnight/MidnightBorrowFromOrdersAction.ts +0 -44
- package/src/actions/midnight/MidnightPaybackDirectAction.ts +0 -36
- package/src/actions/midnight/MidnightPaybackFromOrdersAction.ts +0 -44
- package/src/actions/midnight/MidnightSupplyCollateralAction.ts +0 -39
- package/src/actions/midnight/MidnightWithdrawCollateralAction.ts +0 -39
- package/src/actions/midnight/index.ts +0 -5
package/package.json
CHANGED
package/src/Action.ts
CHANGED
|
@@ -101,30 +101,14 @@ export class Action {
|
|
|
101
101
|
|
|
102
102
|
_parseParamType(paramType:string | ParamTypes, arg:Args) {
|
|
103
103
|
if (typeof (paramType) === 'string') {
|
|
104
|
+
if (paramType.startsWith('(')) {
|
|
105
|
+
let _paramType = paramType.replace('(', '');
|
|
106
|
+
_paramType = _paramType.replace(')', '');
|
|
107
|
+
return _paramType.split(',');
|
|
108
|
+
}
|
|
104
109
|
if (paramType.endsWith('[]')) {
|
|
105
110
|
return Array.from(Array(arg.length).fill(paramType.replace('[]', '')));
|
|
106
111
|
}
|
|
107
|
-
if (paramType.startsWith('(') || paramType.startsWith('tuple(')) {
|
|
108
|
-
const tupleStart = paramType.indexOf('(');
|
|
109
|
-
const tupleEnd = paramType.lastIndexOf(')');
|
|
110
|
-
const tupleContents = paramType.slice(tupleStart + 1, tupleEnd);
|
|
111
|
-
const tupleTypes = [];
|
|
112
|
-
let currentType = '';
|
|
113
|
-
let nestingDepth = 0;
|
|
114
|
-
|
|
115
|
-
for (const character of tupleContents) {
|
|
116
|
-
if (character === ',' && nestingDepth === 0) {
|
|
117
|
-
tupleTypes.push(currentType);
|
|
118
|
-
currentType = '';
|
|
119
|
-
} else {
|
|
120
|
-
currentType += character;
|
|
121
|
-
if (character === '(') nestingDepth += 1;
|
|
122
|
-
if (character === ')') nestingDepth -= 1;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
tupleTypes.push(currentType);
|
|
126
|
-
return tupleTypes;
|
|
127
|
-
}
|
|
128
112
|
}
|
|
129
113
|
return paramType;
|
|
130
114
|
}
|
|
@@ -16,7 +16,7 @@ export class AaveV3DelegateCredit extends ActionWithL2 {
|
|
|
16
16
|
* @param amount Amount of tokens to be payed back
|
|
17
17
|
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
18
18
|
* @param assetId The id of the token to be borrowed
|
|
19
|
-
* @param delegatee The
|
|
19
|
+
* @param delegatee The address of the delegatee to be credited
|
|
20
20
|
*/
|
|
21
21
|
constructor(useOnDefaultMarket: boolean, market:EthAddress, amount:uint256, rateMode:uint8, assetId:uint16, delegatee:EthAddress) {
|
|
22
22
|
super('AaveV3DelegateCredit', getAddr('Empty'),
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
2
|
+
import { Action } from '../../Action';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
import { EthAddress, uint256 } from '../../types';
|
|
5
|
+
import { requireAddress } from '../../utils/general';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* EtherFiStakeFromLidoAction - Converts wstETH to weETH through Ether.fi's Lido staking route
|
|
9
|
+
*
|
|
10
|
+
* @category EtherFi
|
|
11
|
+
*/
|
|
12
|
+
export class EtherFiStakeFromLidoAction extends Action {
|
|
13
|
+
/**
|
|
14
|
+
* @param amount - amount of wstETH to pull
|
|
15
|
+
* @param minAmountOut - minimum amount of weETH to receive
|
|
16
|
+
* @param from - address from which to pull wstETH
|
|
17
|
+
* @param to - address where received weETH will be sent
|
|
18
|
+
*/
|
|
19
|
+
constructor(amount:uint256, minAmountOut:uint256, from:EthAddress, to:EthAddress) {
|
|
20
|
+
requireAddress(to);
|
|
21
|
+
super(
|
|
22
|
+
'EtherFiStakeFromLido',
|
|
23
|
+
getAddr('EtherFiStakeFromLido'),
|
|
24
|
+
['uint256', 'uint256', 'address', 'address'],
|
|
25
|
+
[amount, minAmountOut, from, to],
|
|
26
|
+
);
|
|
27
|
+
this.mappableArgs = [
|
|
28
|
+
this.args[0],
|
|
29
|
+
this.args[1],
|
|
30
|
+
this.args[2],
|
|
31
|
+
this.args[3],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getAssetsToApprove() {
|
|
36
|
+
return [{ asset: getAssetInfo('WSTETH').address, owner: this.args[2] }];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -9,27 +9,21 @@ import { EthAddress, uint256, bytes } from '../../types';
|
|
|
9
9
|
*/
|
|
10
10
|
export class AaveV3FlashLoanCarryDebtAction extends ActionWithL2 {
|
|
11
11
|
/**
|
|
12
|
-
* @param loanAmounts
|
|
13
12
|
* @param tokens
|
|
14
|
-
* @param
|
|
15
|
-
* @param loanPayer
|
|
13
|
+
* @param loanAmounts
|
|
16
14
|
* @param flParamGetterAddr
|
|
17
15
|
* @param flParamGetterData
|
|
18
16
|
*/
|
|
19
|
-
constructor(tokens:Array<EthAddress>, loanAmounts:Array<uint256>,
|
|
17
|
+
constructor(tokens:Array<EthAddress>, loanAmounts:Array<uint256>, flParamGetterAddr:EthAddress = getAddr('Empty'), flParamGetterData:bytes = []) {
|
|
18
|
+
if (tokens.length !== loanAmounts.length) {
|
|
19
|
+
throw new Error('Tokens and loan amounts must be of the same length');
|
|
20
|
+
}
|
|
21
|
+
const modes: Array<uint256> = Array(tokens.length).fill(2); // always use variable borrow rate
|
|
20
22
|
super(
|
|
21
23
|
'FLAaveV3CarryDebt',
|
|
22
24
|
getAddr('FLAaveV3CarryDebt'),
|
|
23
25
|
['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'],
|
|
24
|
-
[tokens, loanAmounts, modes,
|
|
26
|
+
[tokens, loanAmounts, modes, getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
25
27
|
);
|
|
26
|
-
if (tokens.length !== modes.length || tokens.length !== loanAmounts.length) {
|
|
27
|
-
throw new Error('Arrays must be of the same length');
|
|
28
|
-
}
|
|
29
|
-
modes.forEach((mode) => {
|
|
30
|
-
if (mode.toString() !== '1' && mode.toString() !== '2') {
|
|
31
|
-
throw new Error('Invalid borrow mode set');
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
28
|
}
|
|
35
29
|
}
|
|
@@ -9,8 +9,8 @@ import { EthAddress, uint256, bytes } from '../../types';
|
|
|
9
9
|
*/
|
|
10
10
|
export class AaveV3FlashLoanNoFeeAction extends ActionWithL2 {
|
|
11
11
|
/**
|
|
12
|
-
* @param loanAmounts
|
|
13
12
|
* @param tokens
|
|
13
|
+
* @param loanAmounts
|
|
14
14
|
* @param modes
|
|
15
15
|
* @param loanPayer
|
|
16
16
|
* @param flParamGetterAddr
|
package/src/actions/index.ts
CHANGED
|
@@ -40,7 +40,6 @@ import * as fluid from './fluid';
|
|
|
40
40
|
import * as pendle from './pendle';
|
|
41
41
|
import * as umbrella from './umbrella';
|
|
42
42
|
import * as aaveV4 from './aavev4';
|
|
43
|
-
import * as midnight from './midnight';
|
|
44
43
|
|
|
45
44
|
export {
|
|
46
45
|
aave,
|
|
@@ -85,5 +84,4 @@ export {
|
|
|
85
84
|
pendle,
|
|
86
85
|
umbrella,
|
|
87
86
|
aaveV4,
|
|
88
|
-
midnight,
|
|
89
87
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256, bytes32 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* UniswapClaimAction - Claims UNI tokens from the Uniswap merkle distributor
|
|
7
|
+
*
|
|
8
|
+
* @category Uniswap
|
|
9
|
+
*/
|
|
10
|
+
export class UniswapClaimAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param index - Index of the claim in the merkle tree
|
|
13
|
+
* @param to - Address where to send the claimed UNI
|
|
14
|
+
* @param amount - Amount of UNI allocated to the smart wallet in the merkle tree
|
|
15
|
+
* @param merkleProof - Merkle proof of the claim
|
|
16
|
+
*/
|
|
17
|
+
constructor(index: uint256, to: EthAddress, amount: uint256, merkleProof: Array<bytes32>) {
|
|
18
|
+
super(
|
|
19
|
+
'UniswapClaim',
|
|
20
|
+
getAddr('UniswapClaim'),
|
|
21
|
+
['uint256', 'address', 'uint256', 'bytes32[]'],
|
|
22
|
+
[index, to, amount, merkleProof],
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
this.mappableArgs = [
|
|
26
|
+
this.args[0],
|
|
27
|
+
this.args[1],
|
|
28
|
+
this.args[2],
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -95,6 +95,7 @@ export const actionAddresses = {
|
|
|
95
95
|
AaveV3ATokenPayback: '0xDe5c012cd1878D86E91309593764895a3adb380E',
|
|
96
96
|
AaveV3View: '0x0CB0170F3413e54405F64d3C23BA3A1D8Bb96D99',
|
|
97
97
|
AaveV3DelegateWithSig: '0x9253E22Ce4f0AeE541301CF8cC29843f9083a1F4',
|
|
98
|
+
AaveV3DelegateCredit: '0xa7ab39edCb0a1b742DCd908EC6CFe178d8322580',
|
|
98
99
|
GhoClaimAAVE: '0xA53060d822cB31AFd5B26D899130a14E8Efc5917',
|
|
99
100
|
GhoUnstake: '0x3fD02e65B4fb12381946D03815Ff3FF8Ebe2fC63',
|
|
100
101
|
GhoStake: '0x6cfBFd04702f3b7d4fc52D457eDf91D6E4A081bb',
|
|
@@ -147,7 +148,7 @@ export const actionAddresses = {
|
|
|
147
148
|
// flashloan
|
|
148
149
|
FLAaveV2: '0xEA55576383C96A69B3E8beD51Ce0d0294001bc5F',
|
|
149
150
|
FLAaveV3NoFee: '0xd9D8e68717Ce24CCbf162868aaad7E38d81b05d1',
|
|
150
|
-
FLAaveV3CarryDebt: '
|
|
151
|
+
FLAaveV3CarryDebt: '0x8225D3833D88BD1420E7d25e69A00F1A27aB9143',
|
|
151
152
|
FLAaveV3: '0x5021d70aB7D757D61E0230c472ff89b8B2B8705e',
|
|
152
153
|
FLDyDx: '0x08AC78B418fCB0DDF1096533856A757C28d430d7',
|
|
153
154
|
FLMaker: '0x0f8C3368cADF78167F5355D746Ed7b2A826A6e3b',
|
|
@@ -161,6 +162,7 @@ export const actionAddresses = {
|
|
|
161
162
|
// uniswap
|
|
162
163
|
UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
|
|
163
164
|
UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
|
|
165
|
+
UniswapClaim: '0x4Eed50e142BFaE83b2d05ce960C55F4c536d123f',
|
|
164
166
|
|
|
165
167
|
// uniswap V3
|
|
166
168
|
UniCollectV3: '0x331D7C3F6E710cB6cFE94c4Aa04AC3345AC00e00',
|
|
@@ -298,7 +300,7 @@ export const actionAddresses = {
|
|
|
298
300
|
CurveUsdSwapper: '0xFA8c594b903651F97b27aCADEa83b720cfD7F80b',
|
|
299
301
|
CurveUsdSwapperTransient:
|
|
300
302
|
'0xcF0298592b8FCB3823d31Bb257b65afFCAcCb8b6',
|
|
301
|
-
CurveUsdSelfLiquidate: '
|
|
303
|
+
CurveUsdSelfLiquidate: '0x0B21996Fc90993f975D8279bE8ff2D34518da79C',
|
|
302
304
|
CurveUsdSelfLiquidateWithColl:
|
|
303
305
|
'0x7cE305FC2A18c6820a533AD418dC0A549aFeDcAF',
|
|
304
306
|
CurveUsdGetDebt: '0x3Bb41d3f300dA758780fe7696bb4fB93cD7172fB',
|
|
@@ -333,7 +335,7 @@ export const actionAddresses = {
|
|
|
333
335
|
LlamaLendBorrow: '0xCF693585C47049F3eACc2285E7Fe4e80123b2520',
|
|
334
336
|
LlamaLendWithdraw: '0x5aEb07Ce4A49b7EaE2A1e5281768cFc0C3e1d8F3',
|
|
335
337
|
LlamaLendPayback: '0x07e31d56E47EE6926892dCd928dF26899F58Ac8E',
|
|
336
|
-
LlamaLendSelfLiquidate: '
|
|
338
|
+
LlamaLendSelfLiquidate: '0xF0D7b730B40b02Ad555E27CFe5FAF43D6a75dfba',
|
|
337
339
|
LlamaLendGetDebt: '0x5625ea9fcd930d5f131b0261ec4dcaf279fea4ed',
|
|
338
340
|
LlamaLendBoost: '0xa21c1ce7318c6d38a10de44c2cd5d80514437d85',
|
|
339
341
|
LlamaLendRepay: '0x57693f72E628A3F7323D31De35Bd158493Aa9CC0',
|
|
@@ -356,6 +358,7 @@ export const actionAddresses = {
|
|
|
356
358
|
|
|
357
359
|
// etherFi
|
|
358
360
|
EtherFiStake: '0xcadB650B6a60C89f7847Cba555A7eeCC220EA2e8',
|
|
361
|
+
EtherFiStakeFromLido: '0xd4815aa46fc39e667fd7ab3194458639b59bcd82',
|
|
359
362
|
EtherFiWrap: '0x086464be5c73f66cfbe6b64ec23aa5a86749ef58',
|
|
360
363
|
EtherFiUnwrap: '0x6Eb09948DDf9332d628d156950b9B1C0c091e8D8',
|
|
361
364
|
|
|
@@ -363,9 +366,9 @@ export const actionAddresses = {
|
|
|
363
366
|
|
|
364
367
|
// fluid
|
|
365
368
|
FluidVaultT1Open: '0x372404335C05C2493Ff156Ef60cC0B286f6f2971',
|
|
366
|
-
FluidVaultT1Adjust: '
|
|
369
|
+
FluidVaultT1Adjust: '0x0Dfe1e40F3DA8687a68824022176bE547Ecc0906',
|
|
367
370
|
FluidVaultT1Borrow: '0x36AF0cE762a016e8b4a80c70Af406DFcBc1FCbD4',
|
|
368
|
-
FluidVaultT1Payback: '
|
|
371
|
+
FluidVaultT1Payback: '0x8D56b267C6a3e5295EFAebC67Ac413483c885C05',
|
|
369
372
|
FluidVaultT1Withdraw: '0x5673b9ab4A035C5C7474C344664Be91DaFafa17E',
|
|
370
373
|
FluidVaultT1Supply: '0x0c6100209D8A0bb14CC7d18e45dA1bd1E7a3a187',
|
|
371
374
|
FluidView: '0xc8df052bD7A8d76a34c09e758Dff3c6298C0115c',
|
|
@@ -374,7 +377,7 @@ export const actionAddresses = {
|
|
|
374
377
|
FluidDexOpen: '0x071e1369E1c9030Aa1a089bDE2F72797a14FE3b3',
|
|
375
378
|
FluidDexSupply: '0xB3BE39850d8939Cceb4Fc49c415c428548FA9f9C',
|
|
376
379
|
FluidDexBorrow: '0x3fa8EF6DA8f5b2BaAee77493a3A3dA68a7Aa75f3',
|
|
377
|
-
FluidDexPayback: '
|
|
380
|
+
FluidDexPayback: '0x12D0D7c4c2c5304E5ba96A019E0F092FdF555123',
|
|
378
381
|
FluidDexWithdraw: '0x14d5bb8E96fbf7C1f9A8E3EFD0eF5fe6832ff3cd',
|
|
379
382
|
|
|
380
383
|
// pendle
|
|
@@ -438,13 +441,14 @@ export const actionAddresses = {
|
|
|
438
441
|
AaveV3Withdraw: '0xf19d045f6cFc04A5Ee5E0e8837b565b9f276e3F7',
|
|
439
442
|
AaveV3ClaimRewards: '0xBE8e8cea67085F869C1C0040fD52F9F3115E962e',
|
|
440
443
|
AaveV3DelegateWithSig: '0x8dd05d32fB05E8c3e8F37294e6f2d13e5823a712',
|
|
441
|
-
AaveV3DelegateCredit: '
|
|
444
|
+
AaveV3DelegateCredit: '0x11E7B19195a76D2E5A4863cf6cbE8030443c729A',
|
|
442
445
|
|
|
443
446
|
// flashloan
|
|
444
447
|
FLAaveV3NoFee: '0xfbcF23D2BeF8A2C491cfa4dD409D8dF12d431c85',
|
|
445
448
|
FLAaveV3: '0x8A07E93d2B74A80D726eE4E4A0aC1F906aB5Cc63',
|
|
446
449
|
FLBalancer: '0x79d6bf536b8DD65909a3174C87eA6395310d5c41',
|
|
447
450
|
FLAction: '0xB57b666dAB46229e2b80113b5187F6DCD91AB159',
|
|
451
|
+
FLAaveV3CarryDebt: '0x4ab7a392aF23215A9049A64F3B2d44726aD2D6fe',
|
|
448
452
|
|
|
449
453
|
AaveV3RatioTrigger: '0xB76e3f7694589D0f34ba43b17AD0D15350Ab5f85',
|
|
450
454
|
GasFeeTakerL2: '0xB3dB299622A9DB0E944ccda2Ef899d6fF365B082',
|
|
@@ -508,6 +512,7 @@ export const actionAddresses = {
|
|
|
508
512
|
AaveV3Withdraw: '0xbf492F869DdB1A18BB4F41b6c3059D9f882Fe7ff',
|
|
509
513
|
AaveV3ClaimRewards: '0x3a4d72Ed2a47a409a82ba61f0fca1C749Ea8aB66',
|
|
510
514
|
AaveV3DelegateWithSig: '0xFF2CE05250d1880f0f45ea8fB453292CABA42F12',
|
|
515
|
+
AaveV3DelegateCredit: '0x8C13353e3DA67d3171D6F73751E3caa791a3AACD',
|
|
511
516
|
|
|
512
517
|
// CompV3
|
|
513
518
|
CompV3Allow: '0x0380E8e13CdE0499c720999930CaA07A5744887c',
|
|
@@ -525,6 +530,7 @@ export const actionAddresses = {
|
|
|
525
530
|
FLUniV3: '0xf041C72e201CD7d04a240fe06c5783E2Ee2D92b3', // @DEV - incorrect, same as FLAction
|
|
526
531
|
FLAction: '0xf041C72e201CD7d04a240fe06c5783E2Ee2D92b3',
|
|
527
532
|
FLMorphoBlue: '0xf041C72e201CD7d04a240fe06c5783E2Ee2D92b3',
|
|
533
|
+
FLAaveV3CarryDebt: '0xEc6Db90d9EFa7cD75d5b716896A497e9d9103D5b',
|
|
528
534
|
|
|
529
535
|
GasFeeTakerL2: '0x2F64f73B222B4978CAfd0295c0fa106cE5f34996',
|
|
530
536
|
AaveV3RatioCheck: '0x4a5c2cbCFB921b596Dec049389899CC8Eb4678ED',
|
|
@@ -542,7 +548,7 @@ export const actionAddresses = {
|
|
|
542
548
|
LlamaLendBorrow: '0x4948135f8b3a8f3b51fbd1050f5d0f755accb8e7',
|
|
543
549
|
LlamaLendWithdraw: '0xd7a80e7a2296d75cd1eebc2f0de0cebd14fbe117',
|
|
544
550
|
LlamaLendPayback: '0xB2B93495dA2Fee8F92513fBBfA804564110B63ee',
|
|
545
|
-
LlamaLendSelfLiquidate: '
|
|
551
|
+
LlamaLendSelfLiquidate: '0xC330F048B15CA5aadF34A9033B3a24c65200230A',
|
|
546
552
|
LlamaLendGetDebt: '0x81c01f08b8fc4487501c88404ed17ebc17764f9c',
|
|
547
553
|
LlamaLendBoost: '0xc52a3af27696f8cf999463f3455e23440a376f8d',
|
|
548
554
|
LlamaLendRepay: '0x320fdfa922ee33c1cc8a042ada855c9dfe9bed06',
|
|
@@ -552,16 +558,16 @@ export const actionAddresses = {
|
|
|
552
558
|
|
|
553
559
|
// fluid
|
|
554
560
|
FluidVaultT1Open: '0x1947Ce90ACCf0E243CcF85140fCceC2EfAeeA193',
|
|
555
|
-
FluidVaultT1Adjust: '
|
|
561
|
+
FluidVaultT1Adjust: '0x212bB7577B6b302450860E128Eb73Eb2F83514c7',
|
|
556
562
|
FluidVaultT1Borrow: '0x499da89aD564F5D6C828259ce55F53Fa288e7Be7',
|
|
557
|
-
FluidVaultT1Payback: '
|
|
563
|
+
FluidVaultT1Payback: '0x19FF948437B7f1221173effC029739568F5f844a',
|
|
558
564
|
FluidVaultT1Withdraw: '0xc13d93227d97197e5F1751d0a3e80c1080A5fa2B',
|
|
559
565
|
FluidVaultT1Supply: '0xBCF0Dc5bb2C4434AD07369207904F5900d391b0B',
|
|
560
566
|
FluidView: '0xf9e6d5568887ac8eC6fA33B7eefD2A176A958e71',
|
|
561
567
|
FluidDexOpen: '0xA456f13d358B8B93bE6778be3244111E267C0AaC',
|
|
562
568
|
FluidDexSupply: '0x3E49c4f914E01e5612719a7B4965e4FAfb324762',
|
|
563
569
|
FluidDexBorrow: '0x8626b70CDf64e557fDdcFbcb783833Dc314d95F4',
|
|
564
|
-
FluidDexPayback: '
|
|
570
|
+
FluidDexPayback: '0x72b9AAf4864631976D764574f4780B1562CCF0F4',
|
|
565
571
|
FluidDexWithdraw: '0x076D5434793798b153298bF70b014f5E6145aB2E',
|
|
566
572
|
|
|
567
573
|
// summer.fi
|
|
@@ -616,6 +622,7 @@ export const actionAddresses = {
|
|
|
616
622
|
FLUniV3: '0x1bA6082D2ef1aB92a55B96264c72Eb8049C964Ce',
|
|
617
623
|
FLAction: '0x87Af4769e4134379125A262408e1f3EC60d2Ab52', // fix temp
|
|
618
624
|
FLMorphoBlue: '0x87Af4769e4134379125A262408e1f3EC60d2Ab52',
|
|
625
|
+
FLAaveV3CarryDebt: '0x760e97862DD8652e5BB8b4D8ad9C99a74BBe7E7A',
|
|
619
626
|
|
|
620
627
|
// AaveV3
|
|
621
628
|
AaveV3Withdraw: '0x1d2Fa7dAcC660A9124c3685EE8a6E699d10409Eb',
|
|
@@ -630,6 +637,7 @@ export const actionAddresses = {
|
|
|
630
637
|
AaveV3ATokenPayback: '0x3D57875885e3cEe9E56Cb65D21789893B6e67815',
|
|
631
638
|
AaveV3View: '0xf140B2904beb743C2f17e0b5f766074212a7e243',
|
|
632
639
|
AaveV3DelegateWithSig: '0x9e295AFaC75E7843b88a563D119FD953EDf441c2',
|
|
640
|
+
AaveV3DelegateCredit: '0xF85aD63c513A76a1dc05B2AddC4777F17336c7e9',
|
|
633
641
|
|
|
634
642
|
// CompV3
|
|
635
643
|
CompV3Allow: '0x3Fe56B85BBcD759459408Bd8434c37bac93e26bF',
|
|
@@ -659,16 +667,16 @@ export const actionAddresses = {
|
|
|
659
667
|
|
|
660
668
|
// fluid
|
|
661
669
|
FluidVaultT1Open: '0xCd4d5896AEAf97e738d3E7215ac01c2CF97474bc',
|
|
662
|
-
FluidVaultT1Adjust: '
|
|
670
|
+
FluidVaultT1Adjust: '0x2f7839a733B93641aa6a6AF0b593202335c351D3',
|
|
663
671
|
FluidVaultT1Borrow: '0x8dCBF436cC0971FE29886E58CE0CAeb36d43E91E',
|
|
664
|
-
FluidVaultT1Payback: '
|
|
672
|
+
FluidVaultT1Payback: '0xD4cEe5755e4f713B69f5Fc73068505ec6B9ee2a2',
|
|
665
673
|
FluidVaultT1Withdraw: '0x26bE6a2EdE97aE826ed9DA8Fb79428037fe55cEB',
|
|
666
674
|
FluidVaultT1Supply: '0x028ACA45244d4897ff80ef65ed0b735Bb0D4B0A5',
|
|
667
675
|
FluidView: '0x6cd4D6af4F292817eA2A2311F099dF26cd015028',
|
|
668
676
|
FluidDexOpen: '0x5eA8Da9679145D51F5eAEC8Bf2f42f47003A8799',
|
|
669
677
|
FluidDexSupply: '0x2fCb7db80d3Be5C1B0049dF074b1AcFbcA93A867',
|
|
670
678
|
FluidDexBorrow: '0x9D40776a876fA67C6757DA386434844cB6616C5F',
|
|
671
|
-
FluidDexPayback: '
|
|
679
|
+
FluidDexPayback: '0xcaa8877aD3847B428135653AcA5fAd13a2811483',
|
|
672
680
|
FluidDexWithdraw: '0xEaBA867c49FE8e53F5716fFF8857F239bd7202e1',
|
|
673
681
|
|
|
674
682
|
TokenizedVaultAdapter: '0x88cf6cfa51b6f771570f6df450edf1c886212d3e',
|
|
@@ -677,13 +685,6 @@ export const actionAddresses = {
|
|
|
677
685
|
SFApproveTokens: '0x03EDC9A683f37BFB7516FF234223fFb6E38D5eb9',
|
|
678
686
|
SummerfiUnsub: '0x0000000000000000000000000000000000000000', // Only exists for Maker on Mainnet
|
|
679
687
|
SummerfiUnsubV2: '0x60587B8Fe62Fc149d285a611822263206b4138da',
|
|
680
|
-
|
|
681
|
-
MidnightPaybackDirect: '0xC1B049A038f9E9811dc1Ad1D335369844d4268D9',
|
|
682
|
-
MidnightBorrowFromOrders: '0x82F9dd7eA821463178A2c7bC4047057Bd338E5e5',
|
|
683
|
-
MidnightPaybackFromOrders: '0x4B0c242195B1C941A2e7a871Bfa242c40dbf032F',
|
|
684
|
-
MidnightSupplyCollateral: '0xC83C7Ca37203FC30636EDcd3Ef127194542504c5',
|
|
685
|
-
MidnightWithdrawCollateral: '0x4fA4DA5fDD813279409B4Bf0Bde5Fe9ca8006A9C',
|
|
686
|
-
MidnightView: '0x3aa272f329E8B562A3bA56Bb6979a44D23A28839',
|
|
687
688
|
},
|
|
688
689
|
[NETWORKS.linea.chainId]: {
|
|
689
690
|
// Basic
|
|
@@ -707,6 +708,7 @@ export const actionAddresses = {
|
|
|
707
708
|
// Flashloan
|
|
708
709
|
FLAction: '0x04ce4b2a9F524d976a8eD8a49B9313C5a2C3ccAD', // fix temp
|
|
709
710
|
FLAaveV3: '0x04ce4b2a9F524d976a8eD8a49B9313C5a2C3ccAD',
|
|
711
|
+
FLAaveV3CarryDebt: '0x862E533198C9656B75bB6A5dDF0953F7ED5E8507',
|
|
710
712
|
|
|
711
713
|
// AaveV3
|
|
712
714
|
AaveV3Withdraw: '0xae56474aBe3C271579b513b6668864e39f65Ae15',
|
|
@@ -719,7 +721,7 @@ export const actionAddresses = {
|
|
|
719
721
|
AaveV3ATokenPayback: '0xedfc68e2874b0afc0963e18ae4d68522aec7f97d',
|
|
720
722
|
AaveV3View: '0xc9d6efa6e08b66a5cdc516bcd5807c2fa69e0f2a',
|
|
721
723
|
AaveV3DelegateWithSig: '0x169D6E128238ebabF86032Ae9da65938eaD7F69e',
|
|
722
|
-
AaveV3DelegateCredit: '
|
|
724
|
+
AaveV3DelegateCredit: '0x1bA6082D2ef1aB92a55B96264c72Eb8049C964Ce',
|
|
723
725
|
},
|
|
724
726
|
[NETWORKS.plasma.chainId]: {
|
|
725
727
|
// Basic
|
|
@@ -743,6 +745,7 @@ export const actionAddresses = {
|
|
|
743
745
|
// Flashloan
|
|
744
746
|
FLAction: '0x40C9ce603923AACD0b7407Ff0EE844c9C067cEB7', // fix temp
|
|
745
747
|
FLAaveV3: '0x40C9ce603923AACD0b7407Ff0EE844c9C067cEB7',
|
|
748
|
+
FLAaveV3CarryDebt: '0x6Dc6C0e38fBd066b89Ba7E6f711B4288246891b3',
|
|
746
749
|
|
|
747
750
|
// AaveV3
|
|
748
751
|
AaveV3Withdraw: '0x4839d021A24820e57C31D386d430e2e82694F73B',
|
|
@@ -755,20 +758,20 @@ export const actionAddresses = {
|
|
|
755
758
|
AaveV3ATokenPayback: '0x425fA97285965E01Cc5F951B62A51F6CDEA5cc0d',
|
|
756
759
|
AaveV3View: '0xD8E67968d8a0df4beCf2D50daE1e34d4d80C701C',
|
|
757
760
|
AaveV3DelegateWithSig: '0x49658E0CF3883c338397C7257619B280dF581057',
|
|
758
|
-
AaveV3DelegateCredit: '
|
|
761
|
+
AaveV3DelegateCredit: '0x6F53fa9e7d1323d24515a51AB72Da3cf1E9883Bc',
|
|
759
762
|
|
|
760
763
|
// Fluid
|
|
761
764
|
FluidVaultT1Open: '0x491cc4AFbE0081C3464DeF1114ba27BE114b2401',
|
|
762
|
-
FluidVaultT1Adjust: '
|
|
765
|
+
FluidVaultT1Adjust: '0xC196dC97Eb0B58E3755a71143b41D3F24595643f',
|
|
763
766
|
FluidVaultT1Borrow: '0x95a8665Ba58aa13A58c60B0803572772cda153dB',
|
|
764
|
-
FluidVaultT1Payback: '
|
|
767
|
+
FluidVaultT1Payback: '0xdeF8B05Ce194D50C376233C9C5530027f6180442',
|
|
765
768
|
FluidVaultT1Withdraw: '0xcF91546046F16B3c38b890CC508E280BEffa66b9',
|
|
766
769
|
FluidVaultT1Supply: '0x54D1b51d2d68CD0Dc877296527780CA6aff68a39',
|
|
767
770
|
FluidView: '0x27C0BAe2338cE28097122393faF90375B9395dd1',
|
|
768
771
|
FluidDexOpen: '0xF32d5d8D81f2662A02955CE537537088DF29daf5',
|
|
769
772
|
FluidDexSupply: '0x903F7C93FFC4AAbaBB096a7A722F1f057816B399',
|
|
770
773
|
FluidDexBorrow: '0xa2A878a09639D1ab3AF544566c0CA4D0FeAEE65E',
|
|
771
|
-
FluidDexPayback: '
|
|
774
|
+
FluidDexPayback: '0x3094D0D64fa5318162150720c19669d1A163937B',
|
|
772
775
|
FluidDexWithdraw: '0x17B4ecd173b3Df2F5cB02c53Df8AA34e23Bcb92E',
|
|
773
776
|
// Pendle
|
|
774
777
|
PendleTokenRedeem: '0xB4c5f33bb5791D0174Df1879b809Bf57eE540B62',
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const dfs = require('../../../src');
|
|
2
|
+
const { getAssetInfo } = require('@defisaver/tokens');
|
|
3
|
+
const { encodeForDsProxyCall, encodeForRecipe } = require('../../_actionUtils');
|
|
4
|
+
const { assert } = require('chai');
|
|
5
|
+
|
|
6
|
+
describe('Action: EtherFiStakeFromLidoAction', () => {
|
|
7
|
+
let action;
|
|
8
|
+
const amount = 100;
|
|
9
|
+
const minAmountOut = 90;
|
|
10
|
+
const from = '0x80788de454ad3681d357dc7FcB13c72333f684a7';
|
|
11
|
+
const to = '0x968Cc941aD9074EE687E0423a33E6f2D33d7c327';
|
|
12
|
+
|
|
13
|
+
it('constructor', () => {
|
|
14
|
+
action = new dfs.actions.etherfi.EtherFiStakeFromLidoAction(
|
|
15
|
+
amount,
|
|
16
|
+
minAmountOut,
|
|
17
|
+
from,
|
|
18
|
+
to,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
assert.equal(action.args[0], amount);
|
|
22
|
+
assert.equal(action.args[1], minAmountOut);
|
|
23
|
+
assert.equal(action.args[2], from);
|
|
24
|
+
assert.equal(action.args[3], to);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
|
|
28
|
+
it('encodeForRecipe', () => encodeForRecipe(action));
|
|
29
|
+
|
|
30
|
+
it('getEthValue', async () => {
|
|
31
|
+
assert.equal(await action.getEthValue(), '0');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('getAssetsToApprove', async () => {
|
|
35
|
+
const assetOwnerPairs = await action.getAssetsToApprove();
|
|
36
|
+
assert.lengthOf(assetOwnerPairs, 1);
|
|
37
|
+
assert.equal(assetOwnerPairs[0].asset, getAssetInfo('WSTETH').address);
|
|
38
|
+
assert.equal(assetOwnerPairs[0].owner, from);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const dfs = require('../../../src');
|
|
2
|
+
const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
|
|
3
|
+
const {assert} = require('chai');
|
|
4
|
+
|
|
5
|
+
describe('Action: UniswapClaimAction', () => {
|
|
6
|
+
let action;
|
|
7
|
+
context('Claim encoding', () => {
|
|
8
|
+
it('constructor', () => {
|
|
9
|
+
const index = '137';
|
|
10
|
+
const to = '0xC093dFcC2cBc4e9488589B7c2245a7F1DA043389';
|
|
11
|
+
const amount = '4809093062235489680';
|
|
12
|
+
const merkleProof = [
|
|
13
|
+
'0xd496d2a15cf30a2af545b0fd4ced50fb4224bb54e7c9add4885c7b7408c907a1',
|
|
14
|
+
'0x6a8fc6432934b1f2c9f9aed040f4389c0450dd94aff92b16864060e95fba4290',
|
|
15
|
+
'0xb7491e5e898e774e11c50044140df4c1c74bf9cd7855bac78f0709699ed0e6b7',
|
|
16
|
+
];
|
|
17
|
+
action = new dfs.actions.uniswap.UniswapClaimAction(
|
|
18
|
+
index,
|
|
19
|
+
to,
|
|
20
|
+
amount,
|
|
21
|
+
merkleProof,
|
|
22
|
+
);
|
|
23
|
+
})
|
|
24
|
+
it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
|
|
25
|
+
it('encodeForRecipe', () => encodeForRecipe(action));
|
|
26
|
+
it('getEthValue', async () => {
|
|
27
|
+
const ethValue = await action.getEthValue();
|
|
28
|
+
assert.equal(ethValue, '0');
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
})
|