@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.
Files changed (128) hide show
  1. package/index.js +11 -2
  2. package/package.json +1 -1
  3. package/src/Action.js +21 -9
  4. package/src/ActionWithL2.js +36 -0
  5. package/src/actions/aave/AaveBorrowAction.js +11 -2
  6. package/src/actions/aave/AaveClaimStkAaveAction.js +5 -5
  7. package/src/actions/aave/AaveCollateralSwitchAction.js +5 -4
  8. package/src/actions/aave/AavePaybackAction.js +11 -2
  9. package/src/actions/aave/AaveSupplyAction.js +6 -6
  10. package/src/actions/aave/AaveWithdrawAction.js +8 -1
  11. package/src/actions/aaveV3/AaveV3ATokenPaybackAction.js +58 -0
  12. package/src/actions/aaveV3/AaveV3BorrowAction.js +59 -0
  13. package/src/actions/aaveV3/AaveV3ClaimRewardsAction.js +45 -0
  14. package/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +45 -0
  15. package/src/actions/aaveV3/AaveV3PaybackAction.js +68 -0
  16. package/src/actions/aaveV3/AaveV3SetEModeAction.js +40 -0
  17. package/src/actions/aaveV3/AaveV3SupplyAction.js +69 -0
  18. package/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.js +43 -0
  19. package/src/actions/aaveV3/AaveV3WithdrawAction.js +46 -0
  20. package/src/actions/aaveV3/index.js +21 -0
  21. package/src/actions/balancer/BalancerV2ClaimAction.js +12 -10
  22. package/src/actions/balancer/BalancerV2SupplyAction.js +16 -14
  23. package/src/actions/balancer/BalancerV2WithdrawAction.js +17 -15
  24. package/src/actions/basic/AutomationV2Unsub.js +3 -3
  25. package/src/actions/basic/ChangeProxyOwnerAction.js +4 -2
  26. package/src/actions/basic/GasFeeAction.js +6 -6
  27. package/src/actions/basic/PullTokenAction.js +9 -3
  28. package/src/actions/basic/SellAction.js +6 -5
  29. package/src/actions/basic/SendTokenAction.js +9 -4
  30. package/src/actions/basic/SubInputsAction.js +8 -3
  31. package/src/actions/basic/SumInputsAction.js +8 -3
  32. package/src/actions/basic/TokenBalanceAction.js +3 -3
  33. package/src/actions/basic/UnwrapEthAction.js +18 -5
  34. package/src/actions/basic/WrapEthAction.js +15 -5
  35. package/src/actions/basic/index.js +0 -4
  36. package/src/actions/checkers/MakerRatioCheckAction.js +5 -5
  37. package/src/actions/compound/CompoundBorrowAction.js +7 -1
  38. package/src/actions/compound/CompoundClaimAction.js +3 -3
  39. package/src/actions/compound/CompoundCollateralSwitchAction.js +4 -2
  40. package/src/actions/compound/CompoundGetDebtAction.js +3 -3
  41. package/src/actions/compound/CompoundPaybackAction.js +7 -1
  42. package/src/actions/compound/CompoundSupplyAction.js +4 -4
  43. package/src/actions/compound/CompoundWithdrawAction.js +7 -1
  44. package/src/actions/curve/CurveClaimFeesAction.js +4 -4
  45. package/src/actions/curve/CurveDepositAction.js +7 -7
  46. package/src/actions/curve/CurveGaugeDepositAction.js +6 -6
  47. package/src/actions/curve/CurveGaugeWithdrawAction.js +4 -4
  48. package/src/actions/curve/CurveMintCrvAction.js +3 -3
  49. package/src/actions/curve/CurveStethPoolDepositAction.js +7 -7
  50. package/src/actions/curve/CurveStethPoolWithdrawAction.js +7 -7
  51. package/src/actions/curve/CurveSwapAction.js +15 -15
  52. package/src/actions/curve/CurveWithdrawAction.js +7 -7
  53. package/src/actions/dydx/DyDxWithdrawAction.js +7 -1
  54. package/src/actions/flashloan/AaveV2FlashLoanAction.js +2 -2
  55. package/src/actions/flashloan/AaveV3FlashLoanAction.js +26 -0
  56. package/src/actions/flashloan/AaveV3FlashLoanPaybackAction.js +17 -0
  57. package/src/actions/flashloan/BalancerFlashLoanAction.js +2 -2
  58. package/src/actions/flashloan/DyDxFlashLoanAction.js +1 -5
  59. package/src/actions/flashloan/MakerFlashLoanAction.js +2 -2
  60. package/src/actions/flashloan/index.js +4 -0
  61. package/src/actions/guni/GUniDeposit.js +9 -9
  62. package/src/actions/guni/GUniWithdraw.js +5 -5
  63. package/src/actions/index.js +2 -0
  64. package/src/actions/insta/InstPullTokensAction.js +4 -4
  65. package/src/actions/lido/LidoStakeAction.js +7 -2
  66. package/src/actions/lido/LidoUnwrapAction.js +7 -2
  67. package/src/actions/lido/LidoWrapAction.js +7 -7
  68. package/src/actions/liquity/LiquityBorrowAction.js +5 -5
  69. package/src/actions/liquity/LiquityClaimAction.js +3 -3
  70. package/src/actions/liquity/LiquityCloseAction.js +4 -4
  71. package/src/actions/liquity/LiquityEthGainToTroveAction.js +3 -3
  72. package/src/actions/liquity/LiquityOpenAction.js +8 -8
  73. package/src/actions/liquity/LiquityPaybackAction.js +5 -5
  74. package/src/actions/liquity/LiquityRedeemAction.js +7 -7
  75. package/src/actions/liquity/LiquitySPDepositAction.js +7 -7
  76. package/src/actions/liquity/LiquitySPWithdrawAction.js +6 -6
  77. package/src/actions/liquity/LiquityStakeAction.js +7 -7
  78. package/src/actions/liquity/LiquitySupplyAction.js +5 -5
  79. package/src/actions/liquity/LiquityUnstakeAction.js +6 -6
  80. package/src/actions/liquity/LiquityWithdrawAction.js +4 -4
  81. package/src/actions/maker/MakerClaimAction.js +4 -4
  82. package/src/actions/maker/MakerGenerateAction.js +8 -1
  83. package/src/actions/maker/MakerGiveAction.js +4 -4
  84. package/src/actions/maker/MakerMergeAction.js +7 -1
  85. package/src/actions/maker/MakerOpenVaultAction.js +6 -1
  86. package/src/actions/maker/MakerPaybackAction.js +9 -2
  87. package/src/actions/maker/MakerRatioAction.js +5 -1
  88. package/src/actions/maker/MakerSupplyAction.js +9 -1
  89. package/src/actions/maker/MakerWithdrawAction.js +9 -1
  90. package/src/actions/mstable/MStableClaimAction.js +4 -4
  91. package/src/actions/mstable/MStableDepositAction.js +16 -16
  92. package/src/actions/mstable/MStableWithdrawAction.js +15 -15
  93. package/src/actions/rari/RariDepositAction.js +5 -5
  94. package/src/actions/rari/RariWithdrawAction.js +6 -6
  95. package/src/actions/reflexer/ReflexerGenerateAction.js +7 -1
  96. package/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +5 -5
  97. package/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +8 -3
  98. package/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +9 -4
  99. package/src/actions/reflexer/ReflexerOpenSafeAction.js +5 -1
  100. package/src/actions/reflexer/ReflexerPaybackAction.js +7 -1
  101. package/src/actions/reflexer/ReflexerSupplyAction.js +8 -1
  102. package/src/actions/reflexer/ReflexerWithdrawAction.js +8 -1
  103. package/src/actions/uniswap/UniswapSupplyAction.js +22 -20
  104. package/src/actions/uniswap/UniswapWithdrawAction.js +18 -16
  105. package/src/actions/uniswapV3/UniswapV3CollectAction.js +9 -7
  106. package/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +22 -20
  107. package/src/actions/uniswapV3/UniswapV3MintAction.js +21 -19
  108. package/src/actions/uniswapV3/UniswapV3SupplyAction.js +19 -17
  109. package/src/actions/uniswapV3/UniswapV3WithdrawAction.js +14 -12
  110. package/src/actions/yearn/YearnSupplyAction.js +6 -6
  111. package/src/actions/yearn/YearnWithdrawAction.js +6 -6
  112. package/src/addresses.js +187 -143
  113. package/src/config.js +83 -0
  114. package/src/triggers/ChainLinkPriceTrigger.js +2 -2
  115. package/src/triggers/CompoundRatioTrigger.js +1 -1
  116. package/src/triggers/GasPriceTrigger.js +1 -1
  117. package/src/triggers/LiquityRatioTrigger.js +2 -2
  118. package/src/triggers/MakerRatioTrigger.js +5 -1
  119. package/src/triggers/ReflexerRatioTrigger.js +1 -1
  120. package/src/triggers/TimestampTrigger.js +1 -1
  121. package/src/triggers/UniV3CurrentTickTrigger.js +1 -1
  122. package/src/types.js +33 -0
  123. package/test/Action.js +1 -2
  124. package/test/accessLists/access-lists.js +2 -1
  125. package/test/actions/maker/MakerPaybackAction.js +2 -2
  126. package/test/index.js +4 -1
  127. package/src/actions/basic/SendTokenAndUnwrapAction.js +0 -30
  128. package/src/actions/basic/UpdateSubAction.js +0 -19
