Skip to content

Commit 0885c34

Browse files
authored
Merge pull request #36 from succinctlabs/v4
feat: v4.0.0
2 parents 65a1d96 + c7a1346 commit 0885c34

File tree

9 files changed

+3541
-1575
lines changed

9 files changed

+3541
-1575
lines changed

Cargo.lock

Lines changed: 1390 additions & 1573 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ path = "src/bin/artifacts.rs"
1111
anyhow = "1.0.86"
1212
dotenv = "0.15.0"
1313
log = "0.4.21"
14-
sp1-sdk = "3.0.0"
14+
sp1-sdk = { git = "https://github.com/succinctlabs/sp1-wip.git", branch = "dev" }
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {BaseScript} from "../../utils/Base.s.sol";
5+
import {SP1Verifier} from "../../../src/v4.0.0-rc.3/SP1VerifierGroth16.sol";
6+
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol";
7+
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol";
8+
9+
contract SP1VerifierScript is BaseScript {
10+
string internal constant KEY = "V4_0_0_RC_3_SP1_VERIFIER_GROTH16";
11+
12+
function run() external multichain(KEY) broadcaster {
13+
// Read config
14+
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT");
15+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY_GROTH16");
16+
17+
// Deploy contract
18+
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}());
19+
20+
// Add the verifier to the gateway
21+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
22+
gateway.addRoute(verifier);
23+
24+
// Write address
25+
writeAddress(KEY, verifier);
26+
}
27+
28+
function freeze() external multichain(KEY) broadcaster {
29+
// Read config
30+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY_GROTH16");
31+
address SP1_VERIFIER = readAddress(KEY);
32+
33+
// Freeze the verifier on the gateway
34+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
35+
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH());
36+
gateway.freezeRoute(selector);
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {BaseScript} from "../../utils/Base.s.sol";
5+
import {SP1Verifier} from "../../../src/v4.0.0-rc.3/SP1VerifierPlonk.sol";
6+
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol";
7+
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol";
8+
9+
contract SP1VerifierScript is BaseScript {
10+
string internal constant KEY = "V4_0_0_RC_3_SP1_VERIFIER_PLONK";
11+
12+
function run() external multichain(KEY) broadcaster {
13+
// Read config
14+
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT");
15+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY_PLONK");
16+
17+
// Deploy contract
18+
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}());
19+
20+
// Add the verifier to the gateway
21+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
22+
gateway.addRoute(verifier);
23+
24+
// Write address
25+
writeAddress(KEY, verifier);
26+
}
27+
28+
function freeze() external multichain(KEY) broadcaster {
29+
// Read config
30+
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY_PLONK");
31+
address SP1_VERIFIER = readAddress(KEY);
32+
33+
// Freeze the verifier on the gateway
34+
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY);
35+
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH());
36+
gateway.freezeRoute(selector);
37+
}
38+
}

0 commit comments

Comments
 (0)