Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Check TRUNC_VERSION
run: |
expected="${VERSION%.*}" # bash: strip last “.patch”
if [ "${{ steps.extract.outputs.TRUNC_VERSION }}" != "$expected" ]; then
echo "::error::TRUNC_VERSION mismatch: got '${{ steps.extract.outputs.TRUNC_VERSION }}' but expected '$expected'"
if [ "$TRUNC_VERSION" != "$expected" ]; then
echo "::error::TRUNC_VERSION mismatch: got '$TRUNC_VERSION' but expected '$expected'"
exit 1
fi

Expand Down
72 changes: 25 additions & 47 deletions README.md
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/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/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).
6 changes: 4 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ verbosity = 2
solc = "0.8.19"
optimizer = true
optimizer_runs = 100000
evm_version = "cancun"
evm_version = "paris"
show_progress = true
fs_permissions = [{ access = "read", path = "./test/v1.1/evm.proof"}]

[profile.default.optimizer_details]
constantOptimizer = false
yul = false

[fuzz]
runs = 1000
runs = 256

[fmt]
sort_imports = true
bracket_spacing = true
int_types = "long"
line_length = 120
Expand Down
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
forge-std/=lib/forge-std/src/
Loading