-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: v3.0.0-rc4 + simplify
artifacts
flow + better documentation (#30
- Loading branch information
1 parent
a6f13bf
commit 1694126
Showing
14 changed files
with
2,267 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
contracts/script/deploy/v3.0.0-rc4/SP1VerifierGroth16.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {BaseScript} from "../../utils/Base.s.sol"; | ||
import {SP1Verifier} from "../../../src/v3.0.0-rc4/SP1VerifierGroth16.sol"; | ||
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol"; | ||
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol"; | ||
|
||
contract SP1VerifierScript is BaseScript { | ||
string internal constant KEY = "V3_0_0_RC4_SP1_VERIFIER_GROTH16"; | ||
|
||
function run() external multichain(KEY) broadcaster { | ||
// Read config | ||
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT"); | ||
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY"); | ||
|
||
// Deploy contract | ||
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}()); | ||
|
||
// Add the verifier to the gateway | ||
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY); | ||
gateway.addRoute(verifier); | ||
|
||
// Write address | ||
writeAddress(KEY, verifier); | ||
} | ||
|
||
function freeze() external multichain(KEY) broadcaster { | ||
// Read config | ||
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY"); | ||
address SP1_VERIFIER = readAddress(KEY); | ||
|
||
// Freeze the verifier on the gateway | ||
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY); | ||
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH()); | ||
gateway.freezeRoute(selector); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {BaseScript} from "../../utils/Base.s.sol"; | ||
import {SP1Verifier} from "../../../src/v3.0.0-rc4/SP1VerifierPlonk.sol"; | ||
import {SP1VerifierGateway} from "../../../src/SP1VerifierGateway.sol"; | ||
import {ISP1VerifierWithHash} from "../../../src/ISP1Verifier.sol"; | ||
|
||
contract SP1VerifierScript is BaseScript { | ||
string internal constant KEY = "V3_0_0_RC4_SP1_VERIFIER_PLONK"; | ||
|
||
function run() external multichain(KEY) broadcaster { | ||
// Read config | ||
bytes32 CREATE2_SALT = readBytes32("CREATE2_SALT"); | ||
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY"); | ||
|
||
// Deploy contract | ||
address verifier = address(new SP1Verifier{salt: CREATE2_SALT}()); | ||
|
||
// Add the verifier to the gateway | ||
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY); | ||
gateway.addRoute(verifier); | ||
|
||
// Write address | ||
writeAddress(KEY, verifier); | ||
} | ||
|
||
function freeze() external multichain(KEY) broadcaster { | ||
// Read config | ||
address SP1_VERIFIER_GATEWAY = readAddress("SP1_VERIFIER_GATEWAY"); | ||
address SP1_VERIFIER = readAddress(KEY); | ||
|
||
// Freeze the verifier on the gateway | ||
SP1VerifierGateway gateway = SP1VerifierGateway(SP1_VERIFIER_GATEWAY); | ||
bytes4 selector = bytes4(ISP1VerifierWithHash(SP1_VERIFIER).VERIFIER_HASH()); | ||
gateway.freezeRoute(selector); | ||
} | ||
} |
Oops, something went wrong.