Skip to content

Commit

Permalink
WEB3-281: update create-steel-app to 1.2 (#383)
Browse files Browse the repository at this point in the history
* updated create-steel-app to use 1.2 by default
* also added a line to the README to make sure that Foudry is updated to
avoid a relatively old bug (most end users should be fine, but I ran
into this issue)

---------

Co-authored-by: capossele <angelocapossele@gmail.com>
  • Loading branch information
sashaaldrick and capossele authored Jan 10, 2025
1 parent a429fd8 commit 917180d
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 20 deletions.
5 changes: 2 additions & 3 deletions build/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,6 @@ use std::{

use anyhow::{anyhow, bail, Context, Result};
use risc0_build::GuestListEntry;
use risc0_zkp::core::digest::Digest;

const SOL_HEADER: &str = r#"// Copyright 2024 RISC Zero, Inc.
//
Expand Down Expand Up @@ -109,7 +108,7 @@ pub fn generate_image_id_sol(guests: &[GuestListEntry]) -> Result<Vec<u8>> {
.iter()
.map(|guest| {
let name = guest.name.to_uppercase().replace('-', "_");
let image_id = hex::encode(Digest::from(guest.image_id));
let image_id = hex::encode(guest.image_id);
format!("bytes32 public constant {name}_ID = bytes32(0x{image_id});")
})
.collect();
Expand Down
2 changes: 1 addition & 1 deletion examples/erc20-counter/apps/src/bin/publisher.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/token-stats/host/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/token-stats/methods/guest/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions steel/docs/create-steel-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Make sure to have the following installed:
2. [Foundry]
3. [cargo-risczero]

N.B. Please make sure to run `foundryup` to update to the latest Foundry version before continuing.

## Usage

```sh
sh <(curl -fsSL https://raw.githubusercontent.com/risc0/risc0-ethereum/refs/heads/main/steel/docs/create-steel-app/create-steel-app)
```

The script will automatically detect your current `cargo-risczero` version and use that for the corresponding version of the `erc20-counter` example. You also have the manual choice between two release versions: [1.0] and [1.1].

Once the script is finished running, you should:

```console
Expand Down
10 changes: 5 additions & 5 deletions steel/docs/create-steel-app/create-steel-app
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ get_risc0_version() {
echo "detected risc0 version: ${RISC0_VERSION:?}"

# map version to branch
if [[ "${RISC0_VERSION:?}" =~ ^1\.1\. ]]; then
BRANCH="release-1.1"
if [[ "${RISC0_VERSION:?}" =~ ^1\.2\. ]]; then
BRANCH="release-1.2"
else
echo "unsupported risc0 version. version 1.1 is supported"
echo "unsupported risc0 version. version 1.2 is supported"
BRANCH=""
fi
}

select_branch() {
get_risc0_version

# NOTE: Only 1.1 is currently supported.
# NOTE: Only 1.2 is currently supported.

BRANCH="release-1.1"
BRANCH="release-1.2"
echo "selected branch: ${BRANCH:?}"

# Logic below can be used when more than one version is supported.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/history/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/host/db/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/host/db/proof.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/host/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion steel/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 917180d

Please sign in to comment.