@defisaver/sdk 0.2.2 → 0.2.5
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/index.js +11 -2
- package/package.json +1 -1
- package/src/Action.js +21 -9
- package/src/ActionWithL2.js +36 -0
- package/src/actions/aave/AaveBorrowAction.js +11 -2
- package/src/actions/aave/AaveClaimStkAaveAction.js +5 -5
- package/src/actions/aave/AaveCollateralSwitchAction.js +5 -4
- package/src/actions/aave/AavePaybackAction.js +11 -2
- package/src/actions/aave/AaveSupplyAction.js +6 -6
- package/src/actions/aave/AaveWithdrawAction.js +8 -1
- package/src/actions/aaveV3/AaveV3ATokenPaybackAction.js +58 -0
- package/src/actions/aaveV3/AaveV3BorrowAction.js +59 -0
- package/src/actions/aaveV3/AaveV3ClaimRewardsAction.js +45 -0
- package/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +45 -0
- package/src/actions/aaveV3/AaveV3PaybackAction.js +68 -0
- package/src/actions/aaveV3/AaveV3SetEModeAction.js +40 -0
- package/src/actions/aaveV3/AaveV3SupplyAction.js +69 -0
- package/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.js +43 -0
- package/src/actions/aaveV3/AaveV3WithdrawAction.js +46 -0
- package/src/actions/aaveV3/index.js +21 -0
- package/src/actions/balancer/BalancerV2ClaimAction.js +12 -10
- package/src/actions/balancer/BalancerV2SupplyAction.js +16 -14
- package/src/actions/balancer/BalancerV2WithdrawAction.js +17 -15
- package/src/actions/basic/AutomationV2Unsub.js +3 -3
- package/src/actions/basic/ChangeProxyOwnerAction.js +4 -2
- package/src/actions/basic/GasFeeAction.js +6 -6
- package/src/actions/basic/PullTokenAction.js +9 -3
- package/src/actions/basic/SellAction.js +6 -5
- package/src/actions/basic/SendTokenAction.js +9 -4
- package/src/actions/basic/SubInputsAction.js +8 -3
- package/src/actions/basic/SumInputsAction.js +8 -3
- package/src/actions/basic/TokenBalanceAction.js +3 -3
- package/src/actions/basic/UnwrapEthAction.js +18 -5
- package/src/actions/basic/WrapEthAction.js +15 -5
- package/src/actions/basic/index.js +0 -4
- package/src/actions/checkers/MakerRatioCheckAction.js +5 -5
- package/src/actions/compound/CompoundBorrowAction.js +7 -1
- package/src/actions/compound/CompoundClaimAction.js +3 -3
- package/src/actions/compound/CompoundCollateralSwitchAction.js +4 -2
- package/src/actions/compound/CompoundGetDebtAction.js +3 -3
- package/src/actions/compound/CompoundPaybackAction.js +7 -1
- package/src/actions/compound/CompoundSupplyAction.js +4 -4
- package/src/actions/compound/CompoundWithdrawAction.js +7 -1
- package/src/actions/curve/CurveClaimFeesAction.js +4 -4
- package/src/actions/curve/CurveDepositAction.js +7 -7
- package/src/actions/curve/CurveGaugeDepositAction.js +6 -6
- package/src/actions/curve/CurveGaugeWithdrawAction.js +4 -4
- package/src/actions/curve/CurveMintCrvAction.js +3 -3
- package/src/actions/curve/CurveStethPoolDepositAction.js +7 -7
- package/src/actions/curve/CurveStethPoolWithdrawAction.js +7 -7
- package/src/actions/curve/CurveSwapAction.js +15 -15
- package/src/actions/curve/CurveWithdrawAction.js +7 -7
- package/src/actions/dydx/DyDxWithdrawAction.js +7 -1
- package/src/actions/flashloan/AaveV2FlashLoanAction.js +2 -2
- package/src/actions/flashloan/AaveV3FlashLoanAction.js +26 -0
- package/src/actions/flashloan/AaveV3FlashLoanPaybackAction.js +17 -0
- package/src/actions/flashloan/BalancerFlashLoanAction.js +2 -2
- package/src/actions/flashloan/DyDxFlashLoanAction.js +1 -5
- package/src/actions/flashloan/MakerFlashLoanAction.js +2 -2
- package/src/actions/flashloan/index.js +4 -0
- package/src/actions/guni/GUniDeposit.js +9 -9
- package/src/actions/guni/GUniWithdraw.js +5 -5
- package/src/actions/index.js +2 -0
- package/src/actions/insta/InstPullTokensAction.js +4 -4
- package/src/actions/lido/LidoStakeAction.js +7 -2
- package/src/actions/lido/LidoUnwrapAction.js +7 -2
- package/src/actions/lido/LidoWrapAction.js +7 -7
- package/src/actions/liquity/LiquityBorrowAction.js +5 -5
- package/src/actions/liquity/LiquityClaimAction.js +3 -3
- package/src/actions/liquity/LiquityCloseAction.js +4 -4
- package/src/actions/liquity/LiquityEthGainToTroveAction.js +3 -3
- package/src/actions/liquity/LiquityOpenAction.js +8 -8
- package/src/actions/liquity/LiquityPaybackAction.js +5 -5
- package/src/actions/liquity/LiquityRedeemAction.js +7 -7
- package/src/actions/liquity/LiquitySPDepositAction.js +7 -7
- package/src/actions/liquity/LiquitySPWithdrawAction.js +6 -6
- package/src/actions/liquity/LiquityStakeAction.js +7 -7
- package/src/actions/liquity/LiquitySupplyAction.js +5 -5
- package/src/actions/liquity/LiquityUnstakeAction.js +6 -6
- package/src/actions/liquity/LiquityWithdrawAction.js +4 -4
- package/src/actions/maker/MakerClaimAction.js +4 -4
- package/src/actions/maker/MakerGenerateAction.js +8 -1
- package/src/actions/maker/MakerGiveAction.js +4 -4
- package/src/actions/maker/MakerMergeAction.js +7 -1
- package/src/actions/maker/MakerOpenVaultAction.js +6 -1
- package/src/actions/maker/MakerPaybackAction.js +9 -2
- package/src/actions/maker/MakerRatioAction.js +5 -1
- package/src/actions/maker/MakerSupplyAction.js +9 -1
- package/src/actions/maker/MakerWithdrawAction.js +9 -1
- package/src/actions/mstable/MStableClaimAction.js +4 -4
- package/src/actions/mstable/MStableDepositAction.js +16 -16
- package/src/actions/mstable/MStableWithdrawAction.js +15 -15
- package/src/actions/rari/RariDepositAction.js +5 -5
- package/src/actions/rari/RariWithdrawAction.js +6 -6
- package/src/actions/reflexer/ReflexerGenerateAction.js +7 -1
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +5 -5
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +8 -3
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +9 -4
- package/src/actions/reflexer/ReflexerOpenSafeAction.js +5 -1
- package/src/actions/reflexer/ReflexerPaybackAction.js +7 -1
- package/src/actions/reflexer/ReflexerSupplyAction.js +8 -1
- package/src/actions/reflexer/ReflexerWithdrawAction.js +8 -1
- package/src/actions/uniswap/UniswapSupplyAction.js +22 -20
- package/src/actions/uniswap/UniswapWithdrawAction.js +18 -16
- package/src/actions/uniswapV3/UniswapV3CollectAction.js +9 -7
- package/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +22 -20
- package/src/actions/uniswapV3/UniswapV3MintAction.js +21 -19
- package/src/actions/uniswapV3/UniswapV3SupplyAction.js +19 -17
- package/src/actions/uniswapV3/UniswapV3WithdrawAction.js +14 -12
- package/src/actions/yearn/YearnSupplyAction.js +6 -6
- package/src/actions/yearn/YearnWithdrawAction.js +6 -6
- package/src/addresses.js +187 -143
- package/src/config.js +83 -0
- package/src/triggers/ChainLinkPriceTrigger.js +2 -2
- package/src/triggers/CompoundRatioTrigger.js +1 -1
- package/src/triggers/GasPriceTrigger.js +1 -1
- package/src/triggers/LiquityRatioTrigger.js +2 -2
- package/src/triggers/MakerRatioTrigger.js +5 -1
- package/src/triggers/ReflexerRatioTrigger.js +1 -1
- package/src/triggers/TimestampTrigger.js +1 -1
- package/src/triggers/UniV3CurrentTickTrigger.js +1 -1
- package/src/types.js +33 -0
- package/test/Action.js +1 -2
- package/test/accessLists/access-lists.js +2 -1
- package/test/actions/maker/MakerPaybackAction.js +2 -2
- package/test/index.js +4 -1
- package/src/actions/basic/SendTokenAndUnwrapAction.js +0 -30
- package/src/actions/basic/UpdateSubAction.js +0 -19
|
@@ -9,7 +9,11 @@ class ReflexerOpenSafeAction extends Action {
|
|
|
9
9
|
* @param adapterAddr {EthAddress}
|
|
10
10
|
*/
|
|
11
11
|
constructor(adapterAddr) {
|
|
12
|
-
super('ReflexerOpen', getAddr('ReflexerOpen'), ['address'], [adapterAddr]);
|
|
12
|
+
super('ReflexerOpen', getAddr('ReflexerOpen'), [['address']], [[adapterAddr]]);
|
|
13
|
+
|
|
14
|
+
this.mappableArgs = [
|
|
15
|
+
this.args[0][0],
|
|
16
|
+
];
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
|
|
@@ -13,7 +13,13 @@ class ReflexerPaybackAction extends Action {
|
|
|
13
13
|
* @param from {EthAddress} RAI will be sent from this address
|
|
14
14
|
*/
|
|
15
15
|
constructor(safeId, amount, from) {
|
|
16
|
-
super('ReflexerPayback', getAddr('ReflexerPayback'), ['uint256','uint256','address'], [safeId, amount, from]);
|
|
16
|
+
super('ReflexerPayback', getAddr('ReflexerPayback'), [['uint256','uint256','address']], [[safeId, amount, from]]);
|
|
17
|
+
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0][0],
|
|
20
|
+
this.args[0][1],
|
|
21
|
+
this.args[0][2],
|
|
22
|
+
];
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
async getAssetsToApprove() {
|
|
@@ -14,7 +14,14 @@ class ReflexerSupplyAction extends Action {
|
|
|
14
14
|
* @param from {EthAddress} Tokens will be supplied from this address
|
|
15
15
|
*/
|
|
16
16
|
constructor(safeId, amount, adapterAddr, from) {
|
|
17
|
-
super('ReflexerSupply', getAddr('ReflexerSupply'), ['uint256','uint256','address','address'], [safeId, amount, adapterAddr, from]);
|
|
17
|
+
super('ReflexerSupply', getAddr('ReflexerSupply'), [['uint256','uint256','address','address']], [[safeId, amount, adapterAddr, from]]);
|
|
18
|
+
|
|
19
|
+
this.mappableArgs = [
|
|
20
|
+
this.args[0][0],
|
|
21
|
+
this.args[0][1],
|
|
22
|
+
this.args[0][2],
|
|
23
|
+
this.args[0][3],
|
|
24
|
+
];
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
async getAssetsToApprove() {
|
|
@@ -15,7 +15,14 @@ class ReflexerWithdrawAction extends Action {
|
|
|
15
15
|
*/
|
|
16
16
|
constructor(safeId, amount, adapterAddr, to) {
|
|
17
17
|
requireAddress(to);
|
|
18
|
-
super('ReflexerWithdraw', getAddr('ReflexerWithdraw'), ['uint256','uint256','address','address'], [safeId, amount, adapterAddr, to]);
|
|
18
|
+
super('ReflexerWithdraw', getAddr('ReflexerWithdraw'), [['uint256','uint256','address','address']], [[safeId, amount, adapterAddr, to]]);
|
|
19
|
+
|
|
20
|
+
this.mappableArgs = [
|
|
21
|
+
this.args[0][0],
|
|
22
|
+
this.args[0][1],
|
|
23
|
+
this.args[0][2],
|
|
24
|
+
this.args[0][3],
|
|
25
|
+
];
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
28
|
|
|
@@ -22,37 +22,39 @@ class UniswapSupplyAction extends Action {
|
|
|
22
22
|
'UniSupply',
|
|
23
23
|
getAddr('UniSupply'),
|
|
24
24
|
[
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
[
|
|
26
|
+
"address",
|
|
27
|
+
"address",
|
|
28
|
+
"address",
|
|
29
|
+
"address",
|
|
30
|
+
"uint256",
|
|
31
|
+
"uint256",
|
|
32
|
+
"uint256",
|
|
33
|
+
"uint256",
|
|
34
|
+
"uint256",
|
|
35
|
+
],
|
|
34
36
|
],
|
|
35
|
-
[...arguments]
|
|
37
|
+
[[...arguments]]
|
|
36
38
|
);
|
|
37
39
|
|
|
38
40
|
this.mappableArgs = [
|
|
39
|
-
this.args[0],
|
|
40
|
-
this.args[1],
|
|
41
|
-
this.args[2],
|
|
42
|
-
this.args[3],
|
|
43
|
-
this.args[4],
|
|
44
|
-
this.args[5]
|
|
41
|
+
this.args[0][0],
|
|
42
|
+
this.args[0][1],
|
|
43
|
+
this.args[0][2],
|
|
44
|
+
this.args[0][3],
|
|
45
|
+
this.args[0][4],
|
|
46
|
+
this.args[0][5]
|
|
45
47
|
];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
async getAssetsToApprove() {
|
|
49
|
-
const assetA = getAssetInfoByAddress(this.args[0]);
|
|
50
|
-
const assetB = getAssetInfoByAddress(this.args[1]);
|
|
51
|
+
const assetA = getAssetInfoByAddress(this.args[0][0]);
|
|
52
|
+
const assetB = getAssetInfoByAddress(this.args[0][1]);
|
|
51
53
|
|
|
52
54
|
const approveArr = [];
|
|
53
55
|
|
|
54
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[2], specialApproveLabel: 'uniswap v2'});
|
|
55
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[2], specialApproveLabel: 'uniswap v2'});
|
|
56
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][0], owner: this.args[0][2], specialApproveLabel: 'uniswap v2'});
|
|
57
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][1], owner: this.args[0][2], specialApproveLabel: 'uniswap v2'});
|
|
56
58
|
|
|
57
59
|
return approveArr;
|
|
58
60
|
}
|
|
@@ -21,30 +21,32 @@ class UniswapWithdrawAction extends Action {
|
|
|
21
21
|
'UniWithdraw',
|
|
22
22
|
getAddr('UniWithdraw'),
|
|
23
23
|
[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
[
|
|
25
|
+
"address",
|
|
26
|
+
"address",
|
|
27
|
+
"uint256",
|
|
28
|
+
"address",
|
|
29
|
+
"address",
|
|
30
|
+
"uint256",
|
|
31
|
+
"uint256",
|
|
32
|
+
"uint256",
|
|
33
|
+
],
|
|
32
34
|
],
|
|
33
|
-
[...arguments]
|
|
35
|
+
[[...arguments]]
|
|
34
36
|
);
|
|
35
37
|
|
|
36
38
|
this.mappableArgs = [
|
|
37
|
-
this.args[0],
|
|
38
|
-
this.args[1],
|
|
39
|
-
this.args[2],
|
|
40
|
-
this.args[3],
|
|
41
|
-
this.args[4],
|
|
39
|
+
this.args[0][0],
|
|
40
|
+
this.args[0][1],
|
|
41
|
+
this.args[0][2],
|
|
42
|
+
this.args[0][3],
|
|
43
|
+
this.args[0][4],
|
|
42
44
|
];
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
async getAssetsToApprove() {
|
|
46
|
-
const lpAddress = getPoolAddressByAddresses(this.args[0], this.args[1])
|
|
47
|
-
return [{asset: lpAddress, owner: this.args[4], specialApproveLabel: 'uniswap v2'}];
|
|
48
|
+
const lpAddress = getPoolAddressByAddresses(this.args[0][0], this.args[0][1])
|
|
49
|
+
return [{asset: lpAddress, owner: this.args[0][4], specialApproveLabel: 'uniswap v2'}];
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -17,25 +17,27 @@ class UniswapV3CollectAction extends Action {
|
|
|
17
17
|
'UniCollectV3',
|
|
18
18
|
getAddr('UniCollectV3'),
|
|
19
19
|
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
[
|
|
21
|
+
"uint256",
|
|
22
|
+
"address",
|
|
23
|
+
"uint128",
|
|
24
|
+
"uint128",
|
|
25
|
+
],
|
|
24
26
|
],
|
|
25
|
-
[tokenId, recipient, amount0Max, amount1Max]
|
|
27
|
+
[[tokenId, recipient, amount0Max, amount1Max]]
|
|
26
28
|
);
|
|
27
29
|
|
|
28
30
|
this.from = from;
|
|
29
31
|
|
|
30
32
|
this.mappableArgs = [
|
|
31
|
-
this.args[0],
|
|
33
|
+
this.args[0][0],
|
|
32
34
|
];
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
async getAssetsToApprove() {
|
|
36
38
|
return [{
|
|
37
39
|
nft: getAddr('UniswapV3PositionManager'),
|
|
38
|
-
tokenId: this.args[0],
|
|
40
|
+
tokenId: this.args[0][0],
|
|
39
41
|
owner: this.from,
|
|
40
42
|
specialApproveLabel: 'uniswap v3'
|
|
41
43
|
}];
|
|
@@ -26,37 +26,39 @@ class UniswapV3CreatePoolAction extends Action {
|
|
|
26
26
|
'UniCreatePoolV3',
|
|
27
27
|
getAddr('UniCreatePoolV3'),
|
|
28
28
|
[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
[
|
|
30
|
+
"address",
|
|
31
|
+
"address",
|
|
32
|
+
"uint24",
|
|
33
|
+
"int24",
|
|
34
|
+
"int24",
|
|
35
|
+
"uint256",
|
|
36
|
+
"uint256",
|
|
37
|
+
"uint256",
|
|
38
|
+
"uint256",
|
|
39
|
+
"address",
|
|
40
|
+
"uint256",
|
|
41
|
+
"address",
|
|
42
|
+
"uint160",
|
|
43
|
+
],
|
|
42
44
|
],
|
|
43
|
-
[...arguments]
|
|
45
|
+
[[...arguments]]
|
|
44
46
|
);
|
|
45
47
|
|
|
46
48
|
this.mappableArgs = [
|
|
47
|
-
this.args[5],
|
|
48
|
-
this.args[6],
|
|
49
|
+
this.args[0][5],
|
|
50
|
+
this.args[0][6],
|
|
49
51
|
];
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
async getAssetsToApprove() {
|
|
53
|
-
const assetA = getAssetInfoByAddress(this.args[0]);
|
|
54
|
-
const assetB = getAssetInfoByAddress(this.args[1]);
|
|
55
|
+
const assetA = getAssetInfoByAddress(this.args[0][0]);
|
|
56
|
+
const assetB = getAssetInfoByAddress(this.args[0][1]);
|
|
55
57
|
|
|
56
58
|
const approveArr = [];
|
|
57
59
|
|
|
58
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
59
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
60
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][0], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
|
|
61
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][1], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
|
|
60
62
|
|
|
61
63
|
return approveArr;
|
|
62
64
|
}
|
|
@@ -26,36 +26,38 @@ class UniswapV3MintAction extends Action {
|
|
|
26
26
|
'UniMintV3',
|
|
27
27
|
getAddr('UniMintV3'),
|
|
28
28
|
[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
[
|
|
30
|
+
"address",
|
|
31
|
+
"address",
|
|
32
|
+
"uint24",
|
|
33
|
+
"int24",
|
|
34
|
+
"int24",
|
|
35
|
+
"uint256",
|
|
36
|
+
"uint256",
|
|
37
|
+
"uint256",
|
|
38
|
+
"uint256",
|
|
39
|
+
"address",
|
|
40
|
+
"uint256",
|
|
41
|
+
"address",
|
|
42
|
+
],
|
|
41
43
|
],
|
|
42
|
-
[...arguments]
|
|
44
|
+
[[...arguments]]
|
|
43
45
|
);
|
|
44
46
|
|
|
45
47
|
this.mappableArgs = [
|
|
46
|
-
this.args[5],
|
|
47
|
-
this.args[6],
|
|
48
|
+
this.args[0][5],
|
|
49
|
+
this.args[0][6],
|
|
48
50
|
];
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
async getAssetsToApprove() {
|
|
52
|
-
const assetA = getAssetInfoByAddress(this.args[0]);
|
|
53
|
-
const assetB = getAssetInfoByAddress(this.args[1]);
|
|
54
|
+
const assetA = getAssetInfoByAddress(this.args[0][0]);
|
|
55
|
+
const assetB = getAssetInfoByAddress(this.args[0][1]);
|
|
54
56
|
|
|
55
57
|
const approveArr = [];
|
|
56
58
|
|
|
57
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
58
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
59
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][0], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
|
|
60
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][1], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
|
|
59
61
|
|
|
60
62
|
return approveArr;
|
|
61
63
|
}
|
|
@@ -22,34 +22,36 @@ class UniswapV3SupplyAction extends Action {
|
|
|
22
22
|
'UniSupplyV3',
|
|
23
23
|
getAddr('UniSupplyV3'),
|
|
24
24
|
[
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
[
|
|
26
|
+
"uint256",
|
|
27
|
+
"uint256",
|
|
28
|
+
"uint256",
|
|
29
|
+
"uint256",
|
|
30
|
+
"uint256",
|
|
31
|
+
"uint256",
|
|
32
|
+
"address",
|
|
33
|
+
"address",
|
|
34
|
+
"address",
|
|
35
|
+
],
|
|
34
36
|
],
|
|
35
|
-
[...arguments]
|
|
37
|
+
[[...arguments]]
|
|
36
38
|
);
|
|
37
39
|
|
|
38
40
|
this.mappableArgs = [
|
|
39
|
-
this.args[0],
|
|
40
|
-
this.args[1],
|
|
41
|
-
this.args[2],
|
|
41
|
+
this.args[0][0],
|
|
42
|
+
this.args[0][1],
|
|
43
|
+
this.args[0][2],
|
|
42
44
|
];
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
async getAssetsToApprove() {
|
|
46
|
-
const assetA = getAssetInfoByAddress(this.args[7]);
|
|
47
|
-
const assetB = getAssetInfoByAddress(this.args[8]);
|
|
48
|
+
const assetA = getAssetInfoByAddress(this.args[0][7]);
|
|
49
|
+
const assetB = getAssetInfoByAddress(this.args[0][8]);
|
|
48
50
|
|
|
49
51
|
const approveArr = [];
|
|
50
52
|
|
|
51
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[7], owner: this.args[6], specialApproveLabel: 'uniswap v3'});
|
|
52
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[8], owner: this.args[6], specialApproveLabel: 'uniswap v3'});
|
|
53
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][7], owner: this.args[0][6], specialApproveLabel: 'uniswap v3'});
|
|
54
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][8], owner: this.args[0][6], specialApproveLabel: 'uniswap v3'});
|
|
53
55
|
|
|
54
56
|
return approveArr;
|
|
55
57
|
}
|
|
@@ -21,30 +21,32 @@ class UniswapV3WithdrawAction extends Action {
|
|
|
21
21
|
'UniWithdrawV3',
|
|
22
22
|
getAddr('UniWithdrawV3'),
|
|
23
23
|
[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
[
|
|
25
|
+
"uint256",
|
|
26
|
+
"uint128",
|
|
27
|
+
"uint256",
|
|
28
|
+
"uint256",
|
|
29
|
+
"uint256",
|
|
30
|
+
"address",
|
|
31
|
+
"uint128",
|
|
32
|
+
"uint128",
|
|
33
|
+
],
|
|
32
34
|
],
|
|
33
|
-
[tokenId, liquidity, amount0Min, amount1Min, deadline, recipient, amount0Max, amount1Max]
|
|
35
|
+
[[tokenId, liquidity, amount0Min, amount1Min, deadline, recipient, amount0Max, amount1Max]]
|
|
34
36
|
);
|
|
35
37
|
|
|
36
38
|
this.from = from;
|
|
37
39
|
|
|
38
40
|
this.mappableArgs = [
|
|
39
|
-
this.args[0],
|
|
40
|
-
this.args[1],
|
|
41
|
+
this.args[0][0],
|
|
42
|
+
this.args[0][1],
|
|
41
43
|
];
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
async getAssetsToApprove() {
|
|
45
47
|
return [{
|
|
46
48
|
nft: getAddr('UniswapV3PositionManager'),
|
|
47
|
-
tokenId: this.args[0],
|
|
49
|
+
tokenId: this.args[0][0],
|
|
48
50
|
owner: this.from,
|
|
49
51
|
specialApproveLabel: 'uniswap v3'
|
|
50
52
|
}];
|
|
@@ -13,17 +13,17 @@ class YearnSupplyAction extends Action {
|
|
|
13
13
|
* @param to {ETHAddress} yTokens will be sent to this address
|
|
14
14
|
*/
|
|
15
15
|
constructor(tokenAddr, amount, from, to) {
|
|
16
|
-
super('YearnSupply', getAddr('YearnSupply'), ['address','uint256','address', 'address'], [tokenAddr, amount, from, to]);
|
|
16
|
+
super('YearnSupply', getAddr('YearnSupply'), [['address','uint256','address', 'address']], [[tokenAddr, amount, from, to]]);
|
|
17
17
|
this.mappableArgs = [
|
|
18
|
-
this.args[1],
|
|
19
|
-
this.args[2],
|
|
20
|
-
this.args[3],
|
|
18
|
+
this.args[0][1],
|
|
19
|
+
this.args[0][2],
|
|
20
|
+
this.args[0][3],
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
async getAssetsToApprove() {
|
|
25
|
-
const asset = getAssetInfoByAddress(this.args[0]);
|
|
26
|
-
if (asset.symbol !== 'ETH') return [{asset: this.args[0], owner: this.args[2], specialApproveLabel: 'yearn'}];
|
|
25
|
+
const asset = getAssetInfoByAddress(this.args[0][0]);
|
|
26
|
+
if (asset.symbol !== 'ETH') return [{asset: this.args[0][0], owner: this.args[0][2], specialApproveLabel: 'yearn'}];
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -13,17 +13,17 @@ class YearnWithdrawAction extends Action {
|
|
|
13
13
|
* @param to {ETHAddress} underlying tokens will be sent to this address
|
|
14
14
|
*/
|
|
15
15
|
constructor(tokenAddr, amount, from, to) {
|
|
16
|
-
super('YearnWithdraw', getAddr('YearnWithdraw'), ['address','uint256','address', 'address'], [tokenAddr, amount, from, to]);
|
|
16
|
+
super('YearnWithdraw', getAddr('YearnWithdraw'), [['address','uint256','address', 'address']], [[tokenAddr, amount, from, to]]);
|
|
17
17
|
this.mappableArgs = [
|
|
18
|
-
this.args[1],
|
|
19
|
-
this.args[2],
|
|
20
|
-
this.args[3],
|
|
18
|
+
this.args[0][1],
|
|
19
|
+
this.args[0][2],
|
|
20
|
+
this.args[0][3],
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
async getAssetsToApprove() {
|
|
25
|
-
const asset = getAssetInfoByAddress(this.args[0]);
|
|
26
|
-
if (asset.symbol !== 'ETH') return [{asset: this.args[0], owner: this.args[2], specialApproveLabel: 'yearn'}];
|
|
25
|
+
const asset = getAssetInfoByAddress(this.args[0][0]);
|
|
26
|
+
if (asset.symbol !== 'ETH') return [{asset: this.args[0][0], owner: this.args[0][2], specialApproveLabel: 'yearn'}];
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
29
29
|
}
|