@aave-dao/aave-helpers-js 1.0.6 → 1.0.8
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/README.md +27 -10
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +2 -2
- package/dist/protocol-diff-BR_L30bc.mjs +2839 -0
- package/dist/protocol-diff-C0Y-FDPe.cjs +2902 -0
- package/package.json +1 -1
- package/dist/protocol-diff-BpxA1bKM.mjs +0 -1882
- package/dist/protocol-diff-DG-feLJw.cjs +0 -1939
package/README.md
CHANGED
|
@@ -37,17 +37,34 @@ const md = await diffSnapshots(preSnapshot, postSnapshot);
|
|
|
37
37
|
|
|
38
38
|
## Event Database
|
|
39
39
|
|
|
40
|
-
`utils/eventDb.
|
|
40
|
+
`utils/eventDb.ts` is a collection of Solidity event ABIs used to decode transaction logs in reports. If a report shows raw topics/data instead of a decoded event name, the event ABI is likely missing from this file.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
### Adding events from a verified contract
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
Use the `add-events` script to automatically fetch events from a block explorer and add any missing ones to the database:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
# By chain ID and address
|
|
48
|
+
npx tsx scripts/add-events.ts <chainId> <address>
|
|
49
|
+
|
|
50
|
+
# Examples
|
|
51
|
+
npx tsx scripts/add-events.ts 1 0x5ac4182a1dd41aeef465e40b82fd326bf66ab82c
|
|
52
|
+
npx tsx scripts/add-events.ts 137 0xSomePolygonAddress
|
|
51
53
|
```
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
The script will:
|
|
56
|
+
|
|
57
|
+
- Fetch the contract ABI from the block explorer (Etherscan, etc.)
|
|
58
|
+
- If the contract is a proxy, also fetch the implementation ABI
|
|
59
|
+
- Compare against the existing event database and add only missing events
|
|
60
|
+
- Running it twice on the same contract is safe (idempotent)
|
|
61
|
+
|
|
62
|
+
Requires `ETHERSCAN_API_KEY` environment variable. Optionally set `EXPLORER_PROXY` to override the explorer API URL.
|
|
63
|
+
|
|
64
|
+
### Claude Code skill
|
|
65
|
+
|
|
66
|
+
If you're using Claude Code, you can ask it to add events by providing an explorer URL:
|
|
67
|
+
|
|
68
|
+
> add events from https://etherscan.io/address/0x5ac4182a1dd41aeef465e40b82fd326bf66ab82c
|
|
69
|
+
|
|
70
|
+
It will parse the URL, determine the chain ID, and run the script automatically.
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_protocol_diff = require('./protocol-diff-
|
|
2
|
+
const require_protocol_diff = require('./protocol-diff-C0Y-FDPe.cjs');
|
|
3
3
|
let _bgd_labs_toolbox = require("@bgd-labs/toolbox");
|
|
4
4
|
let viem = require("viem");
|
|
5
5
|
let fs = require("fs");
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as diffSnapshots } from "./protocol-diff-
|
|
2
|
+
import { t as diffSnapshots } from "./protocol-diff-BR_L30bc.mjs";
|
|
3
3
|
import { Aip, IPayloadsController_ABI, cidV0ToBs58, getMdContractName, getPayloadsController, hash, makePayloadExecutableOnTestClient, parseFrontmatterMd, renderTenderlyReport, tenderly_createVnet } from "@bgd-labs/toolbox";
|
|
4
4
|
import { encodeFunctionData, parseAbi, zeroAddress } from "viem";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_protocol_diff = require('./protocol-diff-
|
|
2
|
+
const require_protocol_diff = require('./protocol-diff-C0Y-FDPe.cjs');
|
|
3
3
|
|
|
4
4
|
exports.diff = require_protocol_diff.diff;
|
|
5
5
|
exports.diffSnapshots = require_protocol_diff.diffSnapshots;
|
|
6
|
+
exports.eventDb = require_protocol_diff.eventDb;
|
|
6
7
|
exports.hasChanges = require_protocol_diff.hasChanges;
|
|
7
8
|
exports.isChange = require_protocol_diff.isChange;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex } from "viem";
|
|
1
|
+
import { AbiEvent, Hex } from "viem";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region snapshot-types.d.ts
|
|
@@ -270,6 +270,9 @@ type AaveV3Snapshot = z.infer<typeof aaveV3SnapshotSchema>;
|
|
|
270
270
|
*/
|
|
271
271
|
declare function diffSnapshots(before: AaveV3Snapshot, after: AaveV3Snapshot): Promise<string>;
|
|
272
272
|
//#endregion
|
|
273
|
+
//#region utils/eventDb.d.ts
|
|
274
|
+
declare const eventDb: AbiEvent[];
|
|
275
|
+
//#endregion
|
|
273
276
|
//#region diff.d.ts
|
|
274
277
|
/**
|
|
275
278
|
* Generic recursive object diff.
|
|
@@ -298,4 +301,4 @@ declare function isChange<T = any>(value: any): value is Change<T>;
|
|
|
298
301
|
*/
|
|
299
302
|
declare function hasChanges<T extends Record<string, any>>(diffObj: DiffResult<T> | Record<string, unknown> | null | undefined): boolean;
|
|
300
303
|
//#endregion
|
|
301
|
-
export { type AaveV3Config, type AaveV3Emode, type AaveV3Reserve, type AaveV3Snapshot, type AaveV3Strategy, type CHAIN_ID, type Change, type DiffResult, type Log, type RawStorage, type SlotDiff, type ValueDiff, diff, diffSnapshots, hasChanges, isChange };
|
|
304
|
+
export { type AaveV3Config, type AaveV3Emode, type AaveV3Reserve, type AaveV3Snapshot, type AaveV3Strategy, type CHAIN_ID, type Change, type DiffResult, type Log, type RawStorage, type SlotDiff, type ValueDiff, diff, diffSnapshots, eventDb, hasChanges, isChange };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex } from "viem";
|
|
1
|
+
import { AbiEvent, Hex } from "viem";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region snapshot-types.d.ts
|
|
@@ -270,6 +270,9 @@ type AaveV3Snapshot = z.infer<typeof aaveV3SnapshotSchema>;
|
|
|
270
270
|
*/
|
|
271
271
|
declare function diffSnapshots(before: AaveV3Snapshot, after: AaveV3Snapshot): Promise<string>;
|
|
272
272
|
//#endregion
|
|
273
|
+
//#region utils/eventDb.d.ts
|
|
274
|
+
declare const eventDb: AbiEvent[];
|
|
275
|
+
//#endregion
|
|
273
276
|
//#region diff.d.ts
|
|
274
277
|
/**
|
|
275
278
|
* Generic recursive object diff.
|
|
@@ -298,4 +301,4 @@ declare function isChange<T = any>(value: any): value is Change<T>;
|
|
|
298
301
|
*/
|
|
299
302
|
declare function hasChanges<T extends Record<string, any>>(diffObj: DiffResult<T> | Record<string, unknown> | null | undefined): boolean;
|
|
300
303
|
//#endregion
|
|
301
|
-
export { type AaveV3Config, type AaveV3Emode, type AaveV3Reserve, type AaveV3Snapshot, type AaveV3Strategy, type CHAIN_ID, type Change, type DiffResult, type Log, type RawStorage, type SlotDiff, type ValueDiff, diff, diffSnapshots, hasChanges, isChange };
|
|
304
|
+
export { type AaveV3Config, type AaveV3Emode, type AaveV3Reserve, type AaveV3Snapshot, type AaveV3Strategy, type CHAIN_ID, type Change, type DiffResult, type Log, type RawStorage, type SlotDiff, type ValueDiff, diff, diffSnapshots, eventDb, hasChanges, isChange };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as isChange, i as hasChanges, n as eventDb, r as diff, t as diffSnapshots } from "./protocol-diff-BR_L30bc.mjs";
|
|
2
2
|
|
|
3
|
-
export { diff, diffSnapshots, hasChanges, isChange };
|
|
3
|
+
export { diff, diffSnapshots, eventDb, hasChanges, isChange };
|