@defisaver/sdk 0.2.9 → 0.2.12

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 (139) hide show
  1. package/ACTIONS.md +21 -379
  2. package/DEV.md +298 -0
  3. package/index.js +11 -2
  4. package/package.json +2 -2
  5. package/src/Action.js +20 -8
  6. package/src/ActionWithL2.js +36 -0
  7. package/src/actions/aave/AaveBorrowAction.js +11 -2
  8. package/src/actions/aave/AaveClaimStkAaveAction.js +5 -5
  9. package/src/actions/aave/AaveCollateralSwitchAction.js +5 -4
  10. package/src/actions/aave/AavePaybackAction.js +11 -2
  11. package/src/actions/aave/AaveSupplyAction.js +6 -6
  12. package/src/actions/aave/AaveWithdrawAction.js +8 -1
  13. package/src/actions/aaveV3/AaveV3ATokenPaybackAction.js +58 -0
  14. package/src/actions/aaveV3/AaveV3BorrowAction.js +59 -0
  15. package/src/actions/aaveV3/AaveV3ClaimRewardsAction.js +45 -0
  16. package/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +45 -0
  17. package/src/actions/aaveV3/AaveV3PaybackAction.js +68 -0
  18. package/src/actions/aaveV3/AaveV3SetEModeAction.js +40 -0
  19. package/src/actions/aaveV3/AaveV3SupplyAction.js +69 -0
  20. package/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.js +43 -0
  21. package/src/actions/aaveV3/AaveV3WithdrawAction.js +46 -0
  22. package/src/actions/aaveV3/index.js +21 -0
  23. package/src/actions/balancer/BalancerV2ClaimAction.js +12 -10
  24. package/src/actions/balancer/BalancerV2SupplyAction.js +16 -14
  25. package/src/actions/balancer/BalancerV2WithdrawAction.js +17 -15
  26. package/src/actions/basic/AutomationV2Unsub.js +3 -3
  27. package/src/actions/basic/ChangeProxyOwnerAction.js +4 -2
  28. package/src/actions/basic/GasFeeAction.js +6 -6
  29. package/src/actions/basic/PullTokenAction.js +9 -3
  30. package/src/actions/basic/SellAction.js +17 -10
  31. package/src/actions/basic/SendTokenAction.js +9 -4
  32. package/src/actions/basic/SubInputsAction.js +8 -3
  33. package/src/actions/basic/SumInputsAction.js +8 -3
  34. package/src/actions/basic/TokenBalanceAction.js +3 -3
  35. package/src/actions/basic/UnwrapEthAction.js +18 -5
  36. package/src/actions/basic/WrapEthAction.js +15 -5
  37. package/src/actions/basic/index.js +0 -6
  38. package/src/actions/checkers/MakerRatioCheckAction.js +5 -5
  39. package/src/actions/compound/CompoundBorrowAction.js +7 -1
  40. package/src/actions/compound/CompoundClaimAction.js +3 -3
  41. package/src/actions/compound/CompoundCollateralSwitchAction.js +4 -2
  42. package/src/actions/compound/CompoundGetDebtAction.js +3 -3
  43. package/src/actions/compound/CompoundPaybackAction.js +7 -1
  44. package/src/actions/compound/CompoundSupplyAction.js +4 -4
  45. package/src/actions/compound/CompoundWithdrawAction.js +7 -1
  46. package/src/actions/curve/CurveClaimFeesAction.js +4 -4
  47. package/src/actions/curve/CurveDepositAction.js +7 -7
  48. package/src/actions/curve/CurveGaugeDepositAction.js +6 -6
  49. package/src/actions/curve/CurveGaugeWithdrawAction.js +4 -4
  50. package/src/actions/curve/CurveMintCrvAction.js +3 -3
  51. package/src/actions/curve/CurveStethPoolDepositAction.js +9 -9
  52. package/src/actions/curve/CurveStethPoolWithdrawAction.js +9 -11
  53. package/src/actions/curve/CurveSwapAction.js +15 -15
  54. package/src/actions/curve/CurveWithdrawAction.js +7 -7
  55. package/src/actions/dydx/DyDxWithdrawAction.js +7 -1
  56. package/src/actions/flashloan/AaveV2FlashLoanAction.js +2 -2
  57. package/src/actions/flashloan/AaveV3FlashLoanAction.js +26 -0
  58. package/src/actions/flashloan/AaveV3FlashLoanPaybackAction.js +17 -0
  59. package/src/actions/flashloan/BalancerFlashLoanAction.js +2 -2
  60. package/src/actions/flashloan/DyDxFlashLoanAction.js +1 -5
  61. package/src/actions/flashloan/MakerFlashLoanAction.js +2 -2
  62. package/src/actions/flashloan/index.js +4 -0
  63. package/src/actions/guni/GUniDeposit.js +9 -9
  64. package/src/actions/guni/GUniWithdraw.js +5 -5
  65. package/src/actions/index.js +2 -2
  66. package/src/actions/insta/InstPullTokensAction.js +4 -4
  67. package/src/actions/lido/LidoStakeAction.js +7 -2
  68. package/src/actions/lido/LidoUnwrapAction.js +7 -2
  69. package/src/actions/lido/LidoWrapAction.js +7 -7
  70. package/src/actions/liquity/LiquityBorrowAction.js +5 -5
  71. package/src/actions/liquity/LiquityClaimAction.js +3 -3
  72. package/src/actions/liquity/LiquityCloseAction.js +4 -4
  73. package/src/actions/liquity/LiquityEthGainToTroveAction.js +3 -3
  74. package/src/actions/liquity/LiquityOpenAction.js +8 -8
  75. package/src/actions/liquity/LiquityPaybackAction.js +5 -5
  76. package/src/actions/liquity/LiquityRedeemAction.js +7 -7
  77. package/src/actions/liquity/LiquitySPDepositAction.js +7 -7
  78. package/src/actions/liquity/LiquitySPWithdrawAction.js +6 -6
  79. package/src/actions/liquity/LiquityStakeAction.js +7 -7
  80. package/src/actions/liquity/LiquitySupplyAction.js +5 -5
  81. package/src/actions/liquity/LiquityUnstakeAction.js +6 -6
  82. package/src/actions/liquity/LiquityWithdrawAction.js +4 -4
  83. package/src/actions/maker/MakerClaimAction.js +4 -4
  84. package/src/actions/maker/MakerGenerateAction.js +8 -1
  85. package/src/actions/maker/MakerGiveAction.js +4 -4
  86. package/src/actions/maker/MakerMergeAction.js +7 -1
  87. package/src/actions/maker/MakerOpenVaultAction.js +6 -1
  88. package/src/actions/maker/MakerPaybackAction.js +9 -2
  89. package/src/actions/maker/MakerRatioAction.js +5 -1
  90. package/src/actions/maker/MakerSupplyAction.js +9 -1
  91. package/src/actions/maker/MakerWithdrawAction.js +9 -1
  92. package/src/actions/mstable/MStableClaimAction.js +4 -4
  93. package/src/actions/mstable/MStableDepositAction.js +16 -16
  94. package/src/actions/mstable/MStableWithdrawAction.js +15 -15
  95. package/src/actions/rari/RariDepositAction.js +5 -5
  96. package/src/actions/rari/RariWithdrawAction.js +6 -6
  97. package/src/actions/reflexer/ReflexerGenerateAction.js +7 -1
  98. package/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +5 -5
  99. package/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +8 -3
  100. package/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +9 -4
  101. package/src/actions/reflexer/ReflexerOpenSafeAction.js +5 -1
  102. package/src/actions/reflexer/ReflexerPaybackAction.js +7 -1
  103. package/src/actions/reflexer/ReflexerSupplyAction.js +8 -1
  104. package/src/actions/reflexer/ReflexerWithdrawAction.js +8 -1
  105. package/src/actions/uniswap/UniswapSupplyAction.js +22 -20
  106. package/src/actions/uniswap/UniswapWithdrawAction.js +18 -16
  107. package/src/actions/uniswapV3/UniswapV3CollectAction.js +9 -7
  108. package/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +22 -20
  109. package/src/actions/uniswapV3/UniswapV3MintAction.js +21 -19
  110. package/src/actions/uniswapV3/UniswapV3SupplyAction.js +19 -17
  111. package/src/actions/uniswapV3/UniswapV3WithdrawAction.js +14 -12
  112. package/src/actions/yearn/YearnSupplyAction.js +6 -6
  113. package/src/actions/yearn/YearnWithdrawAction.js +6 -6
  114. package/src/addresses.js +217 -152
  115. package/src/config.js +83 -0
  116. package/src/triggers/ChainLinkPriceTrigger.js +2 -2
  117. package/src/triggers/CompoundRatioTrigger.js +1 -1
  118. package/src/triggers/GasPriceTrigger.js +1 -1
  119. package/src/triggers/LiquityRatioTrigger.js +2 -2
  120. package/src/triggers/MakerRatioTrigger.js +5 -1
  121. package/src/triggers/ReflexerRatioTrigger.js +1 -1
  122. package/src/triggers/TimestampTrigger.js +1 -1
  123. package/src/triggers/UniV3CurrentTickTrigger.js +1 -1
  124. package/src/types.js +33 -0
  125. package/src/utils/index.js +0 -2
  126. package/test/Action.js +1 -2
  127. package/test/accessLists/access-lists.js +2 -1
  128. package/test/actions/maker/MakerPaybackAction.js +2 -2
  129. package/test/index.js +4 -1
  130. package/src/actions/basic/SendTokenAndUnwrapAction.js +0 -30
  131. package/src/actions/basic/ToggleSubAction.js +0 -19
  132. package/src/actions/basic/UpdateSubAction.js +0 -19
  133. package/src/actions/convex/ConvexClaimAction.js +0 -60
  134. package/src/actions/convex/ConvexDepositAction.js +0 -67
  135. package/src/actions/convex/ConvexWithdrawAction.js +0 -65
  136. package/src/actions/convex/index.js +0 -9
  137. package/src/utils/convex-utils.js +0 -20
  138. package/src/utils/convexPoolInfo.json +0 -1039
  139. package/test/Strategy.js +0 -44
