-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
0863039
commit 0e7ab30
Showing
13 changed files
with
236 additions
and
36 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,20 @@ | ||
# 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
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
7 changes: 7 additions & 0 deletions
7
contracts/script/output/defenderDeployments/LightClient.sol/11155111/14.json
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,7 @@ | ||
{ | ||
"approvalProcessId": "a0dd5bf1-9766-4a2f-94b1-2a7ceb0dc5be", | ||
"approvalType": "Gnosis Safe", | ||
"multisig": "0xc56fA6505d10bF322e01327e22479DE78C3Bf1cE", | ||
"proxyAddress": "0xfBCb14b42e6dDC81Dd4e02Dc1E35A9581A1F2200", | ||
"salt": 14 | ||
} |
2 changes: 1 addition & 1 deletion
2
contracts/script/output/defenderDeployments/LightClient.sol/11155111/saltHistory.json
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"contractName": "LightClient.sol", | ||
"previousSalt": 12 | ||
"previousSalt": 14 | ||
} |
7 changes: 7 additions & 0 deletions
7
contracts/script/output/defenderDeployments/PlonkVerifier.sol/11155111/2.json
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,7 @@ | ||
{ | ||
"approvalProcessId": "a0dd5bf1-9766-4a2f-94b1-2a7ceb0dc5be", | ||
"approvalType": "Gnosis Safe", | ||
"multisig": "0xc56fA6505d10bF322e01327e22479DE78C3Bf1cE", | ||
"contractAddress": "0x7807612b7F4D8241E1128F0037d056DA2Eec0242", | ||
"salt": 2 | ||
} |
4 changes: 4 additions & 0 deletions
4
contracts/script/output/defenderDeployments/PlonkVerifier.sol/11155111/saltHistory.json
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,4 @@ | ||
{ | ||
"contractName": "PlonkVerifier.sol", | ||
"previousSalt": 2 | ||
} |
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 |
---|---|---|
|
@@ -51,4 +51,4 @@ verbosity = 1 | |
[profile.quick] | ||
fuzz = { runs = 10 } | ||
invariant = { runs = 10 } | ||
verbosity = 1 | ||
verbosity = 1 |