@gearbox-protocol/sdk 14.12.0-next.46 → 14.12.0-next.48
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/dist/cjs/abi/compressors/liquidationCompressor.js +215 -0
- package/dist/cjs/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.js +104 -0
- package/dist/cjs/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.js +104 -0
- package/dist/cjs/dev/withdrawalAbi.js +104 -66
- package/dist/cjs/dev/withdrawalUtils.js +8 -1
- package/dist/cjs/plugins/adapters/abi/adapters/iMidasGatewayAdapterV311.js +2 -306
- package/dist/cjs/plugins/adapters/abi/index.js +2 -0
- package/dist/cjs/plugins/adapters/abi/midas/iMidasGatewayV311.js +194 -0
- package/dist/cjs/plugins/adapters/abi/midas/index.js +22 -0
- package/dist/cjs/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.js +184 -24
- package/dist/cjs/plugins/adapters/contracts/MidasGatewayAdapterContract.js +2 -1
- package/dist/esm/abi/compressors/liquidationCompressor.js +191 -0
- package/dist/esm/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.js +80 -0
- package/dist/esm/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.js +80 -0
- package/dist/esm/dev/withdrawalAbi.js +104 -66
- package/dist/esm/dev/withdrawalUtils.js +8 -1
- package/dist/esm/plugins/adapters/abi/adapters/iMidasGatewayAdapterV311.js +1 -304
- package/dist/esm/plugins/adapters/abi/index.js +1 -0
- package/dist/esm/plugins/adapters/abi/midas/iMidasGatewayV311.js +170 -0
- package/dist/esm/plugins/adapters/abi/midas/index.js +1 -0
- package/dist/esm/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.js +184 -24
- package/dist/esm/plugins/adapters/contracts/MidasGatewayAdapterContract.js +2 -4
- package/dist/types/abi/compressors/liquidationCompressor.d.ts +262 -0
- package/dist/types/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.d.ts +111 -0
- package/dist/types/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.d.ts +111 -0
- package/dist/types/dev/withdrawalAbi.d.ts +81 -53
- package/dist/types/plugins/adapters/abi/adapters/iMidasGatewayAdapterV311.d.ts +0 -233
- package/dist/types/plugins/adapters/abi/index.d.ts +1 -0
- package/dist/types/plugins/adapters/abi/midas/iMidasGatewayV311.d.ts +261 -0
- package/dist/types/plugins/adapters/abi/midas/index.d.ts +1 -0
- package/dist/types/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.d.ts +24 -0
- package/dist/types/plugins/adapters/contracts/MidasGatewayAdapterContract.d.ts +28 -0
- package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
const liquidationCompressorAbi = [
|
|
2
|
+
{
|
|
3
|
+
type: "constructor",
|
|
4
|
+
inputs: [
|
|
5
|
+
{ name: "_owner", type: "address", internalType: "address" },
|
|
6
|
+
{ name: "addressProvider_", type: "address", internalType: "address" }
|
|
7
|
+
],
|
|
8
|
+
stateMutability: "nonpayable"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
type: "function",
|
|
12
|
+
name: "addressProvider",
|
|
13
|
+
inputs: [],
|
|
14
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
15
|
+
stateMutability: "view"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: "function",
|
|
19
|
+
name: "compressorTypeToCompressor",
|
|
20
|
+
inputs: [
|
|
21
|
+
{ name: "", type: "bytes32", internalType: "bytes32" },
|
|
22
|
+
{ name: "", type: "uint256", internalType: "uint256" }
|
|
23
|
+
],
|
|
24
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
25
|
+
stateMutability: "view"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: "function",
|
|
29
|
+
name: "contractType",
|
|
30
|
+
inputs: [],
|
|
31
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
32
|
+
stateMutability: "view"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "function",
|
|
36
|
+
name: "getLiquidationData",
|
|
37
|
+
inputs: [
|
|
38
|
+
{ name: "liquidator", type: "address", internalType: "address" },
|
|
39
|
+
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
40
|
+
{
|
|
41
|
+
name: "priceUpdates",
|
|
42
|
+
type: "tuple[]",
|
|
43
|
+
internalType: "struct PriceUpdate[]",
|
|
44
|
+
components: [
|
|
45
|
+
{ name: "priceFeed", type: "address", internalType: "address" },
|
|
46
|
+
{ name: "data", type: "bytes", internalType: "bytes" }
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
outputs: [
|
|
51
|
+
{
|
|
52
|
+
name: "",
|
|
53
|
+
type: "tuple",
|
|
54
|
+
internalType: "struct LiquidationData",
|
|
55
|
+
components: [
|
|
56
|
+
{
|
|
57
|
+
name: "requiredUnderlyingAmount",
|
|
58
|
+
type: "uint256",
|
|
59
|
+
internalType: "uint256"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "expectedOutputs",
|
|
63
|
+
type: "tuple[]",
|
|
64
|
+
internalType: "struct LiquidationOutput[]",
|
|
65
|
+
components: [
|
|
66
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
67
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
68
|
+
{ name: "delayed", type: "bool", internalType: "bool" },
|
|
69
|
+
{
|
|
70
|
+
name: "redeemerAddress",
|
|
71
|
+
type: "address",
|
|
72
|
+
internalType: "address"
|
|
73
|
+
},
|
|
74
|
+
{ name: "claimableAt", type: "uint256", internalType: "uint256" }
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "liquidationCall",
|
|
79
|
+
type: "tuple",
|
|
80
|
+
internalType: "struct MultiCall",
|
|
81
|
+
components: [
|
|
82
|
+
{ name: "target", type: "address", internalType: "address" },
|
|
83
|
+
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{ name: "isLiquidatorEligible", type: "bool", internalType: "bool" },
|
|
87
|
+
{ name: "kycProtocol", type: "string", internalType: "string" },
|
|
88
|
+
{ name: "kycToken", type: "address", internalType: "address" }
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
stateMutability: "nonpayable"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "function",
|
|
96
|
+
name: "liquidatableTypeToCompressorType",
|
|
97
|
+
inputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
98
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
99
|
+
stateMutability: "view"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "function",
|
|
103
|
+
name: "liquidatableTypeToSpecificCompressorVersion",
|
|
104
|
+
inputs: [
|
|
105
|
+
{ name: "", type: "bytes32", internalType: "bytes32" },
|
|
106
|
+
{ name: "", type: "uint256", internalType: "uint256" }
|
|
107
|
+
],
|
|
108
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
109
|
+
stateMutability: "view"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: "function",
|
|
113
|
+
name: "owner",
|
|
114
|
+
inputs: [],
|
|
115
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
116
|
+
stateMutability: "view"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: "function",
|
|
120
|
+
name: "renounceOwnership",
|
|
121
|
+
inputs: [],
|
|
122
|
+
outputs: [],
|
|
123
|
+
stateMutability: "nonpayable"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: "function",
|
|
127
|
+
name: "setLiquidatableTypeToCompressorType",
|
|
128
|
+
inputs: [
|
|
129
|
+
{ name: "liquidatableType", type: "bytes32", internalType: "bytes32" },
|
|
130
|
+
{ name: "compressorType", type: "bytes32", internalType: "bytes32" }
|
|
131
|
+
],
|
|
132
|
+
outputs: [],
|
|
133
|
+
stateMutability: "nonpayable"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: "function",
|
|
137
|
+
name: "setLiquidatableVersionToSpecificCompressorVersion",
|
|
138
|
+
inputs: [
|
|
139
|
+
{ name: "liquidatableType", type: "bytes32", internalType: "bytes32" },
|
|
140
|
+
{ name: "liquidatableVersion", type: "uint256", internalType: "uint256" },
|
|
141
|
+
{ name: "compressorVersion", type: "uint256", internalType: "uint256" }
|
|
142
|
+
],
|
|
143
|
+
outputs: [],
|
|
144
|
+
stateMutability: "nonpayable"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: "function",
|
|
148
|
+
name: "setSubcompressor",
|
|
149
|
+
inputs: [
|
|
150
|
+
{ name: "subcompressor", type: "address", internalType: "address" }
|
|
151
|
+
],
|
|
152
|
+
outputs: [],
|
|
153
|
+
stateMutability: "nonpayable"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: "function",
|
|
157
|
+
name: "transferOwnership",
|
|
158
|
+
inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
|
|
159
|
+
outputs: [],
|
|
160
|
+
stateMutability: "nonpayable"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: "function",
|
|
164
|
+
name: "version",
|
|
165
|
+
inputs: [],
|
|
166
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
167
|
+
stateMutability: "view"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: "event",
|
|
171
|
+
name: "OwnershipTransferred",
|
|
172
|
+
inputs: [
|
|
173
|
+
{
|
|
174
|
+
name: "previousOwner",
|
|
175
|
+
type: "address",
|
|
176
|
+
indexed: true,
|
|
177
|
+
internalType: "address"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "newOwner",
|
|
181
|
+
type: "address",
|
|
182
|
+
indexed: true,
|
|
183
|
+
internalType: "address"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
anonymous: false
|
|
187
|
+
}
|
|
188
|
+
];
|
|
189
|
+
export {
|
|
190
|
+
liquidationCompressorAbi
|
|
191
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const midasLiquidationSubcompressorAbi = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
name: "contractType",
|
|
5
|
+
inputs: [],
|
|
6
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
7
|
+
stateMutability: "view"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: "function",
|
|
11
|
+
name: "getLiquidationData",
|
|
12
|
+
inputs: [
|
|
13
|
+
{ name: "liquidator", type: "address", internalType: "address" },
|
|
14
|
+
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
15
|
+
{ name: "phantomToken", type: "address", internalType: "address" },
|
|
16
|
+
{
|
|
17
|
+
name: "priceUpdates",
|
|
18
|
+
type: "tuple[]",
|
|
19
|
+
internalType: "struct PriceUpdate[]",
|
|
20
|
+
components: [
|
|
21
|
+
{ name: "priceFeed", type: "address", internalType: "address" },
|
|
22
|
+
{ name: "data", type: "bytes", internalType: "bytes" }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
outputs: [
|
|
27
|
+
{
|
|
28
|
+
name: "data",
|
|
29
|
+
type: "tuple",
|
|
30
|
+
internalType: "struct LiquidationData",
|
|
31
|
+
components: [
|
|
32
|
+
{
|
|
33
|
+
name: "requiredUnderlyingAmount",
|
|
34
|
+
type: "uint256",
|
|
35
|
+
internalType: "uint256"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "expectedOutputs",
|
|
39
|
+
type: "tuple[]",
|
|
40
|
+
internalType: "struct LiquidationOutput[]",
|
|
41
|
+
components: [
|
|
42
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
43
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
44
|
+
{ name: "delayed", type: "bool", internalType: "bool" },
|
|
45
|
+
{
|
|
46
|
+
name: "redeemerAddress",
|
|
47
|
+
type: "address",
|
|
48
|
+
internalType: "address"
|
|
49
|
+
},
|
|
50
|
+
{ name: "claimableAt", type: "uint256", internalType: "uint256" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "liquidationCall",
|
|
55
|
+
type: "tuple",
|
|
56
|
+
internalType: "struct MultiCall",
|
|
57
|
+
components: [
|
|
58
|
+
{ name: "target", type: "address", internalType: "address" },
|
|
59
|
+
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{ name: "isLiquidatorEligible", type: "bool", internalType: "bool" },
|
|
63
|
+
{ name: "kycProtocol", type: "string", internalType: "string" },
|
|
64
|
+
{ name: "kycToken", type: "address", internalType: "address" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
stateMutability: "nonpayable"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "function",
|
|
72
|
+
name: "version",
|
|
73
|
+
inputs: [],
|
|
74
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
75
|
+
stateMutability: "view"
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
export {
|
|
79
|
+
midasLiquidationSubcompressorAbi
|
|
80
|
+
};
|
package/dist/esm/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const securitizeLiquidationSubcompressorAbi = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
name: "contractType",
|
|
5
|
+
inputs: [],
|
|
6
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
7
|
+
stateMutability: "view"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: "function",
|
|
11
|
+
name: "getLiquidationData",
|
|
12
|
+
inputs: [
|
|
13
|
+
{ name: "liquidator", type: "address", internalType: "address" },
|
|
14
|
+
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
15
|
+
{ name: "phantomToken", type: "address", internalType: "address" },
|
|
16
|
+
{
|
|
17
|
+
name: "priceUpdates",
|
|
18
|
+
type: "tuple[]",
|
|
19
|
+
internalType: "struct PriceUpdate[]",
|
|
20
|
+
components: [
|
|
21
|
+
{ name: "priceFeed", type: "address", internalType: "address" },
|
|
22
|
+
{ name: "data", type: "bytes", internalType: "bytes" }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
outputs: [
|
|
27
|
+
{
|
|
28
|
+
name: "data",
|
|
29
|
+
type: "tuple",
|
|
30
|
+
internalType: "struct LiquidationData",
|
|
31
|
+
components: [
|
|
32
|
+
{
|
|
33
|
+
name: "requiredUnderlyingAmount",
|
|
34
|
+
type: "uint256",
|
|
35
|
+
internalType: "uint256"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "expectedOutputs",
|
|
39
|
+
type: "tuple[]",
|
|
40
|
+
internalType: "struct LiquidationOutput[]",
|
|
41
|
+
components: [
|
|
42
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
43
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
44
|
+
{ name: "delayed", type: "bool", internalType: "bool" },
|
|
45
|
+
{
|
|
46
|
+
name: "redeemerAddress",
|
|
47
|
+
type: "address",
|
|
48
|
+
internalType: "address"
|
|
49
|
+
},
|
|
50
|
+
{ name: "claimableAt", type: "uint256", internalType: "uint256" }
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "liquidationCall",
|
|
55
|
+
type: "tuple",
|
|
56
|
+
internalType: "struct MultiCall",
|
|
57
|
+
components: [
|
|
58
|
+
{ name: "target", type: "address", internalType: "address" },
|
|
59
|
+
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{ name: "isLiquidatorEligible", type: "bool", internalType: "bool" },
|
|
63
|
+
{ name: "kycProtocol", type: "string", internalType: "string" },
|
|
64
|
+
{ name: "kycToken", type: "address", internalType: "address" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
stateMutability: "nonpayable"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "function",
|
|
72
|
+
name: "version",
|
|
73
|
+
inputs: [],
|
|
74
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
75
|
+
stateMutability: "view"
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
export {
|
|
79
|
+
securitizeLiquidationSubcompressorAbi
|
|
80
|
+
};
|
|
@@ -18,34 +18,29 @@ const midasGatewayAbi = [
|
|
|
18
18
|
internalType: "address"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
name: "
|
|
22
|
-
type: "
|
|
23
|
-
internalType: "
|
|
21
|
+
name: "_mode",
|
|
22
|
+
type: "uint8",
|
|
23
|
+
internalType: "enum MidasMode"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: "_allowedMarketConfigurator",
|
|
27
27
|
type: "address",
|
|
28
28
|
internalType: "address"
|
|
29
29
|
},
|
|
30
|
-
{
|
|
31
|
-
name: "_checkBorrowerGreenlist",
|
|
32
|
-
type: "bool",
|
|
33
|
-
internalType: "bool"
|
|
34
|
-
},
|
|
35
30
|
{
|
|
36
31
|
name: "_expectedRedemptionDuration",
|
|
37
32
|
type: "uint256",
|
|
38
33
|
internalType: "uint256"
|
|
39
34
|
},
|
|
40
|
-
{
|
|
41
|
-
name: "_redemptionLogger",
|
|
42
|
-
type: "address",
|
|
43
|
-
internalType: "address"
|
|
44
|
-
},
|
|
45
35
|
{
|
|
46
36
|
name: "_withDelayedWithdrawals",
|
|
47
37
|
type: "bool",
|
|
48
38
|
internalType: "bool"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "_addressProvider",
|
|
42
|
+
type: "address",
|
|
43
|
+
internalType: "address"
|
|
49
44
|
}
|
|
50
45
|
],
|
|
51
46
|
stateMutability: "nonpayable"
|
|
@@ -76,19 +71,6 @@ const midasGatewayAbi = [
|
|
|
76
71
|
],
|
|
77
72
|
stateMutability: "view"
|
|
78
73
|
},
|
|
79
|
-
{
|
|
80
|
-
type: "function",
|
|
81
|
-
name: "checkBorrowerGreenlist",
|
|
82
|
-
inputs: [],
|
|
83
|
-
outputs: [
|
|
84
|
-
{
|
|
85
|
-
name: "",
|
|
86
|
-
type: "bool",
|
|
87
|
-
internalType: "bool"
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
stateMutability: "view"
|
|
91
|
-
},
|
|
92
74
|
{
|
|
93
75
|
type: "function",
|
|
94
76
|
name: "contractType",
|
|
@@ -138,6 +120,25 @@ const midasGatewayAbi = [
|
|
|
138
120
|
],
|
|
139
121
|
stateMutability: "view"
|
|
140
122
|
},
|
|
123
|
+
{
|
|
124
|
+
type: "function",
|
|
125
|
+
name: "isEligibleAccountOwner",
|
|
126
|
+
inputs: [
|
|
127
|
+
{
|
|
128
|
+
name: "account",
|
|
129
|
+
type: "address",
|
|
130
|
+
internalType: "address"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
outputs: [
|
|
134
|
+
{
|
|
135
|
+
name: "",
|
|
136
|
+
type: "bool",
|
|
137
|
+
internalType: "bool"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
stateMutability: "view"
|
|
141
|
+
},
|
|
141
142
|
{
|
|
142
143
|
type: "function",
|
|
143
144
|
name: "mToken",
|
|
@@ -190,6 +191,19 @@ const midasGatewayAbi = [
|
|
|
190
191
|
],
|
|
191
192
|
stateMutability: "view"
|
|
192
193
|
},
|
|
194
|
+
{
|
|
195
|
+
type: "function",
|
|
196
|
+
name: "mode",
|
|
197
|
+
inputs: [],
|
|
198
|
+
outputs: [
|
|
199
|
+
{
|
|
200
|
+
name: "",
|
|
201
|
+
type: "uint8",
|
|
202
|
+
internalType: "enum MidasMode"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
stateMutability: "view"
|
|
206
|
+
},
|
|
193
207
|
{
|
|
194
208
|
type: "function",
|
|
195
209
|
name: "pendingAndClaimableTokenOutAmounts",
|
|
@@ -388,6 +402,11 @@ const midasGatewayAbi = [
|
|
|
388
402
|
name: "AccessControlNotSetException",
|
|
389
403
|
inputs: []
|
|
390
404
|
},
|
|
405
|
+
{
|
|
406
|
+
type: "error",
|
|
407
|
+
name: "ArbitraryCAAllowedInPermissionedModeException",
|
|
408
|
+
inputs: []
|
|
409
|
+
},
|
|
391
410
|
{
|
|
392
411
|
type: "error",
|
|
393
412
|
name: "CreditAccountNotEligibleException",
|
|
@@ -461,7 +480,7 @@ const midasRedeemerAbi = [
|
|
|
461
480
|
},
|
|
462
481
|
{
|
|
463
482
|
type: "function",
|
|
464
|
-
name: "
|
|
483
|
+
name: "alreadyRequested",
|
|
465
484
|
inputs: [],
|
|
466
485
|
outputs: [
|
|
467
486
|
{
|
|
@@ -485,19 +504,6 @@ const midasRedeemerAbi = [
|
|
|
485
504
|
],
|
|
486
505
|
stateMutability: "view"
|
|
487
506
|
},
|
|
488
|
-
{
|
|
489
|
-
type: "function",
|
|
490
|
-
name: "clearCancelledRequest",
|
|
491
|
-
inputs: [
|
|
492
|
-
{
|
|
493
|
-
name: "amount",
|
|
494
|
-
type: "uint256",
|
|
495
|
-
internalType: "uint256"
|
|
496
|
-
}
|
|
497
|
-
],
|
|
498
|
-
outputs: [],
|
|
499
|
-
stateMutability: "nonpayable"
|
|
500
|
-
},
|
|
501
507
|
{
|
|
502
508
|
type: "function",
|
|
503
509
|
name: "gateway",
|
|
@@ -511,19 +517,6 @@ const midasRedeemerAbi = [
|
|
|
511
517
|
],
|
|
512
518
|
stateMutability: "view"
|
|
513
519
|
},
|
|
514
|
-
{
|
|
515
|
-
type: "function",
|
|
516
|
-
name: "isManuallyCleared",
|
|
517
|
-
inputs: [],
|
|
518
|
-
outputs: [
|
|
519
|
-
{
|
|
520
|
-
name: "",
|
|
521
|
-
type: "bool",
|
|
522
|
-
internalType: "bool"
|
|
523
|
-
}
|
|
524
|
-
],
|
|
525
|
-
stateMutability: "view"
|
|
526
|
-
},
|
|
527
520
|
{
|
|
528
521
|
type: "function",
|
|
529
522
|
name: "mToken",
|
|
@@ -656,12 +649,7 @@ const midasRedeemerAbi = [
|
|
|
656
649
|
},
|
|
657
650
|
{
|
|
658
651
|
type: "error",
|
|
659
|
-
name: "
|
|
660
|
-
inputs: []
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
type: "error",
|
|
664
|
-
name: "AmountIsLessThanRequiredException",
|
|
652
|
+
name: "AlreadyRequestedException",
|
|
665
653
|
inputs: []
|
|
666
654
|
},
|
|
667
655
|
{
|
|
@@ -673,11 +661,6 @@ const midasRedeemerAbi = [
|
|
|
673
661
|
type: "error",
|
|
674
662
|
name: "InsufficientBalanceException",
|
|
675
663
|
inputs: []
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
type: "error",
|
|
679
|
-
name: "RequestNotCancelledOrManuallyClearedException",
|
|
680
|
-
inputs: []
|
|
681
664
|
}
|
|
682
665
|
];
|
|
683
666
|
const midasRedemptionVaultPhantomTokenAbi = [
|
|
@@ -1024,6 +1007,19 @@ const iMidasDataFeedAbi = [
|
|
|
1024
1007
|
}
|
|
1025
1008
|
];
|
|
1026
1009
|
const iMidasRedemptionVaultAbi = [
|
|
1010
|
+
{
|
|
1011
|
+
type: "function",
|
|
1012
|
+
name: "accessControl",
|
|
1013
|
+
inputs: [],
|
|
1014
|
+
outputs: [
|
|
1015
|
+
{
|
|
1016
|
+
name: "",
|
|
1017
|
+
type: "address",
|
|
1018
|
+
internalType: "address"
|
|
1019
|
+
}
|
|
1020
|
+
],
|
|
1021
|
+
stateMutability: "view"
|
|
1022
|
+
},
|
|
1027
1023
|
{
|
|
1028
1024
|
type: "function",
|
|
1029
1025
|
name: "currentRequestId",
|
|
@@ -1134,7 +1130,7 @@ const iMidasRedemptionVaultAbi = [
|
|
|
1134
1130
|
{
|
|
1135
1131
|
name: "status",
|
|
1136
1132
|
type: "uint8",
|
|
1137
|
-
internalType: "
|
|
1133
|
+
internalType: "enum RedemptionStatus"
|
|
1138
1134
|
},
|
|
1139
1135
|
{
|
|
1140
1136
|
name: "amountMTokenIn",
|
|
@@ -1195,7 +1191,7 @@ const securitizeRedemptionGatewayAbi = [
|
|
|
1195
1191
|
internalType: "address"
|
|
1196
1192
|
},
|
|
1197
1193
|
{
|
|
1198
|
-
name: "
|
|
1194
|
+
name: "_addressProvider",
|
|
1199
1195
|
type: "address",
|
|
1200
1196
|
internalType: "address"
|
|
1201
1197
|
}
|
|
@@ -1298,6 +1294,25 @@ const securitizeRedemptionGatewayAbi = [
|
|
|
1298
1294
|
],
|
|
1299
1295
|
stateMutability: "view"
|
|
1300
1296
|
},
|
|
1297
|
+
{
|
|
1298
|
+
type: "function",
|
|
1299
|
+
name: "isEligibleAccountOwner",
|
|
1300
|
+
inputs: [
|
|
1301
|
+
{
|
|
1302
|
+
name: "account",
|
|
1303
|
+
type: "address",
|
|
1304
|
+
internalType: "address"
|
|
1305
|
+
}
|
|
1306
|
+
],
|
|
1307
|
+
outputs: [
|
|
1308
|
+
{
|
|
1309
|
+
name: "",
|
|
1310
|
+
type: "bool",
|
|
1311
|
+
internalType: "bool"
|
|
1312
|
+
}
|
|
1313
|
+
],
|
|
1314
|
+
stateMutability: "view"
|
|
1315
|
+
},
|
|
1301
1316
|
{
|
|
1302
1317
|
type: "function",
|
|
1303
1318
|
name: "masterRedeemer",
|
|
@@ -1324,6 +1339,19 @@ const securitizeRedemptionGatewayAbi = [
|
|
|
1324
1339
|
],
|
|
1325
1340
|
stateMutability: "view"
|
|
1326
1341
|
},
|
|
1342
|
+
{
|
|
1343
|
+
type: "function",
|
|
1344
|
+
name: "phantomToken",
|
|
1345
|
+
inputs: [],
|
|
1346
|
+
outputs: [
|
|
1347
|
+
{
|
|
1348
|
+
name: "",
|
|
1349
|
+
type: "address",
|
|
1350
|
+
internalType: "address"
|
|
1351
|
+
}
|
|
1352
|
+
],
|
|
1353
|
+
stateMutability: "view"
|
|
1354
|
+
},
|
|
1327
1355
|
{
|
|
1328
1356
|
type: "function",
|
|
1329
1357
|
name: "redeem",
|
|
@@ -1480,6 +1508,16 @@ const securitizeRedemptionPhantomTokenAbi = [
|
|
|
1480
1508
|
name: "_redemptionGateway",
|
|
1481
1509
|
type: "address",
|
|
1482
1510
|
internalType: "address"
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
name: "_dsToken",
|
|
1514
|
+
type: "address",
|
|
1515
|
+
internalType: "address"
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
name: "_stableCoinToken",
|
|
1519
|
+
type: "address",
|
|
1520
|
+
internalType: "address"
|
|
1483
1521
|
}
|
|
1484
1522
|
],
|
|
1485
1523
|
stateMutability: "nonpayable"
|
|
@@ -186,7 +186,7 @@ async function fulfillMidasWithdrawal(anvil, creditAccount, withdrawalPhantomTok
|
|
|
186
186
|
address: MIDAS_VAULT_ADMIN,
|
|
187
187
|
value: parseEther("100")
|
|
188
188
|
});
|
|
189
|
-
await anvil.writeContract({
|
|
189
|
+
const hash = await anvil.writeContract({
|
|
190
190
|
chain: anvil.chain,
|
|
191
191
|
address: midasRedemptionVault,
|
|
192
192
|
account: MIDAS_VAULT_ADMIN,
|
|
@@ -194,6 +194,13 @@ async function fulfillMidasWithdrawal(anvil, creditAccount, withdrawalPhantomTok
|
|
|
194
194
|
functionName: "safeApproveRequest",
|
|
195
195
|
args: [requestId, mTokenRate]
|
|
196
196
|
});
|
|
197
|
+
const receipt = await anvil.waitForTransactionReceipt({
|
|
198
|
+
hash,
|
|
199
|
+
pollingInterval: 100
|
|
200
|
+
});
|
|
201
|
+
if (receipt.status !== "success") {
|
|
202
|
+
throw new Error(`midas: safeApproveRequest tx ${hash} reverted`);
|
|
203
|
+
}
|
|
197
204
|
await anvil.stopImpersonatingAccount({ address: MIDAS_VAULT_ADMIN });
|
|
198
205
|
}
|
|
199
206
|
}
|