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 6 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" }
18 changes: 17 additions & 1 deletion 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 @@ -14,6 +15,7 @@ forge install succinctlabs/sp1-contracts
```

To install a specific version:

```bash
forge install succinctlabs/sp1-contracts@<version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is no longer correct i tihnk?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's still relevant? If someone wants these contracts as a dependency, they can specify a specific tag/commit this way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but shouldn't you only need latest?

```
Expand All @@ -33,12 +35,26 @@ 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 SP1VerifierGatewayScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast
```

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.
43 changes: 43 additions & 0 deletions contracts/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
### The chains to deploy to, specified by chain ID (e.g. CHAINS=1,11155111,17000)
CHAIN_IDS=

### RPCs for each chain ID
RPC_1=
RPC_11155111=
RPC_17000=
RPC_100=
RPC_137=
RPC_42161=
RPC_421614=
RPC_8453=
RPC_84532=
RPC_534352=
RPC_534351=

# Etherscan API keys for each chain ID
ETHERSCAN_API_KEY_1=
ETHERSCAN_API_KEY_11155111=
ETHERSCAN_API_KEY_17000=
ETHERSCAN_API_KEY_100=
ETHERSCAN_API_KEY_137=
ETHERSCAN_API_KEY_42161=
ETHERSCAN_API_KEY_421614=
ETHERSCAN_API_KEY_8453=
ETHERSCAN_API_KEY_84532=
ETHERSCAN_API_KEY_534352=
ETHERSCAN_API_KEY_534351=

# Etherscan API URLs for each chain ID
ETHERSCAN_API_URL_1=https://api.etherscan.io/api
ETHERSCAN_API_URL_5=https://api-goerli.etherscan.io/api
ETHERSCAN_API_URL_17000=https://api-holesky.etherscan.io/api
ETHERSCAN_API_URL_11155111=https://api-sepolia.etherscan.io/api
ETHERSCAN_API_URL_100=https://api.gnosisscan.io/api
ETHERSCAN_API_URL_137=https://api.polygonscan.com/api
ETHERSCAN_API_URL_420=https://api-optimistic.etherscan.io/api
ETHERSCAN_API_URL_42161=https://api.arbiscan.io/api
ETHERSCAN_API_URL_421614=https://api-sepolia.arbiscan.io/api
ETHERSCAN_API_URL_8453=https://api.basescan.org/api
ETHERSCAN_API_URL_84532=https://api-sepolia.basescan.org/api
ETHERSCAN_API_URL_534352=https://api.scrollscan.com/api
ETHERSCAN_API_URL_534351=https://api-sepolia.scrollscan.com/api
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should just manage this all in foundry and have CHAINS be a list of chain names

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice thing about how its setup in this PR is that we can just put in our existing .env from other repo and it works out of the box

ids are easier to standardize around as chain names are conflicting in terms of like exact name ("arb-testnet" vs "arb-sepolia" vs "arb_sepolia") while just leads to work devx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to chain names

8 changes: 3 additions & 5 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
# Ignores broadcast logs
broadcast/

# Docs
docs/

# Dotenv file
.env
.env
Loading
Loading