@@ -13,12 +13,12 @@ class CompoundSupplyAction extends Action {
13
13
  * @param enableAsColl {boolean} If we need to enable asset as collateral
14
14
  */
15
15
  constructor(cTokenAddr, amount, from, enableAsColl = true) {
16
- super('CompSupply', getAddr('CompSupply'), ['address','uint256','address','bool'], [cTokenAddr, amount, from, enableAsColl]);
16
+ super('CompSupply', getAddr('CompSupply'), [['address','uint256','address','bool']], [[cTokenAddr, amount, from, enableAsColl]]);
17
17
 
18
18
  this.mappableArgs = [
19
- this.args[0],
20
- this.args[1],
21
- this.args[2],
19
+ this.args[0][0],
20
+ this.args[0][1],
21
+ this.args[0][2],
22
22
  ];
23
23
  }
24
24
 
@@ -13,7 +13,13 @@ class CompoundWithdrawAction extends Action {
13
13
  */
14
14
  constructor(cTokenAddr, amount, to) {
15
15
  requireAddress(to);
16
- super('CompWithdraw', getAddr('CompWithdraw'), ['address','uint256','address'], [...arguments]);
16
+ super('CompWithdraw', getAddr('CompWithdraw'), [['address','uint256','address']], [[...arguments]]);
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
 
@@ -18,12 +18,12 @@ class CurveClaimFeesAction extends Action {
18
18
  requireAddress(receiver);
19
19
  super('CurveClaimFeesAction',
20
20
  getAddr('CurveClaimFeesAction'),
21
- ['address', 'address'],
22
- [...arguments]);
21
+ [['address', 'address']],
22
+ [[...arguments]]);
23
23
 
24
24
  this.mappableArgs = [
25
- this.args[0],
26
- this.args[1],
25
+ this.args[0][0],
26
+ this.args[0][1],
27
27
  ];
28
28
  }
29
29
  }
@@ -31,19 +31,19 @@ class CurveDepositAction extends Action {
31
31
  requireAddress(receiver);
32
32
  super('CurveDeposit',
33
33
  getAddr('CurveDeposit'),
34
- ['address', 'address', 'address', 'address', 'bytes4', 'uint256', 'uint256[]', 'address[]', 'bool'],
35
- [...arguments]);
34
+ [['address', 'address', 'address', 'address', 'bytes4', 'uint256', 'uint256[]', 'address[]', 'bool']],
35
+ [[...arguments]]);
36
36
 
37
37
  this.mappableArgs = [
38
- this.args[0],
39
- this.args[1],
40
- this.args[5],
41
- ...this.args[6],
38
+ this.args[0][0],
39
+ this.args[0][1],
40
+ this.args[0][5],
41
+ ...this.args[0][6],
42
42
  ];
43
43
  }