@@ -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,7 +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 convex = require('./convex');
20
+ const aaveV3 = require('./aaveV3');
21
21
 
22
22
  module.exports = {
23
23
  maker,
@@ -39,5 +39,5 @@ module.exports = {
39
39
  guni,
40
40
  mstable,
41
41
  rari,
42
- convex,
42
+ aaveV3,
43
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
  }
@@ -19,20 +19,20 @@ class LiquityOpenAction extends Action {
19
19
  requireAddress(to);
20
20
  super('LiquityOpen',
21
21
  getAddr('LiquityOpen'),
22
- ['uint256', 'uint256', 'uint256', 'address', 'address', 'address', 'address'],
23
- [...arguments]);
22
+ [['uint256', 'uint256', 'uint256', 'address', 'address', 'address', 'address']],
23
+ [[...arguments]]);
24
24
 
25
25
  this.mappableArgs = [
26
- this.args[0],
27
- this.args[1],
28
- this.args[2],
29
- this.args[3],
30
- this.args[4],
26
+ this.args[0][0],
27
+ this.args[0][1],
28
+ this.args[0][2],
29
+ this.args[0][3],
30
+ this.args[0][4],
31
31
  ];
32
32
  }
33
33
 
34
34
  async getAssetsToApprove() {
35
- return [{ asset: getAssetInfo('WETH').address, owner: this.args[3]}];
35
+ return [{ asset: getAssetInfo('WETH').address, owner: this.args[0][3]}];
36
36
  }
