Skip to content
Draft
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
22 changes: 22 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"client",
"contracts/rust/adapter",
"contracts/rust/deployer",
"contracts/rust/deployment-info",
"contracts/rust/diff-test",
"contracts/rust/gen-vk-contract",
"crates/builder",
Expand Down Expand Up @@ -52,6 +53,7 @@ default-members = [
"client",
"contracts/rust/adapter",
"contracts/rust/deployer",
"contracts/rust/deployment-info",
"contracts/rust/diff-test",
"contracts/rust/gen-vk-contract",
"crates/builder",
Expand Down
14 changes: 14 additions & 0 deletions contracts/rust/adapter/src/sol_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ sol! {
uint256 v;
uint256 u;
}

/// Safe multisig interface
#[sol(rpc)]
interface ISafe {
function VERSION() external view returns (string memory);
function getOwners() external view returns (address[] memory);
function getThreshold() external view returns (uint256);
}

/// Versioned contract interface
#[sol(rpc)]
interface IVersioned {
function getVersion() external view returns (uint8, uint8, uint8);
}
}

// Due to <https://github.com/foundry-rs/foundry/issues/10153> the rust bindings contain duplicate types for our solidity types.
Expand Down
33 changes: 33 additions & 0 deletions contracts/rust/deployment-info/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "deployment-info"
description = "Tool to collect and output deployment information for Espresso Network contracts"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }

[[bin]]
name = "deployment-info"
path = "src/main.rs"

[dependencies]
alloy = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true }
dotenvy = { workspace = true }
hotshot-contract-adapter = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
url = { workspace = true }

[dev-dependencies]
espresso-contract-deployer = { path = "../deployer" }
espresso-types = { workspace = true }
hotshot-state-prover = { workspace = true }
test-log = { workspace = true }
tracing-test = { workspace = true }

[lints]
workspace = true
108 changes: 108 additions & 0 deletions contracts/rust/deployment-info/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Deployment Info Tool

Tool to collect and output deployment information for Espresso Network contracts.

## Usage

```bash
cargo run -p deployment-info -- --network <mainnet|decaf> \
[--rpc-url <RPC_URL>] \
[--env-file <PATH_TO_ENV_FILE>] \
[--output <OUTPUT_PATH>]
```

Examples:

```bash
# Uses default publicnode RPC for decaf
cargo run -p deployment-info -- --network decaf --env-file decaf.env

# Uses default publicnode RPC for mainnet
cargo run -p deployment-info -- --network mainnet --env-file mainnet.env

# Custom RPC URL
cargo run -p deployment-info -- \
--network mainnet \
--rpc-url https://eth.llamarpc.com \
--env-file mainnet.env
```

If no `--output` is specified, the tool prints JSON to stdout.

## Environment Variables

The tool reads contract addresses from environment variables (or from a specified env file):

- `ESPRESSO_SEQUENCER_ETH_MULTISIG_ADDRESS` - Safe multisig wallet
- `ESPRESSO_SEQUENCER_OPS_TIMELOCK_PROXY_ADDRESS` - Operations timelock
- `ESPRESSO_SEQUENCER_SAFE_EXIT_TIMELOCK_PROXY_ADDRESS` - Safe exit timelock
- `ESPRESSO_SEQUENCER_STAKE_TABLE_PROXY_ADDRESS`
- `ESPRESSO_SEQUENCER_ESP_TOKEN_PROXY_ADDRESS`
- `ESPRESSO_SEQUENCER_LIGHT_CLIENT_PROXY_ADDRESS`
- `ESPRESSO_SEQUENCER_FEE_CONTRACT_PROXY_ADDRESS`
- `ESPRESSO_SEQUENCER_REWARD_CLAIM_PROXY_ADDRESS`

If addresses are not set the tool assumes the contracts are not deployed yet.

## Output

By default, prints to stdout. If `--output` is specified, writes to that file.

Example output:

```json
{
"network": "decaf",
"multisig": {
"status": "deployed",
"address": "0xB76834E371B666feEe48e5d7d9A97CA08b5a0620",
"version": "1.3.0",
"owners": ["0x1234...", "0x5678..."],
"threshold": 2
},
"ops_timelock": {
"status": "not-yet-deployed"
},
"safe_exit_timelock": {
"status": "not-yet-deployed"
},
"light_client_proxy": {
"status": "deployed",
"proxy_address": "0x303872BB82a191771321d4828888920100d0b3e4",
"owner": "0x...",
"version": "3.0.0"
},
"stake_table_proxy": {
"status": "not-yet-deployed"
},
"esp_token_proxy": {
"status": "not-yet-deployed"
},
"fee_contract_proxy": {
"status": "deployed",
"proxy_address": "0x9fce21c3f7600aa63392a5f5713986b39bb98884",
"owner": "0x...",
"version": "1.0.0"
},
"reward_claim_proxy": {
"status": "not-yet-deployed"
}
}
```

## Contract Information Collected

For each contract:
- **Proxy address**: From environment variable
- **Owner**: Queried on-chain (for Ownable contracts)
- **Version**: Queried via `IVersioned.getVersion()` interface

For the Safe multisig:
- **Address**: From environment variable
- **Version**: Queried via `VERSION()`
- **Owners**: Queried via `getOwners()`
- **Threshold**: Queried via `getThreshold()`

For timelocks (OpsTimelock, SafeExitTimelock):
- **Address**: From environment variable
- **Min delay**: Queried via `getMinDelay()` (delay in seconds before operations can execute)
Loading
Loading