44
44
 
45
45
  async getAssetsToApprove() {
46
- return this.args[7].map(_asset => Object({ asset: _asset, owner: this.args[0] }));
46
+ return this.args[0][7].map(_asset => Object({ asset: _asset, owner: this.args[0][0] }));
47
47
  }
48
48
  }
49
49
 
@@ -17,19 +17,19 @@ class CurveGaugeDepositAction extends Action {
17
17
  requireAddress(onBehalfOf);
18
18
  super('CurveGaugeDeposit',
19
19
  getAddr('CurveGaugeDeposit'),
20
- ['address', 'address', 'address', 'address', 'uint256'],
21
- [...arguments],
20
+ [['address', 'address', 'address', 'address', 'uint256']],
21
+ [[...arguments]],
22
22
  );
23
23
 
24
24
  this.mappableArgs = [
25
- this.args[2],
26
- this.args[3],
27
- this.args[4],
25
+ this.args[0][2],
26
+ this.args[0][3],
27
+ this.args[0][4],
28
28
  ];
29
29
  }
30
30
 
31
31
  async getAssetsToApprove() {
32
- return { asset: this.args[1], owner: this.args[2] };
32
+ return { asset: this.args[0][1], owner: this.args[0][2] };
33
33
  }
34
34
  }
35
35
 
