-
Notifications
You must be signed in to change notification settings - Fork 1
chore: release v1.1 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,66 +1,44 @@ | ||
| ## Foundry | ||
| # OpenVM Solidity SDK | ||
|
|
||
| **Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** | ||
| This repository contains OpenVM verifier contracts generated from official release commits of the [openvm](https://github.com/openvm-org/openvm) repository using the default VM configuration via the cargo-openvm CLI tool. If you're using an advanced or custom VM configuration, you may need to generate and maintain your own verifier contracts separately. | ||
|
|
||
| Foundry consists of: | ||
| The contracts are built on every _minor_ release as OpenVM guarantees verifier backward compatibility across patch releases. | ||
|
|
||
| - **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). | ||
| - **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. | ||
| - **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. | ||
| - **Chisel**: Fast, utilitarian, and verbose solidity REPL. | ||
| ## Installation | ||
|
|
||
| ## Documentation | ||
| To install `openvm-solidity-sdk` as a dependency in your forge project, run the following: | ||
|
|
||
| https://book.getfoundry.sh/ | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Build | ||
|
|
||
| ```shell | ||
| $ forge build | ||
| ``` | ||
|
|
||
| ### Test | ||
|
|
||
| ```shell | ||
| $ forge test | ||
| ```bash | ||
| forge install openvm-org/openvm-solidity-sdk | ||
| ``` | ||
|
|
||
| ### Format | ||
| ## Usage | ||
|
|
||
| ```shell | ||
| $ forge fmt | ||
| ``` | ||
| If you are using a deployed instance of the verifier contract, then you can import the interfaces in your contract directly. | ||
|
|
||
| ### Gas Snapshots | ||
| ```solidity | ||
| import { IOpenVmHalo2Verifier } from "openvm-solidity-sdk/v1.1.1/interfaces/IOpenVmHalo2Verifier.sol"; | ||
|
|
||
| ```shell | ||
| $ forge snapshot | ||
| ``` | ||
| contract MyContract { | ||
| function myFunction() public view { | ||
| // ... snip ... | ||
|
|
||
| ### Anvil | ||
| IOpenVmHalo2Verifier(verifierAddress) | ||
| .verify(publicValues, proofData, appExeCommit, appVmCommit); | ||
|
|
||
| ```shell | ||
| $ anvil | ||
| // ... snip ... | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Deploy | ||
| If you want to deploy your own instance of the verifier contract, you can use `forge create`: | ||
|
|
||
| ```shell | ||
| $ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> | ||
| ```bash | ||
| forge create src/v1.1.1/OpenVmHalo2Verifier.sol:OpenVmHalo2Verifier --rpc-url $RPC --private-key $PRIVATE_KEY --broadcast | ||
| ``` | ||
|
|
||
| ### Cast | ||
| If you want to import the verifier contract into your own repository for testing purposes, note that it is locked to Solidity version `0.8.19`. If your project uses a different version, the import may not compile. As a workaround, you can compile the contract separately and use `vm.etch()` to inject the raw bytecode into your tests. | ||
|
|
||
| ```shell | ||
| $ cast <subcommand> | ||
| ``` | ||
|
|
||
| ### Help | ||
| ## Audits | ||
|
|
||
| ```shell | ||
| $ forge --help | ||
| $ anvil --help | ||
| $ cast --help | ||
| ``` | ||
| You can find the audit reports for these contracts in the [OpenVM repo](https://github.com/openvm-org/openvm/tree/main/audits). |
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish there was a nice way we could not have to copy paste this between the openvm book and here