Skip to content

Commit 7dc097f

Browse files
authored
Add contract verification flow (#54)
* Add contract verification flow * Fix CI lint and clippy failures * Add multi-file contract verification via file picker Adds a Single file / Multi-file toggle to the verification form. In multi-file mode, users select .sol files directly via a native file picker instead of manually typing filenames and pasting content. Files are read with FileReader and submitted as source_files to the existing API endpoint. * Fix contract verification regressions * Simplify contract verification inputs * Fix stale proxy implementation address after upgrades * Fix contract verification source persistence * Format contract verification handler * Address contract verification review comments * Fix ABI decoder edge cases
1 parent e1b3e31 commit 7dc097f

31 files changed

Lines changed: 2842 additions & 29 deletions

backend/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async-stream = "0.3"
5757
bigdecimal = { version = "0.4", features = ["serde"] }
5858
hex = "0.4"
5959
chrono = { version = "0.4", features = ["serde"] }
60+
tempfile = "3"
6061

6162
# Testing
6263
testcontainers = { version = "0.27", features = ["blocking"] }

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN cargo build --release
1111
# Server image
1212
FROM alpine:3.21 AS server
1313

14-
RUN apk add --no-cache ca-certificates postgresql16-client
14+
RUN apk add --no-cache ca-certificates gcompat postgresql16-client
1515

1616
COPY --from=builder /app/target/release/atlas-server /usr/local/bin/
1717

backend/crates/atlas-common/src/types.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,24 @@ pub struct ContractAbi {
239239
pub verified_at: DateTime<Utc>,
240240
}
241241

242+
/// Full contract ABI including all verification metadata columns
243+
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]
244+
pub struct FullContractAbi {
245+
pub address: String,
246+
pub abi: serde_json::Value,
247+
pub source_code: Option<String>,
248+
pub compiler_version: Option<String>,
249+
pub optimization_used: Option<bool>,
250+
pub runs: Option<i32>,
251+
pub verified_at: DateTime<Utc>,
252+
pub contract_name: Option<String>,
253+
pub constructor_args: Option<Vec<u8>>,
254+
pub evm_version: Option<String>,
255+
pub license_type: Option<String>,
256+
pub is_multi_file: bool,
257+
pub source_files: Option<serde_json::Value>,
258+
}
259+
242260
/// SQL column list for the `blocks` table, matching the field order in [`Block`].
243261
pub const BLOCK_COLUMNS: &str =
244262
"number, hash, parent_hash, timestamp, gas_used, gas_limit, base_fee_per_gas::text AS base_fee_per_gas, transaction_count, indexed_at";

backend/crates/atlas-server/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dotenvy = { workspace = true }
2929
bigdecimal = { workspace = true }
3030
hex = { workspace = true }
3131
chrono = { workspace = true }
32+
tempfile = { workspace = true }
3233
tokio-stream = { workspace = true }
3334
futures = { workspace = true }
3435
async-stream = { workspace = true }
@@ -48,4 +49,4 @@ tokio = { workspace = true }
4849
tower = { workspace = true, features = ["util"] }
4950
serde_json = { workspace = true }
5051
sqlx = { workspace = true }
51-
tempfile = "3"
52+
tempfile = { workspace = true }

0 commit comments

Comments
 (0)