Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,28 @@ For a full overview of features you can run `aave-cli --help`
## Installation

Make sure to setup your .env as most utilities rely on tenderly and will fail otherwise.

```
TENDERLY_ACCESS_TOKEN=
TENDERLY_PROJECT_SLUG=
TENDERLY_ACCOUNT=
```

Local installation

```
npm i @bgd-labs/aave-cli
```

Global installation

```
npm i -g @bgd-labs/aave-cli
```

Once installed you should be able to run commands via the `@bgd-labs/aave-cli` or the `aave-cli` binary.

Alteratively you can use `npx @bgd-labs/aave-cli` to run the cli via npx.

## Fork

`aave-cli fork --chainId <id>` can ge used to generate tenderly forks.
The cli allows executing certain proposal/actionset IDs, an address or even local payload via aave governance.
For a full overview of commands please run `aave-cli fork --help`
Alternatively you can use `npx @bgd-labs/aave-cli` to run the cli via npx.

## Ipfs

Expand All @@ -44,18 +41,14 @@ For a full overview of commands please run `aave-cli fork --help`

## Governance

### Simulation

`aave-cli governance simulate [proposalId]` can be used to simulate a certain proposal on tenderly (e2e across all networks). This feature is intended to be used by systems like seatbelt.

### View

`aave-cli governance view` will start a command line ui for the aave governance.
The command line ui, explains how to vote and generates the proofs needed for voting or registering roots.

### GetStorageRoots

`aave-cli governance getStorageRoots --proposalId <id>` is a utilitiy that generates the storage roots for the data warehouse.
`aave-cli governance getStorageRoots --proposalId <id>` is a utility that generates the storage roots for the data warehouse.

### GetVotingProofs

Expand Down
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"devDependencies": {
"@types/object-hash": "^3.0.6",
"prettier": "^3.5.3",
"prettier-plugin-solidity": "^2.0.0",
"prettier-plugin-solidity": "^1.0.0",
"tsup": "^8.3.6",
"typescript": "^5.4.5",
"vitest": "^2.1.5"
Expand Down Expand Up @@ -61,6 +61,7 @@
"@bgd-labs/aave-v3-governance-cache": "^1.0.11",
"@bgd-labs/js-utils": "^1.4.8",
"@bgd-labs/rpc-env": "^2.3.2",
"@bgd-labs/toolbox": "^0.0.40",
"@commander-js/extra-typings": "^12.1.0",
"@inquirer/prompts": "^7.1.0",
"blockstore-core": "^5.0.2",
Expand Down
2 changes: 0 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {Command, Option} from '@commander-js/extra-typings';
import 'dotenv/config';
import packageJson from '../package.json';
import {addCommand as addDiffSnapshots} from './commands/diffSnaphots';
import {addCommand as addFork} from './commands/fork';
import {addCommand as addGovernance} from './commands/governance';
import {addCommand as addIpfsCommand} from './commands/ipfsUpload';
import {addCommand as addCapoCommand} from './commands/capo';
Expand All @@ -30,7 +29,6 @@ program
.showHelpAfterError();
addGovernance(program);
addDiffSnapshots(program);
addFork(program);
addIpfsCommand(program);
addCapoCommand(program);
addCapoSvrCommand(program);
Expand Down
1 change: 0 additions & 1 deletion src/commands/diffSnaphots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type {Command} from '@commander-js/extra-typings';
import {adiDiffReports} from '../reports/adi-diff-reports';
import {diffReports} from '../reports/diff-reports';
import {readJsonFile, readJsonString} from '../utils/json';
import {diff} from '../reports/diff';

export function addCommand(program: Command) {
program
Expand Down
147 changes: 0 additions & 147 deletions src/commands/fork.ts

This file was deleted.

41 changes: 0 additions & 41 deletions src/commands/governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import {
import type {Command} from '@commander-js/extra-typings';
import {confirm, input, select} from '@inquirer/prompts';
import {type Hex, encodeAbiParameters, encodeFunctionData, getContract} from 'viem';
import {generateReport} from '../govv3/generatePayloadReport';
import {HUMAN_READABLE_STATE, getGovernance} from '../govv3/governance';
import {getPayloadsController} from '../govv3/payloadsController';
import {getAccountRPL, getBlockRLP} from '../govv3/proofs';
import {simulateProposal} from '../govv3/simulate';
import {findPayloadsController} from '../govv3/utils/checkAddress';
import {toAddressLink, toTxLink} from '../govv3/utils/markdownUtils';
import {DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT, FORMAT} from '../utils/constants';
Expand All @@ -36,45 +34,6 @@ enum DialogOptions {
export function addCommand(program: Command) {
const govV3 = program.command('governance').description('interact with governance v3 contracts');

govV3
.command('simulate')
.description('simulates a proposal on tenderly')
.requiredOption('--proposalId <number>', 'proposalId to simulate via tenderly')
.action(async (name, options) => {
const proposalId = BigInt(options.getOptionValue('proposalId'));
await simulateProposal(DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT, proposalId);
});

govV3
.command('simulate-payload')
.description('simulates a payloadId on tenderly')
.requiredOption('--chainId <number>', 'the chainId to fork of')
.requiredOption('--payloadId <number>', 'payloadId to simulate via tenderly')
.action(async ({payloadId: _payloadId, chainId}, options) => {
await refreshCache(localCacheAdapter);
const payloadId = Number(_payloadId);
const client = getClient(Number(chainId));
const payloadsControllerAddress = findPayloadsController(Number(chainId));
const payloadsController = getPayloadsController(payloadsControllerAddress as Hex, client);
const cache = await localCacheAdapter.getPayload({
chainId: Number(chainId),
payloadsController: payloadsControllerAddress as Hex,
payloadId: Number(payloadId),
});
const result = await payloadsController.simulatePayloadExecutionOnTenderly(
Number(payloadId),
cache.logs,
);
console.log(
await generateReport({
simulation: result,
payloadId: payloadId,
payloadInfo: cache,
client,
}),
);
});

govV3
.command('view')
.description('shows all the proposals & state')
Expand Down
Loading
Loading