-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making the plonk verifier library external to the light client contra…
…ct (#1718) * made the plonk verifier library external to the light client contract and removed oppenzeppelin related secrets to the another secret env file which you can replicate via the example file * Bump openssl from 0.10.64 to 0.10.66 (#1765) Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.64 to 0.10.66. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](sfackler/rust-openssl@openssl-v0.10.64...openssl-v0.10.66) --- updated-dependencies: - dependency-name: openssl dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * made the plonk verifier library external to the light client contract and removed oppenzeppelin related secrets to the another secret env file which you can replicate via the example file * put DEFENDER_OUTPUT_FILE_PATH into a variable --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7d1c28b
commit fccc81d
Showing
13 changed files
with
319 additions
and
40 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
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,42 @@ | ||
# Since foundry and openzeppelin defender expect secrets to be in the .env file, remember to source this file before your forge script command | ||
## e.g. `source .env.contracts && force script $YOUR_SCRIPT_NAME` | ||
|
||
# Openzeppelin Defender Deployment Profile | ||
export DEFENDER_KEY= | ||
export DEFENDER_SECRET= | ||
export FEE_CONTRACT_SALT= | ||
export LIGHT_CLIENT_SALT= | ||
export FEE_CONTRACT_UPGRADE_NAME= #e.g "FeeContract.sol" | ||
export LIGHT_CLIENT_UPGRADE_NAME= | ||
export FOUNDRY_OUT=contracts/out | ||
|
||
# The Ethereum address of the safe multisig wallet used to deploy and operate the contracts. | ||
export SAFE_MULTISIG_ADDRESS= | ||
# The Ethereum private key of the wallet used for the proposing multisig transactions. | ||
export SAFE_ORCHESTRATOR_PRIVATE_KEY= | ||
|
||
# Light Client | ||
export LIGHT_CLIENT_PROXY_CONTRACT_ADDRESS= | ||
export APPROVED_PROVER_ADDRESS= | ||
|
||
# Plonk Verification Library Deployment with Defender | ||
export PLONK_VERIFIER_SALT=# Openzeppelin Defender Deployment Profile | ||
export DEFENDER_KEY= | ||
export DEFENDER_SECRET= | ||
export FEE_CONTRACT_SALT= | ||
export LIGHT_CLIENT_SALT= | ||
export FEE_CONTRACT_UPGRADE_NAME= #e.g "FeeContract.sol" | ||
export LIGHT_CLIENT_UPGRADE_NAME= | ||
export FOUNDRY_OUT=contracts/out | ||
|
||
# The Ethereum address of the safe multisig wallet used to deploy and operate the contracts. | ||
export SAFE_MULTISIG_ADDRESS= | ||
# The Ethereum private key of the wallet used for the proposing multisig transactions. | ||
export SAFE_ORCHESTRATOR_PRIVATE_KEY= | ||
|
||
# Light Client | ||
export LIGHT_CLIENT_PROXY_CONTRACT_ADDRESS= | ||
export APPROVED_PROVER_ADDRESS= | ||
|
||
# Plonk Verification Library Deployment with Defender | ||
export PLONK_VERIFIER_SALT= |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
pragma solidity ^0.8.20; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
|
||
import { Defender, ApprovalProcessResponse } from "openzeppelin-foundry-upgrades/Defender.sol"; | ||
import { Upgrades, Options } from "openzeppelin-foundry-upgrades/Upgrades.sol"; | ||
import { PlonkVerifier as PV } from "../src/libraries/PlonkVerifier.sol"; | ||
import { UtilsScript } from "./Utils.s.sol"; | ||
|
||
contract PlonkVerifierDefenderDeployScript is Script { | ||
string public contractName = "PlonkVerifier.sol"; | ||
UtilsScript public utils = new UtilsScript(); | ||
uint256 public contractSalt = uint256(vm.envInt("PLONK_VERIFIER_SALT")); | ||
|
||
function run() public returns (address contractAddress, address multisig) { | ||
ApprovalProcessResponse memory upgradeApprovalProcess = Defender.getDeployApprovalProcess(); | ||
multisig = upgradeApprovalProcess.via; | ||
|
||
if (upgradeApprovalProcess.via == address(0)) { | ||
revert( | ||
string.concat( | ||
"Deploy approval process with id ", | ||
upgradeApprovalProcess.approvalProcessId, | ||
" has no assigned address" | ||
) | ||
); | ||
} | ||
|
||
Options memory opts; | ||
opts.defender.useDefenderDeploy = true; | ||
opts.defender.skipLicenseType = true; | ||
opts.defender.salt = bytes32(abi.encodePacked(contractSalt)); | ||
|
||
contractAddress = Defender.deployContract(contractName, opts.defender); | ||
|
||
//generate the file path, file output and write to the file | ||
(string memory filePath, string memory fileData) = utils.generateDeploymentOutput( | ||
contractName, | ||
contractSalt, | ||
contractAddress, | ||
multisig, | ||
upgradeApprovalProcess.approvalProcessId, | ||
upgradeApprovalProcess.viaType | ||
); | ||
utils.writeJson(filePath, fileData); | ||
|
||
//generate the salt history file path, output and write to the file | ||
(string memory saltFilePath, string memory saltFileData) = | ||
utils.generateSaltOutput(contractName, contractSalt); | ||
utils.writeJson(saltFilePath, saltFileData); | ||
|
||
return (contractAddress, multisig); | ||
} | ||
} |
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
Oops, something went wrong.