@defisaver/sdk 0.1.23 → 0.1.24

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 (93) hide show
  1. package/ACTIONS.md +20 -311
  2. package/AccessLists/DyDxAccessLists.js +0 -4
  3. package/AccessLists/InstaAccessLists.js +0 -8
  4. package/AccessLists/UtilsAccessLists.js +0 -5
  5. package/DEV.md +0 -7
  6. package/index.js +15 -2
  7. package/package.json +1 -1
  8. package/src/Action.js +52 -12
  9. package/src/L2Action.js +44 -0
  10. package/src/Recipe.js +5 -4
  11. package/src/Strategy.js +63 -0
  12. package/src/abis/Action.json +157 -11
  13. package/src/abis/Recipe.json +92 -47
  14. package/src/actions/aave/AaveBorrowAction.js +11 -2
  15. package/src/actions/aave/AavePaybackAction.js +11 -2
  16. package/src/actions/aave/AaveSupplyAction.js +9 -1
  17. package/src/actions/aave/AaveWithdrawAction.js +8 -1
  18. package/src/actions/aaveV3/AaveV3ATokenPaybackAction.js +53 -0
  19. package/src/actions/aaveV3/AaveV3BorrowAction.js +54 -0
  20. package/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +41 -0
  21. package/src/actions/aaveV3/AaveV3PaybackAction.js +63 -0
  22. package/src/actions/aaveV3/AaveV3SetEModeAction.js +35 -0
  23. package/src/actions/aaveV3/AaveV3SupplyAction.js +64 -0
  24. package/src/actions/aaveV3/AaveV3WithdrawAction.js +41 -0
  25. package/src/actions/aaveV3/index.js +17 -0
  26. package/src/actions/basic/GasFeeAction.js +27 -0
  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 -3
  30. package/src/actions/basic/SumInputsAction.js +8 -3
  31. package/src/actions/basic/UnwrapEthAction.js +8 -3
  32. package/src/actions/basic/WrapEthAction.js +5 -1
  33. package/src/actions/basic/index.js +2 -2
  34. package/src/actions/checkers/MakerRatioCheckAction.js +29 -0
  35. package/src/actions/checkers/index.js +5 -0
  36. package/src/actions/compound/CompoundBorrowAction.js +7 -1
  37. package/src/actions/compound/CompoundClaimAction.js +6 -1
  38. package/src/actions/compound/CompoundPaybackAction.js +7 -1
  39. package/src/actions/compound/CompoundSupplyAction.js +7 -1
  40. package/src/actions/compound/CompoundWithdrawAction.js +7 -1
  41. package/src/actions/curve/CurveStethPoolDepositAction.js +2 -2
  42. package/src/actions/curve/CurveStethPoolWithdrawAction.js +3 -5
  43. package/src/actions/dydx/DyDxWithdrawAction.js +7 -1
  44. package/src/actions/dydx/index.js +0 -2
  45. package/src/actions/flashloan/AaveV2FlashLoanAction.js +2 -2
  46. package/src/actions/flashloan/BalancerFlashLoanAction.js +2 -2
  47. package/src/actions/flashloan/DyDxFlashLoanAction.js +1 -1
  48. package/src/actions/flashloan/MakerFlashLoanAction.js +2 -2
  49. package/src/actions/index.js +4 -0
  50. package/src/actions/insta/index.js +0 -2
  51. package/src/actions/liquity/LiquityClaimAction.js +6 -2
  52. package/src/actions/liquity/LiquityCloseAction.js +7 -2
  53. package/src/actions/maker/MakerGenerateAction.js +8 -1
  54. package/src/actions/maker/MakerGiveAction.js +7 -1
  55. package/src/actions/maker/MakerMergeAction.js +7 -1
  56. package/src/actions/maker/MakerOpenVaultAction.js +6 -1
  57. package/src/actions/maker/MakerPaybackAction.js +1 -0
  58. package/src/actions/maker/MakerRatioAction.js +20 -0
  59. package/src/actions/maker/MakerSupplyAction.js +9 -1
  60. package/src/actions/maker/MakerWithdrawAction.js +10 -2
  61. package/src/actions/maker/index.js +2 -0
  62. package/src/actions/mstable/MStableDepositAction.js +2 -2
  63. package/src/actions/mstable/MStableWithdrawAction.js +2 -2
  64. package/src/actions/reflexer/ReflexerGenerateAction.js +7 -1
  65. package/src/actions/reflexer/ReflexerOpenSafeAction.js +5 -1
  66. package/src/actions/reflexer/ReflexerPaybackAction.js +7 -1
  67. package/src/actions/reflexer/ReflexerSupplyAction.js +8 -1
  68. package/src/actions/reflexer/ReflexerWithdrawAction.js +8 -1
  69. package/src/addresses.js +179 -143
  70. package/src/config.js +74 -0
  71. package/src/triggers/ChainLinkPriceTrigger.js +12 -0
  72. package/src/triggers/CompoundRatioTrigger.js +11 -0
  73. package/src/triggers/GasPriceTrigger.js +11 -0
  74. package/src/triggers/LiquityRatioTrigger.js +16 -0
  75. package/src/triggers/MakerRatioTrigger.js +15 -0
  76. package/src/triggers/ReflexerRatioTrigger.js +11 -0
  77. package/src/triggers/TimestampTrigger.js +11 -0
  78. package/src/triggers/UniV3CurrentTickTrigger.js +12 -0
  79. package/src/triggers/index.js +19 -0
  80. package/src/types.js +33 -0
  81. package/src/utils/general.js +2 -0
  82. package/src/utils/zeroExExchange.js +2 -40
  83. package/test/accessLists/MockAccessLists.json +0 -72
  84. package/test/accessLists/Recipe.js +3 -3
  85. package/test/actions/insta/InstPullTokensAction.js +2 -2
  86. package/test/index.js +4 -1
  87. package/test/utils/zeroExExchange.js +0 -8
  88. package/src/actions/basic/BuyAction.js +0 -53
  89. package/src/actions/dydx/DyDxSupplyAction.js +0 -25
  90. package/src/actions/insta/ClaimInstMakerAction.js +0 -21
  91. package/test/actions/basic/BuyAction.js +0 -100
  92. package/test/actions/dydx/DyDxSupplyAction.js +0 -78
  93. package/test/actions/insta/ClaimInstMakerAction.js +0 -46
