diff --git a/README.md b/README.md index bdd0228..fcca0c6 100644 --- a/README.md +++ b/README.md @@ -156,24 +156,7 @@ See `--help` for all available flags and default values. ## Verifying Stylus Contracts -**cargo stylus verify** - -Verifies that a deployed smart contract is identical to that produced by the -current project. Since Stylus smart contracts include a hash of all project -files, this additionally verifies that code comments and other files are -identical. To ensure build reproducibility, if a contract is to be verified, -it should be both deployed and verified using `cargo stylus reproducible`. - -See `--help` for all available flags and default values. - -## Reproducibly Deploying and Verifying - -**cargo stylus reproducible** - -Runs a `cargo stylus` command in a Docker container to ensure build -reproducibility. - -See `--help` for all available flags and default values. +See [here](https://hackmd.io/bpeMnrzbSvO4mohhvkrKqw) ## Deploying Non-Rust WASM Projects diff --git a/check/src/docker.rs b/check/src/docker.rs index 89a433d..a5ce9f2 100644 --- a/check/src/docker.rs +++ b/check/src/docker.rs @@ -45,15 +45,7 @@ fn create_image(version: &str) -> Result<()> { if image_exists(&name)? { return Ok(()); } - let cargo_stylus_version = env!("CARGO_PKG_VERSION"); - let cargo_stylus_version: String = cargo_stylus_version - .chars() - .filter(|c| c.is_alphanumeric() || *c == '-' || *c == '.') - .collect(); - println!( - "Building Docker image for cargo-stylus version {} and Rust toolchain {}", - cargo_stylus_version, version, - ); + println!("Building Docker image for Rust toolchain {}", version,); let mut child = Command::new("docker") .arg("build") .arg("-t") @@ -62,24 +54,23 @@ fn create_image(version: &str) -> Result<()> { .arg("-f-") .stdin(Stdio::piped()) .spawn() - .map_err(|e| eyre!("failed to execure Docker command: {e}"))?; + .map_err(|e| eyre!("failed to execute Docker command: {e}"))?; write!( child.stdin.as_mut().unwrap(), "\ FROM --platform=linux/amd64 rust:{} as builder\n\ - RUN rustup toolchain install {}-x86_64-unknown-linux-gnu - RUN rustup default {}-x86_64-unknown-linux-gnu RUN rustup target add wasm32-unknown-unknown RUN rustup target add wasm32-wasi RUN rustup target add x86_64-unknown-linux-gnu - RUN cargo install cargo-stylus-check --version {} --force - RUN cargo install cargo-stylus --version {} --force + RUN cargo install cargo-stylus-check --force + RUN cargo install cargo-stylus --force + + RUN rustup toolchain install {}-x86_64-unknown-linux-gnu + RUN rustup default {}-x86_64-unknown-linux-gnu ", RUST_BASE_IMAGE_VERSION, version, version, - cargo_stylus_version, - cargo_stylus_version, )?; child.wait().map_err(|e| eyre!("wait failed: {e}"))?; Ok(())