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

Add updateGroth16Verifier function #85

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions packages/contracts/script/BaseDeployScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ contract BaseDeployScript is Script {
address verifierProxyAddress;
Verifier verifierImpl = new Verifier();
Groth16Verifier groth16Verifier = new Groth16Verifier();
console.log("Groth16Verifier deployed at: %s", address(groth16Verifier));
verifierProxyAddress = address(
new ERC1967Proxy(
address(verifierImpl),
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts/src/utils/Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ contract Verifier is OwnableUpgradeable, UUPSUpgradeable, IVerifier {
return groth16Verifier.verifyProof(pA, pB, pC, pubSignals);
}

function updateGroth16Verifier(address _groth16Verifier) public onlyOwner {
require(
_groth16Verifier != address(0),
"New groth16Verifier address is invalid"
);
groth16Verifier = IGroth16Verifier(_groth16Verifier);
}

function _packBytes2Fields(
bytes memory _bytes,
uint256 _paddedSize
Expand Down
Loading