Skip to content

Commit 9cca378

Browse files
committed
fix: some extra errors
1 parent 655622c commit 9cca378

File tree

7 files changed

+241
-5
lines changed

7 files changed

+241
-5
lines changed

src/errors/abis.ts

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
import { errorAbis as sdkErrorAbis } from "@gearbox-protocol/sdk/abi/errors";
2+
3+
export const errorAbis = [
4+
{
5+
inputs: [],
6+
name: "AccountNotWhitelisted",
7+
type: "error",
8+
},
9+
{
10+
inputs: [],
11+
name: "AddressBlacklisted",
12+
type: "error",
13+
},
14+
{
15+
inputs: [],
16+
name: "AmountExceedsAllowance",
17+
type: "error",
18+
},
19+
{
20+
inputs: [],
21+
name: "AmountExceedsSenderBalance",
22+
type: "error",
23+
},
24+
{
25+
inputs: [],
26+
name: "AmountTooLow",
27+
type: "error",
28+
},
29+
{
30+
inputs: [],
31+
name: "AssetsAmountRequired",
32+
type: "error",
33+
},
34+
{
35+
inputs: [],
36+
name: "BalanceCheckFailed",
37+
type: "error",
38+
},
39+
{
40+
inputs: [],
41+
name: "BurnAmountExceedsBalance",
42+
type: "error",
43+
},
44+
{
45+
inputs: [],
46+
name: "CannotBlacklistOwner",
47+
type: "error",
48+
},
49+
{
50+
inputs: [],
51+
name: "CollectorRequired",
52+
type: "error",
53+
},
54+
{
55+
inputs: [],
56+
name: "DepositLimitReached",
57+
type: "error",
58+
},
59+
{
60+
inputs: [],
61+
name: "DepositsPaused",
62+
type: "error",
63+
},
64+
{
65+
inputs: [],
66+
name: "InsufficientAllowance",
67+
type: "error",
68+
},
69+
{
70+
inputs: [],
71+
name: "InsufficientBalance",
72+
type: "error",
73+
},
74+
{
75+
inputs: [],
76+
name: "InsufficientShares",
77+
type: "error",
78+
},
79+
{
80+
inputs: [],
81+
name: "InvalidAddress",
82+
type: "error",
83+
},
84+
{
85+
inputs: [],
86+
name: "InvalidDepositLimit",
87+
type: "error",
88+
},
89+
{
90+
inputs: [],
91+
name: "InvalidExternalAssets",
92+
type: "error",
93+
},
94+
{
95+
inputs: [],
96+
name: "InvalidHolder",
97+
type: "error",
98+
},
99+
{
100+
inputs: [],
101+
name: "InvalidMaxSupply",
102+
type: "error",
103+
},
104+
{
105+
inputs: [],
106+
name: "InvalidOwner",
107+
type: "error",
108+
},
109+
{
110+
inputs: [],
111+
name: "InvalidPercentage",
112+
type: "error",
113+
},
114+
{
115+
inputs: [],
116+
name: "InvalidReceiver",
117+
type: "error",
118+
},
119+
{
120+
inputs: [],
121+
name: "InvalidTimestamp",
122+
type: "error",
123+
},
124+
{
125+
inputs: [],
126+
name: "InvalidWithdrawalLimit",
127+
type: "error",
128+
},
129+
{
130+
inputs: [],
131+
name: "LimitRequired",
132+
type: "error",
133+
},
134+
{
135+
inputs: [],
136+
name: "MaxAllowedChangeReached",
137+
type: "error",
138+
},
139+
{
140+
inputs: [],
141+
name: "MaxMintReached",
142+
type: "error",
143+
},
144+
{
145+
inputs: [],
146+
name: "MaxSupplyLimitReached",
147+
type: "error",
148+
},
149+
{
150+
inputs: [],
151+
name: "NoSharesForReceiver",
152+
type: "error",
153+
},
154+
{
155+
inputs: [],
156+
name: "NonZeroAddressRequired",
157+
type: "error",
158+
},
159+
{
160+
inputs: [],
161+
name: "NonZeroAmountRequired",
162+
type: "error",
163+
},
164+
{
165+
inputs: [],
166+
name: "NothingToProcess",
167+
type: "error",
168+
},
169+
{
170+
inputs: [],
171+
name: "OperatorOnly",
172+
type: "error",
173+
},
174+
{
175+
inputs: [],
176+
name: "OwnerOnly",
177+
type: "error",
178+
},
179+
{
180+
inputs: [],
181+
name: "PoolAlreadyConfigured",
182+
type: "error",
183+
},
184+
{
185+
inputs: [],
186+
name: "PoolNotConfigured",
187+
type: "error",
188+
},
189+
{
190+
inputs: [],
191+
name: "PoolOwnerRequired",
192+
type: "error",
193+
},
194+
{
195+
inputs: [],
196+
name: "ReentrantCall",
197+
type: "error",
198+
},
199+
{
200+
inputs: [],
201+
name: "SettlementAccountNotSet",
202+
type: "error",
203+
},
204+
{
205+
inputs: [],
206+
name: "SharesAmountRequired",
207+
type: "error",
208+
},
209+
{
210+
inputs: [],
211+
name: "TooEarly",
212+
type: "error",
213+
},
214+
{
215+
inputs: [],
216+
name: "TotalAssetsError",
217+
type: "error",
218+
},
219+
{
220+
inputs: [],
221+
name: "WithdrawalLimitReached",
222+
type: "error",
223+
},
224+
{
225+
inputs: [],
226+
name: "WithdrawalRequestRequired",
227+
type: "error",
228+
},
229+
{
230+
inputs: [],
231+
name: "WithdrawalsPaused",
232+
type: "error",
233+
},
234+
...sdkErrorAbis,
235+
] as const;