@@ -14,13 +14,13 @@ class CurveGaugeWithdrawAction extends Action {
14
14
  requireAddress(receiver);
15
15
  super('CurveGaugeWithdraw',
16
16
  getAddr('CurveGaugeWithdraw'),
17
- ['address', 'address', 'address', 'uint256'],
18
- [...arguments],
17
+ [['address', 'address', 'address', 'uint256']],
18
+ [[...arguments]],
19
19
  );
20
20
 
21
21
  this.mappableArgs = [
22
- this.args[2],
23
- this.args[3],
22
+ this.args[0][2],
23
+ this.args[0][3],
24
24
  ];
25
25
  }
26
26
  }
@@ -12,12 +12,12 @@ class CurveMintCrvAction extends Action {
12
12
  requireAddress(receiver);
13
13
  super('CurveMintCrv',
14
14
  getAddr('CurveMintCrv'),
15
- ['address[8]', 'address'],
16
- [...arguments],
15
+ [['address[8]', 'address']],
16
+ [[...arguments]],
17
17
  );
18
18
 
19
19
  this.mappableArgs = [
20
- this.args[8],
20
+ this.args[0][8],
21
21
  ];
22
22
  }
23
23
  }
@@ -23,16 +23,16 @@ class CurveStethPoolDepositAction extends Action {
23
23
  super(
24
24
  'CurveStethPoolDeposit',
25
25
  getAddr('CurveStethPoolDeposit'),
26
- ['address', 'address', 'uint256[2]', 'uint256'],
27
- [...arguments],
26
+ [['address', 'address', 'uint256[2]', 'uint256']],
27
+ [[...arguments]],
28
28
  );
29
29
 
30
30
  this.mappableArgs = [
31
- this.args[0],
32
- this.args[1],
33
- this.args[2][0],
34
- this.args[2][1],
35
- this.args[3],
31
+ this.args[0][0],
32
+ this.args[0][1],
33
+ this.args[0][2][0],
34
+ this.args[0][2][1],
35
+ this.args[0][3],
36
36
  ];
37
37
  }
38
38
  }
@@ -23,16 +23,16 @@ class CurveStethPoolWithdrawAction extends Action {
23
23
  super(
24
24
  'CurveStethPoolWithdraw',
25
25
  getAddr('CurveStethPoolWithdraw'),
26
- ['address', 'address', 'uint256[2]', 'uint256'],
27
- [...arguments],
26
+ [['address', 'address', 'uint256[2]', 'uint256']],
27
+ [[...arguments]],
28
28
  );
29
29
 
30
30
  this.mappableArgs = [
31
- this.args[0],
32
- this.args[1],
33
- this.args[2][0],
34
- this.args[2][1],
35
- this.args[3],
31
+ this.args[0][0],
32
+ this.args[0][1],
33
+ this.args[0][2][0],
34
+ this.args[0][2][1],
35
+ this.args[0][3],
36
36
  ];
37
37
  }
38
38
  }
