@aave-dao/aave-helpers-js 1.0.1 → 1.0.4
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 +1 -3
- package/dist/cli.cjs +4 -4
- package/dist/cli.mjs +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{protocol-diff-M_rYNx6y.mjs → protocol-diff-BpxA1bKM.mjs} +1 -1
- package/dist/{protocol-diff-YLEa_C3t.cjs → protocol-diff-DG-feLJw.cjs} +5 -5
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -46,9 +46,7 @@ To add a missing event, append its ABI entry to the JSON array:
|
|
|
46
46
|
"type": "event",
|
|
47
47
|
"name": "MyEvent",
|
|
48
48
|
"anonymous": false,
|
|
49
|
-
"inputs": [
|
|
50
|
-
{ "name": "param", "type": "uint256", "indexed": false, "internalType": "uint256" }
|
|
51
|
-
]
|
|
49
|
+
"inputs": [{ "name": "param", "type": "uint256", "indexed": false, "internalType": "uint256" }]
|
|
52
50
|
}
|
|
53
51
|
```
|
|
54
52
|
|
package/dist/cli.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_protocol_diff = require('./protocol-diff-
|
|
2
|
+
const require_protocol_diff = require('./protocol-diff-DG-feLJw.cjs');
|
|
3
3
|
let _bgd_labs_toolbox = require("@bgd-labs/toolbox");
|
|
4
4
|
let viem = require("viem");
|
|
5
5
|
let fs = require("fs");
|
|
6
6
|
let path = require("path");
|
|
7
7
|
let commander = require("commander");
|
|
8
|
-
let
|
|
8
|
+
let _aave_dao_aave_address_book_utils = require("@aave-dao/aave-address-book/utils");
|
|
9
9
|
let viem_actions = require("viem/actions");
|
|
10
10
|
let viem_accounts = require("viem/accounts");
|
|
11
11
|
|
|
@@ -61,7 +61,7 @@ program.command("ipfs").description("generates the ipfs hash for specified sourc
|
|
|
61
61
|
console.log(bs58Hash);
|
|
62
62
|
});
|
|
63
63
|
function flagAsKnown(value, reference) {
|
|
64
|
-
return `${value} [:ghost:](https://github.com/
|
|
64
|
+
return `${value} [:ghost:](https://github.com/aave-dao/aave-address-book "${reference}")`;
|
|
65
65
|
}
|
|
66
66
|
program.command("seatbelt-report").description("generates a seatbelt report for the payload").addOption(new commander.Option("-c,--chainId <number>").makeOptionMandatory()).addOption(new commander.Option("--pi,--payloadId <number>")).addOption(new commander.Option("--pa, --payloadAddress <address>")).addOption(new commander.Option("--pb,--payloadBytecode <hex>")).addOption(new commander.Option("--pcd,--payloadCalldata <hex>")).addOption(new commander.Option("--pc, --payloadsController <address>").makeOptionMandatory()).addOption(new commander.Option("-o, --output <output path>").default("./reports/seatbelt/")).addOption(new commander.Option("-t, --tenderlyAccessToken <string>", "defaults to env.TENDERLY_ACCESS_TOKEN")).addOption(new commander.Option("-a, --tenderlyAccountSlug <string>", "defaults to env.TENDERLY_ACCOUNT_SLUG")).addOption(new commander.Option("-p, --tenderlyProjectSlug <string>", "defaults to env.TENDERLY_PROJECT_SLUG")).addOption(new commander.Option("-e, --etherscanApiKey <string>", "defaults to env.ETHERSCAN_API_KEY")).action(async ({ chainId, tenderlyAccessToken, tenderlyAccountSlug, tenderlyProjectSlug, output, payloadId, payloadAddress, payloadBytecode, payloadCalldata, payloadsController }) => {
|
|
67
67
|
const vnet = await (0, _bgd_labs_toolbox.tenderly_createVnet)({
|
|
@@ -148,7 +148,7 @@ program.command("seatbelt-report").description("generates a seatbelt report for
|
|
|
148
148
|
onchainLogs: {},
|
|
149
149
|
config: { etherscanApiKey: process.env.ETHERSCAN_API_KEY },
|
|
150
150
|
getContractName: (sim, address) => {
|
|
151
|
-
const references = (0,
|
|
151
|
+
const references = (0, _aave_dao_aave_address_book_utils.getAddressBookReferences)(address, Number(sim.simulation.network_id));
|
|
152
152
|
if (references.length > 0) return flagAsKnown((0, _bgd_labs_toolbox.getMdContractName)(sim.contracts, address), references[0]);
|
|
153
153
|
return (0, _bgd_labs_toolbox.getMdContractName)(sim.contracts, address);
|
|
154
154
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as diffSnapshots } from "./protocol-diff-
|
|
2
|
+
import { t as diffSnapshots } from "./protocol-diff-BpxA1bKM.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";
|
|
6
6
|
import { dirname, join } from "path";
|
|
7
7
|
import { Command, Option } from "commander";
|
|
8
|
-
import { getAddressBookReferences } from "@
|
|
8
|
+
import { getAddressBookReferences } from "@aave-dao/aave-address-book/utils";
|
|
9
9
|
import { readContract } from "viem/actions";
|
|
10
10
|
import { toAccount } from "viem/accounts";
|
|
11
11
|
|
|
@@ -61,7 +61,7 @@ program.command("ipfs").description("generates the ipfs hash for specified sourc
|
|
|
61
61
|
console.log(bs58Hash);
|
|
62
62
|
});
|
|
63
63
|
function flagAsKnown(value, reference) {
|
|
64
|
-
return `${value} [:ghost:](https://github.com/
|
|
64
|
+
return `${value} [:ghost:](https://github.com/aave-dao/aave-address-book "${reference}")`;
|
|
65
65
|
}
|
|
66
66
|
program.command("seatbelt-report").description("generates a seatbelt report for the payload").addOption(new Option("-c,--chainId <number>").makeOptionMandatory()).addOption(new Option("--pi,--payloadId <number>")).addOption(new Option("--pa, --payloadAddress <address>")).addOption(new Option("--pb,--payloadBytecode <hex>")).addOption(new Option("--pcd,--payloadCalldata <hex>")).addOption(new Option("--pc, --payloadsController <address>").makeOptionMandatory()).addOption(new Option("-o, --output <output path>").default("./reports/seatbelt/")).addOption(new Option("-t, --tenderlyAccessToken <string>", "defaults to env.TENDERLY_ACCESS_TOKEN")).addOption(new Option("-a, --tenderlyAccountSlug <string>", "defaults to env.TENDERLY_ACCOUNT_SLUG")).addOption(new Option("-p, --tenderlyProjectSlug <string>", "defaults to env.TENDERLY_PROJECT_SLUG")).addOption(new Option("-e, --etherscanApiKey <string>", "defaults to env.ETHERSCAN_API_KEY")).action(async ({ chainId, tenderlyAccessToken, tenderlyAccountSlug, tenderlyProjectSlug, output, payloadId, payloadAddress, payloadBytecode, payloadCalldata, payloadsController }) => {
|
|
67
67
|
const vnet = await tenderly_createVnet({
|
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-
|
|
2
|
+
const require_protocol_diff = require('./protocol-diff-DG-feLJw.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 { i as isChange, n as diff, r as hasChanges, t as diffSnapshots } from "./protocol-diff-
|
|
1
|
+
import { i as isChange, n as diff, r as hasChanges, t as diffSnapshots } from "./protocol-diff-BpxA1bKM.mjs";
|
|
2
2
|
|
|
3
3
|
export { diff, diffSnapshots, hasChanges, isChange };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bitmapToIndexes, enhanceLogs, getClient, parseLogs } from "@bgd-labs/toolbox";
|
|
2
2
|
import { formatUnits, getAddress } from "viem";
|
|
3
|
-
import * as addresses from "@
|
|
3
|
+
import * as addresses from "@aave-dao/aave-address-book";
|
|
4
4
|
import { findObjectPaths } from "find-object-paths";
|
|
5
5
|
|
|
6
6
|
//#region diff.ts
|
|
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
//#endregion
|
|
28
28
|
let _bgd_labs_toolbox = require("@bgd-labs/toolbox");
|
|
29
29
|
let viem = require("viem");
|
|
30
|
-
let
|
|
31
|
-
|
|
30
|
+
let _aave_dao_aave_address_book = require("@aave-dao/aave-address-book");
|
|
31
|
+
_aave_dao_aave_address_book = __toESM(_aave_dao_aave_address_book);
|
|
32
32
|
let find_object_paths = require("find-object-paths");
|
|
33
33
|
|
|
34
34
|
//#region diff.ts
|
|
@@ -551,9 +551,9 @@ function renderPoolConfigSection(diffResult, chainId) {
|
|
|
551
551
|
* Returns found paths or undefined.
|
|
552
552
|
*/
|
|
553
553
|
function isKnownAddress(value, chainId) {
|
|
554
|
-
const results = (0, find_object_paths.findObjectPaths)(Object.keys(
|
|
555
|
-
if (
|
|
556
|
-
const chainAddresses = { ...
|
|
554
|
+
const results = (0, find_object_paths.findObjectPaths)(Object.keys(_aave_dao_aave_address_book).reduce((acc, key) => {
|
|
555
|
+
if (_aave_dao_aave_address_book[key].CHAIN_ID === chainId) {
|
|
556
|
+
const chainAddresses = { ..._aave_dao_aave_address_book[key] };
|
|
557
557
|
if (chainAddresses.E_MODES) delete chainAddresses.E_MODES;
|
|
558
558
|
acc[key] = chainAddresses;
|
|
559
559
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aave-dao/aave-helpers-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -16,11 +16,19 @@
|
|
|
16
16
|
"bin": {
|
|
17
17
|
"aave-helpers-js": "dist/cli.mjs"
|
|
18
18
|
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/aave-dao/aave-helpers.git",
|
|
22
|
+
"directory": "packages/aave-helpers-js"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22"
|
|
26
|
+
},
|
|
19
27
|
"files": [
|
|
20
28
|
"dist"
|
|
21
29
|
],
|
|
22
30
|
"dependencies": {
|
|
23
|
-
"@
|
|
31
|
+
"@aave-dao/aave-address-book": "^4.44.14",
|
|
24
32
|
"@bgd-labs/toolbox": "^0.2.18",
|
|
25
33
|
"commander": "^14.0.3",
|
|
26
34
|
"find-object-paths": "^1.1.0",
|