-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol): scripts of upgrading zk verifier (#18270)
- Loading branch information
1 parent
e6a3e03
commit 8f72bd2
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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,21 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.24; | ||
|
||
import "@risc0/contracts/groth16/RiscZeroGroth16Verifier.sol"; | ||
import "test/shared/DeployCapability.sol"; | ||
|
||
contract UpdateRisc0Verifier is DeployCapability { | ||
uint256 public deployerPrivKey = vm.envUint("PRIVATE_KEY"); | ||
address public rollupAddressManager = vm.envAddress("ROLLUP_ADDRESS_MANAGER"); | ||
|
||
function run() external { | ||
require(deployerPrivKey != 0, "invalid deployer priv key"); | ||
require(rollupAddressManager != address(0), "invalid rollup address manager address"); | ||
|
||
vm.startBroadcast(deployerPrivKey); | ||
RiscZeroGroth16Verifier verifier = | ||
new RiscZeroGroth16Verifier(ControlID.CONTROL_ROOT, ControlID.BN254_CONTROL_ID); | ||
register(rollupAddressManager, "risc0_groth16_verifier", address(verifier)); | ||
vm.stopBroadcast(); | ||
} | ||
} |
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,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import "@sp1-contracts/src/v3.0.0-rc3/SP1VerifierPlonk.sol"; | ||
import "test/shared/DeployCapability.sol"; | ||
|
||
contract UpdateSP1Verifier is DeployCapability { | ||
uint256 public deployerPrivKey = vm.envUint("PRIVATE_KEY"); | ||
address public rollupAddressManager = vm.envAddress("ROLLUP_ADDRESS_MANAGER"); | ||
|
||
function run() external { | ||
require(deployerPrivKey != 0, "invalid deployer priv key"); | ||
require(rollupAddressManager != address(0), "invalid rollup address manager address"); | ||
|
||
vm.startBroadcast(deployerPrivKey); | ||
|
||
// Deploy sp1 plonk verifier | ||
SP1Verifier sp1Verifier = new SP1Verifier(); | ||
register(rollupAddressManager, "sp1_remote_verifier", address(sp1Verifier)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |