@defisaver/sdk 0.2.0 → 0.2.2
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/package.json +1 -1
- package/src/Action.js +4 -8
- package/src/actions/aave/AaveBorrowAction.js +2 -11
- package/src/actions/aave/AaveClaimStkAaveAction.js +5 -5
- package/src/actions/aave/AaveCollateralSwitchAction.js +4 -5
- package/src/actions/aave/AavePaybackAction.js +2 -11
- package/src/actions/aave/AaveSupplyAction.js +6 -6
- package/src/actions/aave/AaveWithdrawAction.js +1 -8
- package/src/actions/balancer/BalancerV2ClaimAction.js +10 -12
- package/src/actions/balancer/BalancerV2SupplyAction.js +14 -16
- package/src/actions/balancer/BalancerV2WithdrawAction.js +15 -17
- package/src/actions/basic/AutomationV2Unsub.js +3 -3
- package/src/actions/basic/ChangeProxyOwnerAction.js +2 -4
- package/src/actions/basic/GasFeeAction.js +6 -6
- package/src/actions/basic/PullTokenAction.js +3 -9
- package/src/actions/basic/SellAction.js +5 -6
- package/src/actions/basic/SendTokenAction.js +3 -9
- package/src/actions/basic/SendTokenAndUnwrapAction.js +3 -9
- package/src/actions/basic/SubInputsAction.js +3 -8
- package/src/actions/basic/SumInputsAction.js +3 -8
- package/src/actions/basic/TokenBalanceAction.js +3 -3
- package/src/actions/basic/UnwrapEthAction.js +3 -8
- package/src/actions/basic/UpdateSubAction.js +1 -1
- package/src/actions/basic/WrapEthAction.js +1 -5
- package/src/actions/checkers/MakerRatioCheckAction.js +5 -5
- package/src/actions/compound/CompoundBorrowAction.js +1 -7
- package/src/actions/compound/CompoundClaimAction.js +3 -3
- package/src/actions/compound/CompoundCollateralSwitchAction.js +2 -4
- package/src/actions/compound/CompoundGetDebtAction.js +3 -3
- package/src/actions/compound/CompoundPaybackAction.js +1 -7
- package/src/actions/compound/CompoundSupplyAction.js +4 -4
- package/src/actions/compound/CompoundWithdrawAction.js +1 -7
- package/src/actions/curve/CurveClaimFeesAction.js +4 -4
- package/src/actions/curve/CurveDepositAction.js +7 -7
- package/src/actions/curve/CurveGaugeDepositAction.js +6 -6
- package/src/actions/curve/CurveGaugeWithdrawAction.js +4 -4
- package/src/actions/curve/CurveMintCrvAction.js +3 -3
- package/src/actions/curve/CurveStethPoolDepositAction.js +7 -7
- package/src/actions/curve/CurveStethPoolWithdrawAction.js +7 -7
- package/src/actions/curve/CurveSwapAction.js +15 -15
- package/src/actions/curve/CurveWithdrawAction.js +7 -7
- package/src/actions/dydx/DyDxWithdrawAction.js +1 -7
- package/src/actions/flashloan/AaveV2FlashLoanAction.js +2 -2
- package/src/actions/flashloan/BalancerFlashLoanAction.js +2 -2
- package/src/actions/flashloan/DyDxFlashLoanAction.js +5 -1
- package/src/actions/flashloan/MakerFlashLoanAction.js +2 -2
- package/src/actions/guni/GUniDeposit.js +9 -9
- package/src/actions/guni/GUniWithdraw.js +5 -5
- package/src/actions/insta/InstPullTokensAction.js +4 -4
- package/src/actions/lido/LidoStakeAction.js +2 -7
- package/src/actions/lido/LidoUnwrapAction.js +2 -7
- 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 +1 -8
- package/src/actions/maker/MakerGiveAction.js +4 -4
- package/src/actions/maker/MakerMergeAction.js +1 -7
- package/src/actions/maker/MakerOpenVaultAction.js +1 -6
- package/src/actions/maker/MakerPaybackAction.js +2 -9
- package/src/actions/maker/MakerRatioAction.js +1 -5
- package/src/actions/maker/MakerSupplyAction.js +1 -9
- package/src/actions/maker/MakerWithdrawAction.js +1 -9
- 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 +1 -7
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +5 -5
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +3 -8
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +4 -9
- package/src/actions/reflexer/ReflexerOpenSafeAction.js +1 -5
- package/src/actions/reflexer/ReflexerPaybackAction.js +1 -7
- package/src/actions/reflexer/ReflexerSupplyAction.js +1 -8
- package/src/actions/reflexer/ReflexerWithdrawAction.js +1 -8
- package/src/actions/uniswap/UniswapSupplyAction.js +20 -22
- package/src/actions/uniswap/UniswapWithdrawAction.js +16 -18
- package/src/actions/uniswapV3/UniswapV3CollectAction.js +7 -9
- package/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +20 -22
- package/src/actions/uniswapV3/UniswapV3MintAction.js +19 -21
- package/src/actions/uniswapV3/UniswapV3SupplyAction.js +17 -19
- package/src/actions/uniswapV3/UniswapV3WithdrawAction.js +12 -14
- package/src/actions/yearn/YearnSupplyAction.js +6 -6
- package/src/actions/yearn/YearnWithdrawAction.js +6 -6
- 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 +3 -2
- package/src/triggers/MakerRatioTrigger.js +1 -5
- package/src/triggers/ReflexerRatioTrigger.js +2 -1
- package/src/triggers/TimestampTrigger.js +1 -1
- package/src/triggers/UniV3CurrentTickTrigger.js +1 -1
- package/test/Action.js +2 -1
- package/test/accessLists/access-lists.js +1 -2
- package/test/actions/maker/MakerPaybackAction.js +2 -2
package/package.json
CHANGED
package/src/Action.js
CHANGED
|
@@ -107,13 +107,9 @@ class Action {
|
|
|
107
107
|
* @private
|
|
108
108
|
*/
|
|
109
109
|
_encodeForCall() {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
let _paramType = this._formatType(paramType);
|
|
114
|
-
return AbiCoder.encodeParameter(_paramType, _arg);
|
|
115
|
-
});
|
|
116
|
-
return bytesEncodedArgs;
|
|
110
|
+
let _arg = this._replaceWithPlaceholders(this.args, this.paramTypes);
|
|
111
|
+
let _paramType = this._formatType(this.paramTypes);
|
|
112
|
+
return [AbiCoder.encodeParameter(_paramType, _arg)];
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
/**
|
|
@@ -144,7 +140,7 @@ class Action {
|
|
|
144
140
|
encodeForStrategy(subSlots) {
|
|
145
141
|
return [
|
|
146
142
|
this.getId(),
|
|
147
|
-
this._getArgumentMappingWithSlots(subSlots), // paramMappings
|
|
143
|
+
[this._getArgumentMappingWithSlots(subSlots)], // paramMappings
|
|
148
144
|
]
|
|
149
145
|
}
|
|
150
146
|
|
|
@@ -19,18 +19,9 @@ class AaveBorrowAction extends Action {
|
|
|
19
19
|
super(
|
|
20
20
|
'AaveBorrow',
|
|
21
21
|
getAddr('AaveBorrow'),
|
|
22
|
-
[
|
|
23
|
-
[
|
|
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
|
-
];
|
|
34
25
|
}
|
|
35
26
|
}
|
|
36
27
|
|
|
@@ -11,13 +11,13 @@ class AaveClaimStkAaveAction extends Action {
|
|
|
11
11
|
super(
|
|
12
12
|
'AaveClaimStkAave',
|
|
13
13
|
getAddr('AaveClaimStkAave'),
|
|
14
|
-
[
|
|
15
|
-
[
|
|
14
|
+
['address[]', 'uint256', 'address'],
|
|
15
|
+
[...arguments],
|
|
16
16
|
);
|
|
17
17
|
this.mappableArgs = [
|
|
18
|
-
this.args[
|
|
19
|
-
this.args[
|
|
20
|
-
|
|
18
|
+
this.args[1],
|
|
19
|
+
this.args[2],
|
|
20
|
+
];
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const Action = require("../../Action");
|
|
2
2
|
const {requireAddress} = require("../../utils/general.js");
|
|
3
|
-
const {
|
|
3
|
+
const {getAddr} = require('../../addresses.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* AaveCollateralSwitchAction - Aave enable/disable token usage as collateral
|
|
@@ -10,11 +10,10 @@ class AaveCollateralSwitchAction extends Action {
|
|
|
10
10
|
super(
|
|
11
11
|
'AaveCollateralSwitch',
|
|
12
12
|
getAddr('AaveCollateralSwitch'),
|
|
13
|
-
[
|
|
14
|
-
[
|
|
13
|
+
['address', 'address[]', 'bool[]'],
|
|
14
|
+
[...arguments],
|
|
15
15
|
);
|
|
16
|
-
this.mappableArgs = [
|
|
17
|
-
];
|
|
16
|
+
this.mappableArgs = [];
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -17,18 +17,9 @@ class AavePaybackAction extends Action {
|
|
|
17
17
|
constructor(market, tokenAddr, amount, rateMode, from, onBehalf = getAddr('Empty')) {
|
|
18
18
|
super('AavePayback',
|
|
19
19
|
getAddr('AavePayback'),
|
|
20
|
-
[
|
|
21
|
-
[
|
|
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
|
-
];
|
|
32
23
|
}
|
|
33
24
|
|
|
34
25
|
async getAssetsToApprove() {
|
|
@@ -15,14 +15,14 @@ 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'), [
|
|
18
|
+
super('AaveSupply', getAddr('AaveSupply'), ['address','address','uint256','address','address','bool'], [market, tokenAddr, amount, from, onBehalf, enableAsColl]);
|
|
19
19
|
|
|
20
20
|
this.mappableArgs = [
|
|
21
|
-
this.args[0]
|
|
22
|
-
this.args[
|
|
23
|
-
this.args[
|
|
24
|
-
this.args[
|
|
25
|
-
this.args[
|
|
21
|
+
this.args[0],
|
|
22
|
+
this.args[1],
|
|
23
|
+
this.args[2],
|
|
24
|
+
this.args[3],
|
|
25
|
+
this.args[4],
|
|
26
26
|
];
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -14,14 +14,7 @@ class AaveWithdrawAction extends Action {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(market, tokenAddr, amount, to) {
|
|
16
16
|
requireAddress(to);
|
|
17
|
-
super('AaveWithdraw', getAddr('AaveWithdraw'), [
|
|
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
|
-
];
|
|
17
|
+
super('AaveWithdraw', getAddr('AaveWithdraw'), ['address','address','uint256','address'], [...arguments]);
|
|
25
18
|
}
|
|
26
19
|
}
|
|
27
20
|
|
|
@@ -17,29 +17,27 @@ class BalancerV2ClaimAction extends Action {
|
|
|
17
17
|
'BalancerV2Claim',
|
|
18
18
|
getAddr('BalancerV2Claim'),
|
|
19
19
|
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"bytes32[][]",
|
|
26
|
-
],
|
|
20
|
+
"address",
|
|
21
|
+
"address",
|
|
22
|
+
"uint256[]",
|
|
23
|
+
"uint256[]",
|
|
24
|
+
"bytes32[][]",
|
|
27
25
|
],
|
|
28
|
-
[
|
|
26
|
+
[liquidityProvider, to, weeks, balances, merkleProofs]
|
|
29
27
|
);
|
|
30
28
|
|
|
31
29
|
this.mappableArgs = [
|
|
32
|
-
this.args[0]
|
|
33
|
-
this.args[
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
34
32
|
];
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
async getAssetsToApprove() {
|
|
38
36
|
|
|
39
37
|
const approveArr = [];
|
|
40
|
-
if (this.args[0]
|
|
38
|
+
if (this.args[0] !== this.args[1]){
|
|
41
39
|
const tokenAddress = getAddr('BalancerToken');
|
|
42
|
-
approveArr.push({asset: tokenAddress, owner: this.args[0]
|
|
40
|
+
approveArr.push({asset: tokenAddress, owner: this.args[0]});
|
|
43
41
|
}
|
|
44
42
|
return approveArr;
|
|
45
43
|
}
|
|
@@ -18,32 +18,30 @@ class BalancerV2SupplyAction extends Action {
|
|
|
18
18
|
'BalancerV2Supply',
|
|
19
19
|
getAddr('BalancerV2Supply'),
|
|
20
20
|
[
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"bytes",
|
|
28
|
-
],
|
|
21
|
+
"bytes32",
|
|
22
|
+
"address",
|
|
23
|
+
"address",
|
|
24
|
+
"address[]",
|
|
25
|
+
"uint256[]",
|
|
26
|
+
"bytes",
|
|
29
27
|
],
|
|
30
|
-
[
|
|
28
|
+
[poolId, from, to, tokens, maxAmountsIn, userData]
|
|
31
29
|
);
|
|
32
30
|
|
|
33
31
|
this.mappableArgs = [
|
|
34
|
-
this.args[
|
|
35
|
-
this.args[
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
36
34
|
];
|
|
37
|
-
for (let i = 0; i < this.args[
|
|
38
|
-
this.mappableArgs.push(this.args[
|
|
35
|
+
for (let i = 0; i < this.args[4].length; i++){
|
|
36
|
+
this.mappableArgs.push(this.args[4][i]);
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
async getAssetsToApprove() {
|
|
43
41
|
const approveArr = [];
|
|
44
|
-
const tokens = this.args[
|
|
45
|
-
tokens.forEach(token => approveArr.push({asset: token, owner: this.args[
|
|
46
|
-
|
|
42
|
+
const tokens = this.args[3];
|
|
43
|
+
tokens.forEach(token => approveArr.push({asset: token, owner: this.args[1], specialApproveLabel: 'balancer'}));
|
|
44
|
+
|
|
47
45
|
return approveArr;
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -19,36 +19,34 @@ class BalancerV2WithdrawAction extends Action {
|
|
|
19
19
|
'BalancerV2Withdraw',
|
|
20
20
|
getAddr('BalancerV2Withdraw'),
|
|
21
21
|
[
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"bytes",
|
|
30
|
-
],
|
|
22
|
+
"bytes32",
|
|
23
|
+
"address",
|
|
24
|
+
"address",
|
|
25
|
+
"uint256",
|
|
26
|
+
"address[]",
|
|
27
|
+
"uint256[]",
|
|
28
|
+
"bytes",
|
|
31
29
|
],
|
|
32
|
-
[
|
|
30
|
+
[poolId, from, to, lpTokenAmount, tokens, minAmountsOut, userData]
|
|
33
31
|
);
|
|
34
32
|
|
|
35
33
|
this.from = from;
|
|
36
34
|
|
|
37
35
|
this.mappableArgs = [
|
|
38
|
-
this.args[
|
|
39
|
-
this.args[
|
|
40
|
-
this.args[
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
41
39
|
];
|
|
42
40
|
|
|
43
|
-
for (let i = 0; i < this.args[
|
|
44
|
-
this.mappableArgs.push(this.args[
|
|
41
|
+
for (let i = 0; i < this.args[5].length; i++){
|
|
42
|
+
this.mappableArgs.push(this.args[5][i]);
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
async getAssetsToApprove() {
|
|
49
47
|
const approveArr = [];
|
|
50
|
-
const token = this.args[0]
|
|
51
|
-
approveArr.push({asset: token, owner: this.args[
|
|
48
|
+
const token = this.args[0].slice(0,42);
|
|
49
|
+
approveArr.push({asset: token, owner: this.args[1], specialApproveLabel: 'balancer'});
|
|
52
50
|
return approveArr;
|
|
53
51
|
}
|
|
54
52
|
}
|
|
@@ -6,10 +6,10 @@ class AutomationV2Unsub extends Action {
|
|
|
6
6
|
super(
|
|
7
7
|
'AutomationV2Unsub',
|
|
8
8
|
getAddr('AutomationV2Unsub'),
|
|
9
|
-
[
|
|
10
|
-
[
|
|
9
|
+
["uint256", "uint256"],
|
|
10
|
+
[cdpId, protocol]
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
module.exports = AutomationV2Unsub;
|
|
15
|
+
module.exports = AutomationV2Unsub;
|
|
@@ -9,10 +9,8 @@ class ChangeProxyOwnerAction extends Action {
|
|
|
9
9
|
* @param newOwner {Address} Address of new owner
|
|
10
10
|
*/
|
|
11
11
|
constructor(newOwner) {
|
|
12
|
-
super("ChangeProxyOwner", getAddr("ChangeProxyOwner"), [
|
|
13
|
-
|
|
14
|
-
this.mappableArgs = [this.args[0][0]];
|
|
15
|
-
}
|
|
12
|
+
super("ChangeProxyOwner", getAddr("ChangeProxyOwner"), ["address"], [...arguments]);
|
|
13
|
+
}
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
module.exports = ChangeProxyOwnerAction;
|
|
@@ -11,17 +11,17 @@ class GasFeeAction extends Action {
|
|
|
11
11
|
constructor(gasStart, feeToken, availableAmount, dfsFeeDivider = 2000) {
|
|
12
12
|
super("GasFeeTaker",
|
|
13
13
|
getAddr("GasFeeTaker"),
|
|
14
|
-
[
|
|
15
|
-
[
|
|
14
|
+
["uint256", "address", "uint256", "uint256"],
|
|
15
|
+
[gasStart, feeToken, availableAmount, dfsFeeDivider],
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
this.mappableArgs = [
|
|
19
|
-
this.args[
|
|
20
|
-
this.args[
|
|
21
|
-
this.args[
|
|
19
|
+
this.args[1],
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
module.exports = GasFeeAction;
|
|
27
|
+
module.exports = GasFeeAction;
|
|
@@ -17,19 +17,13 @@ class PullTokenAction extends Action {
|
|
|
17
17
|
super(
|
|
18
18
|
'PullToken',
|
|
19
19
|
getAddr('PullToken'),
|
|
20
|
-
[
|
|
20
|
+
[
|
|
21
21
|
"address",
|
|
22
22
|
"address",
|
|
23
23
|
"uint",
|
|
24
|
-
]
|
|
25
|
-
[
|
|
24
|
+
],
|
|
25
|
+
[...arguments]
|
|
26
26
|
);
|
|
27
|
-
|
|
28
|
-
this.mappableArgs = [
|
|
29
|
-
this.args[0][0],
|
|
30
|
-
this.args[0][1],
|
|
31
|
-
this.args[0][2],
|
|
32
|
-
];
|
|
33
27
|
}
|
|
34
28
|
|
|
35
29
|
async getAssetsToApprove() {
|
|
@@ -19,23 +19,22 @@ class SellAction extends Action {
|
|
|
19
19
|
super(
|
|
20
20
|
'DFSSell',
|
|
21
21
|
getAddr('DFSSell'),
|
|
22
|
-
[
|
|
22
|
+
[
|
|
23
23
|
["address","address","uint256","uint256","uint256","uint256","address","address","bytes",["address","address","address","uint256","uint256","bytes"]],
|
|
24
24
|
"address",
|
|
25
25
|
"address",
|
|
26
|
-
]
|
|
27
26
|
],
|
|
28
|
-
[
|
|
27
|
+
[exchangeOrder, from, to]
|
|
29
28
|
);
|
|
30
29
|
|
|
31
30
|
this.protocolFee = protocolFee;
|
|
32
31
|
|
|
33
32
|
this.mappableArgs = [
|
|
34
|
-
this.args[0][0]
|
|
35
|
-
this.args[0][0][1],
|
|
36
|
-
this.args[0][0][2],
|
|
33
|
+
this.args[0][0],
|
|
37
34
|
this.args[0][1],
|
|
38
35
|
this.args[0][2],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
39
38
|
];
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -17,19 +17,13 @@ class SendTokenAction extends Action {
|
|
|
17
17
|
super(
|
|
18
18
|
'SendToken',
|
|
19
19
|
getAddr('SendToken'),
|
|
20
|
-
[
|
|
20
|
+
[
|
|
21
21
|
"address",
|
|
22
22
|
"address",
|
|
23
23
|
"uint",
|
|
24
|
-
]
|
|
25
|
-
[
|
|
24
|
+
],
|
|
25
|
+
[...arguments]
|
|
26
26
|
);
|
|
27
|
-
|
|
28
|
-
this.mappableArgs = [
|
|
29
|
-
this.args[0][0],
|
|
30
|
-
this.args[0][1],
|
|
31
|
-
this.args[0][2],
|
|
32
|
-
];
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
29
|
|
|
@@ -17,19 +17,13 @@ class SendTokenAndUnwrapAction extends Action {
|
|
|
17
17
|
super(
|
|
18
18
|
'SendTokenAndUnwrap',
|
|
19
19
|
getAddr('SendTokenAndUnwrap'),
|
|
20
|
-
[
|
|
20
|
+
[
|
|
21
21
|
"address",
|
|
22
22
|
"address",
|
|
23
23
|
"uint",
|
|
24
|
-
]
|
|
25
|
-
[
|
|
24
|
+
],
|
|
25
|
+
[...arguments]
|
|
26
26
|
);
|
|
27
|
-
|
|
28
|
-
this.mappableArgs = [
|
|
29
|
-
this.args[0][0],
|
|
30
|
-
this.args[0][1],
|
|
31
|
-
this.args[0][2],
|
|
32
|
-
];
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
29
|
|
|
@@ -9,17 +9,12 @@ class SubInputsAction extends Action {
|
|
|
9
9
|
super(
|
|
10
10
|
'SubInputs',
|
|
11
11
|
getAddr('SubInputs'),
|
|
12
|
-
[
|
|
12
|
+
[
|
|
13
13
|
"uint",
|
|
14
14
|
"uint",
|
|
15
|
-
]
|
|
16
|
-
[
|
|
15
|
+
],
|
|
16
|
+
[...arguments]
|
|
17
17
|
);
|
|
18
|
-
|
|
19
|
-
this.mappableArgs = [
|
|
20
|
-
this.args[0][0],
|
|
21
|
-
this.args[0][1],
|
|
22
|
-
];
|
|
23
18
|
}
|
|
24
19
|
}
|
|
25
20
|
|
|
@@ -9,17 +9,12 @@ class SumInputsAction extends Action {
|
|
|
9
9
|
super(
|
|
10
10
|
'SumInputs',
|
|
11
11
|
getAddr('SumInputs'),
|
|
12
|
-
[
|
|
12
|
+
[
|
|
13
13
|
"uint",
|
|
14
14
|
"uint",
|
|
15
|
-
]
|
|
16
|
-
[
|
|
15
|
+
],
|
|
16
|
+
[...arguments]
|
|
17
17
|
);
|
|
18
|
-
|
|
19
|
-
this.mappableArgs = [
|
|
20
|
-
this.args[0][0],
|
|
21
|
-
this.args[0][1],
|
|
22
|
-
];
|
|
23
18
|
}
|
|
24
19
|
}
|
|
25
20
|
|
|
@@ -15,17 +15,12 @@ class UnwrapEthAction extends Action {
|
|
|
15
15
|
super(
|
|
16
16
|
'UnwrapEth',
|
|
17
17
|
getAddr('UnwrapEth'),
|
|
18
|
-
[
|
|
18
|
+
[
|
|
19
19
|
"uint256",
|
|
20
20
|
"address"
|
|
21
|
-
]
|
|
22
|
-
[
|
|
21
|
+
],
|
|
22
|
+
[...arguments]
|
|
23
23
|
);
|
|
24
|
-
|
|
25
|
-
this.mappableArgs = [
|
|
26
|
-
this.args[0][0],
|
|
27
|
-
this.args[0][1],
|
|
28
|
-
];
|
|
29
24
|
}
|
|
30
25
|
}
|
|
31
26
|
|
|
@@ -10,7 +10,7 @@ class UpdateSubAction extends Action {
|
|
|
10
10
|
* @param sub object that contains new sub information
|
|
11
11
|
*/
|
|
12
12
|
constructor(subId, sub) {
|
|
13
|
-
super("UpdateSub", getAddr("UpdateSub"), [["uint256", "(uint64,bool,bytes[],bytes32[])"]], [
|
|
13
|
+
super("UpdateSub", getAddr("UpdateSub"), [["uint256", "(uint64,bool,bytes[],bytes32[])"]], [...arguments]);
|
|
14
14
|
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -9,11 +9,7 @@ class WrapEthAction extends Action {
|
|
|
9
9
|
* @param amount {string} Transfer amount
|
|
10
10
|
*/
|
|
11
11
|
constructor(amount) {
|
|
12
|
-
super("WrapEth", getAddr("WrapEth"), [
|
|
13
|
-
|
|
14
|
-
this.mappableArgs = [
|
|
15
|
-
this.args[0][0],
|
|
16
|
-
];
|
|
12
|
+
super("WrapEth", getAddr("WrapEth"), ["uint256"], [...arguments]);
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
async getEthValue() {
|
|
@@ -13,13 +13,13 @@ class MakerRatioCheckAction extends Action {
|
|
|
13
13
|
* @param startRatioIndex {uint256} Index in returnValues where ratio before actions is stored
|
|
14
14
|
*/
|
|
15
15
|
constructor(ratioState, checkTarget, targetRatio, vaultId, startRatioIndex) {
|
|
16
|
-
super("McdRatioCheck", getAddr("McdRatioCheck"), [
|
|
16
|
+
super("McdRatioCheck", getAddr("McdRatioCheck"), ["uint8","bool","uint256","uint256","uint256"], [ratioState, checkTarget, targetRatio, vaultId, startRatioIndex]);
|
|
17
17
|
|
|
18
18
|
this.mappableArgs = [
|
|
19
|
-
this.args[0]
|
|
20
|
-
this.args[
|
|
21
|
-
this.args[
|
|
22
|
-
this.args[
|
|
19
|
+
this.args[0],
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
|
+
this.args[4],
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -13,13 +13,7 @@ class CompoundBorrowAction extends Action {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(cTokenAddr, amount, to) {
|
|
15
15
|
requireAddress(to);
|
|
16
|
-
super('CompBorrow', getAddr('CompBorrow'), [
|
|
17
|
-
|
|
18
|
-
this.mappableArgs = [
|
|
19
|
-
this.args[0][0],
|
|
20
|
-
this.args[0][1],
|
|
21
|
-
this.args[0][2],
|
|
22
|
-
];
|
|
16
|
+
super('CompBorrow', getAddr('CompBorrow'), ['address','uint256','address'], [...arguments]);
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
|
|
@@ -14,11 +14,11 @@ class CompoundClaimAction extends Action {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(cSupplyAddresses, cBorrowAddresses, from, to) {
|
|
16
16
|
requireAddress(to);
|
|
17
|
-
super('CompClaim', getAddr('CompClaim'), [
|
|
17
|
+
super('CompClaim', getAddr('CompClaim'), ["address[]", "address[]", "address", "address"], [...arguments]);
|
|
18
18
|
|
|
19
19
|
this.mappableArgs = [
|
|
20
|
-
this.args[
|
|
21
|
-
this.args[
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -10,11 +10,9 @@ class CompoundCollateralSwitchAction extends Action {
|
|
|
10
10
|
super(
|
|
11
11
|
'CompCollateralSwitch',
|
|
12
12
|
getAddr('CompCollateralSwitch'),
|
|
13
|
-
[
|
|
14
|
-
[
|
|
13
|
+
['address[]', 'bool[]'],
|
|
14
|
+
[...arguments],
|
|
15
15
|
);
|
|
16
|
-
this.mappableArgs = [
|
|
17
|
-
];
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -13,13 +13,7 @@ class CompoundPaybackAction extends Action {
|
|
|
13
13
|
* @param onBehalf {EthAddress} Defaults to DsProxy address if 0x0
|
|
14
14
|
*/
|
|
15
15
|
constructor(cTokenAddr, amount, from, onBehalf = getAddr('Empty')) {
|
|
16
|
-
super('CompPayback', getAddr('CompPayback'), [
|
|
17
|
-
this.mappableArgs = [
|
|
18
|
-
this.args[0][0],
|
|
19
|
-
this.args[0][1],
|
|
20
|
-
this.args[0][2],
|
|
21
|
-
this.args[0][3],
|
|
22
|
-
];
|
|
16
|
+
super('CompPayback', getAddr('CompPayback'), ['address', 'uint256', 'address', 'address'], [cTokenAddr, amount, from, onBehalf]);
|
|
23
17
|
}
|
|
24
18
|
|
|
25
19
|
async getAssetsToApprove() {
|