@@ -6,33 +6,33 @@ const { getAddr } = require('../../addresses');
6
6
  class CurveSwapAction extends Action {
7
7
 
8
8
  /**
9
- *
10
- * @param {EthAddress} sender
11
- * @param {EthAddress} receiver
12
- * @param {EthAddress} pool
13
- * @param {EthAddress} tokenA
14
- * @param {EthAddress} tokenB
15
- * @param {string} amount
16
- * @param {string} expected
9
+ *
10
+ * @param {EthAddress} sender
11
+ * @param {EthAddress} receiver
12
+ * @param {EthAddress} pool
13
+ * @param {EthAddress} tokenA
14
+ * @param {EthAddress} tokenB
15
+ * @param {string} amount
16
+ * @param {string} expected
17
17
  */
18
18
  constructor(sender, receiver, pool, tokenA, tokenB, amount, expected) {
19
19
  requireAddress(sender);
20
20
  requireAddress(receiver);
21
21
  super('CurveSwap',
22
22
  getAddr('CurveSwap'),
23
- ['address', 'address', 'address', 'address', 'address', 'uint256', 'uint256'],
24
- [...arguments]);
23
+ [['address', 'address', 'address', 'address', 'address', 'uint256', 'uint256']],
24
+ [[...arguments]]);
25
25
 
26
26
  this.mappableArgs = [
27
- this.args[0],
28
- this.args[1],
29
- this.args[5],
30
- this.args[6],
27
+ this.args[0][0],
28
+ this.args[0][1],
29
+ this.args[0][5],
30
+ this.args[0][6],
31
31
  ];
32
32
  }
33
33
 
34
34
  async getAssetsToApprove() {
35
- return [{ asset: this.args[3], owner: this.args[0] }];
35
+ return [{ asset: this.args[0][3], owner: this.args[0][0] }];
36
36
  }
37
37
  }
38
38
 
@@ -34,19 +34,19 @@ class CurveWithdrawAction extends Action {
34
34
  requireAddress(receiver);
35
35
  super('CurveWithdrawAction',
36
36
  getAddr('CurveWithdrawAction'),
37
- ['address', 'address', 'address', 'address', 'bytes4', 'uint256', 'uint256[]', 'address[]', 'bool', 'bool'],
38
- [...arguments]);
37
+ [['address', 'address', 'address', 'address', 'bytes4', 'uint256', 'uint256[]', 'address[]', 'bool', 'bool']],
38
+ [[...arguments]]);
39
39
 
40
40
  this.mappableArgs = [
41
- this.args[0],
42
- this.args[1],
43
- this.args[5],
44
- ...this.args[6],
41
+ this.args[0][0],
42
+ this.args[0][1],
43
+ this.args[0][5],
44
+ ...this.args[0][6],
45
45
  ];
46
46
  }
47
47
 
48
48
  async getAssetsToApprove() {
49
- return { asset: this.args[3], owner: this.args[0] };
49
+ return { asset: this.args[0][3], owner: this.args[0][0] };
50
50
  }
51
51
  }
52
52
 
