@defisaver/sdk 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ACTIONS.md +379 -21
- package/DEV.md +0 -298
- package/package.json +2 -2
- package/src/Action.js +3 -6
- 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/aaveV3/AaveV3ATokenPaybackAction.js +13 -13
- package/src/actions/aaveV3/AaveV3BorrowAction.js +16 -16
- package/src/actions/aaveV3/AaveV3ClaimRewardsAction.js +8 -8
- package/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +9 -9
- package/src/actions/aaveV3/AaveV3PaybackAction.js +16 -16
- package/src/actions/aaveV3/AaveV3SetEModeAction.js +7 -7
- package/src/actions/aaveV3/AaveV3SupplyAction.js +17 -17
- package/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.js +8 -8
- package/src/actions/aaveV3/AaveV3WithdrawAction.js +11 -11
- 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 +30 -0
- package/src/actions/basic/SubInputsAction.js +3 -8
- package/src/actions/basic/SumInputsAction.js +3 -8
- package/src/actions/basic/ToggleSubAction.js +19 -0
- package/src/actions/basic/TokenBalanceAction.js +3 -3
- package/src/actions/basic/UnwrapEthAction.js +3 -8
- package/src/actions/basic/UpdateSubAction.js +19 -0
- package/src/actions/basic/WrapEthAction.js +5 -8
- package/src/actions/basic/index.js +6 -0
- 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/convex/ConvexClaimAction.js +60 -0
- package/src/actions/convex/ConvexDepositAction.js +67 -0
- package/src/actions/convex/ConvexWithdrawAction.js +65 -0
- package/src/actions/convex/index.js +9 -0
- package/src/actions/curve/CurveClaimFeesAction.js +4 -4
- package/src/actions/curve/CurveDepositAction.js +7 -7
- package/src/actions/curve/CurveGaugeDepositAction.js +6 -6
- package/src/actions/curve/CurveGaugeWithdrawAction.js +4 -4
- package/src/actions/curve/CurveMintCrvAction.js +3 -3
- package/src/actions/curve/CurveStethPoolDepositAction.js +9 -9
- package/src/actions/curve/CurveStethPoolWithdrawAction.js +11 -9
- 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/AaveV3FlashLoanAction.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/index.js +2 -0
- 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/addresses.js +19 -12
- package/src/triggers/ChainLinkPriceTrigger.js +2 -2
- package/src/triggers/CompoundRatioTrigger.js +1 -1
- package/src/triggers/GasPriceTrigger.js +1 -1
- package/src/triggers/LiquityRatioTrigger.js +2 -2
- package/src/triggers/MakerRatioTrigger.js +1 -5
- package/src/triggers/ReflexerRatioTrigger.js +1 -1
- package/src/triggers/TimestampTrigger.js +1 -1
- package/src/triggers/UniV3CurrentTickTrigger.js +1 -1
- package/src/utils/convex-utils.js +20 -0
- package/src/utils/convexPoolInfo.json +1039 -0
- package/src/utils/index.js +2 -0
- package/test/Action.js +2 -1
- package/test/Strategy.js +44 -0
- package/test/accessLists/access-lists.js +1 -2
- package/test/actions/maker/MakerPaybackAction.js +2 -2
|
@@ -15,15 +15,7 @@ class MakerSupplyAction extends Action {
|
|
|
15
15
|
* @param mcdManager {EthAddress}
|
|
16
16
|
*/
|
|
17
17
|
constructor(vaultId, amount, joinAddr, from, mcdManager = getAddr('McdCdpManager')) {
|
|
18
|
-
super('McdSupply', getAddr('McdSupply'), [
|
|
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
|
-
];
|
|
18
|
+
super('McdSupply', getAddr('McdSupply'), ['uint256','uint256','address','address','address'], [vaultId, amount, joinAddr, from, mcdManager]);
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
async getAssetsToApprove() {
|
|
@@ -16,15 +16,7 @@ class MakerWithdrawAction extends Action {
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(vaultId, amount, joinAddr, to, mcdManager = getAddr('McdCdpManager')) {
|
|
18
18
|
requireAddress(to);
|
|
19
|
-
super('McdWithdraw', getAddr('McdWithdraw'), [
|
|
20
|
-
|
|
21
|
-
this.mappableArgs = [
|
|
22
|
-
this.args[0][0],
|
|
23
|
-
this.args[0][1],
|
|
24
|
-
this.args[0][2],
|
|
25
|
-
this.args[0][3],
|
|
26
|
-
this.args[0][4],
|
|
27
|
-
];
|
|
19
|
+
super('McdWithdraw', getAddr('McdWithdraw'), ['uint256','uint256','address','address','address'], [vaultId, amount, joinAddr, to, mcdManager]);
|
|
28
20
|
}
|
|
29
21
|
}
|
|
30
22
|
|
|
@@ -24,13 +24,13 @@ class MStableClaimAction extends Action {
|
|
|
24
24
|
super(
|
|
25
25
|
'MStableClaim',
|
|
26
26
|
getAddr('MStableClaim'),
|
|
27
|
-
[
|
|
28
|
-
[
|
|
27
|
+
['address', 'address', 'uint256', 'uint256'],
|
|
28
|
+
[...arguments],
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
this.mappableArgs = [
|
|
32
|
-
this.args[0]
|
|
33
|
-
this.args[
|
|
32
|
+
this.args[0],
|
|
33
|
+
this.args[1],
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -39,39 +39,39 @@ class MStableDepositAction extends Action {
|
|
|
39
39
|
super(
|
|
40
40
|
'MStableDeposit',
|
|
41
41
|
getAddr('MStableDeposit'),
|
|
42
|
-
[
|
|
43
|
-
[
|
|
42
|
+
['address', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256'],
|
|
43
|
+
[...arguments],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
this.mappableArgs = [
|
|
47
|
-
this.args[0]
|
|
48
|
-
this.args[
|
|
49
|
-
this.args[
|
|
50
|
-
this.args[
|
|
51
|
-
this.args[
|
|
52
|
-
this.args[
|
|
53
|
-
this.args[
|
|
54
|
-
this.args[
|
|
55
|
-
this.args[
|
|
47
|
+
this.args[0],
|
|
48
|
+
this.args[1],
|
|
49
|
+
this.args[2],
|
|
50
|
+
this.args[3],
|
|
51
|
+
this.args[4],
|
|
52
|
+
this.args[5],
|
|
53
|
+
this.args[6],
|
|
54
|
+
this.args[7],
|
|
55
|
+
this.args[8],
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
async getAssetsToApprove() {
|
|
60
|
-
const assetPair = this.args[
|
|
61
|
-
const owner = this.args[
|
|
60
|
+
const assetPair = this.args[8];
|
|
61
|
+
const owner = this.args[4];
|
|
62
62
|
let asset;
|
|
63
63
|
switch (assetPair) {
|
|
64
64
|
case mstableAssetPairs.BASSET_MASSET:
|
|
65
65
|
case mstableAssetPairs.BASSET_IMASSET:
|
|
66
66
|
case mstableAssetPairs.BASSET_IMASSETVAULT:
|
|
67
|
-
asset = this.args[0]
|
|
67
|
+
asset = this.args[0];
|
|
68
68
|
break;
|
|
69
69
|
case mstableAssetPairs.MASSET_IMASSET:
|
|
70
70
|
case mstableAssetPairs.MASSET_IMASSETVAULT:
|
|
71
|
-
asset = this.args[
|
|
71
|
+
asset = this.args[1];
|
|
72
72
|
break;
|
|
73
73
|
case mstableAssetPairs.IMASSET_IMASSETVAULT:
|
|
74
|
-
asset = this.args[
|
|
74
|
+
asset = this.args[2];
|
|
75
75
|
break;
|
|
76
76
|
default:
|
|
77
77
|
return [];
|
|
@@ -39,26 +39,26 @@ class MStableWithdrawAction extends Action {
|
|
|
39
39
|
super(
|
|
40
40
|
'MStableWithdraw',
|
|
41
41
|
getAddr('MStableWithdraw'),
|
|
42
|
-
[
|
|
43
|
-
[
|
|
42
|
+
['address', 'address', 'address', 'address', 'address', 'address', 'uint256', 'uint256', 'uint256'],
|
|
43
|
+
[...arguments],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
this.mappableArgs = [
|
|
47
|
-
this.args[0]
|
|
48
|
-
this.args[
|
|
49
|
-
this.args[
|
|
50
|
-
this.args[
|
|
51
|
-
this.args[
|
|
52
|
-
this.args[
|
|
53
|
-
this.args[
|
|
54
|
-
this.args[
|
|
55
|
-
this.args[
|
|
47
|
+
this.args[0],
|
|
48
|
+
this.args[1],
|
|
49
|
+
this.args[2],
|
|
50
|
+
this.args[3],
|
|
51
|
+
this.args[4],
|
|
52
|
+
this.args[5],
|
|
53
|
+
this.args[6],
|
|
54
|
+
this.args[7],
|
|
55
|
+
this.args[8],
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
async getAssetsToApprove() {
|
|
60
|
-
const assetPair = this.args[
|
|
61
|
-
const owner = this.args[
|
|
60
|
+
const assetPair = this.args[8];
|
|
61
|
+
const owner = this.args[4];
|
|
62
62
|
let asset;
|
|
63
63
|
switch (assetPair) {
|
|
64
64
|
case mstableAssetPairs.BASSET_IMASSETVAULT:
|
|
@@ -67,10 +67,10 @@ class MStableWithdrawAction extends Action {
|
|
|
67
67
|
return [];
|
|
68
68
|
case mstableAssetPairs.MASSET_IMASSET:
|
|
69
69
|
case mstableAssetPairs.BASSET_IMASSET:
|
|
70
|
-
asset = this.args[
|
|
70
|
+
asset = this.args[2];
|
|
71
71
|
break;
|
|
72
72
|
case mstableAssetPairs.BASSET_MASSET:
|
|
73
|
-
asset = this.args[
|
|
73
|
+
asset = this.args[1];
|
|
74
74
|
break;
|
|
75
75
|
default:
|
|
76
76
|
return [];
|
|
@@ -15,16 +15,16 @@ class RariDepositAction extends Action {
|
|
|
15
15
|
* @param to {EthAddress} RSPT will be sent to this address
|
|
16
16
|
*/
|
|
17
17
|
constructor(fundManager, stablecoinAddress, poolTokenAddress, amount, from, to) {
|
|
18
|
-
super('RariDeposit', getAddr('RariDeposit'), [
|
|
18
|
+
super('RariDeposit', getAddr('RariDeposit'), ['address', 'address', 'address', 'uint256', 'address', 'address'], [fundManager, stablecoinAddress, poolTokenAddress, amount, from, to]);
|
|
19
19
|
this.mappableArgs = [
|
|
20
|
-
this.args[
|
|
21
|
-
this.args[
|
|
22
|
-
this.args[
|
|
20
|
+
this.args[3],
|
|
21
|
+
this.args[4],
|
|
22
|
+
this.args[5],
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async getAssetsToApprove() {
|
|
27
|
-
return [{asset: this.args[
|
|
27
|
+
return [{asset: this.args[1], owner: this.args[4]}];
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -16,17 +16,17 @@ class RariWithdrawAction extends Action {
|
|
|
16
16
|
* @param to {EthAddress} stablecoins withdrawn will be sent to this address
|
|
17
17
|
*/
|
|
18
18
|
constructor(fundManager, poolTokenAddress, poolTokensAmountToPull, from, stablecoinAddress, stablecoinAmountToWithdraw, to) {
|
|
19
|
-
super('RariWithdraw', getAddr('RariWithdraw'), [
|
|
19
|
+
super('RariWithdraw', getAddr('RariWithdraw'), ['address', 'address', 'uint256', 'address', 'address', 'uint256', 'address'], [fundManager, poolTokenAddress, poolTokensAmountToPull, from, stablecoinAddress, stablecoinAmountToWithdraw, to]);
|
|
20
20
|
this.mappableArgs = [
|
|
21
|
-
this.args[
|
|
22
|
-
this.args[
|
|
23
|
-
this.args[
|
|
24
|
-
this.args[
|
|
21
|
+
this.args[2],
|
|
22
|
+
this.args[3],
|
|
23
|
+
this.args[5],
|
|
24
|
+
this.args[6],
|
|
25
25
|
];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async getAssetsToApprove() {
|
|
29
|
-
return [{asset: this.args[
|
|
29
|
+
return [{asset: this.args[1], owner: this.args[3]}];
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -13,13 +13,7 @@ class ReflexerGenerateAction extends Action {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(vaultId, amount, to) {
|
|
15
15
|
requireAddress(to);
|
|
16
|
-
super('ReflexerGenerate', getAddr('ReflexerGenerate'), [
|
|
17
|
-
|
|
18
|
-
this.mappableArgs = [
|
|
19
|
-
this.args[0][0],
|
|
20
|
-
this.args[0][1],
|
|
21
|
-
this.args[0][2],
|
|
22
|
-
];
|
|
16
|
+
super('ReflexerGenerate', getAddr('ReflexerGenerate'), ['uint256','uint256','address'], [vaultId, amount, to]);
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
|
|
@@ -12,17 +12,17 @@ class ReflexerNativeUniV2SaviourDepositAction extends Action {
|
|
|
12
12
|
* @param lpTokenAmount {string}
|
|
13
13
|
*/
|
|
14
14
|
constructor(from, safeId, lpTokenAmount) {
|
|
15
|
-
super('ReflexerNativeUniV2SaviourDeposit', getAddr('ReflexerNativeUniV2SaviourDeposit'), [
|
|
15
|
+
super('ReflexerNativeUniV2SaviourDeposit', getAddr('ReflexerNativeUniV2SaviourDeposit'), ['address','uint256','uint256'], [from, safeId, lpTokenAmount]);
|
|
16
16
|
this.mappableArgs = [
|
|
17
|
-
this.args[0]
|
|
18
|
-
this.args[
|
|
19
|
-
this.args[
|
|
17
|
+
this.args[0],
|
|
18
|
+
this.args[1],
|
|
19
|
+
this.args[2],
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async getAssetsToApprove() {
|
|
24
24
|
const tokenAddress = getAddr('RaiWethUniV2LPToken');
|
|
25
|
-
return [{asset: tokenAddress, owner: this.args[0]
|
|
25
|
+
return [{asset: tokenAddress, owner: this.args[0]}];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
}
|
|
@@ -11,16 +11,11 @@ class ReflexerNativeUniV2SaviourGetReservesAction extends Action {
|
|
|
11
11
|
* @param safeId {SafeId}
|
|
12
12
|
*/
|
|
13
13
|
constructor(to, safeId) {
|
|
14
|
-
super('ReflexerNativeUniV2SaviourGetReserves', getAddr('ReflexerNativeUniV2SaviourGetReserves'), [
|
|
14
|
+
super('ReflexerNativeUniV2SaviourGetReserves', getAddr('ReflexerNativeUniV2SaviourGetReserves'), ['address','uint256'], [to, safeId]);
|
|
15
15
|
this.mappableArgs = [
|
|
16
|
-
this.args[0]
|
|
16
|
+
this.args[0],
|
|
17
17
|
];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async getAssetsToApprove() {
|
|
21
|
-
return [];
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
}
|
|
25
20
|
|
|
26
|
-
module.exports = ReflexerNativeUniV2SaviourGetReservesAction;
|
|
21
|
+
module.exports = ReflexerNativeUniV2SaviourGetReservesAction;
|
|
@@ -12,17 +12,12 @@ class ReflexerNativeUniV2SaviourWithdrawAction extends Action {
|
|
|
12
12
|
* @param lpTokenAmount {string}
|
|
13
13
|
*/
|
|
14
14
|
constructor(to, safeId, lpTokenAmount) {
|
|
15
|
-
super('ReflexerNativeUniV2SaviourWithdraw', getAddr('ReflexerNativeUniV2SaviourWithdraw'), [
|
|
15
|
+
super('ReflexerNativeUniV2SaviourWithdraw', getAddr('ReflexerNativeUniV2SaviourWithdraw'), ['address','uint256','uint256', ], [to, safeId, lpTokenAmount]);
|
|
16
16
|
this.mappableArgs = [
|
|
17
|
-
this.args[0]
|
|
18
|
-
this.args[
|
|
17
|
+
this.args[0],
|
|
18
|
+
this.args[2],
|
|
19
19
|
];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async getAssetsToApprove() {
|
|
23
|
-
return [];
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
}
|
|
27
22
|
|
|
28
|
-
module.exports = ReflexerNativeUniV2SaviourWithdrawAction;
|
|
23
|
+
module.exports = ReflexerNativeUniV2SaviourWithdrawAction;
|
|
@@ -9,11 +9,7 @@ class ReflexerOpenSafeAction extends Action {
|
|
|
9
9
|
* @param adapterAddr {EthAddress}
|
|
10
10
|
*/
|
|
11
11
|
constructor(adapterAddr) {
|
|
12
|
-
super('ReflexerOpen', getAddr('ReflexerOpen'), [
|
|
13
|
-
|
|
14
|
-
this.mappableArgs = [
|
|
15
|
-
this.args[0][0],
|
|
16
|
-
];
|
|
12
|
+
super('ReflexerOpen', getAddr('ReflexerOpen'), ['address'], [adapterAddr]);
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
|
|
@@ -13,13 +13,7 @@ class ReflexerPaybackAction extends Action {
|
|
|
13
13
|
* @param from {EthAddress} RAI will be sent from this address
|
|
14
14
|
*/
|
|
15
15
|
constructor(safeId, amount, from) {
|
|
16
|
-
super('ReflexerPayback', getAddr('ReflexerPayback'), [
|
|
17
|
-
|
|
18
|
-
this.mappableArgs = [
|
|
19
|
-
this.args[0][0],
|
|
20
|
-
this.args[0][1],
|
|
21
|
-
this.args[0][2],
|
|
22
|
-
];
|
|
16
|
+
super('ReflexerPayback', getAddr('ReflexerPayback'), ['uint256','uint256','address'], [safeId, amount, from]);
|
|
23
17
|
}
|
|
24
18
|
|
|
25
19
|
async getAssetsToApprove() {
|
|
@@ -14,14 +14,7 @@ class ReflexerSupplyAction extends Action {
|
|
|
14
14
|
* @param from {EthAddress} Tokens will be supplied from this address
|
|
15
15
|
*/
|
|
16
16
|
constructor(safeId, amount, adapterAddr, from) {
|
|
17
|
-
super('ReflexerSupply', getAddr('ReflexerSupply'), [
|
|
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('ReflexerSupply', getAddr('ReflexerSupply'), ['uint256','uint256','address','address'], [safeId, amount, adapterAddr, from]);
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
async getAssetsToApprove() {
|
|
@@ -15,14 +15,7 @@ class ReflexerWithdrawAction extends Action {
|
|
|
15
15
|
*/
|
|
16
16
|
constructor(safeId, amount, adapterAddr, to) {
|
|
17
17
|
requireAddress(to);
|
|
18
|
-
super('ReflexerWithdraw', getAddr('ReflexerWithdraw'), [
|
|
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
|
-
];
|
|
18
|
+
super('ReflexerWithdraw', getAddr('ReflexerWithdraw'), ['uint256','uint256','address','address'], [safeId, amount, adapterAddr, to]);
|
|
26
19
|
}
|
|
27
20
|
}
|
|
28
21
|
|
|
@@ -22,39 +22,37 @@ class UniswapSupplyAction extends Action {
|
|
|
22
22
|
'UniSupply',
|
|
23
23
|
getAddr('UniSupply'),
|
|
24
24
|
[
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"uint256",
|
|
35
|
-
],
|
|
25
|
+
"address",
|
|
26
|
+
"address",
|
|
27
|
+
"address",
|
|
28
|
+
"address",
|
|
29
|
+
"uint256",
|
|
30
|
+
"uint256",
|
|
31
|
+
"uint256",
|
|
32
|
+
"uint256",
|
|
33
|
+
"uint256",
|
|
36
34
|
],
|
|
37
|
-
[
|
|
35
|
+
[...arguments]
|
|
38
36
|
);
|
|
39
37
|
|
|
40
38
|
this.mappableArgs = [
|
|
41
|
-
this.args[0]
|
|
42
|
-
this.args[
|
|
43
|
-
this.args[
|
|
44
|
-
this.args[
|
|
45
|
-
this.args[
|
|
46
|
-
this.args[
|
|
39
|
+
this.args[0],
|
|
40
|
+
this.args[1],
|
|
41
|
+
this.args[2],
|
|
42
|
+
this.args[3],
|
|
43
|
+
this.args[4],
|
|
44
|
+
this.args[5]
|
|
47
45
|
];
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
async getAssetsToApprove() {
|
|
51
|
-
const assetA = getAssetInfoByAddress(this.args[0]
|
|
52
|
-
const assetB = getAssetInfoByAddress(this.args[
|
|
49
|
+
const assetA = getAssetInfoByAddress(this.args[0]);
|
|
50
|
+
const assetB = getAssetInfoByAddress(this.args[1]);
|
|
53
51
|
|
|
54
52
|
const approveArr = [];
|
|
55
53
|
|
|
56
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0]
|
|
57
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[
|
|
54
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[2], specialApproveLabel: 'uniswap v2'});
|
|
55
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[2], specialApproveLabel: 'uniswap v2'});
|
|
58
56
|
|
|
59
57
|
return approveArr;
|
|
60
58
|
}
|
|
@@ -21,32 +21,30 @@ class UniswapWithdrawAction extends Action {
|
|
|
21
21
|
'UniWithdraw',
|
|
22
22
|
getAddr('UniWithdraw'),
|
|
23
23
|
[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"uint256",
|
|
33
|
-
],
|
|
24
|
+
"address",
|
|
25
|
+
"address",
|
|
26
|
+
"uint256",
|
|
27
|
+
"address",
|
|
28
|
+
"address",
|
|
29
|
+
"uint256",
|
|
30
|
+
"uint256",
|
|
31
|
+
"uint256",
|
|
34
32
|
],
|
|
35
|
-
[
|
|
33
|
+
[...arguments]
|
|
36
34
|
);
|
|
37
35
|
|
|
38
36
|
this.mappableArgs = [
|
|
39
|
-
this.args[0]
|
|
40
|
-
this.args[
|
|
41
|
-
this.args[
|
|
42
|
-
this.args[
|
|
43
|
-
this.args[
|
|
37
|
+
this.args[0],
|
|
38
|
+
this.args[1],
|
|
39
|
+
this.args[2],
|
|
40
|
+
this.args[3],
|
|
41
|
+
this.args[4],
|
|
44
42
|
];
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
async getAssetsToApprove() {
|
|
48
|
-
const lpAddress = getPoolAddressByAddresses(this.args[0]
|
|
49
|
-
return [{asset: lpAddress, owner: this.args[
|
|
46
|
+
const lpAddress = getPoolAddressByAddresses(this.args[0], this.args[1])
|
|
47
|
+
return [{asset: lpAddress, owner: this.args[4], specialApproveLabel: 'uniswap v2'}];
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
|
|
@@ -17,27 +17,25 @@ class UniswapV3CollectAction extends Action {
|
|
|
17
17
|
'UniCollectV3',
|
|
18
18
|
getAddr('UniCollectV3'),
|
|
19
19
|
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"uint128",
|
|
25
|
-
],
|
|
20
|
+
"uint256",
|
|
21
|
+
"address",
|
|
22
|
+
"uint128",
|
|
23
|
+
"uint128",
|
|
26
24
|
],
|
|
27
|
-
[
|
|
25
|
+
[tokenId, recipient, amount0Max, amount1Max]
|
|
28
26
|
);
|
|
29
27
|
|
|
30
28
|
this.from = from;
|
|
31
29
|
|
|
32
30
|
this.mappableArgs = [
|
|
33
|
-
this.args[0]
|
|
31
|
+
this.args[0],
|
|
34
32
|
];
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
async getAssetsToApprove() {
|
|
38
36
|
return [{
|
|
39
37
|
nft: getAddr('UniswapV3PositionManager'),
|
|
40
|
-
tokenId: this.args[0]
|
|
38
|
+
tokenId: this.args[0],
|
|
41
39
|
owner: this.from,
|
|
42
40
|
specialApproveLabel: 'uniswap v3'
|
|
43
41
|
}];
|
|
@@ -26,39 +26,37 @@ class UniswapV3CreatePoolAction extends Action {
|
|
|
26
26
|
'UniCreatePoolV3',
|
|
27
27
|
getAddr('UniCreatePoolV3'),
|
|
28
28
|
[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"uint160",
|
|
43
|
-
],
|
|
29
|
+
"address",
|
|
30
|
+
"address",
|
|
31
|
+
"uint24",
|
|
32
|
+
"int24",
|
|
33
|
+
"int24",
|
|
34
|
+
"uint256",
|
|
35
|
+
"uint256",
|
|
36
|
+
"uint256",
|
|
37
|
+
"uint256",
|
|
38
|
+
"address",
|
|
39
|
+
"uint256",
|
|
40
|
+
"address",
|
|
41
|
+
"uint160",
|
|
44
42
|
],
|
|
45
|
-
[
|
|
43
|
+
[...arguments]
|
|
46
44
|
);
|
|
47
45
|
|
|
48
46
|
this.mappableArgs = [
|
|
49
|
-
this.args[
|
|
50
|
-
this.args[
|
|
47
|
+
this.args[5],
|
|
48
|
+
this.args[6],
|
|
51
49
|
];
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
async getAssetsToApprove() {
|
|
55
|
-
const assetA = getAssetInfoByAddress(this.args[0]
|
|
56
|
-
const assetB = getAssetInfoByAddress(this.args[
|
|
53
|
+
const assetA = getAssetInfoByAddress(this.args[0]);
|
|
54
|
+
const assetB = getAssetInfoByAddress(this.args[1]);
|
|
57
55
|
|
|
58
56
|
const approveArr = [];
|
|
59
57
|
|
|
60
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0]
|
|
61
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[
|
|
58
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
59
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
62
60
|
|
|
63
61
|
return approveArr;
|
|
64
62
|
}
|
|
@@ -26,38 +26,36 @@ class UniswapV3MintAction extends Action {
|
|
|
26
26
|
'UniMintV3',
|
|
27
27
|
getAddr('UniMintV3'),
|
|
28
28
|
[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"address",
|
|
42
|
-
],
|
|
29
|
+
"address",
|
|
30
|
+
"address",
|
|
31
|
+
"uint24",
|
|
32
|
+
"int24",
|
|
33
|
+
"int24",
|
|
34
|
+
"uint256",
|
|
35
|
+
"uint256",
|
|
36
|
+
"uint256",
|
|
37
|
+
"uint256",
|
|
38
|
+
"address",
|
|
39
|
+
"uint256",
|
|
40
|
+
"address",
|
|
43
41
|
],
|
|
44
|
-
[
|
|
42
|
+
[...arguments]
|
|
45
43
|
);
|
|
46
44
|
|
|
47
45
|
this.mappableArgs = [
|
|
48
|
-
this.args[
|
|
49
|
-
this.args[
|
|
46
|
+
this.args[5],
|
|
47
|
+
this.args[6],
|
|
50
48
|
];
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
async getAssetsToApprove() {
|
|
54
|
-
const assetA = getAssetInfoByAddress(this.args[0]
|
|
55
|
-
const assetB = getAssetInfoByAddress(this.args[
|
|
52
|
+
const assetA = getAssetInfoByAddress(this.args[0]);
|
|
53
|
+
const assetB = getAssetInfoByAddress(this.args[1]);
|
|
56
54
|
|
|
57
55
|
const approveArr = [];
|
|
58
56
|
|
|
59
|
-
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0]
|
|
60
|
-
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[
|
|
57
|
+
if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
58
|
+
if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
|
|
61
59
|
|
|
62
60
|
return approveArr;
|
|
63
61
|
}
|