37
37
  }
38
38
 
@@ -15,17 +15,17 @@ class LiquityPaybackAction extends Action {
15
15
  requireAddress(from);
16
16
  super('LiquityPayback',
17
17
  getAddr('LiquityPayback'),
18
- ['uint256', 'address', 'address', 'address'],
19
- [...arguments]);
18
+ [['uint256', 'address', 'address', 'address']],
19
+ [[...arguments]]);
20
20
 
21
21
  this.mappableArgs = [
22
- this.args[0],
23
- this.args[1],
22
+ this.args[0][0],
23
+ this.args[0][1],
24
24
  ];
25
25
  }
26
26
 
27
27
  async getAssetsToApprove() {
28
- return [{ asset: getAssetInfo('LUSD').address, owner: this.args[1]}];
28
+ return [{ asset: getAssetInfo('LUSD').address, owner: this.args[0][1]}];
29
29
  }
30
30
  }
31
31
 
@@ -28,19 +28,19 @@ class LiquityRedeemAction extends Action {
28
28
  requireAddress(to);
29
29
  super('LiquityRedeem',
30
30
  getAddr('LiquityRedeem'),
31
- ['uint256', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256'],
32
- [...arguments]);
31
+ [['uint256', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256']],
32
+ [[...arguments]]);
33
33
 
34
34
  this.mappableArgs = [
35
- this.args[0],
36
- this.args[1],
37
- this.args[2],
38
- this.args[8],
35
+ this.args[0][0],
36
+ this.args[0][1],
37
+ this.args[0][2],
38
+ this.args[0][8],
39
39
  ];
40
40
  }
41
41
 
42
42
  async getAssetsToApprove() {
43
- return [{ asset: getAssetInfo('LUSD').address, owner: this.args[1]}];
43
+ return [{ asset: getAssetInfo('LUSD').address, owner: this.args[0][1]}];
44
44
  }
45
45
  }
46
46
 
@@ -18,19 +18,19 @@ class LiquitySPDepositAction extends Action {
18
18
  requireAddress(lqtyTo);
19
19
  super('LiquitySPDeposit',
20
20
  getAddr('LiquitySPDeposit'),
21
- ['uint256', 'address', 'address', 'address'],
22
- [...arguments]);
21
+ [['uint256', 'address', 'address', 'address']],
22
+ [[...arguments]]);
23
23
 
24
24
  this.mappableArgs = [
25
- this.args[0],
26
- this.args[1],
27
- this.args[2],
28
- this.args[3],
25
+ this.args[0][0],
26
+ this.args[0][1],
27
+ this.args[0][2],
28
+ this.args[0][3],
29
29
  ];
30
30
  }