@@ -0,0 +1,44 @@
1
+ const Action = require('./Action');
2
+ class L2Action extends Action {
3
+ /**
4
+ * Encode arguments for calling the action via DsProxy
5
+ * @returns {string}
6
+ */
7
+ encodeForL2DsProxyCall() {
8
+ return this.encodeInputs();
9
+ }
10
+
11
+ encodeInputs(){
12
+ throw new Error('Use implementation from specific L2Action');
13
+ }
14
+
15
+ addressToBytes20(address){
16
+ return address.slice(2);
17
+ }
18
+
19
+ boolToBytes1(bool){
20
+ if (bool) {
21
+ return '01';
22
+ } else {
23
+ return '00';
24
+ }
25
+ }
26
+
27
+ numberToBytes2(number){
28
+ const hexNumber = number.toString(16);
29
+ return hexNumber.padStart(4, '0');
30
+ }
31
+
32
+ numberToBytes1(number){
33
+ const hexNumber = number.toString(16);
34
+ return hexNumber.padStart(2, '0');
35
+ }
36
+
37
+ numberToBytes32(number){
38
+ let hexNumber = number.toHexString();
39
+ hexNumber = hexNumber.slice(2);
40
+
41
+ return hexNumber.padStart(64, '0');
42
+ }
43
+ }
44
+ module.exports = L2Action;
package/src/Recipe.js CHANGED
@@ -21,7 +21,8 @@ class Recipe {
21
21
 
22
22
  this.name = name;
23
23
  this.actions = actions;
24
- this.taskExecutorAddress = getAddr('TaskExecutor');
24
+
25
+ this.recipeExecutorAddress = getAddr('RecipeExecutor');
25
26
  }
26
27
 
27
28
  /**
@@ -54,9 +55,9 @@ class Recipe {
54
55
  * @returns {Array<string>} `address` & `data` to be passed on to DSProxy's `execute(address _target, bytes memory _data)`
55
56
  */
56
57
  encodeForDsProxyCall() {
57
- const executeTaskAbi = RecipeAbi.find(({name}) => name === 'executeTask');
58
+ const executeTaskAbi = RecipeAbi.find(({name}) => name === 'executeRecipe');
58
59
  return [
59
- this.taskExecutorAddress,
60
+ this.recipeExecutorAddress,
60
61
  AbiCoder.encodeFunctionCall(executeTaskAbi, this._encodeForCall()),
61
62
  ];
62
63
  }
