-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
# Solidity Contracts | ||
|
||
This directory contains the Solidity contract for deploying an application with [RISC Zero] on Ethereum. | ||
There are two primary starter template contracts included. | ||
The example contract included within the template is [EvenNumber.sol]. It holds a number, guaranteed to be even. | ||
|
||
<!-- TODO: Change this link once the new repo is live --> | ||
Additional contracts get auto-generated when building the project with cargo, by running: | ||
|
||
The Solidity libraries for Bonsai can be found at [github.com/risc0/risc0](https://github.com/risc0/risc0/tree/main/bonsai/ethereum). | ||
```bash | ||
cargo build | ||
``` | ||
|
||
or to build guest code for the zkVM target `riscv32im-risc0-zkvm-elf` deterministically: | ||
|
||
```bash | ||
RISC0_USE_DOCKER=1 cargo build | ||
``` | ||
|
||
By setting the env variable `RISC0_USE_DOCKER` a containerized build process via `Docker` will ensure that all builds of your guest code, regardless of the machine or local environment, will produce the same [ImageID]. The ImageID, and its importance to [security], is explained in more detail in our [developer FAQ]. | ||
|
||
> **Note**: *to install `Docker`, see [Get Docker].* | ||
Specifically: | ||
- `ImageID.sol`: contains the ImageIDs for the guests implemented in the [methods] directory. | ||
- `elf.sol`: contains the path of the guest binaries implemented in the [methods] directory. This contract is saved in the `tests` directory in the root of this template. | ||
|
||
The Solidity libraries for Bonsai can be found at [github.com/risc0/risc0-ethereum]. | ||
|
||
Contracts are built and tested with [forge], which is part of the [Foundry] toolkit. | ||
Tests are defined in the `tests` directory in the root of this template. | ||
|
||
[Foundry]: https://getfoundry.sh/ | ||
[forge]: https://github.com/foundry-rs/foundry#forge | ||
[RISC Zero]: https://risczero.com | ||
[EvenNumber.sol]: ./EvenNumber.sol | ||
[github.com/risc0/risc0-ethereum]: https://github.com/risc0/risc0-ethereum/tree/main/contracts | ||
[methods]: ../methods/README.md | ||
[ImageID]: https://dev.risczero.com/terminology#image-id | ||
[Get Docker]: https://docs.docker.com/get-docker/ | ||
[security]: https://dev.risczero.com/faq#security | ||
[developer FAQ]: https://dev.risczero.com/faq#zkvm-application-design |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters