Skip to content

Commit 334a709

Browse files
committed
Revert "Merge pull request #414 from Gearbox-protocol/withdrawals"
This reverts commit 4a48afc, reversing changes made to d915a52.
1 parent 4a48afc commit 334a709

File tree

2 files changed

+6
-137
lines changed

2 files changed

+6
-137
lines changed
Lines changed: 2 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,8 @@
11
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2-
// WithdrawalCompressorV310
2+
// IWithdrawalCompressorV310
33
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
44

55
export const iWithdrawalCompressorV310Abi = [
6-
{
7-
type: "constructor",
8-
inputs: [
9-
{ name: "_owner", internalType: "address", type: "address" },
10-
{ name: "addressProvider_", internalType: "address", type: "address" },
11-
],
12-
stateMutability: "nonpayable",
13-
},
14-
{
15-
type: "function",
16-
inputs: [],
17-
name: "addressProvider",
18-
outputs: [{ name: "", internalType: "address", type: "address" }],
19-
stateMutability: "view",
20-
},
21-
{
22-
type: "function",
23-
inputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
24-
name: "compressorTypeToCompressor",
25-
outputs: [{ name: "", internalType: "address", type: "address" }],
26-
stateMutability: "view",
27-
},
286
{
297
type: "function",
308
inputs: [],
@@ -142,7 +120,7 @@ export const iWithdrawalCompressorV310Abi = [
142120
name: "getWithdrawalRequestResult",
143121
outputs: [
144122
{
145-
name: "withdrawal",
123+
name: "",
146124
internalType: "struct RequestableWithdrawal",
147125
type: "tuple",
148126
components: [
@@ -173,120 +151,11 @@ export const iWithdrawalCompressorV310Abi = [
173151
],
174152
stateMutability: "view",
175153
},
176-
// TODO: REMOVE COMMENTS AFTER MIGRATION TO MULTIPLE
177-
// {
178-
// type: "function",
179-
// inputs: [
180-
// { name: "creditAccount", internalType: "address", type: "address" },
181-
// { name: "token", internalType: "address", type: "address" },
182-
// { name: "withdrawalToken", internalType: "address", type: "address" },
183-
// { name: "amount", internalType: "uint256", type: "uint256" },
184-
// ],
185-
// name: "getWithdrawalRequestResult",
186-
// outputs: [
187-
// {
188-
// name: "withdrawal",
189-
// internalType: "struct RequestableWithdrawal",
190-
// type: "tuple",
191-
// components: [
192-
// { name: "token", internalType: "address", type: "address" },
193-
// { name: "amountIn", internalType: "uint256", type: "uint256" },
194-
// {
195-
// name: "outputs",
196-
// internalType: "struct WithdrawalOutput[]",
197-
// type: "tuple[]",
198-
// components: [
199-
// { name: "token", internalType: "address", type: "address" },
200-
// { name: "isDelayed", internalType: "bool", type: "bool" },
201-
// { name: "amount", internalType: "uint256", type: "uint256" },
202-
// ],
203-
// },
204-
// {
205-
// name: "requestCalls",
206-
// internalType: "struct MultiCall[]",
207-
// type: "tuple[]",
208-
// components: [
209-
// { name: "target", internalType: "address", type: "address" },
210-
// { name: "callData", internalType: "bytes", type: "bytes" },
211-
// ],
212-
// },
213-
// { name: "claimableAt", internalType: "uint256", type: "uint256" },
214-
// ],
215-
// },
216-
// ],
217-
// stateMutability: "view",
218-
// },
219-
{
220-
type: "function",
221-
inputs: [],
222-
name: "owner",
223-
outputs: [{ name: "", internalType: "address", type: "address" }],
224-
stateMutability: "view",
225-
},
226-
{
227-
type: "function",
228-
inputs: [],
229-
name: "renounceOwnership",
230-
outputs: [],
231-
stateMutability: "nonpayable",
232-
},
233-
{
234-
type: "function",
235-
inputs: [
236-
{ name: "subcompressor", internalType: "address", type: "address" },
237-
],
238-
name: "setSubcompressor",
239-
outputs: [],
240-
stateMutability: "nonpayable",
241-
},
242-
{
243-
type: "function",
244-
inputs: [
245-
{ name: "withdrawableType", internalType: "bytes32", type: "bytes32" },
246-
{ name: "compressorType", internalType: "bytes32", type: "bytes32" },
247-
],
248-
name: "setWithdrawableTypeToCompressorType",
249-
outputs: [],
250-
stateMutability: "nonpayable",
251-
},
252-
{
253-
type: "function",
254-
inputs: [{ name: "newOwner", internalType: "address", type: "address" }],
255-
name: "transferOwnership",
256-
outputs: [],
257-
stateMutability: "nonpayable",
258-
},
259154
{
260155
type: "function",
261156
inputs: [],
262157
name: "version",
263158
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
264159
stateMutability: "view",
265160
},
266-
{
267-
type: "function",
268-
inputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
269-
name: "withdrawableTypeToCompressorType",
270-
outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
271-
stateMutability: "view",
272-
},
273-
{
274-
type: "event",
275-
anonymous: false,
276-
inputs: [
277-
{
278-
name: "previousOwner",
279-
internalType: "address",
280-
type: "address",
281-
indexed: true,
282-
},
283-
{
284-
name: "newOwner",
285-
internalType: "address",
286-
type: "address",
287-
indexed: true,
288-
},
289-
],
290-
name: "OwnershipTransferred",
291-
},
292161
] as const;

src/sdk/accounts/AbstractCreditAccountsService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ export interface CreditAccountServiceOptions {
7575
batchSize?: number;
7676
}
7777

78-
export function getWithdrawalCompressorAddress(_chainId: number) {
78+
export function getWithdrawalCompressorAddress(chainId: number) {
7979
// TODO: HARDCODED
80-
return "0x36F3d0Bb73CBC2E94fE24dF0f26a689409cF9023" as const;
80+
const compressor =
81+
chainId === 1 ? "0xfB79b6713fe214B8748ED7b0db1f93E4f1aC9d29" : undefined;
82+
return compressor;
8183
}
8284

8385
export abstract class AbstractCreditAccountService extends SDKConstruct {
@@ -716,7 +718,6 @@ export abstract class AbstractCreditAccountService extends SDKConstruct {
716718
client: this.client,
717719
});
718720

719-
// TODO: return multiple configs
720721
const resp = await contract.read.getWithdrawalRequestResult([
721722
creditAccount,
722723
token,
@@ -746,7 +747,6 @@ export abstract class AbstractCreditAccountService extends SDKConstruct {
746747
client: this.client,
747748
});
748749

749-
// TODO: return multiple configs
750750
const resp = await contract.read.getCurrentWithdrawals([creditAccount]);
751751

752752
const claimableNow = resp?.[0] || [];

0 commit comments

Comments
 (0)