@@ -107,7 +108,7 @@ class Recipe {
107
108
  */
108
109
  getAccessList() {
109
110
  const addressMapping = {
110
- [getAddr('TaskExecutor')]: [],
111
+ [getAddr('RecipeExecutor')]: [],
111
112
  [getAddr('DFSRegistry')]: [],
112
113
  };
113
114
  this.actions.forEach((action) => {
@@ -0,0 +1,63 @@
1
+ const Action = require('./Action');
2
+
3
+ // TODO: Code is a prototype should be cleaned up before use in prod.
4
+
5
+ class Strategy {
6
+
7
+ constructor(name) {
8
+ this.name = name;
9
+ this.subSlots = {};
10
+ this.actions = [];
11
+ this.triggers = [];
12
+ this.numSubSlots = 0;
13
+ }
14
+
15
+ addSubSlot(name, type) {
16
+ this.subSlots[name] = { type, index: this.numSubSlots + 128 };
17
+ this.numSubSlots++;
18
+ }
19
+
20
+ addTrigger(newTrigger) {
21
+ this.triggers.push(newTrigger);
22
+ }
23
+
24
+ addAction(newAction) {
25
+ this.actions.push(newAction);
26
+ }
27
+
28
+ print() {
29
+ console.log(`Name: ${this.name }`);
30
+ console.log(`Slots: ${this.subSlots }`);
31
+ console.log(`Action: ${this.actions[0]}`);
32
+ }
33
+
34
+ getSubSlots() {
35
+ return this.subSlots;
36
+ }
37
+
38
+ // TODO: Probably should be tied into Recipe obj. not directly with actions
39
+ encodeForDsProxyCall() {
40
+ const triggerIds = this.triggers.map((trigger) => trigger.getId());
41
+
42
+ const paramMappings = [];
43
+ const actionIds = [];
44
+
45
+ this.actions.forEach(action => {
46
+ const actionEncoded = action.encodeForStrategy(this.subSlots);
47
+
48
+ actionIds.push(actionEncoded[0]);
49
+ paramMappings.push(actionEncoded[1]);
50
+ });
51
+
52
+ return [
53
+ this.name,
54
+ triggerIds,
55
+ actionIds,
56
+ paramMappings
57
+ ];
58
+ }
59
+
60
+ }
61
+
62
+ module.exports = Strategy;
63
+
@@ -1,4 +1,55 @@
1
1
  [
2
+ {
3
+ "inputs": [],
4
+ "name": "NonContractCall",
5
+ "type": "error"
6
+ },
7
+ {
8
+ "inputs": [],
9
+ "name": "ReturnIndexValueError",
10
+ "type": "error"
11
+ },
12
+ {
13
+ "inputs": [],
14
+ "name": "SenderNotAdmin",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "SenderNotOwner",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [],
24
+ "name": "SubIndexValueError",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [],
29
+ "name": "ADMIN_VAULT_ADDR",
30
+ "outputs": [
31
+ {
32
+ "internalType": "address",
33
+ "name": "",
34
+ "type": "address"
35
+ }
36
+ ],
37
+ "stateMutability": "view",
38
+ "type": "function"
39
+ },
40
+ {
41
+ "inputs": [],
42
+ "name": "NO_PARAM_MAPPING",
43
+ "outputs": [
44
+ {
45
+ "internalType": "uint8",
46
+ "name": "",
47
+ "type": "uint8"
48
+ }
49
+ ],
50
+ "stateMutability": "view",
51
+ "type": "function"
52
+ },
2
53
  {
3
54
  "inputs": [],
4
55
  "name": "REGISTRY_ADDR",
@@ -12,6 +63,58 @@
12
63
  "stateMutability": "view",
13
64
  "type": "function"
14
65
  },
66
+ {
67
+ "inputs": [],
68
+ "name": "RETURN_MAX_INDEX_VALUE",
69
+ "outputs": [
70
+ {
71
+ "internalType": "uint8",
72
+ "name": "",
73
+ "type": "uint8"
74
+ }
75
+ ],
76
+ "stateMutability": "view",
77
+ "type": "function"
78
+ },
79
+ {
80
+ "inputs": [],
81
+ "name": "RETURN_MIN_INDEX_VALUE",
82
+ "outputs": [
83
+ {
84
+ "internalType": "uint8",
85
+ "name": "",
86
+ "type": "uint8"
87
+ }
88
+ ],
89
+ "stateMutability": "view",
90
+ "type": "function"
91
+ },
92
+ {
93
+ "inputs": [],
94
+ "name": "SUB_MAX_INDEX_VALUE",
95
+ "outputs": [
96
+ {
97
+ "internalType": "uint8",
98
+ "name": "",
99
+ "type": "uint8"
100
+ }
101
+ ],
102
+ "stateMutability": "view",
103
+ "type": "function"
104
+ },
105
+ {
106
+ "inputs": [],
107
+ "name": "SUB_MIN_INDEX_VALUE",
108
+ "outputs": [
109
+ {
110
+ "internalType": "uint8",
111
+ "name": "",
112
+ "type": "uint8"
113
+ }
114
+ ],
115
+ "stateMutability": "view",
116
+ "type": "function"
117
+ },
15
118
  {
16
119
  "inputs": [],
17
120
  "name": "actionType",
@@ -26,25 +129,38 @@
26
129
  "type": "function"
27
130
  },
28
131
  {
29
- "inputs": [
132
+ "inputs": [],
133
+ "name": "adminVault",
134
+ "outputs": [
30
135
  {
31
- "internalType": "bytes[]",
136
+ "internalType": "contract AdminVault",
32
137
  "name": "",
33
- "type": "bytes[]"
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "stateMutability": "view",
142
+ "type": "function"
143
+ },
144
+ {
145
+ "inputs": [
146
+ {
147
+ "internalType": "bytes",
148
+ "name": "_callData",
149
+ "type": "bytes"
34
150
  },
35
151
  {
36
- "internalType": "bytes[]",
37
- "name": "",
38
- "type": "bytes[]"
152
+ "internalType": "bytes32[]",
153
+ "name": "_subData",
154
+ "type": "bytes32[]"
39
155
  },
40
156
  {
41
157
  "internalType": "uint8[]",
42
- "name": "",
158
+ "name": "_paramMapping",
43
159
  "type": "uint8[]"
44
160
  },
45
161
  {
46
162
  "internalType": "bytes32[]",
47
- "name": "",
163
+ "name": "_returnValues",
48
164
  "type": "bytes32[]"
49
165
  }
50
166
  ],
@@ -62,9 +178,9 @@
62
178
  {
63
179
  "inputs": [
64
180
  {
65
- "internalType": "bytes[]",
181
+ "internalType": "bytes",
66
182
  "name": "_callData",
67
- "type": "bytes[]"
183
+ "type": "bytes"
68
184
  }
69
185
  ],
70
186
  "name": "executeActionDirect",
@@ -72,6 +188,13 @@
72
188
  "stateMutability": "payable",
73
189
  "type": "function"
74
190
  },
191
+ {
192
+ "inputs": [],
193
+ "name": "kill",
194
+ "outputs": [],
195
+ "stateMutability": "nonpayable",
196
+ "type": "function"
197
+ },
75
198
  {
76
199
  "inputs": [],
77
200
  "name": "logger",
@@ -97,5 +220,28 @@
97
220
  ],
98
221
  "stateMutability": "view",
99
222
  "type": "function"
223
+ },
224
+ {
225
+ "inputs": [
226
+ {
227
+ "internalType": "address",
228
+ "name": "_token",
229
+ "type": "address"
230
+ },
231
+ {
232
+ "internalType": "address",
233
+ "name": "_receiver",
234
+ "type": "address"
235
+ },
236
+ {
237
+ "internalType": "uint256",
238
+ "name": "_amount",
239
+ "type": "uint256"
240
+ }
241
+ ],
242
+ "name": "withdrawStuckFunds",
243
+ "outputs": [],
244
+ "stateMutability": "nonpayable",
245
+ "type": "function"
100
246
  }
101
- ]
247
+ ]
@@ -1,4 +1,32 @@
1
1
  [
2
+ {
3
+ "inputs": [],
4
+ "name": "NonContractCall",
5
+ "type": "error"
6
+ },
7
+ {
8
+ "inputs": [],
9
+ "name": "SenderNotAdmin",
10
+ "type": "error"
11
+ },
12
+ {
13
+ "inputs": [],
14
+ "name": "SenderNotOwner",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "ADMIN_VAULT_ADDR",
20
+ "outputs": [
21
+ {
22
+ "internalType": "address",
23
+ "name": "",
24
+ "type": "address"
25
+ }
26
+ ],
27
+ "stateMutability": "view",
28
+ "type": "function"
29
+ },
2
30
  {
3
31
  "inputs": [],
4
32
  "name": "DEFISAVER_LOGGER",
@@ -48,19 +76,19 @@
48
76
  "type": "string"
49
77
  },
50
78
  {
51
- "internalType": "bytes[][]",
79
+ "internalType": "bytes[]",
52
80
  "name": "callData",
53
- "type": "bytes[][]"
81
+ "type": "bytes[]"
54
82
  },
55
83
  {
56
- "internalType": "bytes[][]",
84
+ "internalType": "bytes32[]",
57
85
  "name": "subData",
58
- "type": "bytes[][]"
86
+ "type": "bytes32[]"
59
87
  },
60
88
  {
61
- "internalType": "bytes32[]",
62
- "name": "ids",
63
- "type": "bytes32[]"
89
+ "internalType": "bytes4[]",
90
+ "name": "actionIds",
91
+ "type": "bytes4[]"
64
92
  },
65
93
  {
66
94
  "internalType": "uint8[][]",
@@ -68,8 +96,8 @@
68
96
  "type": "uint8[][]"
69
97
  }
70
98
  ],
71
- "internalType": "struct StrategyData.Task",
72
- "name": "_currTask",
99
+ "internalType": "struct StrategyModel.Recipe",
100
+ "name": "_currRecipe",
73
101
  "type": "tuple"
74
102
  },
75
103
  {
@@ -85,10 +113,10 @@
85
113
  },
86
114
  {
87
115
  "inputs": [],
88
- "name": "chiToken",
116
+ "name": "adminVault",
89
117
  "outputs": [
90
118
  {
91
- "internalType": "contract IGasToken",
119
+ "internalType": "contract AdminVault",
92
120
  "name": "",
93
121
  "type": "address"
94
122
  }
@@ -96,24 +124,6 @@
96
124
  "stateMutability": "view",
97
125
  "type": "function"
98
126
  },
99
- {
100
- "inputs": [
101
- {
102
- "internalType": "uint256",
103
- "name": "_strategyId",
104
- "type": "uint256"
105
- },
106
- {
107
- "internalType": "bytes[][]",
108
- "name": "_actionCallData",
109
- "type": "bytes[][]"
110
- }
111
- ],
112
- "name": "executeStrategyTask",
113
- "outputs": [],
114
- "stateMutability": "payable",
115
- "type": "function"
116
- },
117
127
  {
118
128
  "inputs": [
119
129
  {
@@ -124,19 +134,19 @@
124
134
  "type": "string"
125
135
  },
126
136
  {
127
- "internalType": "bytes[][]",
137
+ "internalType": "bytes[]",
128
138
  "name": "callData",
129
- "type": "bytes[][]"
139
+ "type": "bytes[]"
130
140
  },
131
141
  {
132
- "internalType": "bytes[][]",
142
+ "internalType": "bytes32[]",
133
143
  "name": "subData",
134
- "type": "bytes[][]"
144
+ "type": "bytes32[]"
135
145
  },
136
146
  {
137
- "internalType": "bytes32[]",
138
- "name": "ids",
139
- "type": "bytes32[]"
147
+ "internalType": "bytes4[]",
148
+ "name": "actionIds",
149
+ "type": "bytes4[]"
140
150
  },
141
151
  {
142
152
  "internalType": "uint8[][]",
@@ -144,27 +154,32 @@
144
154
  "type": "uint8[][]"
145
155
  }
146
156
  ],
147
- "internalType": "struct StrategyData.Task",
148
- "name": "currTask",
157
+ "internalType": "struct StrategyModel.Recipe",
158
+ "name": "_currRecipe",
149
159
  "type": "tuple"
150
160
  }
151
161
  ],
152
- "name": "executeTask",
162
+ "name": "executeRecipe",
153
163
  "outputs": [],
154
164
  "stateMutability": "payable",
155
165
  "type": "function"
156
166
  },
157
167
  {
158
- "inputs": [],
159
- "name": "gasToken",
160
- "outputs": [
168
+ "inputs": [
161
169
  {
162
- "internalType": "contract IGasToken",
163
- "name": "",
164
- "type": "address"
170
+ "internalType": "uint256",
171
+ "name": "_subId",
172
+ "type": "uint256"
173
+ },
174
+ {
175
+ "internalType": "bytes[]",
176
+ "name": "_actionCallData",
177
+ "type": "bytes[]"
165
178
  }
166
179
  ],
167
- "stateMutability": "view",
180
+ "name": "executeRecipeFromStrategy",
181
+ "outputs": [],
182
+ "stateMutability": "payable",
168
183
  "type": "function"
169
184
  },
170
185
  {
@@ -180,6 +195,13 @@
180
195
  "stateMutability": "nonpayable",
181
196
  "type": "function"
182
197
  },
198
+ {
199
+ "inputs": [],
200
+ "name": "kill",
201
+ "outputs": [],
202
+ "stateMutability": "nonpayable",
203
+ "type": "function"
204
+ },
183
205
  {
184
206
  "inputs": [],
185
207
  "name": "registry",
@@ -205,5 +227,28 @@
205
227
  "outputs": [],
206
228
  "stateMutability": "nonpayable",
207
229
  "type": "function"
230
+ },
231
+ {
232
+ "inputs": [
233
+ {
234
+ "internalType": "address",
235
+ "name": "_token",
236
+ "type": "address"
237
+ },
238
+ {
239
+ "internalType": "address",
240
+ "name": "_receiver",
241
+ "type": "address"
242
+ },
243
+ {
244
+ "internalType": "uint256",
245
+ "name": "_amount",
246
+ "type": "uint256"
247
+ }
248
+ ],
249
+ "name": "withdrawStuckFunds",
250
+ "outputs": [],
251
+ "stateMutability": "nonpayable",
252
+ "type": "function"
208
253
  }
209
- ]
254
+ ]
@@ -19,9 +19,18 @@ class AaveBorrowAction extends Action {
19
19
  super(
20
20
  'AaveBorrow',
21
21
  getAddr('AaveBorrow'),
22
- ['address', 'address', 'uint256', 'uint256', 'address', 'address'],
23
- [market, tokenAddr, amount, rateMode, to, onBehalf],
22
+ [['address', 'address', 'uint256', 'uint256', 'address', 'address']],
23
+ [[market, tokenAddr, amount, rateMode, to, onBehalf]],
24
24
  );
25
+
26
+ this.mappableArgs = [
27
+ this.args[0][0],
28
+ this.args[0][1],
29
+ this.args[0][2],
30
+ this.args[0][3],
31
+ this.args[0][4],
32
+ this.args[0][5],
33
+ ];
25
34
  }
26
35
  }
27
36
 
@@ -17,9 +17,18 @@ class AavePaybackAction extends Action {
17
17
  constructor(market, tokenAddr, amount, rateMode, from, onBehalf = getAddr('Empty')) {
18
18
  super('AavePayback',
19
19
  getAddr('AavePayback'),
20
- ['address', 'address', 'uint256', 'uint256', 'address', 'address'],
21
- [market, tokenAddr, amount, rateMode, from, onBehalf],
20
+ [['address', 'address', 'uint256', 'uint256', 'address', 'address']],
21
+ [[market, tokenAddr, amount, rateMode, from, onBehalf]],
22
22
  );
23
+
24
+ this.mappableArgs = [
25
+ this.args[0][0],
26
+ this.args[0][1],
27
+ this.args[0][2],
28
+ this.args[0][3],
29
+ this.args[0][4],
30
+ this.args[0][5],
31
+ ];
23
32
  }
24
33
 
25
34
  async getAssetsToApprove() {
@@ -15,7 +15,15 @@ class AaveSupplyAction extends Action {
15
15
  * @param enableAsColl {boolean} If we need to enable asset as collateral
16
16
  */
17
17
  constructor(market, tokenAddr, amount, from, onBehalf = getAddr('Empty'), enableAsColl) {
18
- super('AaveSupply', getAddr('AaveSupply'), ['address','address','uint256','address','address','bool'], [market, tokenAddr, amount, from, onBehalf, enableAsColl]);
18
+ super('AaveSupply', getAddr('AaveSupply'), [['address','address','uint256','address','address','bool']], [[market, tokenAddr, amount, from, onBehalf, enableAsColl]]);
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() {
@@ -14,7 +14,14 @@ class AaveWithdrawAction extends Action {
14
14
  */
15
15
  constructor(market, tokenAddr, amount, to) {
16
16
  requireAddress(to);
17
- super('AaveWithdraw', getAddr('AaveWithdraw'), ['address','address','uint256','address'], [...arguments]);
17
+ super('AaveWithdraw', getAddr('AaveWithdraw'), [['address','address','uint256','address']], [[...arguments]]);
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