Skip to content
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

feat: deployment scripts #8

Merged
merged 13 commits into from
Jun 27, 2024
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
62 changes: 31 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ path = "src/bin/artifacts.rs"
anyhow = "1.0.86"
dotenv = "0.15.0"
log = "0.4.21"
sp1-sdk = { git = "https://github.com/succinctlabs/sp1", tag = "v1.0.7-testnet" }
sp1-sdk = { git = "https://github.com/succinctlabs/sp1", tag = "v1.0.8-testnet" }
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This repository contains the smart contracts for verifying [SP1](https://github.
## Installation

> [!WARNING]
>
> [Foundry](https://github.com/foundry-rs/foundry) installs the latest release version initially, but subsequent `forge update` commands will use the `main` branch. This branch is the development branch and should be avoided in favor of tagged releases. The release process matches a specific SP1 version.

To install the latest release version:
Expand All @@ -13,11 +14,6 @@ To install the latest release version:
forge install succinctlabs/sp1-contracts
```

To install a specific version:
```bash
forge install succinctlabs/sp1-contracts@<version>
```

Add `@sp1-contracts/=lib/sp1-contracts/contracts/src/` in `remappings.txt.`

### Usage
Expand All @@ -33,12 +29,34 @@ contract MyContract is SP1Verifier {
}
```

### Deployments

To deploy the contracts, ensure your [.env](./contracts/.env.example) file is configured with all the chains you want to deploy to.

Then you can use the `forge script` command and specify the specific contract you want to deploy. For example, to deploy the SP1 Verifier Gateway you can run:

```bash
FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGateway.s.sol:SP1VerifierGatewayScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
```

To deploy a specific SP1 Verifier version and add it to the gateway, run:

```bash
FOUNDRY_PROFILE=deploy forge script ./script/deploy/v1.0.8-testnet/SP1Verifier.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
```

Change `v1.0.8-testnet` to the desired version to add.

To re-verify already existing deployments, remove the `--broadcast` flag.

## For Developers: Integrate SP1 Contracts

This repository contains the EVM contracts for verifying SP1 PLONK EVM proofs.

You can find more details on the contracts in the [`contracts`](./contracts/README.md) directory.

Note: you should ensure that all the contracts are on Solidity version `0.8.20`.

## For Contributors

To update the SP1 contracts, please refer to the [`update`](./UPDATE_CONTRACTS.md) file.
To update the SP1 contracts, please refer to the [`update`](./UPDATE_CONTRACTS.md) file.
41 changes: 41 additions & 0 deletions contracts/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Salt used to deploy the contracts. Recommended to use the same salt across different chains.
CREATE2_SALT=

### The owner of the SP1 Verifier Gateway. This is the account that will be able to add and freeze routes.
OWNER=

### The chains to deploy to, specified by chain name (e.g. CHAINS=mainnet,sepolia,arbitrum_sepolia)
CHAINS=

### RPCs for each chain ID
RPC_MAINNET=
RPC_SEPOLIA=
RPC_HOLESKY=
RPC_ARBITRUM=
RPC_ARBITRUM_SEPOLIA=
RPC_BASE=
RPC_BASE_SEPOLIA=
RPC_SCROLL=
RPC_SCROLL_SEPOLIA=

# Etherscan API keys for each chain ID
ETHERSCAN_API_KEY_MAINNET=
ETHERSCAN_API_KEY_SEPOLIA=
ETHERSCAN_API_KEY_HOLESKY=
ETHERSCAN_API_KEY_ARBITRUM=
ETHERSCAN_API_KEY_ARBITRUM_SEPOLIA=
ETHERSCAN_API_KEY_BASE=
ETHERSCAN_API_KEY_BASE_SEPOLIA=
ETHERSCAN_API_KEY_SCROLL=
ETHERSCAN_API_KEY_SCROLL_SEPOLIA=

# Etherscan API URLs for each chain ID
ETHERSCAN_API_URL_MAINNET=https://api.etherscan.io/api
ETHERSCAN_API_URL_HOLESKY=https://api-holesky.etherscan.io/api
ETHERSCAN_API_URL_SEPOLIA=https://api-sepolia.etherscan.io/api
ETHERSCAN_API_URL_ARBITRUM=https://api.arbiscan.io/api
ETHERSCAN_API_URL_ARBITRUM_SEPOLIA=https://api-sepolia.arbiscan.io/api
ETHERSCAN_API_URL_BASE=https://api.basescan.org/api
ETHERSCAN_API_URL_BASE_SEPOLIA=https://api-sepolia.basescan.org/api
ETHERSCAN_API_URL_SCROLL=https://api.scrollscan.com/api
ETHERSCAN_API_URL_SCROLL_SEPOLIA=https://api-sepolia.scrollscan.com/api
Loading
Loading