@@ -13,7 +13,13 @@ class DyDxWithdrawAction extends Action {
13
13
  */
14
14
  constructor(tokenAddr, amount, to) {
15
15
  requireAddress(to);
16
- super('DyDxWithdraw', getAddr('DyDxWithdraw'), ['address','uint256','address'], [...arguments]);
16
+ super('DyDxWithdraw', getAddr('DyDxWithdraw'), [['address','uint256','address']], [[...arguments]]);
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
 
@@ -17,8 +17,8 @@ class AaveV2FlashLoanAction extends Action {
17
17
  super(
18
18
  'FLAaveV2',
19
19
  getAddr('FLAaveV2'),
20
- ['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'],
21
- [tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []]
20
+ [['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes']],
21
+ [[tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []]]
22
22
  );
23
23
  }
24
24
  }
@@ -0,0 +1,26 @@
1
+ const ActionWithL2 = require("../../ActionWithL2");
2
+ const { getAddr } = require('../../addresses.js');
3
+
4
+ /**
5
+ * Gets a flashloan from Aave v2
6
+ */
7
+ class AaveV3FlashLoanAction extends ActionWithL2 {
8
+ /**
9
+ * @param loanAmounts {Array<string>}
10
+ * @param tokens {Array<EthAddress>}
11
+ * @param modes {Array<number>}
12
+ * @param loanPayer {EthAddress}
13
+ * @param flParamGetterAddr {EthAddress}
14
+ * @param flParamGetterData {bytes}
15
+ */
16
+ constructor(loanAmounts, tokens, modes, loanPayer, flParamGetterAddr = getAddr('Empty'), flParamGetterData= []) {
17
+ super(
18
+ 'FLAaveV3',
19
+ getAddr('FLAaveV3'),
20
+ [['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes']],
21
+ [[tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []]]
22
+ );
23
+ }
24
+ }
25
+
26
+ module.exports = AaveV3FlashLoanAction;
@@ -0,0 +1,17 @@
1
+ const SendTokenAction = require("../basic/SendTokenAction");
2
+ const { getAddr } = require('../../addresses.js');
3
+
4
+ /**
5
+ * Pays back a single flashloan from Aave v3
6
+ */
7
+ class AaveV3FlashLoanPaybackAction extends SendTokenAction {
8
+ /**
9
+ * @param loanAmount {string}
10
+ * @param tokenAddr {EthAddress}
11
+ */
12
+ constructor(loanAmount, tokenAddr) {
13
+ super(tokenAddr, getAddr('FLAaveV3'), loanAmount);
14
+ }
15
+ }
16
+
17
+ module.exports = AaveV3FlashLoanPaybackAction;
@@ -15,8 +15,8 @@ class BalancerFlashLoanAction extends Action {
15
15
  super(
16
16
  'FLBalancer',
17
17
  getAddr('FLBalancer'),
18
- ['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'],
19
- [tokens, amounts, [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]
18
+ [['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes']],
19
+ [[tokens, amounts, [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]]
20
20
  );
21
21
  }
22
22
  }
@@ -12,11 +12,7 @@ class DyDxFlashLoanAction extends Action {
12
12
  * @param flParamGetterData {bytes}
13
13
  */
14
14
  constructor(loanAmount, tokenAddr, flParamGetterAddr = getAddr('Empty'), flParamGetterData= []) {
15
- super('FLDyDx',
16
- getAddr('FLDyDx'),
17
- ['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'],
18
- [[tokenAddr], [loanAmount], [], getAddr('Empty'),flParamGetterAddr, flParamGetterData, []],
19
- );
15
+ super('FLDyDx', getAddr('FLDyDx'),[['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes']], [[[tokenAddr], [loanAmount], [], getAddr('Empty'),flParamGetterAddr, flParamGetterData, []]]);
20
16
  }
21
17
  }
22
18
 
@@ -14,8 +14,8 @@ class MakerFlashLoanAction extends Action {
14
14
  super(
15
15
  'FLMaker',
16
16
  getAddr('FLMaker'),
17
- ['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'],
18
- [[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]
17
+ [['address[]','uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes']],
18
+ [[[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]]
19
19
  );
20
20
  }
21
21
  }
@@ -2,6 +2,8 @@ const DyDxFlashLoanAction = require('./DyDxFlashLoanAction');
2
2
  const DyDxFlashLoanPaybackAction = require('./DyDxFlashLoanPaybackAction');
3
3
  const AaveV2FlashLoanAction = require('./AaveV2FlashLoanAction');
4
4
  const AaveV2FlashLoanPaybackAction = require('./AaveV2FlashLoanPaybackAction');
5
+ const AaveV3FlashLoanAction = require('./AaveV3FlashLoanAction');
6
+ const AaveV3FlashLoanPaybackAction = require('./AaveV3FlashLoanPaybackAction');
5
7
  const MakerFlashLoanAction = require('./MakerFlashLoanAction');
6
8
  const MakerFlashLoanPaybackAction = require('./MakerFlashLoanPaybackAction');
7
9
  const BalancerFlashLoanAction = require('./BalancerFlashLoanAction');
@@ -12,6 +14,8 @@ module.exports = {
12
14
  DyDxFlashLoanPaybackAction,
13
15
  AaveV2FlashLoanAction,
14
16
  AaveV2FlashLoanPaybackAction,
17
+ AaveV3FlashLoanAction,
18
+ AaveV3FlashLoanPaybackAction,
15
19
  MakerFlashLoanAction,
16
20
  MakerFlashLoanPaybackAction,
17
21
  BalancerFlashLoanAction,
@@ -19,25 +19,25 @@ class GUniDeposit extends Action {
19
19
  super(
20
20
  'GUniDeposit',
21
21
  getAddr('GUniDeposit'),
22
- ['address', 'address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address'],
23
- [pool, token0, token1, amount0Max, amount1max, amount0Min, amount1Min, to, from]
22
+ [['address', 'address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address']],
23
+ [[pool, token0, token1, amount0Max, amount1max, amount0Min, amount1Min, to, from]]
24
24
  );
25
25
  this.mappableArgs = [
26
- this.args[3],
27
- this.args[4],
28
- this.args[5],
29
- this.args[6],
26
+ this.args[0][3],
27
+ this.args[0][4],
28
+ this.args[0][5],
29
+ this.args[0][6],
30
30
  ];
31
31
  }
32
32
 
33
33
  async getAssetsToApprove() {
34
34
  const approveArr = [];
35
35
 
36
- approveArr.push({asset: this.args[1], owner: this.args[8]});
37
- approveArr.push({asset: this.args[2], owner: this.args[8]});
36
+ approveArr.push({asset: this.args[0][1], owner: this.args[0][8]});
37
+ approveArr.push({asset: this.args[0][2], owner: this.args[0][8]});
38
38
 
39
39
  return approveArr;
40
40
  }
41
41
  }
42
42
 
43
- module.exports = GUniDeposit;
43
+ module.exports = GUniDeposit;
@@ -16,17 +16,17 @@ class GUniWithdraw extends Action {
16
16
  super(
17
17
  'GUniWithdraw',
18
18
  getAddr('GUniWithdraw'),
19
- ['address', 'uint256', 'uint256', 'uint256', 'address', 'address'],
20
- [pool, burnAmount, amount0Min, amount1Min, to, from]
19
+ [['address', 'uint256', 'uint256', 'uint256', 'address', 'address']],
20
+ [[pool, burnAmount, amount0Min, amount1Min, to, from]]
21
21
  );
22
22
  this.mappableArgs = [
23
- this.args[1],
23
+ this.args[0][1],
24
24
  ];
25
25
  }
26
26
 
27
27
  async getAssetsToApprove() {
28
- return [{asset: this.args[0], owner: this.args[5]}];
28
+ return [{asset: this.args[0][0], owner: this.args[0][5]}];
29
29
  }
30
30
  }
31
31
 
32
- module.exports = GUniWithdraw;
32
+ module.exports = GUniWithdraw;
@@ -17,6 +17,7 @@ const curve = require('./curve');
17
17
  const guni = require('./guni');
18
18
  const mstable = require('./mstable');
19
19
  const rari = require('./rari');
20
+ const aaveV3 = require('./aaveV3');
20
21
 
21
22
  module.exports = {
22
23
  maker,
@@ -38,4 +39,5 @@ module.exports = {
38
39
  guni,
39
40
  mstable,
40
41
  rari,
42
+ aaveV3,
41
43
  };
@@ -7,16 +7,16 @@ class InstPullTokensAction extends Action {
7
7
  super(
8
8
  "InstPullTokens",
9
9
  getAddr("InstPullTokens"),
10
- ["address", "address[]", "uint256[]", "address"],
11
- [dsaAddress, tokens, amounts, to]
10
+ [["address", "address[]", "uint256[]", "address"]],
11
+ [[dsaAddress, tokens, amounts, to]]
12
12
  );
13
13
  this.mappableArgs = [];
14
14
  }
15
15
 
16
16
  async getAssetsToApprove() {
17
17
  return [{
18
- dsaAddress: this.args[0],
19
- specialApproveLabel: 'Instadapp'
18
+ dsaAddress: this.args[0][0],
19
+ specialApproveLabel: 'Instadapp'
20
20
  }];
21
21
  }
22
22
  }
@@ -12,11 +12,16 @@ class LidoStakeAction extends Action {
12
12
  * @param to {EthAddress} stETH will be sent to this address
13
13
  */
14
14
  constructor(amount, from, to) {
15
- super('LidoStake', getAddr('LidoStake'), ['uint256','address', 'address'], [amount, from, to]);
15
+ super('LidoStake', getAddr('LidoStake'), [['uint256','address', 'address']], [[amount, from, to]]);
16
+ this.mappableArgs = [
17
+ this.args[0][0],
18
+ this.args[0][1],
19
+ this.args[0][2],
20
+ ];
16
21
  }
17
22
 
18
23
  async getAssetsToApprove() {
19
- return [{asset: getAssetInfo('WETH').address, owner: this.args[1]}];
24
+ return [{asset: getAssetInfo('WETH').address, owner: this.args[0][1]}];
20
25
  }
21
26
  }
22
27
 
@@ -11,11 +11,16 @@ class LidoUnwrapAction extends Action {
11
11
  * @param to {EthAddress} stETH will be sent to this address
12
12
  */
13
13
  constructor(amount, from, to) {
14
- super('LidoUnwrap', getAddr('LidoUnwrap'), ['uint256','address', 'address'], [amount, from, to]);
14
+ super('LidoUnwrap', getAddr('LidoUnwrap'), [['uint256','address', 'address']], [[amount, from, to]]);
15
+ this.mappableArgs = [
16
+ this.args[0][0],
17
+ this.args[0][1],
18
+ this.args[0][2],
19
+ ];
15
20
  }
16
21
 
17
22
  async getAssetsToApprove() {
18
- return [{asset: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0', owner: this.args[1]}];
23
+ return [{asset: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0', owner: this.args[0][1]}];
19
24
  }
20
25
  }
21
26
 
@@ -13,19 +13,19 @@ class LidoWrapAction extends Action {
13
13
  * @param useEth {boolean} true for using WETH, false for using stEth
14
14
  */
15
15
  constructor(amount, from, to, useEth) {
16
- super('LidoWrap', getAddr('LidoWrap'), ['uint256','address', 'address', 'bool'], [amount, from, to, useEth]);
16
+ super('LidoWrap', getAddr('LidoWrap'), [['uint256','address', 'address', 'bool']], [[amount, from, to, useEth]]);
17
17
  this.mappableArgs = [
18
- this.args[0],
19
- this.args[1],
20
- this.args[2],
18
+ this.args[0][0],
19
+ this.args[0][1],
20
+ this.args[0][2],
21
21
  ];
22
22
  }
23
23
 
24
24
  async getAssetsToApprove() {
25
- if (this.args[3]){
26
- return [{asset: getAssetInfo('WETH').address, owner: this.args[1]}];
25
+ if (this.args[0][3]){
26
+ return [{asset: getAssetInfo('WETH').address, owner: this.args[0][1]}];
27
27
  }else{
28
- return [{asset: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', owner: this.args[1]}];
28
+ return [{asset: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', owner: this.args[0][1]}];
29
29
  }
30
30
  }
31
31
  }
@@ -15,13 +15,13 @@ class LiquityBorrowAction extends Action {
15
15
  requireAddress(to);
16
16
  super('LiquityBorrow',
17
17
  getAddr('LiquityBorrow'),
18
- ['uint256', 'uint256', 'address', 'address', 'address'],
19
- [...arguments]);
18
+ [['uint256', 'uint256', 'address', 'address', 'address']],
19
+ [[...arguments]]);
20
20
 
21
21
  this.mappableArgs = [
22
- this.args[0],
23
- this.args[1],
24
- this.args[2],
22
+ this.args[0][0],
23
+ this.args[0][1],
24
+ this.args[0][2],
25
25
  ];
26
26
  }
27
27
  }
@@ -13,11 +13,11 @@ class LiquityClaimAction extends Action {
13
13
  requireAddress(to);
14
14
  super('LiquityClaim',
15
15
  getAddr('LiquityClaim'),
16
- ['address'],
17
- [...arguments]);
16
+ [['address']],
17
+ [[...arguments]]);
18
18
 
19
19
  this.mappableArgs = [
20
- this.args[0],
20
+ this.args[0][0],
21
21
  ];
22
22
  }
23
23
  }
@@ -16,12 +16,12 @@ class LiquityCloseAction extends Action {
16
16
  requireAddress(to);
17
17
  super('LiquityClose',
18
18
  getAddr('LiquityClose'),
19
- ['address', 'address'],
20
- [from, to]);
19
+ [['address', 'address']],
20
+ [[from, to]]);
21
21
 
22
22
  this.mappableArgs = [
23
- this.args[0],
24
- this.args[1],
23
+ this.args[0][0],
24
+ this.args[0][1],
25
25
  ];
26
26
  }
27
27
 
@@ -12,11 +12,11 @@ class LiquityEthGainToTroveAction extends Action {
12
12
  requireAddress(lqtyTo);
13
13
  super('LiquityEthGainToTrove',
14
14
  getAddr('LiquityEthGainToTrove'),
15
- ['address', 'address', 'address'],
16
- [...arguments]);
15
+ [['address', 'address', 'address']],
16
+ [[...arguments]]);
17
17
 
18
18
  this.mappableArgs = [
19
- this.args[0],
19
+ this.args[0][0],
20
20
  ];
21
21
  }
22
22
  }