Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
5041935
initial commit
roger-bai-coinbase Dec 4, 2025
bd550fd
Refactor tests and simplify verifier
roger-bai-coinbase Dec 4, 2025
e1a7654
Refactor proof verification methods to consolidate TEE and ZK proof h…
roger-bai-coinbase Dec 8, 2025
2ea6dff
refactor tests and errors
roger-bai-coinbase Dec 9, 2025
70864f8
Prevent proofs from extending resolution time
roger-bai-coinbase Dec 9, 2025
2ef75e4
ZK proof allows game creator to immediately reclaim bond
roger-bai-coinbase Dec 9, 2025
7e70a75
Additional tests
roger-bai-coinbase Dec 9, 2025
ab2e400
Refactor test cases to standardize warp duration and improve naming c…
roger-bai-coinbase Dec 10, 2025
aa2518d
Add validation to ensure parent game has a proof before creating a ch…
roger-bai-coinbase Dec 10, 2025
1613646
Use calldata and remove unused variable
roger-bai-coinbase Dec 11, 2025
5ba6ed7
Make internal verify functions consistent
roger-bai-coinbase Dec 11, 2025
ab2d01b
fix: can claim bond after nullifying a challenge
roger-bai-coinbase Dec 11, 2025
8e38be6
prevent challenges if parent or game itself is invalid
roger-bai-coinbase Jan 6, 2026
3a2b31c
Enhance AggregateVerifier to include hashes for TEE and ZK images, an…
roger-bai-coinbase Jan 12, 2026
0a053f1
Add ReentrancyGuard to AggregateVerifier and protect claimCredit func…
roger-bai-coinbase Jan 16, 2026
308f591
Add constant for initialize calldata size in AggregateVerifier and up…
roger-bai-coinbase Jan 16, 2026
9585f67
Add test to validate failure on invalid calldata size in AggregateVer…
roger-bai-coinbase Jan 16, 2026
45c47f6
Refactor l2BlockNumber function to l2SequenceNumber in AggregateVerif…
roger-bai-coinbase Jan 16, 2026
5cfe30b
Refactor visibility of state variables in AggregateVerifier from inte…
roger-bai-coinbase Jan 16, 2026
b2dd1ff
Moved wasRespectedGameTypeWhenCreated for storage optimization
roger-bai-coinbase Jan 16, 2026
f0d3f54
Remove underscores from constructor variables
roger-bai-coinbase Jan 16, 2026
5fcecd5
IDIsputeGame compliance
roger-bai-coinbase Jan 16, 2026
ba44e13
Remove implicit returns
roger-bai-coinbase Jan 16, 2026
54c4192
Add CreditClaimed event and update claimCredit logic in AggregateVeri…
roger-bai-coinbase Jan 16, 2026
49e2eea
Rename getParentGameStatus to _getParentGameStatus in AggregateVerifi…
roger-bai-coinbase Jan 16, 2026
2b3238d
Refactor return logic in getParentGameStatus to improve clarity by co…
roger-bai-coinbase Jan 16, 2026
8d47e48
solidity style guide
roger-bai-coinbase Jan 16, 2026
abe2710
forge fmt
roger-bai-coinbase Jan 16, 2026
c200cb7
Fix tests
roger-bai-coinbase Jan 16, 2026
3fbec56
remove unused imports
roger-bai-coinbase Jan 16, 2026
40b8bff
Named imports, reorganized imports, defined errors directly
roger-bai-coinbase Jan 16, 2026
59f58be
linter
roger-bai-coinbase Jan 16, 2026
79fbe48
Add underscores to deal with compiler warnings
roger-bai-coinbase Jan 20, 2026
7991678
Refactor and have consistent comments
roger-bai-coinbase Jan 22, 2026
b188c31
Update verifier interface to include image ID
roger-bai-coinbase Jan 30, 2026
e0dc966
Added feature where a proof is required for initialization
roger-bai-coinbase Feb 2, 2026
52d9845
Added feature where a proof is required for initialization
roger-bai-coinbase Feb 2, 2026
f099f9e
Add back in IDisputeGame inheritance
roger-bai-coinbase Feb 2, 2026
e4e32f7
forge fmt
roger-bai-coinbase Feb 2, 2026
6e1ed51
refactor proof format
roger-bai-coinbase Feb 3, 2026
3d1f480
game type validation on challenging game
roger-bai-coinbase Feb 3, 2026
fd2b88e
Add delayedWETH
roger-bai-coinbase Feb 5, 2026
faebf6e
forge fmt
roger-bai-coinbase Feb 5, 2026
9f4a3d9
Check challenging game validity when claiming credit
roger-bai-coinbase Feb 5, 2026
e9fa5a8
Add TEEVerifier and SystemConfigGlobal contracts and update Aggregate…
leopoldjoy Feb 5, 2026
d80610f
Merge branch 'main' of github.com:base/multiproof-dispute-game
leopoldjoy Feb 5, 2026
307b6fc
fix(TEEVerifier): use correct EIP-2935 address and raw calldata for b…
leopoldjoy Feb 5, 2026
98693e5
Refactor TEE contracts and deployment script based on PR review feedback
leopoldjoy Feb 7, 2026
b9e101d
Refactor TEE contracts and deployment script based on PR review feedback
leopoldjoy Feb 7, 2026
9ff1818
Remove underscore-prefixed parameters from mock contracts per style g…
leopoldjoy Feb 7, 2026
f57741c
Add comprehensive tests for TEEVerifier, SystemConfigGlobal, and DevS…
leopoldjoy Feb 7, 2026
01cd442
Update teeProposer to match proposer address
leopoldjoy Feb 8, 2026
db1107e
correct teeImageHash in Sepolia deploy config
leopoldjoy Feb 8, 2026
e0a9a4b
Merge pull request #1 from base/teeverifier-and-2e2-integration
leopoldjoy Feb 9, 2026
9e2690c
Merge pull request #1 from base/teeverifier-and-2e2-integration
leopoldjoy Feb 9, 2026
26eac98
Moving TEE proposer to TEEVerifier
roger-bai-coinbase Feb 9, 2026
b3e4392
fix TEE comment
roger-bai-coinbase Feb 10, 2026
e223802
Merge pull request #2 from base/move-tee-proposer-to-tee-verifier
roger-bai-coinbase Feb 11, 2026
c192c9b
feat: intermediate roots for nullification
roger-bai-coinbase Feb 17, 2026
f0b333f
move L1 origin hash check from TEEVerifier to AggregateVerifier
roger-bai-coinbase Feb 17, 2026
c7b1d81
fix tests
roger-bai-coinbase Feb 17, 2026
b38214b
forge fmt
roger-bai-coinbase Feb 17, 2026
f82f983
feat: split deploy configs and scripts into no-nitro and with-nitro v…
leopoldjoy Feb 19, 2026
8201c04
Merge branch 'main' into feat/split-deploy-configs-and-scripts
leopoldjoy Feb 19, 2026
1801c49
refactor _verifyProof
roger-bai-coinbase Feb 20, 2026
1c4e3fc
Merge pull request #3 from base/intermediate-roots
roger-bai-coinbase Feb 20, 2026
85918ee
added block interval tests and cleaned up some errors
roger-bai-coinbase Feb 20, 2026
d9732f3
forge fmt
roger-bai-coinbase Feb 20, 2026
6119424
verify proof earlier during initialize
roger-bai-coinbase Feb 20, 2026
db1268c
revert last commit
roger-bai-coinbase Feb 20, 2026
0633e55
refactor initialize
roger-bai-coinbase Feb 20, 2026
d3a3bc3
Merge branch 'main' into feat/split-deploy-configs-and-scripts
leopoldjoy Feb 20, 2026
50c088c
refactor
roger-bai-coinbase Feb 20, 2026
f59abd6
Merge branch 'simplify-storage-and-refactor' into feat/split-deploy-c…
leopoldjoy Feb 22, 2026
cf84877
Merge pull request #5 from base/simplify-storage-and-refactor
roger-bai-coinbase Feb 22, 2026
ccac6c3
fix: register TEE proposer during deployment and add intermediateBloc…
leopoldjoy Feb 22, 2026
d0c40f0
Merge pull request #4 from base/feat/split-deploy-configs-and-scripts
leopoldjoy Feb 22, 2026
6164a13
use l1head for proofs after initialization
roger-bai-coinbase Feb 24, 2026
fd779bc
forge fmt
roger-bai-coinbase Feb 25, 2026
780715d
Fix comments from PR feedback
roger-bai-coinbase Feb 26, 2026
2daabba
Merge pull request #6 from base/use-l1head-after-init
roger-bai-coinbase Feb 26, 2026
c2e9154
Merge branch 'main' into joby.thundil/CHAIN-3293-migrate-multiproof-c…
jjtny1 Feb 27, 2026
935b7eb
step 1 fix dependencies and op commit
jjtny1 Feb 27, 2026
b0726ae
Merge branch 'main' into joby.thundil/CHAIN-3293-migrate-multiproof-c…
jjtny1 Feb 27, 2026
920d6e4
make multiproof compatible with base contracts
jjtny1 Feb 28, 2026
351a9ba
fix imports in scripts
jjtny1 Feb 28, 2026
48c06f9
fix mocks
jjtny1 Feb 28, 2026
e986e12
format and seperate out multiproof tests
jjtny1 Feb 28, 2026
c0ee7ac
add tests to just and gen semver
jjtny1 Feb 28, 2026
7d94460
fix tests
jjtny1 Feb 28, 2026
d416a43
rm unecessary op commit
jjtny1 Feb 28, 2026
cb97431
apply optimism patch for multiproof
jjtny1 Feb 28, 2026
cae85a8
move multiproof tests
jjtny1 Mar 1, 2026
cb82112
move files and delete multiproof test usage and profile
jjtny1 Mar 1, 2026
ccf3601
remove remappings of nitro and op enclave
jjtny1 Mar 1, 2026
1b4343e
undo multiproof changes and solady import change
jjtny1 Mar 1, 2026
babc5ad
support AggregateVerifier in initalizer test
jjtny1 Mar 2, 2026
7b90711
fix import path
jjtny1 Mar 2, 2026
76335ba
semver
jjtny1 Mar 2, 2026
1e6412c
semver
jjtny1 Mar 2, 2026
5d90e6e
semver
jjtny1 Mar 2, 2026
4fd964b
deterministic semverlock
jjtny1 Mar 2, 2026
928cfe0
add comment
jjtny1 Mar 2, 2026
ee8c3b9
refactor multiproof patch changes. fix typo
jjtny1 Mar 2, 2026
3c6111b
semver
jjtny1 Mar 2, 2026
e7abb04
fmt
jjtny1 Mar 2, 2026
14ed45f
semver
jjtny1 Mar 2, 2026
9323dfd
fix tests
jjtny1 Mar 2, 2026
3a65398
fix tests where bytecodes size was different
jjtny1 Mar 3, 2026
b1dc695
fmt
jjtny1 Mar 3, 2026
11a0d84
semver
jjtny1 Mar 3, 2026
3953c94
semver
jjtny1 Mar 3, 2026
13610a9
semver
jjtny1 Mar 3, 2026
c956def
make aggregateverifies excluded like faultdispute game. fix systemcon…
jjtny1 Mar 3, 2026
a0f0b14
fmt
jjtny1 Mar 3, 2026
6b31f9d
fix tests
jjtny1 Mar 3, 2026
5cdba94
semver
jjtny1 Mar 3, 2026
8e00905
rm just test-multiproof
jjtny1 Mar 3, 2026
3e6f2e7
Replace onchain Nitro cert verification with Automata ZK verifier (#197)
leopoldjoy Mar 5, 2026
320d989
pr feedback: delete unecessary snapshots
jjtny1 Mar 5, 2026
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ deploy-config/getting-started.json
# IDE
/.idea/

# Foundry
foundry.lock

# OS
.DS_Store
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ deps: clean-lib
github.com/OpenZeppelin/openzeppelin-contracts-upgradeable@0a2cb9a445c365870ed7a8ab461b12acf3e27d63 \
github.com/transmissions11/solmate@8f9b23f8838670afda0fd8983f2c41e8037ae6bc \
github.com/safe-global/safe-contracts@bf943f80fec5ac647159d26161446ac5d716a294 \
github.com/Vectorized/solady@502cc1ea718e6fa73b380635ee0868b0740595f0
github.com/Vectorized/solady@502cc1ea718e6fa73b380635ee0868b0740595f0 \
github.com/base/nitro-validator@0f006d2075637dd9640e530c4a7065f5c8bb2132 \
github.com/base/op-enclave@a2d5398f04c3a8e4df929d58ee638ba4a037bfec \
github.com/automata-network/aws-nitro-enclave-attestation@10fe7be8d9840490f5655e4b2a2aba3a95ec88c1
forge install --no-git \
github.com/ethereum-optimism/superchain-registry@84bce73573f130008d84bae6e924163bab589a11
@# openzeppelin-contracts-v5 and solady-v0.0.245 use the same orgs as their
Expand Down
12 changes: 11 additions & 1 deletion deploy-config/hardhat.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,15 @@
"gasPayingTokenName": "",
"gasPayingTokenSymbol": "",
"nativeAssetLiquidityAmount": null,
"liquidityControllerOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc"
"liquidityControllerOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"teeImageHash": "0x0000000000000000000000000000000000000000000000000000000000000001",
"multiproofConfigHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"multiproofGameType": 621,
"teeProposer": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"nitroEnclaveVerifier": "0x0000000000000000000000000000000000000000",
"multiproofGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000001",
"multiproofGenesisBlockNumber": 0,
"multiproofBlockInterval": 100,
"multiproofIntermediateBlockInterval": 10,
"multiproofProofThreshold": 1
}
12 changes: 11 additions & 1 deletion deploy-config/sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,15 @@
"gasPayingTokenName": "",
"gasPayingTokenSymbol": "",
"nativeAssetLiquidityAmount": null,
"liquidityControllerOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301"
"liquidityControllerOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"teeImageHash": "0x0000000000000000000000000000000000000000000000000000000000000001",
"multiproofConfigHash": "0x12e9c45f19f9817c6d4385fad29e7a70c355502cf0883e76a9a7e478a85d1360",
"multiproofGameType": 621,
"teeProposer": "0xb28E6890Cffa969dA9851c1BF1Ac34B76EbFEe98",
"nitroEnclaveVerifier": "0x0000000000000000000000000000000000000000",
"multiproofGenesisOutputRoot": "0xbc273d5876d1858ecd5aaf4ce4eaf16c73f0187ca4271b774ed5da7d2254ba79",
"multiproofGenesisBlockNumber": 37223829,
"multiproofBlockInterval": 100,
"multiproofIntermediateBlockInterval": 10,
"multiproofProofThreshold": 1
}
1 change: 1 addition & 0 deletions deployments/11155111-dev-no-nitro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"SystemConfigGlobal":"0xf8293c0f3a36A746B559a1a51870339B20F60945","TEEVerifier":"0x82453dA61B397EE366fB2129502de9c216480aB6","DisputeGameFactory":"0xfEa8Cb315F75d838b6c76ae336a9255f81df0D50","AnchorStateRegistry":"0x556BD554854504BE2F2023F6531D25eF6f6Fe77D","DelayedWETH":"0xb1FB7f05711d2270cD658448562A29E8c5C95E9E","AggregateVerifier":"0xeeF18F1640fa79f919799B5D629908909e715f97"}
21 changes: 20 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ additional_compiler_profiles = [
{ name = "dispute", optimizer_runs = 5000 },
]
compilation_restrictions = [
{ paths = "src/dispute/DisputeGameFactory.sol", optimizer_runs = 5000 },
{ paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 5000 },
{ paths = "src/dispute/v2/FaultDisputeGameV2.sol", optimizer_runs = 5000 },
{ paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 5000 },
Expand All @@ -29,7 +30,15 @@ compilation_restrictions = [
{ paths = "src/L1/OPContractsManager.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OPContractsManagerStandardValidator.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 },
{ paths = "src/L1/ProtocolVersions.sol", optimizer_runs = 5000 }
{ paths = "src/L1/ProtocolVersions.sol", optimizer_runs = 5000 },
{ paths = "src/L1/SystemConfig.sol", optimizer_runs = 5000 },
{ paths = "src/universal/OptimismMintableERC20Factory.sol", optimizer_runs = 5000 },
{ paths = "src/dispute/AnchorStateRegistry.sol", optimizer_runs = 5000 },
{ paths = "src/dispute/DelayedWETH.sol", optimizer_runs = 5000 },
{ paths = "src/universal/ProxyAdmin.sol", optimizer_runs = 5000 },
{ paths = "src/universal/Proxy.sol", optimizer_runs = 5000 },
{ paths = "src/L2/OptimismMintableERC721.sol", optimizer_runs = 5000 },
{ paths = "src/L2/OptimismMintableERC721Factory.sol", optimizer_runs = 5000 },
]

extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
Expand All @@ -43,6 +52,7 @@ remappings = [
'@openzeppelin/contracts-v5/=lib/openzeppelin-contracts-v5/contracts',
'@rari-capital/solmate/=lib/solmate',
'@lib-keccak/=lib/lib-keccak/contracts/lib',
'solady/=lib/solady/src/',
'@solady/=lib/solady/src',
'@solady-v0.0.245/=lib/solady-v0.0.245/src',
'forge-std/=lib/forge-std/src',
Expand Down Expand Up @@ -153,6 +163,7 @@ additional_compiler_profiles = [
{ name = "dispute", optimizer_runs = 0 },
]
compilation_restrictions = [
{ paths = "src/dispute/DisputeGameFactory.sol", optimizer_runs = 0 },
{ paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 0 },
{ paths = "src/dispute/v2/FaultDisputeGameV2.sol", optimizer_runs = 0 },
{ paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 0 },
Expand All @@ -162,6 +173,14 @@ compilation_restrictions = [
{ paths = "src/L1/OPContractsManagerStandardValidator.sol", optimizer_runs = 0 },
{ paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 0 },
{ paths = "src/L1/ProtocolVersions.sol", optimizer_runs = 0 },
{ paths = "src/L1/SystemConfig.sol", optimizer_runs = 0 },
{ paths = "src/universal/OptimismMintableERC20Factory.sol", optimizer_runs = 0 },
{ paths = "src/dispute/AnchorStateRegistry.sol", optimizer_runs = 0 },
{ paths = "src/dispute/DelayedWETH.sol", optimizer_runs = 0 },
{ paths = "src/universal/ProxyAdmin.sol", optimizer_runs = 0 },
{ paths = "src/universal/Proxy.sol", optimizer_runs = 0 },
{ paths = "src/L2/OptimismMintableERC721.sol", optimizer_runs = 0 },
{ paths = "src/L2/OptimismMintableERC721Factory.sol", optimizer_runs = 0 },
]

################################################################
Expand Down
9 changes: 9 additions & 0 deletions interfaces/dispute/IDisputeGameFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ interface IDisputeGameFactory is IProxyAdminOwnedBase, IReinitializableBase {
external
payable
returns (IDisputeGame proxy_);
function createWithInitData(
GameType _gameType,
Claim _rootClaim,
bytes memory _extraData,
bytes memory initData
)
external
payable
returns (IDisputeGame proxy_);
function findLatestGames(
GameType _gameType,
uint256 _start,
Expand Down
1 change: 1 addition & 0 deletions interfaces/dispute/IInitializable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ pragma solidity ^0.8.0;

interface IInitializable {
function initialize() external payable;
function initializeWithInitData(bytes calldata initData) external payable;
}
6 changes: 6 additions & 0 deletions interfaces/multiproof/IVerifier.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

interface IVerifier {
function verify(bytes calldata proofBytes, bytes32 imageId, bytes32 journal) external view returns (bool);
}
10 changes: 10 additions & 0 deletions scripts/autogen/generate-semver-lock/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ func processFile(file string) (*SemverLockResult, []error) {
sourceFilePath = path
contractName = name
contractKey = sourceFilePath + ":" + name
if strings.HasSuffix(file, ".dispute.json") {
// We have an additional compiler profile called "dispute".
// This can produce different bytecode for certain contracts
// and the output will contain 2 jsons: <contract>.sol and
// <contract>.dispute.sol. These both produce the same contractKey
// since the CompilationTarget is the same. However, this leads to
// non-determinstic initCode hashes. Here, we make the contractKey
// unique thus guranteeing deterministic hashes.
contractKey += ":dispute"
}
break
}

Expand Down
10 changes: 10 additions & 0 deletions scripts/deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@ contract Deploy is Deployer {
faultGameV2SplitDepth: cfg.faultGameV2SplitDepth(),
faultGameV2ClockExtension: cfg.faultGameV2ClockExtension(),
faultGameV2MaxClockDuration: cfg.faultGameV2MaxClockDuration(),
teeImageHash: cfg.teeImageHash(),
multiproofConfigHash: cfg.multiproofConfigHash(),
multiproofGameType: cfg.multiproofGameType(),
nitroEnclaveVerifier: cfg.nitroEnclaveVerifier(),
l2ChainID: cfg.l2ChainID(),
multiproofBlockInterval: cfg.multiproofBlockInterval(),
multiproofIntermediateBlockInterval: cfg.multiproofIntermediateBlockInterval(),
multiproofProofThreshold: cfg.multiproofProofThreshold(),
protocolVersionsProxy: IProtocolVersions(artifacts.mustGetAddress("ProtocolVersionsProxy")),
superchainConfigProxy: superchainConfigProxy,
superchainProxyAdmin: superchainProxyAdmin,
Expand All @@ -300,6 +308,8 @@ contract Deploy is Deployer {
artifacts.save("DelayedWETHImpl", address(dio.delayedWETHImpl));
artifacts.save("PreimageOracle", address(dio.preimageOracleSingleton));
artifacts.save("PermissionedDisputeGame", address(dio.permissionedDisputeGameV2Impl));
artifacts.save("AggregateVerifier", address(dio.aggregateVerifierImpl));
artifacts.save("SystemConfigGlobal", address(dio.systemConfigGlobalImpl));

// Get a contract set from the implementation addresses which were just deployed.
Types.ContractSet memory impls = ChainAssertions.dioToContractSet(dio);
Expand Down
22 changes: 22 additions & 0 deletions scripts/deploy/DeployConfig.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ contract DeployConfig is Script {
uint256 public faultGameV2ClockExtension;
uint256 public faultGameV2MaxClockDuration;

// Multiproof Configuration
bytes32 public teeImageHash;
bytes32 public multiproofConfigHash;
uint256 public multiproofGameType;
address public teeProposer;
address public nitroEnclaveVerifier;
bytes32 public multiproofGenesisOutputRoot;
uint256 public multiproofGenesisBlockNumber;
uint256 public multiproofBlockInterval;
uint256 public multiproofIntermediateBlockInterval;
uint256 public multiproofProofThreshold;

bool public useInterop;
bool public useUpgradedFork;
bytes32 public devFeatureBitmap;
Expand Down Expand Up @@ -192,6 +204,16 @@ contract DeployConfig is Script {
faultGameV2SplitDepth = _readOr(_json, "$.faultGameV2SplitDepth", 30);
faultGameV2ClockExtension = _readOr(_json, "$.faultGameV2ClockExtension", 10800);
faultGameV2MaxClockDuration = _readOr(_json, "$.faultGameV2MaxClockDuration", 302400);
teeImageHash = bytes32(_readOr(_json, "$.teeImageHash", 0));
multiproofConfigHash = bytes32(_readOr(_json, "$.multiproofConfigHash", 0));
multiproofGameType = _readOr(_json, "$.multiproofGameType", 621);
teeProposer = _readOr(_json, "$.teeProposer", finalSystemOwner);
nitroEnclaveVerifier = stdJson.readAddress(_json, "$.nitroEnclaveVerifier");
multiproofGenesisOutputRoot = bytes32(_readOr(_json, "$.multiproofGenesisOutputRoot", uint256(1)));
multiproofGenesisBlockNumber = _readOr(_json, "$.multiproofGenesisBlockNumber", 0);
multiproofBlockInterval = _readOr(_json, "$.multiproofBlockInterval", 100);
multiproofIntermediateBlockInterval = _readOr(_json, "$.multiproofIntermediateBlockInterval", 10);
multiproofProofThreshold = _readOr(_json, "$.multiproofProofThreshold", 1);
}

function fork() public view returns (Fork fork_) {
Expand Down
53 changes: 53 additions & 0 deletions scripts/deploy/DeployImplementations.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol";
import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol";
import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol";
import { IOPContractsManagerStandardValidator } from "interfaces/L1/IOPContractsManagerStandardValidator.sol";
import { IVerifier } from "interfaces/multiproof/IVerifier.sol";
import { DeployUtils } from "scripts/libraries/DeployUtils.sol";
import { Solarray } from "scripts/libraries/Solarray.sol";
import { ChainAssertions } from "scripts/deploy/ChainAssertions.sol";
import { DevFeatures } from "src/libraries/DevFeatures.sol";
import {
INitroEnclaveVerifier
} from "lib/aws-nitro-enclave-attestation/contracts/src/interfaces/INitroEnclaveVerifier.sol";
import { SystemConfigGlobal } from "src/multiproof/tee/SystemConfigGlobal.sol";
import { MockVerifier } from "src/multiproof/mocks/MockVerifier.sol";
import { TEEVerifier } from "src/multiproof/tee/TEEVerifier.sol";
import { AggregateVerifier } from "src/multiproof/AggregateVerifier.sol";
import { GameType } from "src/dispute/lib/Types.sol";

contract DeployImplementations is Script {
struct Input {
Expand All @@ -58,6 +67,15 @@ contract DeployImplementations is Script {
uint256 faultGameV2SplitDepth;
uint256 faultGameV2ClockExtension;
uint256 faultGameV2MaxClockDuration;
// Multiproof parameters
bytes32 teeImageHash;
bytes32 multiproofConfigHash;
uint256 multiproofGameType;
address nitroEnclaveVerifier;
uint256 l2ChainID;
uint256 multiproofBlockInterval;
uint256 multiproofIntermediateBlockInterval;
uint256 multiproofProofThreshold;
// Outputs from DeploySuperchain.s.sol.
ISuperchainConfig superchainConfigProxy;
IProtocolVersions protocolVersionsProxy;
Expand Down Expand Up @@ -95,6 +113,8 @@ contract DeployImplementations is Script {
IPermissionedDisputeGameV2 permissionedDisputeGameV2Impl;
ISuperFaultDisputeGame superFaultDisputeGameImpl;
ISuperPermissionedDisputeGame superPermissionedDisputeGameImpl;
IVerifier aggregateVerifierImpl;
SystemConfigGlobal systemConfigGlobalImpl;
}

bytes32 internal _salt = DeployUtils.DEFAULT_SALT;
Expand Down Expand Up @@ -128,6 +148,7 @@ contract DeployImplementations is Script {
deployAnchorStateRegistryImpl(_input, output_);
deployFaultDisputeGameV2Impl(_input, output_);
deployPermissionedDisputeGameV2Impl(_input, output_);
deployAggregateVerifierImpl(_input, output_);
if (DevFeatures.isDevFeatureEnabled(_input.devFeatureBitmap, DevFeatures.OPTIMISM_PORTAL_INTEROP)) {
deploySuperFaultDisputeGameImpl(_input, output_);
deploySuperPermissionedDisputeGameImpl(_input, output_);
Expand Down Expand Up @@ -695,6 +716,38 @@ contract DeployImplementations is Script {
_output.opcmStandardValidator = impl;
}

function deployAggregateVerifierImpl(Input memory _input, Output memory _output) private {
address zkVerifier = address(new MockVerifier());

address teeVerifierImpl;
{
SystemConfigGlobal scgImpl = new SystemConfigGlobal(INitroEnclaveVerifier(_input.nitroEnclaveVerifier));
vm.label(address(scgImpl), "SystemConfigGlobalImpl");
_output.systemConfigGlobalImpl = scgImpl;
teeVerifierImpl = address(new TEEVerifier(scgImpl));
}

_output.aggregateVerifierImpl = IVerifier(
address(
new AggregateVerifier(
GameType.wrap(uint32(_input.multiproofGameType)),
_output.anchorStateRegistryImpl,
_output.delayedWETHImpl,
IVerifier(teeVerifierImpl),
IVerifier(zkVerifier),
_input.teeImageHash,
bytes32(0),
_input.multiproofConfigHash,
_input.l2ChainID,
_input.multiproofBlockInterval,
_input.multiproofIntermediateBlockInterval,
_input.multiproofProofThreshold
)
)
);
vm.label(address(_output.aggregateVerifierImpl), "AggregateVerifierImpl");
}

function assertValidInput(Input memory _input) private pure {
// Validate V2 game depth parameters are sensible
require(
Expand Down
8 changes: 6 additions & 2 deletions scripts/libraries/ForgeArtifacts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,14 @@ library ForgeArtifacts {

/// @notice Pulls the `_initialized` storage slot information from the Forge artifacts for a given contract.
function getInitializedSlot(string memory _contractName) internal returns (StorageSlot memory slot_) {
// FaultDisputeGame and PermissionedDisputeGame use a different name for the initialized storage slot.
// FaultDisputeGame, PermissionedDisputeGame, and AggregateVerifier use a different name for the initialized
// storage slot.
string memory slotName = "_initialized";
string memory slotType = "t_uint8";
if (LibString.eq(_contractName, "FaultDisputeGame") || LibString.eq(_contractName, "PermissionedDisputeGame")) {
if (
LibString.eq(_contractName, "FaultDisputeGame") || LibString.eq(_contractName, "PermissionedDisputeGame")
|| LibString.eq(_contractName, "AggregateVerifier")
) {
slotName = "initialized";
slotType = "t_bool";
}
Expand Down
Loading
Loading