Skip to content
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
baf8317
forge install: risc0-ethereum
Prabhat1308 Jan 23, 2025
ca49660
add onchain risc0 verifier
Prabhat1308 Jan 23, 2025
67e9d7b
add image id related content
Prabhat1308 Jan 23, 2025
b34edc0
add risc0-ethereum and update NexusProofManager
Prabhat1308 Jan 23, 2025
21ee60d
fix typo for Elf.sol generation
Prabhat1308 Jan 23, 2025
12c3b98
different naming for different example methods for elf and imageID
Prabhat1308 Jan 23, 2025
d3cfd27
temp commit
Prabhat1308 Jan 24, 2025
091c872
introduce Necessary imports in updateNexusBlock
Prabhat1308 Jan 28, 2025
5fe6aea
feat : updated proof manager and added tests
ocdbytes Feb 19, 2025
5f71a64
Merge branch 'main' into pv/onchain-risc0-verifier
ocdbytes Feb 19, 2025
46ad5c2
fix : updated the state update logic from journal param
ocdbytes Feb 27, 2025
6767587
fix : foundry tests
ocdbytes Mar 4, 2025
d1378cc
fix : ci
ocdbytes Mar 4, 2025
a584898
fix : r0 ci version fix
ocdbytes Mar 4, 2025
1a4c89e
fix : on chain verification ci
ocdbytes Mar 4, 2025
12cf779
feat : added mock storage verifier for zksync
ocdbytes Mar 5, 2025
b4f66d1
forge install: risc0-ethereum
Prabhat1308 Jan 23, 2025
eb86916
add onchain risc0 verifier
Prabhat1308 Jan 23, 2025
d7d47e4
add image id related content
Prabhat1308 Jan 23, 2025
4cfb582
add risc0-ethereum and update NexusProofManager
Prabhat1308 Jan 23, 2025
0f0188a
fix typo for Elf.sol generation
Prabhat1308 Jan 23, 2025
769c2df
different naming for different example methods for elf and imageID
Prabhat1308 Jan 23, 2025
e0308a2
temp commit
Prabhat1308 Jan 24, 2025
45790c2
introduce Necessary imports in updateNexusBlock
Prabhat1308 Jan 28, 2025
2dabf2b
feat : updated proof manager and added tests
ocdbytes Feb 19, 2025
c3a7377
fix : updated the state update logic from journal param
ocdbytes Feb 27, 2025
20e2473
fix : foundry tests
ocdbytes Mar 4, 2025
ba1a731
fix : ci
ocdbytes Mar 4, 2025
c659452
fix : r0 ci version fix
ocdbytes Mar 4, 2025
18ab55c
fix : on chain verification ci
ocdbytes Mar 4, 2025
4c0f680
feat : added mock storage verifier for zksync
ocdbytes Mar 5, 2025
40df162
Merge branch 'pv/onchain-risc0-verifier' of https://github.com/availp…
ocdbytes Apr 17, 2025
1b287e4
feat : updated nexus manager contract
ocdbytes Apr 18, 2025
43e3ff4
feat : test added
ocdbytes Apr 21, 2025
689df03
resolved : comments
ocdbytes Apr 23, 2025
ff13e3d
fix : dependency update
ocdbytes Apr 24, 2025
89bf427
ci update
ocdbytes Apr 24, 2025
b8fe79c
feat : updated prover image id and elf
ocdbytes Apr 24, 2025
fd16dd8
feat : ownable added
ocdbytes Apr 26, 2025
3716bc7
feat : spec updated
ocdbytes May 1, 2025
b3e47ff
Merge branch 'main' into aj/contracts
ocdbytes May 1, 2025
ba348fa
update : lock file
ocdbytes May 2, 2025
2e8980f
feat : updated proof manager to use vector x
ocdbytes May 13, 2025
a704e3e
Merge branch 'main' into aj/contracts
ocdbytes May 13, 2025
a3fbf96
feat : tests fixed and updated contracts
ocdbytes May 15, 2025
887c3c8
feat : tests fixed and updated contracts
ocdbytes May 15, 2025
22bb0d9
fix : tests
ocdbytes May 16, 2025
dea325d
Merge branch 'main' into aj/contracts
ocdbytes May 16, 2025
6fe0eea
fix : lint
ocdbytes May 16, 2025
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "lib/nexus"]
path = lib/nexus
url = https://github.com/availproject/nexus
[submodule "contracts/lib/risc0-ethereum"]
path = contracts/lib/risc0-ethereum
url = https://github.com/risc0/risc0-ethereum
176 changes: 175 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions contracts/remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ forge-std/=lib/forge-std/src/
halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/
openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/
openzeppelin-contracts/=lib/openzeppelin-contracts/
risc0/=lib/risc0-ethereum/contracts/src/
openzeppelin/contracts=lib/openzeppelin-contracts/contracts/
34 changes: 13 additions & 21 deletions contracts/script/Nexus-zksync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {IZKSyncNexusManagerRouter} from "../src/verification/zksync/StorageProof
import {INexusProofManager} from "../src/interfaces/INexusProofManager.sol";
import {VerifierInfo} from "../src/interfaces/INexusMailbox.sol";
import {INexusVerifierWrapper} from "../src/interfaces/INexusVerifierWrapper.sol";
import {RiscZeroVerifierRouter} from "risc0/RiscZeroVerifierRouter.sol";

