@bgd-labs/toolbox 0.0.54 → 0.0.55
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/index.d.mts +42850 -25417
- package/dist/index.d.ts +42850 -25417
- package/dist/index.js +184 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +164 -27
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +6 -1
- package/dist/node.d.ts +6 -1
- package/dist/node.js +184 -41
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +164 -27
- package/dist/node.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -87,6 +87,7 @@ __export(index_exports, {
|
|
|
87
87
|
assetToBase: () => assetToBase,
|
|
88
88
|
bitmapToIndexes: () => bitmapToIndexes,
|
|
89
89
|
blockscoutExplorers: () => blockscoutExplorers,
|
|
90
|
+
bytes32ToAddress: () => bytes32ToAddress,
|
|
90
91
|
calculateAvailableBorrowsMarketReferenceCurrency: () => calculateAvailableBorrowsMarketReferenceCurrency,
|
|
91
92
|
calculateCompoundedInterest: () => calculateCompoundedInterest,
|
|
92
93
|
calculateHealthFactor: () => calculateHealthFactor,
|
|
@@ -113,10 +114,13 @@ __export(index_exports, {
|
|
|
113
114
|
genericIndexer: () => genericIndexer,
|
|
114
115
|
getAlchemyRPC: () => getAlchemyRPC,
|
|
115
116
|
getBits: () => getBits,
|
|
117
|
+
getBytesValue: () => getBytesValue,
|
|
116
118
|
getClient: () => getClient,
|
|
119
|
+
getCompleteReserveConfiguration: () => getCompleteReserveConfiguration,
|
|
117
120
|
getContractDeploymentBlock: () => getContractDeploymentBlock,
|
|
118
121
|
getCurrentDebtBalance: () => getCurrentDebtBalance,
|
|
119
122
|
getCurrentLiquidityBalance: () => getCurrentLiquidityBalance,
|
|
123
|
+
getDynamicArraySlot: () => getDynamicArraySlot,
|
|
120
124
|
getExplicitRPC: () => getExplicitRPC,
|
|
121
125
|
getExplorer: () => getExplorer,
|
|
122
126
|
getGovernance: () => getGovernance,
|
|
@@ -138,6 +142,9 @@ __export(index_exports, {
|
|
|
138
142
|
getRPCUrl: () => getRPCUrl,
|
|
139
143
|
getReserveConfigurations: () => getReserveConfigurations,
|
|
140
144
|
getReserveTokens: () => getReserveTokens,
|
|
145
|
+
getSolidityStorageSlotAddress: () => getSolidityStorageSlotAddress,
|
|
146
|
+
getSolidityStorageSlotBytes: () => getSolidityStorageSlotBytes,
|
|
147
|
+
getSolidityStorageSlotUint: () => getSolidityStorageSlotUint,
|
|
141
148
|
getSourceCode: () => getSourceCode,
|
|
142
149
|
getTenderlyRpc: () => getTenderlyRpc,
|
|
143
150
|
getVerificationStatus: () => getVerificationStatus,
|
|
@@ -191,18 +198,27 @@ function bitmapToIndexes(bitmap) {
|
|
|
191
198
|
}
|
|
192
199
|
return indexes;
|
|
193
200
|
}
|
|
194
|
-
function getBits(uint256, startBit,
|
|
195
|
-
|
|
201
|
+
function getBits(uint256, startBit, endBit) {
|
|
202
|
+
if (uint256 < 0n) {
|
|
203
|
+
throw new Error("uint256 must be non-negative");
|
|
204
|
+
}
|
|
205
|
+
if (startBit < 0n || endBit < 0n) {
|
|
206
|
+
throw new Error("Bit positions must be non-negative");
|
|
207
|
+
}
|
|
196
208
|
if (startBit > endBit) {
|
|
197
209
|
throw new Error(
|
|
198
210
|
"Invalid bit range: startBit must be less than or equal to endBit"
|
|
199
211
|
);
|
|
200
212
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
if (uint256 === 0n) {
|
|
214
|
+
return 0n;
|
|
215
|
+
}
|
|
216
|
+
const bitLength = uint256.toString(2).length;
|
|
217
|
+
if (startBit >= bitLength) {
|
|
218
|
+
return 0n;
|
|
204
219
|
}
|
|
205
|
-
const
|
|
220
|
+
const actualEndBit = endBit >= bitLength ? BigInt(bitLength - 1) : endBit;
|
|
221
|
+
const mask = (1n << actualEndBit - startBit + 1n) - 1n;
|
|
206
222
|
return uint256 >> startBit & mask;
|
|
207
223
|
}
|
|
208
224
|
function setBits(input, startBit, endBit, replaceValue) {
|
|
@@ -230,10 +246,10 @@ function decodeUserConfiguration(userConfiguration) {
|
|
|
230
246
|
|
|
231
247
|
// src/aave/reserve.ts
|
|
232
248
|
function decodeReserveConfiguration(data) {
|
|
233
|
-
const ltv =
|
|
234
|
-
const liquidationThreshold =
|
|
235
|
-
const liquidationBonus =
|
|
236
|
-
const decimals =
|
|
249
|
+
const ltv = getBits(data, 0n, 15n);
|
|
250
|
+
const liquidationThreshold = getBits(data, 16n, 31n);
|
|
251
|
+
const liquidationBonus = getBits(data, 32n, 47n);
|
|
252
|
+
const decimals = getBits(data, 48n, 55n);
|
|
237
253
|
const active = getBits(data, 56n, 56n);
|
|
238
254
|
const frozen = getBits(data, 57n, 57n);
|
|
239
255
|
const borrowingEnabled = getBits(data, 58n, 58n);
|
|
@@ -245,26 +261,25 @@ function decodeReserveConfiguration(data) {
|
|
|
245
261
|
const borrowCap = getBits(data, 80n, 115n);
|
|
246
262
|
const supplyCap = getBits(data, 116n, 151n);
|
|
247
263
|
const liquidationProtocolFee = Number(getBits(data, 152n, 167n));
|
|
248
|
-
const unbackedMintCap = getBits(data, 176n, 211n);
|
|
249
264
|
const debtCeiling = getBits(data, 212n, 251n);
|
|
250
265
|
const virtualAccountingEnabled = getBits(data, 252n, 252n);
|
|
251
266
|
return {
|
|
252
|
-
ltv,
|
|
253
|
-
liquidationThreshold,
|
|
254
|
-
liquidationBonus,
|
|
255
|
-
decimals,
|
|
267
|
+
ltv: Number(ltv),
|
|
268
|
+
liquidationThreshold: Number(liquidationThreshold),
|
|
269
|
+
liquidationBonus: Number(liquidationBonus),
|
|
270
|
+
decimals: Number(decimals),
|
|
256
271
|
active: !!active,
|
|
257
272
|
frozen: !!frozen,
|
|
258
273
|
borrowingEnabled: !!borrowingEnabled,
|
|
259
274
|
// stableRateBorrowingEnabled: !!stableRateBorrowingEnabled,
|
|
260
275
|
paused: !!paused,
|
|
261
276
|
borrowingInIsolation: !!borrowingInIsolation,
|
|
262
|
-
reserveFactor,
|
|
277
|
+
reserveFactor: Number(reserveFactor),
|
|
263
278
|
borrowCap,
|
|
264
279
|
supplyCap,
|
|
265
|
-
liquidationProtocolFee,
|
|
280
|
+
liquidationProtocolFee: Number(liquidationProtocolFee),
|
|
266
281
|
// eModeCategory,
|
|
267
|
-
unbackedMintCap,
|
|
282
|
+
// unbackedMintCap,
|
|
268
283
|
debtCeiling,
|
|
269
284
|
siloedBorrowingEnabled: !!siloedBorrowingEnabled,
|
|
270
285
|
flashloaningEnabled: !!flashloaningEnabled,
|
|
@@ -16398,7 +16413,84 @@ async function getReserveConfigurations(client, pool, reserves) {
|
|
|
16398
16413
|
};
|
|
16399
16414
|
}
|
|
16400
16415
|
|
|
16401
|
-
//
|
|
16416
|
+
// src/aave/pool/configurations.ts
|
|
16417
|
+
var import_actions2 = require("viem/actions");
|
|
16418
|
+
async function getCompleteReserveConfiguration(client, poolAddress, reserve) {
|
|
16419
|
+
const [
|
|
16420
|
+
reserveData,
|
|
16421
|
+
deficit,
|
|
16422
|
+
virtualUnderlyingBalance,
|
|
16423
|
+
liquidationGracePeriod
|
|
16424
|
+
] = await Promise.all([
|
|
16425
|
+
(0, import_actions2.readContract)(client, {
|
|
16426
|
+
address: poolAddress,
|
|
16427
|
+
abi: IPool_ABI,
|
|
16428
|
+
functionName: "getReserveData",
|
|
16429
|
+
args: [reserve]
|
|
16430
|
+
}),
|
|
16431
|
+
(0, import_actions2.readContract)(client, {
|
|
16432
|
+
address: poolAddress,
|
|
16433
|
+
abi: IPool_ABI,
|
|
16434
|
+
functionName: "getReserveDeficit",
|
|
16435
|
+
args: [reserve]
|
|
16436
|
+
}),
|
|
16437
|
+
(0, import_actions2.readContract)(client, {
|
|
16438
|
+
address: poolAddress,
|
|
16439
|
+
abi: IPool_ABI,
|
|
16440
|
+
functionName: "getVirtualUnderlyingBalance",
|
|
16441
|
+
args: [reserve]
|
|
16442
|
+
}),
|
|
16443
|
+
(0, import_actions2.readContract)(client, {
|
|
16444
|
+
address: poolAddress,
|
|
16445
|
+
abi: IPool_ABI,
|
|
16446
|
+
functionName: "getLiquidationGracePeriod",
|
|
16447
|
+
args: [reserve]
|
|
16448
|
+
})
|
|
16449
|
+
]);
|
|
16450
|
+
const [
|
|
16451
|
+
scaledATokenTotalSupply,
|
|
16452
|
+
scaledVTokenTotalSupply,
|
|
16453
|
+
availableLiquidity,
|
|
16454
|
+
irParams
|
|
16455
|
+
] = await Promise.all([
|
|
16456
|
+
(0, import_actions2.readContract)(client, {
|
|
16457
|
+
address: reserveData.aTokenAddress,
|
|
16458
|
+
abi: IAToken_ABI,
|
|
16459
|
+
functionName: "scaledTotalSupply"
|
|
16460
|
+
}),
|
|
16461
|
+
(0, import_actions2.readContract)(client, {
|
|
16462
|
+
address: reserveData.variableDebtTokenAddress,
|
|
16463
|
+
abi: IAToken_ABI,
|
|
16464
|
+
functionName: "scaledTotalSupply"
|
|
16465
|
+
}),
|
|
16466
|
+
(0, import_actions2.readContract)(client, {
|
|
16467
|
+
address: reserve,
|
|
16468
|
+
abi: IAToken_ABI,
|
|
16469
|
+
functionName: "balanceOf",
|
|
16470
|
+
args: [reserveData.aTokenAddress]
|
|
16471
|
+
}),
|
|
16472
|
+
(0, import_actions2.readContract)(client, {
|
|
16473
|
+
address: reserveData.interestRateStrategyAddress,
|
|
16474
|
+
abi: IDefaultInterestRateStrategyV2_ABI,
|
|
16475
|
+
functionName: "getInterestRateDataBps",
|
|
16476
|
+
args: [reserve]
|
|
16477
|
+
})
|
|
16478
|
+
]);
|
|
16479
|
+
const config = decodeReserveConfiguration(reserveData.configuration.data);
|
|
16480
|
+
return {
|
|
16481
|
+
...reserveData,
|
|
16482
|
+
...config,
|
|
16483
|
+
deficit,
|
|
16484
|
+
virtualUnderlyingBalance,
|
|
16485
|
+
liquidationGracePeriod,
|
|
16486
|
+
scaledATokenTotalSupply,
|
|
16487
|
+
scaledVTokenTotalSupply,
|
|
16488
|
+
availableLiquidity,
|
|
16489
|
+
...irParams
|
|
16490
|
+
};
|
|
16491
|
+
}
|
|
16492
|
+
|
|
16493
|
+
// ../../node_modules/.pnpm/@bgd-labs+aave-address-book@4.31.0_viem@2.41.2_typescript@5.8.3_zod@3.24.2_/node_modules/@bgd-labs/aave-address-book/dist/abis/IPayloadsControllerCore.mjs
|
|
16402
16494
|
var IPayloadsControllerCore_ABI = [
|
|
16403
16495
|
{
|
|
16404
16496
|
type: "function",
|
|
@@ -16903,7 +16995,7 @@ var IPayloadsControllerCore_ABI = [
|
|
|
16903
16995
|
}
|
|
16904
16996
|
];
|
|
16905
16997
|
|
|
16906
|
-
// ../../node_modules/.pnpm/@bgd-labs+aave-address-book@4.31.0_viem@2.
|
|
16998
|
+
// ../../node_modules/.pnpm/@bgd-labs+aave-address-book@4.31.0_viem@2.41.2_typescript@5.8.3_zod@3.24.2_/node_modules/@bgd-labs/aave-address-book/dist/abis/IGovernanceCore.mjs
|
|
16907
16999
|
var IGovernanceCore_ABI = [
|
|
16908
17000
|
{
|
|
16909
17001
|
type: "function",
|
|
@@ -17936,7 +18028,7 @@ var IGovernanceCore_ABI = [
|
|
|
17936
18028
|
}
|
|
17937
18029
|
];
|
|
17938
18030
|
|
|
17939
|
-
// ../../node_modules/.pnpm/@bgd-labs+aave-address-book@4.31.0_viem@2.
|
|
18031
|
+
// ../../node_modules/.pnpm/@bgd-labs+aave-address-book@4.31.0_viem@2.41.2_typescript@5.8.3_zod@3.24.2_/node_modules/@bgd-labs/aave-address-book/dist/abis/IPool.mjs
|
|
17940
18032
|
var IPool_ABI2 = [
|
|
17941
18033
|
{
|
|
17942
18034
|
type: "function",
|
|
@@ -19964,6 +20056,17 @@ var import_viem3 = require("viem");
|
|
|
19964
20056
|
|
|
19965
20057
|
// src/math/slot.ts
|
|
19966
20058
|
var import_viem2 = require("viem");
|
|
20059
|
+
function getSolidityStorageSlotBytes(mappingSlot, key) {
|
|
20060
|
+
const slot = (0, import_viem2.pad)(mappingSlot, { size: 32 });
|
|
20061
|
+
return (0, import_viem2.trim)(
|
|
20062
|
+
(0, import_viem2.keccak256)(
|
|
20063
|
+
(0, import_viem2.encodeAbiParameters)((0, import_viem2.parseAbiParameters)("bytes32, uint256"), [
|
|
20064
|
+
key,
|
|
20065
|
+
BigInt(slot)
|
|
20066
|
+
])
|
|
20067
|
+
)
|
|
20068
|
+
);
|
|
20069
|
+
}
|
|
19967
20070
|
function getSolidityStorageSlotUint(mappingSlot, key) {
|
|
19968
20071
|
return (0, import_viem2.keccak256)(
|
|
19969
20072
|
(0, import_viem2.encodeAbiParameters)((0, import_viem2.parseAbiParameters)("uint256, uint256"), [
|
|
@@ -19972,9 +20075,42 @@ function getSolidityStorageSlotUint(mappingSlot, key) {
|
|
|
19972
20075
|
])
|
|
19973
20076
|
);
|
|
19974
20077
|
}
|
|
20078
|
+
function getSolidityStorageSlotAddress(mappingSlot, key) {
|
|
20079
|
+
return (0, import_viem2.keccak256)(
|
|
20080
|
+
(0, import_viem2.encodeAbiParameters)((0, import_viem2.parseAbiParameters)("address, uint256"), [
|
|
20081
|
+
key,
|
|
20082
|
+
BigInt(mappingSlot)
|
|
20083
|
+
])
|
|
20084
|
+
);
|
|
20085
|
+
}
|
|
20086
|
+
function getDynamicArraySlot(baseSlot, arrayIndex, itemSize) {
|
|
20087
|
+
return (0, import_viem2.pad)(
|
|
20088
|
+
(0, import_viem2.toHex)(
|
|
20089
|
+
(0, import_viem2.fromHex)(
|
|
20090
|
+
(0, import_viem2.keccak256)(
|
|
20091
|
+
(0, import_viem2.encodeAbiParameters)((0, import_viem2.parseAbiParameters)("uint256"), [baseSlot])
|
|
20092
|
+
),
|
|
20093
|
+
"bigint"
|
|
20094
|
+
) + BigInt(arrayIndex * itemSize)
|
|
20095
|
+
),
|
|
20096
|
+
{ size: 32 }
|
|
20097
|
+
);
|
|
20098
|
+
}
|
|
20099
|
+
function getBytesValue(value) {
|
|
20100
|
+
const bytesString = (0, import_viem2.toBytes)(value);
|
|
20101
|
+
if (bytesString.length > 31)
|
|
20102
|
+
throw new Error("Error: strings > 31 bytes are not implemented");
|
|
20103
|
+
return (0, import_viem2.concat)([
|
|
20104
|
+
(0, import_viem2.toHex)((0, import_viem2.pad)(bytesString, { size: 31, dir: "right" })),
|
|
20105
|
+
(0, import_viem2.toHex)(bytesString.length * 2, { size: 1 })
|
|
20106
|
+
]);
|
|
20107
|
+
}
|
|
20108
|
+
function bytes32ToAddress(bytes32) {
|
|
20109
|
+
return (0, import_viem2.getAddress)((0, import_viem2.slice)(bytes32, 12, 32));
|
|
20110
|
+
}
|
|
19975
20111
|
|
|
19976
20112
|
// src/aave/governance/payloads-controller.ts
|
|
19977
|
-
var
|
|
20113
|
+
var import_actions3 = require("viem/actions");
|
|
19978
20114
|
var PayloadState = /* @__PURE__ */ ((PayloadState2) => {
|
|
19979
20115
|
PayloadState2[PayloadState2["None"] = 0] = "None";
|
|
19980
20116
|
PayloadState2[PayloadState2["Created"] = 1] = "Created";
|
|
@@ -20002,7 +20138,7 @@ function getPayloadsController(client, address) {
|
|
|
20002
20138
|
async function getPayloadStorageOverrides(client, payloadsController, payloadId) {
|
|
20003
20139
|
const controllerContract = getPayloadsController(client, payloadsController);
|
|
20004
20140
|
const payload = await controllerContract.read.getPayloadById([payloadId]);
|
|
20005
|
-
const currentBlock = await (0,
|
|
20141
|
+
const currentBlock = await (0, import_actions3.getBlock)(client);
|
|
20006
20142
|
return [
|
|
20007
20143
|
{
|
|
20008
20144
|
slot: getSolidityStorageSlotUint(3n, BigInt(payloadId)),
|
|
@@ -20056,7 +20192,7 @@ async function getNonFinalizedPayloads(client, payloadsController) {
|
|
|
20056
20192
|
|
|
20057
20193
|
// src/aave/governance/governance.ts
|
|
20058
20194
|
var import_viem4 = require("viem");
|
|
20059
|
-
var
|
|
20195
|
+
var import_actions4 = require("viem/actions");
|
|
20060
20196
|
var ProposalState = /* @__PURE__ */ ((ProposalState2) => {
|
|
20061
20197
|
ProposalState2[ProposalState2["Null"] = 0] = "Null";
|
|
20062
20198
|
ProposalState2[ProposalState2["Created"] = 1] = "Created";
|
|
@@ -20086,9 +20222,9 @@ function getGovernance(client, address) {
|
|
|
20086
20222
|
});
|
|
20087
20223
|
}
|
|
20088
20224
|
async function makeProposalExecutableOnTestClient(client, governance, proposalId) {
|
|
20089
|
-
const currentBlock = await (0,
|
|
20225
|
+
const currentBlock = await (0, import_actions4.getBlock)(client);
|
|
20090
20226
|
const proposalSlot = getSolidityStorageSlotUint(7n, proposalId);
|
|
20091
|
-
const data = await (0,
|
|
20227
|
+
const data = await (0, import_actions4.getStorageAt)(client, {
|
|
20092
20228
|
address: governance,
|
|
20093
20229
|
slot: proposalSlot
|
|
20094
20230
|
});
|
|
@@ -21354,7 +21490,7 @@ async function tenderly_createVnet({
|
|
|
21354
21490
|
},
|
|
21355
21491
|
mode: "tenderly",
|
|
21356
21492
|
transport: (0, import_viem5.http)(rpc.url, { timeout: 2e5 })
|
|
21357
|
-
}),
|
|
21493
|
+
}).extend(import_viem5.publicActions),
|
|
21358
21494
|
walletClient: (0, import_viem5.createWalletClient)({
|
|
21359
21495
|
chain: {
|
|
21360
21496
|
...ChainList[baseChainId],
|
|
@@ -22028,7 +22164,7 @@ function getClient(chainId, {
|
|
|
22028
22164
|
} = {}) {
|
|
22029
22165
|
if (!clientCache[chainId] || forceRebuildClient) {
|
|
22030
22166
|
const rpcURL = getRPCUrl(chainId, providerConfig);
|
|
22031
|
-
clientCache[chainId] = (0, import_viem6.
|
|
22167
|
+
clientCache[chainId] = (0, import_viem6.createPublicClient)({
|
|
22032
22168
|
chain: ChainList[chainId],
|
|
22033
22169
|
transport: (0, import_viem6.http)(rpcURL, httpConfig),
|
|
22034
22170
|
...clientConfig
|
|
@@ -22038,7 +22174,7 @@ function getClient(chainId, {
|
|
|
22038
22174
|
}
|
|
22039
22175
|
|
|
22040
22176
|
// src/ecosystem/rpc-helpers.ts
|
|
22041
|
-
var
|
|
22177
|
+
var import_actions5 = require("viem/actions");
|
|
22042
22178
|
|
|
22043
22179
|
// src/ecosystem/constants.ts
|
|
22044
22180
|
var erc1967_ImplementationSlot = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
|
|
@@ -22047,7 +22183,7 @@ var erc1967_AdminSlot = "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a71
|
|
|
22047
22183
|
// src/ecosystem/rpc-helpers.ts
|
|
22048
22184
|
var import_viem7 = require("viem");
|
|
22049
22185
|
function getImplementationSlot(client, address) {
|
|
22050
|
-
return (0,
|
|
22186
|
+
return (0, import_actions5.getStorageAt)(client, { address, slot: erc1967_ImplementationSlot });
|
|
22051
22187
|
}
|
|
22052
22188
|
async function getLogsRecursive({
|
|
22053
22189
|
client,
|
|
@@ -22058,7 +22194,7 @@ async function getLogsRecursive({
|
|
|
22058
22194
|
}) {
|
|
22059
22195
|
if (fromBlock <= toBlock) {
|
|
22060
22196
|
try {
|
|
22061
|
-
const logs = await (0,
|
|
22197
|
+
const logs = await (0, import_actions5.getLogs)(client, {
|
|
22062
22198
|
fromBlock,
|
|
22063
22199
|
toBlock,
|
|
22064
22200
|
events,
|
|
@@ -22130,7 +22266,7 @@ async function getContractDeploymentBlock({
|
|
|
22130
22266
|
if (fromBlock == toBlock) return fromBlock;
|
|
22131
22267
|
if (fromBlock < toBlock) {
|
|
22132
22268
|
const midBlock = BigInt(fromBlock + toBlock) >> BigInt(1);
|
|
22133
|
-
const codeMid = await (0,
|
|
22269
|
+
const codeMid = await (0, import_actions5.getBytecode)(client, {
|
|
22134
22270
|
blockNumber: midBlock,
|
|
22135
22271
|
address: contractAddress
|
|
22136
22272
|
});
|
|
@@ -22161,7 +22297,7 @@ async function getContractDeploymentBlock({
|
|
|
22161
22297
|
// src/ecosystem/flashbots.ts
|
|
22162
22298
|
var import_eventsource = require("eventsource");
|
|
22163
22299
|
var import_viem8 = require("viem");
|
|
22164
|
-
var
|
|
22300
|
+
var import_actions6 = require("viem/actions");
|
|
22165
22301
|
function flashbotsOnFetchRequest(account, relay = "https://relay.flashbots.net") {
|
|
22166
22302
|
return async function(request, init) {
|
|
22167
22303
|
if (init.body.includes("eth_sendPrivateTransaction") || init.body.includes("mev_simBundle") || init.body.includes("mev_sendBundle")) {
|
|
@@ -22196,7 +22332,7 @@ function flashbotsClientExtension(client) {
|
|
|
22196
22332
|
params: [
|
|
22197
22333
|
{
|
|
22198
22334
|
tx: signedTx,
|
|
22199
|
-
maxBlockNumber: (0, import_viem8.toHex)(await (0,
|
|
22335
|
+
maxBlockNumber: (0, import_viem8.toHex)(await (0, import_actions6.getBlockNumber)(client) + 100n),
|
|
22200
22336
|
preferences,
|
|
22201
22337
|
...maxBlockNumber ? { maxBlockNumber } : {}
|
|
22202
22338
|
}
|
|
@@ -38797,7 +38933,7 @@ function enhanceLogs(client, logs) {
|
|
|
38797
38933
|
}
|
|
38798
38934
|
|
|
38799
38935
|
// src/seatbelt/selfdestruct.ts
|
|
38800
|
-
var
|
|
38936
|
+
var import_actions7 = require("viem/actions");
|
|
38801
38937
|
var STOP = 0;
|
|
38802
38938
|
var JUMPDEST = 91;
|
|
38803
38939
|
var PUSH1 = 96;
|
|
@@ -38843,9 +38979,9 @@ async function checkForSelfdestruct(client, addresses, trustedAddresses) {
|
|
|
38843
38979
|
result.push({ address, state: 0 /* TRUSTED */ });
|
|
38844
38980
|
continue;
|
|
38845
38981
|
}
|
|
38846
|
-
const code = await (0,
|
|
38982
|
+
const code = await (0, import_actions7.getBytecode)(client, { address });
|
|
38847
38983
|
if (!code) {
|
|
38848
|
-
const nonce = await (0,
|
|
38984
|
+
const nonce = await (0, import_actions7.getTransactionCount)(client, { address });
|
|
38849
38985
|
if (nonce > 0)
|
|
38850
38986
|
result.push({ address, state: 1 /* EOA */ });
|
|
38851
38987
|
else result.push({ address, state: 2 /* EMPTY */ });
|
|
@@ -38888,7 +39024,7 @@ function checkCode(bytecode) {
|
|
|
38888
39024
|
var import_viem12 = require("viem");
|
|
38889
39025
|
|
|
38890
39026
|
// src/seatbelt/verified.ts
|
|
38891
|
-
var
|
|
39027
|
+
var import_actions8 = require("viem/actions");
|
|
38892
39028
|
var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
38893
39029
|
VerificationStatus2[VerificationStatus2["EOA"] = 0] = "EOA";
|
|
38894
39030
|
VerificationStatus2[VerificationStatus2["CONTRACT"] = 1] = "CONTRACT";
|
|
@@ -38922,7 +39058,7 @@ async function getVerificationStatus({
|
|
|
38922
39058
|
});
|
|
38923
39059
|
continue;
|
|
38924
39060
|
}
|
|
38925
|
-
const code = await (0,
|
|
39061
|
+
const code = await (0, import_actions8.getCode)(client, { address });
|
|
38926
39062
|
if (!code) {
|
|
38927
39063
|
results.push({
|
|
38928
39064
|
address,
|
|
@@ -38955,7 +39091,7 @@ async function getVerificationStatus({
|
|
|
38955
39091
|
|
|
38956
39092
|
// src/seatbelt/state.ts
|
|
38957
39093
|
var import_viem11 = require("viem");
|
|
38958
|
-
var
|
|
39094
|
+
var import_actions9 = require("viem/actions");
|
|
38959
39095
|
function isChangeOfType(change, name) {
|
|
38960
39096
|
return change.name === name;
|
|
38961
39097
|
}
|
|
@@ -39164,7 +39300,7 @@ async function enhanceStateDiff(client, diff) {
|
|
|
39164
39300
|
if (isChangeOfType(change, "_reserves")) {
|
|
39165
39301
|
let method = decodeReserveConfigurationV2;
|
|
39166
39302
|
try {
|
|
39167
|
-
await (0,
|
|
39303
|
+
await (0, import_actions9.readContract)(client, {
|
|
39168
39304
|
abi: IPool_ABI,
|
|
39169
39305
|
functionName: "getUserEMode",
|
|
39170
39306
|
args: [import_viem11.zeroAddress],
|
|
@@ -39509,6 +39645,7 @@ function toAddressLink(address, client) {
|
|
|
39509
39645
|
assetToBase,
|
|
39510
39646
|
bitmapToIndexes,
|
|
39511
39647
|
blockscoutExplorers,
|
|
39648
|
+
bytes32ToAddress,
|
|
39512
39649
|
calculateAvailableBorrowsMarketReferenceCurrency,
|
|
39513
39650
|
calculateCompoundedInterest,
|
|
39514
39651
|
calculateHealthFactor,
|
|
@@ -39535,10 +39672,13 @@ function toAddressLink(address, client) {
|
|
|
39535
39672
|
genericIndexer,
|
|
39536
39673
|
getAlchemyRPC,
|
|
39537
39674
|
getBits,
|
|
39675
|
+
getBytesValue,
|
|
39538
39676
|
getClient,
|
|
39677
|
+
getCompleteReserveConfiguration,
|
|
39539
39678
|
getContractDeploymentBlock,
|
|
39540
39679
|
getCurrentDebtBalance,
|
|
39541
39680
|
getCurrentLiquidityBalance,
|
|
39681
|
+
getDynamicArraySlot,
|
|
39542
39682
|
getExplicitRPC,
|
|
39543
39683
|
getExplorer,
|
|
39544
39684
|
getGovernance,
|
|
@@ -39560,6 +39700,9 @@ function toAddressLink(address, client) {
|
|
|
39560
39700
|
getRPCUrl,
|
|
39561
39701
|
getReserveConfigurations,
|
|
39562
39702
|
getReserveTokens,
|
|
39703
|
+
getSolidityStorageSlotAddress,
|
|
39704
|
+
getSolidityStorageSlotBytes,
|
|
39705
|
+
getSolidityStorageSlotUint,
|
|
39563
39706
|
getSourceCode,
|
|
39564
39707
|
getTenderlyRpc,
|
|
39565
39708
|
getVerificationStatus,
|