@defisaver/sdk 0.2.7 → 0.2.10
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/ACTIONS.md +21 -379
- package/DEV.md +298 -0
- package/index.js +11 -2
- package/package.json +2 -2
- package/src/Action.js +20 -8
- 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 +17 -10
- 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 -6
- 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 +9 -9
- package/src/actions/curve/CurveStethPoolWithdrawAction.js +9 -11
- 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 -2
- 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 +217 -152
- 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/ToggleSubAction.js +0 -19
- package/src/actions/basic/UpdateSubAction.js +0 -19
- package/src/actions/convex/ConvexClaimAction.js +0 -60
- package/src/actions/convex/ConvexDepositAction.js +0 -67
- package/src/actions/convex/ConvexWithdrawAction.js +0 -65
- package/src/actions/convex/index.js +0 -9
- package/src/utils/convex-utils.js +0 -20
- package/src/utils/convexPoolInfo.json +0 -1039
- package/test/Strategy.js +0 -44
|
@@ -9,7 +9,11 @@ class MakerRatioAction extends Action {
|
|
|
9
9
|
* @param vaultId {uint256}
|
|
10
10
|
*/
|
|
11
11
|
constructor(vaultId) {
|
|
12
|
-
super('McdRatio', getAddr('McdRatio'), ['uint256'], [vaultId]);
|
|
12
|
+
super('McdRatio', getAddr('McdRatio'), [['uint256']], [[vaultId]]);
|
|
13
|
+
|
|
14
|
+
this.mappableArgs = [
|
|
15
|
+
this.args[0][0],
|
|
16
|
+
];
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
|
|
@@ -15,7 +15,15 @@ class MakerSupplyAction extends Action {
|
|
|
15
15
|
* @param mcdManager {EthAddress}
|
|
16
16
|
*/
|
|
17
17
|
constructor(vaultId, amount, joinAddr, from, mcdManager = getAddr('McdCdpManager')) {
|
|
18
|
-
super('McdSupply', getAddr('McdSupply'), ['uint256','uint256','address','address','address'], [vaultId, amount, joinAddr, from, mcdManager]);
|
|
18
|
+
super('McdSupply', getAddr('McdSupply'), [['uint256','uint256','address','address','address']], [[vaultId, amount, joinAddr, from, mcdManager]]);
|
|
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
|
+
this.args[0][4],
|
|
26
|
+
];
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
async getAssetsToApprove() {
|
|
@@ -16,7 +16,15 @@ class MakerWithdrawAction extends Action {
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(vaultId, amount, joinAddr, to, mcdManager = getAddr('McdCdpManager')) {
|
|
18
18
|
requireAddress(to);
|
|
19
|
-
super('McdWithdraw', getAddr('McdWithdraw'), ['uint256','uint256','address','address','address'], [vaultId, amount, joinAddr, to, mcdManager]);
|
|
19
|
+
super('McdWithdraw', getAddr('McdWithdraw'), [['uint256','uint256','address','address','address']], [[vaultId, amount, joinAddr, to, mcdManager]]);
|
|
20
|
+
|
|
21
|
+
this.mappableArgs = [
|
|
22
|
+
this.args[0][0],
|
|
23
|
+
this.args[0][1],
|
|
24
|
+
this.args[0][2],
|
|
25
|
+
this.args[0][3],
|
|
26
|
+
this.args[0][4],
|
|
27
|
+
];
|
|
20
28
|
}
|
|
21
29
|
}
|
|
22
30
|
|
|
@@ -24,13 +24,13 @@ class MStableClaimAction extends Action {
|
|
|
24
24
|
super(
|
|
25
25
|
'MStableClaim',
|
|
26
26
|
getAddr('MStableClaim'),
|
|
27
|
-
['address', 'address', 'uint256', 'uint256'],
|
|
28
|
-
[...arguments],
|
|
27
|
+
[['address', 'address', 'uint256', 'uint256']],
|
|
28
|
+
[[...arguments]],
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
this.mappableArgs = [
|
|
32
|
-
this.args[0],
|
|
33
|
-
this.args[1],
|
|
32
|
+
this.args[0][0],
|
|
33
|
+
this.args[0][1],
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -39,39 +39,39 @@ class MStableDepositAction extends Action {
|
|
|
39
39
|
super(
|
|
40
40
|
'MStableDeposit',
|
|
41
41
|
getAddr('MStableDeposit'),
|
|
42
|
-
['address', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256'],
|
|
43
|
-
[...arguments],
|
|
42
|
+
[['address', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256']],
|
|
43
|
+
[[...arguments]],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
this.mappableArgs = [
|
|
47
|
-
this.args[0],
|
|
48
|
-
this.args[1],
|
|
49
|
-
this.args[2],
|
|
50
|
-
this.args[3],
|
|
51
|
-
this.args[4],
|
|
52
|
-
this.args[5],
|
|
53
|
-
this.args[6],
|
|
54
|
-
this.args[7],
|
|
55
|
-
this.args[8],
|
|
47
|
+
this.args[0][0],
|
|
48
|
+
this.args[0][1],
|
|
49
|
+
this.args[0][2],
|
|
50
|
+
this.args[0][3],
|
|
51
|
+
this.args[0][4],
|
|
52
|
+
this.args[0][5],
|
|
53
|
+
this.args[0][6],
|
|
54
|
+
this.args[0][7],
|
|
55
|
+
this.args[0][8],
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
async getAssetsToApprove() {
|
|
60
|
-
const assetPair = this.args[8];
|
|
61
|
-
const owner = this.args[4];
|
|
60
|
+
const assetPair = this.args[0][8];
|
|
61
|
+
const owner = this.args[0][4];
|
|
62
62
|
let asset;
|
|
63
63
|
switch (assetPair) {
|
|
64
64
|
case mstableAssetPairs.BASSET_MASSET:
|
|
65
65
|
case mstableAssetPairs.BASSET_IMASSET:
|
|
66
66
|
case mstableAssetPairs.BASSET_IMASSETVAULT:
|
|
67
|
-
asset = this.args[0];
|
|
67
|
+
asset = this.args[0][0];
|
|
68
68
|
break;
|
|
69
69
|
case mstableAssetPairs.MASSET_IMASSET:
|
|
70
70
|
case mstableAssetPairs.MASSET_IMASSETVAULT:
|
|
71
|
-
asset = this.args[1];
|
|
71
|
+
asset = this.args[0][1];
|
|
72
72
|
break;
|
|
73
73
|
case mstableAssetPairs.IMASSET_IMASSETVAULT:
|
|
74
|
-
asset = this.args[2];
|
|
74
|
+
asset = this.args[0][2];
|
|
75
75
|
break;
|
|
76
76
|
default:
|
|
77
77
|
return [];
|
|
@@ -39,26 +39,26 @@ class MStableWithdrawAction extends Action {
|
|
|
39
39
|
super(
|
|
40
40
|
'MStableWithdraw',
|
|
41
41
|
getAddr('MStableWithdraw'),
|
|
42
|
-
['address', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256'],
|
|
43
|
-
[...arguments],
|
|
42
|
+
[['address', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256']],
|
|
43
|
+
[[...arguments]],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
this.mappableArgs = [
|
|
47
|
-
this.args[0],
|
|
48
|
-
this.args[1],
|
|
49
|
-
this.args[2],
|
|
50
|
-
this.args[3],
|
|
51
|
-
this.args[4],
|
|
52
|
-
this.args[5],
|
|
53
|
-
this.args[6],
|
|
54
|
-
this.args[7],
|
|
55
|
-
this.args[8],
|
|
47
|
+
this.args[0][0],
|
|
48
|
+
this.args[0][1],
|
|
49
|
+
this.args[0][2],
|
|
50
|
+
this.args[0][3],
|
|
51
|
+
this.args[0][4],
|
|
52
|
+
this.args[0][5],
|
|
53
|
+
this.args[0][6],
|
|
54
|
+
this.args[0][7],
|
|
55
|
+
this.args[0][8],
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
async getAssetsToApprove() {
|
|
60
|
-
const assetPair = this.args[8];
|
|
61
|
-
const owner = this.args[4];
|
|
60
|
+
const assetPair = this.args[0][8];
|
|
61
|
+
const owner = this.args[0][4];
|
|
62
62
|
let asset;
|
|
63
63
|
switch (assetPair) {
|
|
64
64
|
case mstableAssetPairs.BASSET_IMASSETVAULT:
|
|
@@ -67,10 +67,10 @@ class MStableWithdrawAction extends Action {
|
|
|
67
67
|
return [];
|
|
68
68
|
case mstableAssetPairs.MASSET_IMASSET:
|
|
69
69
|
case mstableAssetPairs.BASSET_IMASSET:
|
|
70
|
-
asset = this.args[2];
|
|
70
|
+
asset = this.args[0][2];
|
|
71
71
|
break;
|
|
72
72
|
case mstableAssetPairs.BASSET_MASSET:
|
|
73
|
-
asset = this.args[1];
|
|
73
|
+
asset = this.args[0][1];
|
|
74
74
|
break;
|
|
75
75
|
default:
|
|
76
76
|
return [];
|
|
@@ -15,16 +15,16 @@ class RariDepositAction extends Action {
|
|
|
15
15
|
* @param to {EthAddress} RSPT will be sent to this address
|
|
16
16
|
*/
|
|
17
17
|
constructor(fundManager, stablecoinAddress, poolTokenAddress, amount, from, to) {
|
|
18
|
-
super('RariDeposit', getAddr('RariDeposit'), ['address', 'address', 'address', 'uint256', 'address', 'address'], [fundManager, stablecoinAddress, poolTokenAddress, amount, from, to]);
|
|
18
|
+
super('RariDeposit', getAddr('RariDeposit'), [['address', 'address', 'address', 'uint256', 'address', 'address']], [[fundManager, stablecoinAddress, poolTokenAddress, amount, from, to]]);
|
|
19
19
|
this.mappableArgs = [
|
|
20
|
-
this.args[3],
|
|
21
|
-
this.args[4],
|
|
22
|
-
this.args[5],
|
|
20
|
+
this.args[0][3],
|
|
21
|
+
this.args[0][4],
|
|
22
|
+
this.args[0][5],
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async getAssetsToApprove() {
|
|
27
|
-
return [{asset: this.args[1], owner: this.args[4]}];
|
|
27
|
+
return [{asset: this.args[0][1], owner: this.args[0][4]}];
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -16,17 +16,17 @@ class RariWithdrawAction extends Action {
|
|
|
16
16
|
* @param to {EthAddress} stablecoins withdrawn will be sent to this address
|
|
17
17
|
*/
|
|
18
18
|
constructor(fundManager, poolTokenAddress, poolTokensAmountToPull, from, stablecoinAddress, stablecoinAmountToWithdraw, to) {
|
|
19
|
-
super('RariWithdraw', getAddr('RariWithdraw'), ['address', 'address', 'uint256', 'address', 'address', 'uint256', 'address'], [fundManager, poolTokenAddress, poolTokensAmountToPull, from, stablecoinAddress, stablecoinAmountToWithdraw, to]);
|
|
19
|
+
super('RariWithdraw', getAddr('RariWithdraw'), [['address', 'address', 'uint256', 'address', 'address', 'uint256', 'address']], [[fundManager, poolTokenAddress, poolTokensAmountToPull, from, stablecoinAddress, stablecoinAmountToWithdraw, to]]);
|
|
20
20
|
this.mappableArgs = [
|
|
21
|
-
this.args[2],
|
|
22
|
-
this.args[3],
|
|
23
|
-
this.args[5],
|
|
24
|
-
this.args[6],
|
|
21
|
+
this.args[0][2],
|
|
22
|
+
this.args[0][3],
|
|
23
|
+
this.args[0][5],
|
|
24
|
+
this.args[0][6],
|
|
25
25
|
];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async getAssetsToApprove() {
|
|
29
|
-
return [{asset: this.args[1], owner: this.args[3]}];
|
|
29
|
+
return [{asset: this.args[0][1], owner: this.args[0][3]}];
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -13,7 +13,13 @@ class ReflexerGenerateAction extends Action {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(vaultId, amount, to) {
|
|
15
15
|
requireAddress(to);
|
|
16
|
-
super('ReflexerGenerate', getAddr('ReflexerGenerate'), ['uint256','uint256','address'], [vaultId, amount, to]);
|
|
16
|
+
super('ReflexerGenerate', getAddr('ReflexerGenerate'), [['uint256','uint256','address']], [[vaultId, amount, to]]);
|
|
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
|
|
|
@@ -12,17 +12,17 @@ class ReflexerNativeUniV2SaviourDepositAction extends Action {
|
|
|
12
12
|
* @param lpTokenAmount {string}
|
|
13
13
|
*/
|
|
14
14
|
constructor(from, safeId, lpTokenAmount) {
|
|
15
|
-
super('ReflexerNativeUniV2SaviourDeposit', getAddr('ReflexerNativeUniV2SaviourDeposit'), ['address','uint256','uint256'], [from, safeId, lpTokenAmount]);
|
|
15
|
+
super('ReflexerNativeUniV2SaviourDeposit', getAddr('ReflexerNativeUniV2SaviourDeposit'), [['address','uint256','uint256']], [[from, safeId, lpTokenAmount]]);
|
|
16
16
|
this.mappableArgs = [
|
|
17
|
-
this.args[0],
|
|
18
|
-
this.args[1],
|
|
19
|
-
this.args[2],
|
|
17
|
+
this.args[0][0],
|
|
18
|
+
this.args[0][1],
|
|
19
|
+
this.args[0][2],
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async getAssetsToApprove() {
|
|
24
24
|
const tokenAddress = getAddr('RaiWethUniV2LPToken');
|
|
25
|
-
return [{asset: tokenAddress, owner: this.args[0]}];
|
|
25
|
+
return [{asset: tokenAddress, owner: this.args[0][0]}];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
}
|
|
@@ -11,11 +11,16 @@ class ReflexerNativeUniV2SaviourGetReservesAction extends Action {
|
|
|
11
11
|
* @param safeId {SafeId}
|
|
12
12
|
*/
|
|
13
13
|
constructor(to, safeId) {
|
|
14
|
-
super('ReflexerNativeUniV2SaviourGetReserves', getAddr('ReflexerNativeUniV2SaviourGetReserves'), ['address','uint256'], [to, safeId]);
|
|
14
|
+
super('ReflexerNativeUniV2SaviourGetReserves', getAddr('ReflexerNativeUniV2SaviourGetReserves'), [['address','uint256']], [[to, safeId]]);
|
|
15
15
|
this.mappableArgs = [
|
|
16
|
-
this.args[0],
|
|
16
|
+
this.args[0][0],
|
|
17
17
|
];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async getAssetsToApprove() {
|
|
21
|
+
return [];
|
|
18
22
|
}
|
|
23
|
+
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
module.exports = ReflexerNativeUniV2SaviourGetReservesAction;
|
|
26
|
+
module.exports = ReflexerNativeUniV2SaviourGetReservesAction;
|
|
@@ -12,12 +12,17 @@ class ReflexerNativeUniV2SaviourWithdrawAction extends Action {
|
|
|
12
12
|
* @param lpTokenAmount {string}
|
|
13
13
|
*/
|
|
14
14
|
constructor(to, safeId, lpTokenAmount) {
|
|
15
|
-
super('ReflexerNativeUniV2SaviourWithdraw', getAddr('ReflexerNativeUniV2SaviourWithdraw'), ['address','uint256','uint256', ], [to, safeId, lpTokenAmount]);
|
|
15
|
+
super('ReflexerNativeUniV2SaviourWithdraw', getAddr('ReflexerNativeUniV2SaviourWithdraw'), [['address','uint256','uint256', ]], [[to, safeId, lpTokenAmount]]);
|
|
16
16
|
this.mappableArgs = [
|
|
17
|
-
this.args[0],
|
|
18
|
-
this.args[2],
|
|
17
|
+
this.args[0][0],
|
|
18
|
+
this.args[0][2],
|
|
19
19
|
];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async getAssetsToApprove() {
|
|
23
|
+
return [];
|
|
20
24
|
}
|
|
25
|
+
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
module.exports = ReflexerNativeUniV2SaviourWithdrawAction;
|
|
28
|
+
module.exports = ReflexerNativeUniV2SaviourWithdrawAction;
|
|
@@ -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
|
}
|