Skip to content
Open
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
15 changes: 15 additions & 0 deletions interfaces/L1/IOptimismPortal2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";
import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol";
import { IAnchorStateRegistry } from "interfaces/L1/proofs/IAnchorStateRegistry.sol";
import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol";
import { ITEEProverRegistry } from "interfaces/L1/proofs/tee/ITEEProverRegistry.sol";

interface IOptimismPortal2 is IProxyAdminOwnedBase {
error ContentLengthMismatch();
Expand All @@ -33,6 +34,11 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
error OptimismPortal_ProofNotOldEnough();
error OptimismPortal_Unproven();
error OptimismPortal_ImmediateFinalityNotEnabled();
error OptimismPortal_AttestedWithdrawalAlreadyRedeemed();
error OptimismPortal_InvalidAttestedWithdrawalSignature();
error OptimismPortal_InvalidAttestedWithdrawalSigner(address signer);
error OptimismPortal_TEEProverRegistryAlreadySet();
error OptimismPortal_AttestedWithdrawalTransferFailed();
error OutOfGas();
error UnexpectedList();
error UnexpectedString();
Expand All @@ -42,10 +48,14 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success);
event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter);
event AttestedWithdrawalRedeemed(
bytes32 indexed authHash, address indexed recipient, uint256 amount, uint256 nonce, address signer
);

receive() external payable;

function anchorStateRegistry() external view returns (IAnchorStateRegistry);
function attestRedeemed(bytes32) external view returns (bool);
function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) external view;
function depositTransaction(
address _to,
Expand Down Expand Up @@ -106,9 +116,14 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
external
view
returns (IDisputeGame disputeGameProxy, uint64 timestamp);
function redeemAttestedWithdrawal(
address _recipient, uint256 _amount, uint256 _nonce, bytes calldata _sig
) external;
function respectedGameType() external view returns (GameType);
function respectedGameTypeUpdatedAt() external view returns (uint64);
function setTEEProverRegistry(ITEEProverRegistry _teeProverRegistry) external;
function systemConfig() external view returns (ISystemConfig);
function teeProverRegistry() external view returns (ITEEProverRegistry);
function version() external pure returns (string memory);

function __constructor__(uint256 _proofMaturityDelaySeconds) external;
Expand Down
6 changes: 6 additions & 0 deletions interfaces/L2/IL2ToL1MessagePasser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ interface IL2ToL1MessagePasser {
bytes32 withdrawalHash
);
event WithdrawerBalanceBurnt(uint256 indexed amount);
event AttestedWithdrawalInitiated(
bytes32 indexed authHash, address indexed recipient, address indexed token, uint256 amount, uint256 nonce
);

receive() external payable;

function MESSAGE_VERSION() external view returns (uint16);
function attestNonce() external view returns (uint256);
function attestedWithdraw(address _recipient) external payable;
function attestedWithdrawals(bytes32) external view returns (bool);
function burn() external;
function initiateWithdrawal(address _target, uint256 _gasLimit, bytes memory _data) external payable;
function messageNonce() external view returns (uint256);
Expand Down
17 changes: 13 additions & 4 deletions scripts/deploy/SystemDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ contract SystemDeploy is Script {
output_.zkVerifier = multiproof.zkVerifier;
output_.nitroEnclaveVerifier = INitroEnclaveVerifier(_implementationsInput.nitroEnclaveVerifier);
output_.sp1Verifier = _implementationsInput.sp1Verifier;

vm.broadcast(msg.sender);
output_.optimismPortalProxy.setTEEProverRegistry(output_.teeProverRegistryProxy);
}

_transferOwnership(address(output_.disputeGameFactoryProxy), _input.roles.opChainProxyAdminOwner);
Expand Down Expand Up @@ -783,7 +786,7 @@ contract SystemDeploy is Script {

IDisputeGameFactory disputeGameFactory = IDisputeGameFactory(_systemConfigProxy.disputeGameFactory());
_upgradeTo(proxyAdmin, address(disputeGameFactory), _impls.disputeGameFactoryImpl);
_upgradeMultiproofContracts(_systemConfigProxy, disputeGameFactory, _impls);
_upgradeMultiproofContracts(_systemConfigProxy, optimismPortal, disputeGameFactory, _impls);

ISystemConfig.Addresses memory opChainAddrs = _systemConfigProxy.getAddresses();
_upgradeTo(proxyAdmin, opChainAddrs.l1CrossDomainMessenger, _impls.l1CrossDomainMessengerImpl);
Expand All @@ -802,6 +805,7 @@ contract SystemDeploy is Script {

function _upgradeMultiproofContracts(
ISystemConfig _systemConfigProxy,
IOptimismPortal _optimismPortal,
IDisputeGameFactory _disputeGameFactory,
Types.Implementations memory _impls
)
Expand All @@ -810,10 +814,15 @@ contract SystemDeploy is Script {
IDisputeGame currentGameImpl = _disputeGameFactory.gameImpls(GameTypes.AGGREGATE_VERIFIER);
if (address(currentGameImpl) == address(0)) return;

AggregateVerifier currentAggregateVerifier = AggregateVerifier(address(currentGameImpl));
TEEProverRegistry teeProverRegistry =
TEEVerifier(address(currentAggregateVerifier.TEE_VERIFIER())).TEE_PROVER_REGISTRY();
if (address(_optimismPortal.teeProverRegistry()) == address(0)) {
vm.broadcast(msg.sender);
_optimismPortal.setTEEProverRegistry(ITEEProverRegistry(address(teeProverRegistry)));
}

if (_impls.teeProverRegistryImpl != address(0)) {
AggregateVerifier currentAggregateVerifier = AggregateVerifier(address(currentGameImpl));
TEEProverRegistry teeProverRegistry =
TEEVerifier(address(currentAggregateVerifier.TEE_VERIFIER())).TEE_PROVER_REGISTRY();
_upgradeTo(_systemConfigProxy.proxyAdmin(), address(teeProverRegistry), _impls.teeProverRegistryImpl);
}

Expand Down
82 changes: 82 additions & 0 deletions snapshots/abi/L2ToL1MessagePasser.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,51 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "attestNonce",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_recipient",
"type": "address"
}
],
"name": "attestedWithdraw",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "attestedWithdrawals",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "burn",
Expand Down Expand Up @@ -91,6 +136,43 @@
"stateMutability": "pure",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "authHash",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
}
],
"name": "AttestedWithdrawalInitiated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down
Loading
Loading