contract NexusDeployment is Script {
struct NetworkConfig {
Expand All @@ -34,32 +35,27 @@ contract NexusDeployment is Script {

// Parse privateKey
string memory privateKeyPath = string.concat(basePath, ".privateKey");
config.deployerPrivateKey = abi.decode(
vm.parseJson(jsonConfig, privateKeyPath),
(uint256)
);
config.deployerPrivateKey = abi.decode(vm.parseJson(jsonConfig, privateKeyPath), (uint256));

// Parse appId
string memory appIdPath = string.concat(basePath, ".appId");
bytes32 appIdUint = abi.decode(
vm.parseJson(jsonConfig, appIdPath),
(bytes32)
);
bytes32 appIdUint = abi.decode(vm.parseJson(jsonConfig, appIdPath), (bytes32));
config.appId = appIdUint;

string memory appId2Path = string.concat(basePath, ".appId2");
bytes32 appId2Uint = abi.decode(
vm.parseJson(jsonConfig, appId2Path),
(bytes32)
);
bytes32 appId2Uint = abi.decode(vm.parseJson(jsonConfig, appId2Path), (bytes32));
config.appId2 = appId2Uint;
}

function run() public {
vm.startBroadcast(config.deployerPrivateKey);

// Deploy Verifier
RiscZeroVerifierRouter risc0Router = new RiscZeroVerifierRouter(msg.sender);
// TODO : add logic for adding the verifier to the router.

// Deploy NexusProofManager
NexusProofManager nexusManager = new NexusProofManager();
NexusProofManager nexusManager = new NexusProofManager(address(risc0Router));
console.log("NexusProofManager deployed to: ", address(nexusManager));

// Deploy and initialize NexusMailbox
Expand All @@ -68,19 +64,15 @@ contract NexusDeployment is Script {
console.log("Mailbox deployed to: ", address(mailbox));

// Deploy ZKSyncNexusManagerRouter
ZKSyncNexusManagerRouter zksyncdiamond = new ZKSyncNexusManagerRouter(
INexusProofManager(address(nexusManager)),
config.appId2
);
ZKSyncNexusManagerRouter zksyncdiamond =
new ZKSyncNexusManagerRouter(INexusProofManager(address(nexusManager)), config.appId2);

// Deploy SparseMerkleTree
SparseMerkleTree sparseMerkleTree = new SparseMerkleTree();

// Deploy VerifierWrapper
VerifierWrapper verifierWrapper = new VerifierWrapper(
IZKSyncNexusManagerRouter(address(zksyncdiamond)),
sparseMerkleTree
);
VerifierWrapper verifierWrapper =
new VerifierWrapper(IZKSyncNexusManagerRouter(address(zksyncdiamond)), sparseMerkleTree);

console.log("Verifer deployed to : ", address(verifierWrapper));
// Add or update wrapper in mailbox
Expand Down
23 changes: 23 additions & 0 deletions contracts/src/GethImageID.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2024 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

// This file is automatically generated

pragma solidity ^0.8.20;

library ImageID {
bytes32 public constant ADAPTER_ID = bytes32(0x35e11aa083da4b62f64a80c2b731097e5dcf9b0608a9689cd10b4633d56dcc7a);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we need this when we are using the nexus manager contract with ethereum mock geth adapter.

}
Loading