31
31
 
32
32
  async getAssetsToApprove() {
33
- return [{ asset: getAssetInfo('LUSD').address, owner: this.args[1]}];
33
+ return [{ asset: getAssetInfo('LUSD').address, owner: this.args[0][1]}];
34
34
  }
35
35
  }
36
36
 
@@ -18,14 +18,14 @@ class LiquitySPWithdrawAction extends Action {
18
18
  requireAddress(lqtyTo);
19
19
  super('LiquitySPWithdraw',
20
20
  getAddr('LiquitySPWithdraw'),
21
- ['uint256', 'address', 'address', 'address'],
22
- [...arguments]);
21
+ [['uint256', 'address', 'address', 'address']],
22
+ [[...arguments]]);
23
23
 
24
24
  this.mappableArgs = [
25
- this.args[0],
26
- this.args[1],
27
- this.args[2],
28
- this.args[3],
25
+ this.args[0][0],
26
+ this.args[0][1],
27
+ this.args[0][2],
28
+ this.args[0][3],
29
29
  ];
30
30
  }
31
31
  }
@@ -19,19 +19,19 @@ class LiquityStakeAction extends Action {
19
19
  requireAddress(lusdTo);
20
20
  super('LiquityStake',
21
21
  getAddr('LiquityStake'),
22
- ['uint256', 'address', 'address', 'address'],
23
- [...arguments]);
22
+ [['uint256', 'address', 'address', 'address']],
23
+ [[...arguments]]);
24
24
 
25
25
  this.mappableArgs = [
26
- this.args[0],
27
- this.args[1],
28
- this.args[2],
29
- this.args[3],
26
+ this.args[0][0],
27
+ this.args[0][1],
28
+ this.args[0][2],
29
+ this.args[0][3],
30
30
  ];
31
31
  }
32
32
 
33
33
  async getAssetsToApprove() {
34
- return [{ asset: getAssetInfo('LQTY').address, owner: this.args[1]}];
34
+ return [{ asset: getAssetInfo('LQTY').address, owner: this.args[0][1]}];
35
35
  }
36
36
  }
37
37
 
@@ -15,17 +15,17 @@ class LiquitySupplyAction extends Action {
15
15
  requireAddress(from);
16
16
  super('LiquitySupply',
17
17
  getAddr('LiquitySupply'),
18
- ['uint256', 'address', 'address', 'address'],
19
- [...arguments]);
18
+ [['uint256', 'address', 'address', 'address']],
19
+ [[...arguments]]);
20
20
 
21
21
  this.mappableArgs = [
22
- this.args[0],
23
- this.args[1],
22
+ this.args[0][0],
23
+ this.args[0][1],
24
24
  ];
25
25
  }
26
26
 
27
27
  async getAssetsToApprove() {
28
- return [{ asset: getAssetInfo('WETH').address, owner: this.args[1]}];
28
+ return [{ asset: getAssetInfo('WETH').address, owner: this.args[0][1]}];
29
29
  }
30
30
  }
31
31
 
@@ -18,14 +18,14 @@ class LiquityUnstakeAction extends Action {
18
18
  requireAddress(lusdTo);
19
19
  super('LiquityUnstake',
20
20
  getAddr('LiquityUnstake'),
21
- ['uint256', 'address', 'address', 'address'],
22
- [...arguments]);
21
+ [['uint256', 'address', 'address', 'address']],
22
+ [[...arguments]]);
23
23
 
24
24
  this.mappableArgs = [
25
- this.args[0],
26
- this.args[1],
27
- this.args[2],
28
- this.args[3],
25
+ this.args[0][0],
26
+ this.args[0][1],
27
+ this.args[0][2],
28
+ this.args[0][3],
29
29
  ];
30
30
  }
31
31
  }