src/errors/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from "./abis.js";
12
export * from "./ErrorHandler.js";
23
export * from "./isRevertedWith.js";
34
export * from "./TransactionRevertedError.js";

src/services/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { nextTick } from "node:process";
22

33
import { chains, formatBN, PERCENTAGE_FACTOR } from "@gearbox-protocol/sdk";
4-
import { errorAbis } from "@gearbox-protocol/sdk/abi/errors";
54
import type {
65
AnvilClient,
76
AnvilNodeInfo,
@@ -36,6 +35,7 @@ import { privateKeyToAccount } from "viem/accounts";
3635

3736
import type { Config } from "../config/index.js";
3837
import { DI } from "../di.js";
38+
import { errorAbis } from "../errors/abis.js";
3939
import { TransactionRevertedError } from "../errors/TransactionRevertedError.js";
4040
import { type ILogger, Logger } from "../log/index.js";
4141
import type { StatusCode } from "../utils/index.js";

src/services/liquidate/LiquidationStrategyFull.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
iCreditManagerV310Abi,
1212
iPoolV310Abi,
1313
} from "@gearbox-protocol/sdk/abi/310/generated";
14-
import { errorAbis } from "@gearbox-protocol/sdk/abi/errors";
1514
import { replaceStorage } from "@gearbox-protocol/sdk/dev";
1615
import {
1716
BaseError,
@@ -23,7 +22,7 @@ import type {
2322
LiqduiatorConfig,
2423
} from "../../config/index.js";
2524
import { DI } from "../../di.js";
26-
import { isRevertedWith } from "../../errors/index.js";
25+
import { errorAbis, isRevertedWith } from "../../errors/index.js";
2726
import { type ILogger, Logger } from "../../log/index.js";
2827
import type Client from "../Client.js";
2928
import AccountHelper from "./AccountHelper.js";

src/services/liquidate/partial/v300/PartialLiquidatorV300Contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import type {
77
PriceUpdateV300,
88
} from "@gearbox-protocol/sdk";
99
import { ADDRESS_0X0, hexEq } from "@gearbox-protocol/sdk";
10-
import { errorAbis } from "@gearbox-protocol/sdk/abi/errors";
1110
import type { Address, SimulateContractReturnType } from "viem";
1211
import { parseAbi } from "viem";
1312
import type { PartialV300ConfigSchema } from "../../../../config/index.js";
13+
import { errorAbis } from "../../../../errors/index.js";
1414
import type { PartialLiquidationPreview } from "../../types.js";
1515
import { AbstractPartialLiquidatorContract } from "../AbstractPartialLiquidatorContract.js";
1616
import type {

src/services/liquidate/partial/v310/PartialLiquidatorV310Contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type {
77
PriceUpdateV310,
88
} from "@gearbox-protocol/sdk";
99
import { ADDRESS_0X0, hexEq } from "@gearbox-protocol/sdk";
10-
import { errorAbis } from "@gearbox-protocol/sdk/abi/errors";
1110
import { Create2Deployer } from "@gearbox-protocol/sdk/dev";
1211
import {
1312
type Address,
@@ -19,6 +18,7 @@ import {
1918
type SimulateContractReturnType,
2019
type Transport,
2120
} from "viem";
21+
import { errorAbis } from "../../../../errors/index.js";
2222
import type { PartialLiquidationPreview } from "../../types.js";
2323
import { AbstractPartialLiquidatorContract } from "../AbstractPartialLiquidatorContract.js";
2424
import type {

src/services/swap/base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const WETH: Record<NetworkType, Address> = {
2525
Hemi: NOT_DEPLOYED,
2626
Lisk: NOT_DEPLOYED,
2727
Plasma: NOT_DEPLOYED,
28+
Somnia: NOT_DEPLOYED,
2829
};
2930

3031
export default abstract class BaseSwapper {

0 commit comments

Comments
 (0)