@aave-dao/aave-helpers-js 1.0.7 → 1.0.9

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 CHANGED
@@ -37,17 +37,34 @@ const md = await diffSnapshots(preSnapshot, postSnapshot);
37
37
 
38
38
  ## Event Database
39
39
 
40
- `utils/eventDb.json` is a static 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.
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
- To add a missing event, append its ABI entry to the JSON array:
42
+ ### Adding events from a verified contract
43
43
 
44
- ```json
45
- {
46
- "type": "event",
47
- "name": "MyEvent",
48
- "anonymous": false,
49
- "inputs": [{ "name": "param", "type": "uint256", "indexed": false, "internalType": "uint256" }]
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
- You can extract event ABIs from contract artifacts (`out/` / `artifacts/`) or from block explorers.
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-QsvWEZ3c.cjs');
2
+ const require_protocol_diff = require('./protocol-diff-CnKXLpiL.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-BB9QZ_ZN.mjs";
2
+ import { t as diffSnapshots } from "./protocol-diff-C2SNG4ee.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,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_protocol_diff = require('./protocol-diff-QsvWEZ3c.cjs');
2
+ const require_protocol_diff = require('./protocol-diff-CnKXLpiL.cjs');
3
3
 
4
4
  exports.diff = require_protocol_diff.diff;
5
5
  exports.diffSnapshots = require_protocol_diff.diffSnapshots;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as isChange, i as hasChanges, n as eventDb, r as diff, t as diffSnapshots } from "./protocol-diff-BB9QZ_ZN.mjs";
1
+ import { a as isChange, i as hasChanges, n as eventDb, r as diff, t as diffSnapshots } from "./protocol-diff-C2SNG4ee.mjs";
2
2
 
3
3
  export { diff, diffSnapshots, eventDb, hasChanges, isChange };