diff --git a/README.md b/README.md index c388736..3de4456 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ pragma solidity ^0.8.20; import {ISP1Verifier} from "@sp1-contracts/ISP1Verifier.sol"; contract MyContract { - address public constant SP1_VERIFIER = 0x3B6041173B80E77f038f3F2C0f9744f04837185e; + address public constant SP1_VERIFIER = 0x3B6041173B80E77f038f3F2C0f9744f04837185e; - bytes32 public constant PROGRAM_VKEY = ...; + bytes32 public constant PROGRAM_VKEY = ...; - function myFunction(..., bytes calldata publicValues, bytes calldata proofBytes) external { - ISP1Verifier(SP1_VERIFIER).verifyProof(PROGRAM_VKEY, publicValues, proofBytes); - } + function myFunction(..., bytes calldata publicValues, bytes calldata proofBytes) external { + ISP1Verifier(SP1_VERIFIER).verifyProof(PROGRAM_VKEY, publicValues, proofBytes); + } } ``` @@ -49,26 +49,30 @@ To deploy the contracts, ensure your [.env](./contracts/.env.example) file is co 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 for PLONK you can run: ```bash -FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGatewayPlonk.s.sol:SP1VerifierGatewayPlonkScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast +FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGatewayPlonk.s.sol:SP1VerifierGatewayScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast ``` or to deploy the SP1 Verifier Gateway for Groth16 you can run: ```bash -FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGatewayGroth16.s.sol:SP1VerifierGatewayGroth16Script --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast +FOUNDRY_PROFILE=deploy forge script ./script/deploy/SP1VerifierGatewayGroth16.s.sol:SP1VerifierGatewayScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast ``` ### Adding Verifiers -To deploy a specific SP1 Verifier version and add it to the gateway, run: +You can use the `forge script` command to specify which verifier you want to deploy and add to the gateway. For example to deploy the PLONK verifier and add it to the PLONK gateway you can run: ```bash FOUNDRY_PROFILE=deploy forge script ./script/deploy/v3.0.0/SP1VerifierPlonk.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast ``` -Change `v3.0.0` to the desired version to add. +or to deploy the Groth16 verifier and add it to the Groth16 gateway you can run: -To re-verify already existing deployments, remove the `--broadcast` flag. +```bash +FOUNDRY_PROFILE=deploy forge script ./script/deploy/v3.0.0/SP1VerifierGroth16.s.sol:SP1VerifierScript --private-key $PRIVATE_KEY --verify --verifier etherscan --multi --broadcast +``` + +Change `v3.0.0` to the desired version to add. ### Freezing Verifiers diff --git a/contracts/deployments/1.json b/contracts/deployments/1.json index bf43c45..e945a22 100644 --- a/contracts/deployments/1.json +++ b/contracts/deployments/1.json @@ -7,6 +7,6 @@ "V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB", "V1_2_0_SP1_VERIFIER_PLONK": "0x6B6A7Ded061567d8A56279801DEA5cFB79be5bFc", "V2_0_0_SP1_VERIFIER_PLONK": "0x1764C29FBd94865198588f10FC75D4f6636d158d", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/10.json b/contracts/deployments/10.json index a792e84..c02d1b9 100644 --- a/contracts/deployments/10.json +++ b/contracts/deployments/10.json @@ -3,6 +3,6 @@ "SP1_VERIFIER_GATEWAY_PLONK": "0x3B6041173B80E77f038f3F2C0f9744f04837185e", "V1_2_0_SP1_VERIFIER_PLONK": "0x6B6A7Ded061567d8A56279801DEA5cFB79be5bFc", "V2_0_0_SP1_VERIFIER_PLONK": "0x1764C29FBd94865198588f10FC75D4f6636d158d", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/11155111.json b/contracts/deployments/11155111.json index 36b2c05..02e6c62 100644 --- a/contracts/deployments/11155111.json +++ b/contracts/deployments/11155111.json @@ -16,6 +16,6 @@ "V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf", "V3_0_0_RC4_SP1_VERIFIER_GROTH16": "0xbEe24654bF5D675D88e504a0DC148022664Ce436", "V3_0_0_RC4_SP1_VERIFIER_PLONK": "0xAF58C8Feee48f9952A444cD897Fd16e99000a4E1", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/11155420.json b/contracts/deployments/11155420.json index f5a9504..d49309b 100644 --- a/contracts/deployments/11155420.json +++ b/contracts/deployments/11155420.json @@ -8,6 +8,6 @@ "V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A", "V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0", "V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/17000.json b/contracts/deployments/17000.json index 3cb4d51..6ff8ad1 100644 --- a/contracts/deployments/17000.json +++ b/contracts/deployments/17000.json @@ -15,6 +15,6 @@ "V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A", "V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0", "V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/42161.json b/contracts/deployments/42161.json index bf43c45..e945a22 100644 --- a/contracts/deployments/42161.json +++ b/contracts/deployments/42161.json @@ -7,6 +7,6 @@ "V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB", "V1_2_0_SP1_VERIFIER_PLONK": "0x6B6A7Ded061567d8A56279801DEA5cFB79be5bFc", "V2_0_0_SP1_VERIFIER_PLONK": "0x1764C29FBd94865198588f10FC75D4f6636d158d", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/421614.json b/contracts/deployments/421614.json index 3cb4d51..6ff8ad1 100644 --- a/contracts/deployments/421614.json +++ b/contracts/deployments/421614.json @@ -15,6 +15,6 @@ "V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A", "V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0", "V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/534351.json b/contracts/deployments/534351.json index 3cb4d51..6ff8ad1 100644 --- a/contracts/deployments/534351.json +++ b/contracts/deployments/534351.json @@ -15,6 +15,6 @@ "V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A", "V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0", "V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/534352.json b/contracts/deployments/534352.json index bf43c45..e945a22 100644 --- a/contracts/deployments/534352.json +++ b/contracts/deployments/534352.json @@ -7,6 +7,6 @@ "V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB", "V1_2_0_SP1_VERIFIER_PLONK": "0x6B6A7Ded061567d8A56279801DEA5cFB79be5bFc", "V2_0_0_SP1_VERIFIER_PLONK": "0x1764C29FBd94865198588f10FC75D4f6636d158d", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/8453.json b/contracts/deployments/8453.json index bf43c45..e945a22 100644 --- a/contracts/deployments/8453.json +++ b/contracts/deployments/8453.json @@ -7,6 +7,6 @@ "V1_1_0_SP1_VERIFIER": "0xc350F063C13a3Ca21331610fe159E697a5c9c2FB", "V1_2_0_SP1_VERIFIER_PLONK": "0x6B6A7Ded061567d8A56279801DEA5cFB79be5bFc", "V2_0_0_SP1_VERIFIER_PLONK": "0x1764C29FBd94865198588f10FC75D4f6636d158d", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/deployments/84532.json b/contracts/deployments/84532.json index 3cb4d51..6ff8ad1 100644 --- a/contracts/deployments/84532.json +++ b/contracts/deployments/84532.json @@ -15,6 +15,6 @@ "V3_0_0_RC1_SP1_VERIFIER_PLONK": "0xCf5bB55AaE25b5A66CEfbe85d81b7b144472102A", "V3_0_0_RC3_SP1_VERIFIER_GROTH16": "0x890E1c4ff98453f1201e5cB65F6C588FD28748b0", "V3_0_0_RC3_SP1_VERIFIER_PLONK": "0x31aeD863BecC509B9e16403c52C07560A0d4ecBf", - "V3_0_0_SP1_VERIFIER_GROTH16": "0x6A87EFd4e6B2Db1ed73129A8b9c51aaA583d49e3", + "V3_0_0_SP1_VERIFIER_GROTH16": "0xE780809121774D06aD9B0EEeC620fF4B3913Ced1", "V3_0_0_SP1_VERIFIER_PLONK": "0xd2832Cf1fC8bA210FfABF62Db9A8781153131d16" } \ No newline at end of file diff --git a/contracts/script/deploy/SP1VerifierGatewayGroth16.s.sol b/contracts/script/deploy/SP1VerifierGatewayGroth16.s.sol index cea6239..55e951a 100644 --- a/contracts/script/deploy/SP1VerifierGatewayGroth16.s.sol +++ b/contracts/script/deploy/SP1VerifierGatewayGroth16.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import {BaseScript} from "../utils/Base.s.sol"; import {SP1VerifierGateway} from "../../src/SP1VerifierGateway.sol"; -contract SP1VerifierGatewayGroth16Script is BaseScript { +contract SP1VerifierGatewayScript is BaseScript { string internal constant KEY = "SP1_VERIFIER_GATEWAY_GROTH16"; function run() external multichain(KEY) broadcaster { diff --git a/contracts/script/deploy/SP1VerifierGatewayPlonk.s.sol b/contracts/script/deploy/SP1VerifierGatewayPlonk.s.sol index 08006bf..4789972 100644 --- a/contracts/script/deploy/SP1VerifierGatewayPlonk.s.sol +++ b/contracts/script/deploy/SP1VerifierGatewayPlonk.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import {BaseScript} from "../utils/Base.s.sol"; import {SP1VerifierGateway} from "../../src/SP1VerifierGateway.sol"; -contract SP1VerifierGatewayPlonkScript is BaseScript { +contract SP1VerifierGatewayScript is BaseScript { string internal constant KEY = "SP1_VERIFIER_GATEWAY_PLONK"; function run() external multichain(KEY) broadcaster {