@@ -14,12 +14,12 @@ class LiquityWithdrawAction extends Action {
14
14
  requireAddress(to);
15
15
  super('LiquityWithdraw',
16
16
  getAddr('LiquityWithdraw'),
17
- ['uint256', 'address', 'address', 'address'],
18
- [...arguments]);
17
+ [['uint256', 'address', 'address', 'address']],
18
+ [[...arguments]]);
19
19
 
20
20
  this.mappableArgs = [
21
- this.args[0],
22
- this.args[1],
21
+ this.args[0][0],
22
+ this.args[0][1],
23
23
  ];
24
24
  }
25
25
  }
@@ -13,12 +13,12 @@ class MakerClaimAction extends Action {
13
13
  * @param to {EthAddress} Tokens will be sent to this address
14
14
  */
15
15
  constructor(vaultId, joinAddr, to) {
16
- super('McdClaim', getAddr('McdClaim'), ['uint256','address','address'], [vaultId, joinAddr, to]);
16
+ super('McdClaim', getAddr('McdClaim'), [['uint256','address','address']], [[vaultId, joinAddr, to]]);
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
  }
@@ -14,7 +14,14 @@ class MakerGenerateAction extends Action {
14
14
  */
15
15
  constructor(vaultId, amount, to, mcdManager = getAddr('McdCdpManager')) {
16
16
  requireAddress(to);
17
- super('McdGenerate', getAddr('McdGenerate'), ['uint256','uint256','address','address'], [vaultId, amount, to, mcdManager]);
17
+ super('McdGenerate', getAddr('McdGenerate'), [['uint256','uint256','address','address']], [[vaultId, amount, to, mcdManager]]);
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
 
@@ -15,12 +15,12 @@ class MakerGiveAction extends Action {
15
15
  */
16
16
  constructor(vaultId, newOwner, createProxy, mcdManager= getAddr('McdCdpManager')) {
17
17
  requireAddress(newOwner);
18
- super('McdGive', getAddr('McdGive'), ["uint256", "address", "bool", "address"], [vaultId, newOwner, createProxy, mcdManager]);
18
+ super('McdGive', getAddr('McdGive'), [["uint256", "address", "bool", "address"]], [[vaultId, newOwner, createProxy, mcdManager]]);
19
19
 
20
20
  this.mappableArgs = [
21
- this.args[0],
22
- this.args[1],
23
- this.args[2],
21
+ this.args[0][0],
22
+ this.args[0][1],
23
+ this.args[0][2],
24
24
  ];
25
25
  }
26
26
  }
@@ -12,7 +12,13 @@ class MakerMergeAction extends Action {
12
12
  * @param mcdManager {EthAddress}
13
13
  */
14
14
  constructor(srcVaultId, destVaultId, mcdManager = getAddr('McdCdpManager')) {
15
- super('McdMerge', getAddr('McdMerge'), ['uint256','uint256','address'], [srcVaultId, destVaultId, mcdManager]);
15
+ super('McdMerge', getAddr('McdMerge'), [['uint256','uint256','address']], [[srcVaultId, destVaultId, mcdManager]]);
16
+
17
+ this.mappableArgs = [
18
+ this.args[0][0],
19
+ this.args[0][1],
20
+ this.args[0][2],
21
+ ];
16
22
  }
17
23
  }
18
24
 
@@ -10,7 +10,12 @@ class MakerOpenVaultAction extends Action {
10
10
  * @param mcdManager {EthAddress}
11
11
  */
12
12
  constructor(joinAddr, mcdManager = getAddr('McdCdpManager')) {
13
- super('McdOpen', getAddr('McdOpen'), ['address','address'], [joinAddr, mcdManager]);
13
+ super('McdOpen', getAddr('McdOpen'), [['address','address']], [[joinAddr, mcdManager]]);
14
+
15
+ this.mappableArgs = [
16
+ this.args[0][0],
17
+ this.args[0][1],
18
+ ];
14
19
  }
15
20
  }
16
21
 
@@ -14,11 +14,18 @@ class MakerPaybackAction extends Action {
14
14
  * @param mcdManager {EthAddress}
15
15
  */
16
16
  constructor(vaultId, amount, from, mcdManager = getAddr('McdCdpManager')) {
17
- super('McdPayback', getAddr('McdPayback'), ['uint256','uint256','address','address'], [vaultId, amount, from, mcdManager]);
17
+ super('McdPayback', getAddr('McdPayback'), [['uint256','uint256','address','address']], [[vaultId, amount, from, mcdManager]]);
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() {
21
- return [{asset: getAssetInfo('DAI').address, owner: this.args[2]}];
28
+ return [{asset: getAssetInfo('DAI').address, owner: this.args[0][2]}];
22
29
  }
23
30
  }
24
31