Commit 1940dfb6 authored by Mark Tyneway's avatar Mark Tyneway

ctb: fix interface

parent 11b679f1
This diff is collapsed.
This diff is collapsed.
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
| finalizedWithdrawals | mapping(bytes32 => bool) | 51 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal | | finalizedWithdrawals | mapping(bytes32 => bool) | 51 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal |
| provenWithdrawals | mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal) | 52 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal | | provenWithdrawals | mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal) | 52 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal |
| paused | bool | 53 | 0 | 1 | src/L1/OptimismPortal.sol:OptimismPortal | | paused | bool | 53 | 0 | 1 | src/L1/OptimismPortal.sol:OptimismPortal |
| $l2Oracle | contract L2OutputOracle | 53 | 1 | 20 | src/L1/OptimismPortal.sol:OptimismPortal | | l2Oracle | contract L2OutputOracle | 53 | 1 | 20 | src/L1/OptimismPortal.sol:OptimismPortal |
| $systemConfig | contract SystemConfig | 54 | 0 | 20 | src/L1/OptimismPortal.sol:OptimismPortal | | systemConfig | contract SystemConfig | 54 | 0 | 20 | src/L1/OptimismPortal.sol:OptimismPortal |
| $guardian | address | 55 | 0 | 20 | src/L1/OptimismPortal.sol:OptimismPortal | | guardian | address | 55 | 0 | 20 | src/L1/OptimismPortal.sol:OptimismPortal |
======================= =======================
➡ src/L1/SystemConfig.sol:SystemConfig ➡ src/L1/SystemConfig.sol:SystemConfig
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"src/L1/L1ERC721Bridge.sol": "0xac9d8e236a1b35c358f9800834f65375cf4270155e817cf3d0f2bac1968f9107", "src/L1/L1ERC721Bridge.sol": "0xac9d8e236a1b35c358f9800834f65375cf4270155e817cf3d0f2bac1968f9107",
"src/L1/L1StandardBridge.sol": "0x26fd79e041c403f4bc68758c410fcc801975e7648c0b51a2c4a6e8c44fabcbfd", "src/L1/L1StandardBridge.sol": "0x26fd79e041c403f4bc68758c410fcc801975e7648c0b51a2c4a6e8c44fabcbfd",
"src/L1/L2OutputOracle.sol": "0xd6c5eb38732077c4705f46a61be68a7beccc069a99ed1d07b8e1fc6e1de8ffa6", "src/L1/L2OutputOracle.sol": "0xd6c5eb38732077c4705f46a61be68a7beccc069a99ed1d07b8e1fc6e1de8ffa6",
"src/L1/OptimismPortal.sol": "0xaec3d476e2b892a56a7214aa1cceb33584457fd5f68c66730bb7cf27ddc7b57b", "src/L1/OptimismPortal.sol": "0xb3652b69895ef7ab6da489ba57ee9b213cf4e2939cdf3b8d40a39a9fac13d31e",
"src/L1/SystemConfig.sol": "0x8e2b5103d2eb93b74af2e2f96a4505e637cdc3c44d80cf5ec2eca70060e1deff", "src/L1/SystemConfig.sol": "0x8e2b5103d2eb93b74af2e2f96a4505e637cdc3c44d80cf5ec2eca70060e1deff",
"src/L2/BaseFeeVault.sol": "0xa596e60762f16192cfa86459fcb9f4da9d8f756106eedac643a1ffeafbbfcc5f", "src/L2/BaseFeeVault.sol": "0xa596e60762f16192cfa86459fcb9f4da9d8f756106eedac643a1ffeafbbfcc5f",
"src/L2/GasPriceOracle.sol": "0xc735a8bf01ad8bca194345748537bfd9924909c0342bc133c4a31e2fb8cb9882", "src/L2/GasPriceOracle.sol": "0xc735a8bf01ad8bca194345748537bfd9924909c0342bc133c4a31e2fb8cb9882",
......
...@@ -53,15 +53,15 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -53,15 +53,15 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/// @notice Address of the L2OutputOracle contract. /// @notice Address of the L2OutputOracle contract.
/// @custom:network-specific /// @custom:network-specific
L2OutputOracle internal $l2Oracle; L2OutputOracle public l2Oracle;
/// @notice Address of the SystemConfig contract. /// @notice Address of the SystemConfig contract.
/// @custom:network-specific /// @custom:network-specific
SystemConfig internal $systemConfig; SystemConfig public systemConfig;
/// @notice Address that has the ability to pause and unpause withdrawals. /// @notice Address that has the ability to pause and unpause withdrawals.
/// @custom:network-specific /// @custom:network-specific
address internal $guardian; address public guardian;
/// @notice Emitted when a transaction is deposited from L1 to L2. /// @notice Emitted when a transaction is deposited from L1 to L2.
/// The parameters of this event are read by the rollup node and used to derive deposit /// The parameters of this event are read by the rollup node and used to derive deposit
...@@ -129,9 +129,9 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -129,9 +129,9 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
bool _paused bool _paused
) public reinitializer(2) { ) public reinitializer(2) {
l2Sender = Constants.DEFAULT_L2_SENDER; l2Sender = Constants.DEFAULT_L2_SENDER;
$l2Oracle = _l2Oracle; l2Oracle = _l2Oracle;
$systemConfig = _systemConfig; systemConfig = _systemConfig;
$guardian = _guardian; guardian = _guardian;
paused = _paused; paused = _paused;
__ResourceMetering_init(); __ResourceMetering_init();
} }
...@@ -139,46 +139,31 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -139,46 +139,31 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/// @notice Getter for the L2OutputOracle /// @notice Getter for the L2OutputOracle
/// @custom:legacy /// @custom:legacy
function L2_ORACLE() external view returns (L2OutputOracle) { function L2_ORACLE() external view returns (L2OutputOracle) {
return $l2Oracle; return l2Oracle;
}
/// @notice Getter for the L2OutputOracle
function l2Oracle() external view returns (L2OutputOracle) {
return $l2Oracle;
} }
/// @notice Getter for the SystemConfig /// @notice Getter for the SystemConfig
/// @custom:legacy /// @custom:legacy
function SYSTEM_CONFIG() external view returns (SystemConfig) { function SYSTEM_CONFIG() external view returns (SystemConfig) {
return $systemConfig; return systemConfig;
}
/// @notice Getter for the SystemConfig
function systemConfig() external view returns (SystemConfig) {
return $systemConfig;
} }
/// @notice Getter for the Guardian /// @notice Getter for the Guardian
/// @custom:legacy /// @custom:legacy
function GUARDIAN() external view returns (address) { function GUARDIAN() external view returns (address) {
return $guardian; return guardian;
}
/// @notice Getter for the Guardian
function guardian() external view returns (address) {
return $guardian;
} }
/// @notice Pauses withdrawals. /// @notice Pauses withdrawals.
function pause() external { function pause() external {
require(msg.sender == $guardian, "OptimismPortal: only guardian can pause"); require(msg.sender == guardian, "OptimismPortal: only guardian can pause");
paused = true; paused = true;
emit Paused(msg.sender); emit Paused(msg.sender);
} }
/// @notice Unpauses withdrawals. /// @notice Unpauses withdrawals.
function unpause() external { function unpause() external {
require(msg.sender == $guardian, "OptimismPortal: only guardian can unpause"); require(msg.sender == guardian, "OptimismPortal: only guardian can unpause");
paused = false; paused = false;
emit Unpaused(msg.sender); emit Unpaused(msg.sender);
} }
...@@ -220,7 +205,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -220,7 +205,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
override override
returns (ResourceMetering.ResourceConfig memory) returns (ResourceMetering.ResourceConfig memory)
{ {
return $systemConfig.resourceConfig(); return systemConfig.resourceConfig();
} }
/// @notice Proves a withdrawal transaction. /// @notice Proves a withdrawal transaction.
...@@ -244,7 +229,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -244,7 +229,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// Get the output root and load onto the stack to prevent multiple mloads. This will // Get the output root and load onto the stack to prevent multiple mloads. This will
// revert if there is no output root for the given block number. // revert if there is no output root for the given block number.
bytes32 outputRoot = $l2Oracle.getL2Output(_l2OutputIndex).outputRoot; bytes32 outputRoot = l2Oracle.getL2Output(_l2OutputIndex).outputRoot;
// Verify that the output root can be generated with the elements in the proof. // Verify that the output root can be generated with the elements in the proof.
require( require(
...@@ -264,7 +249,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -264,7 +249,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// output index has been updated. // output index has been updated.
require( require(
provenWithdrawal.timestamp == 0 || provenWithdrawal.timestamp == 0 ||
$l2Oracle.getL2Output(provenWithdrawal.l2OutputIndex).outputRoot != l2Oracle.getL2Output(provenWithdrawal.l2OutputIndex).outputRoot !=
provenWithdrawal.outputRoot, provenWithdrawal.outputRoot,
"OptimismPortal: withdrawal hash has already been proven" "OptimismPortal: withdrawal hash has already been proven"
); );
...@@ -336,7 +321,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -336,7 +321,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// starting timestamp inside the L2OutputOracle. Not strictly necessary but extra layer of // starting timestamp inside the L2OutputOracle. Not strictly necessary but extra layer of
// safety against weird bugs in the proving step. // safety against weird bugs in the proving step.
require( require(
provenWithdrawal.timestamp >= $l2Oracle.startingTimestamp(), provenWithdrawal.timestamp >= l2Oracle.startingTimestamp(),
"OptimismPortal: withdrawal timestamp less than L2 Oracle starting timestamp" "OptimismPortal: withdrawal timestamp less than L2 Oracle starting timestamp"
); );
...@@ -351,7 +336,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -351,7 +336,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// Grab the OutputProposal from the L2OutputOracle, will revert if the output that // Grab the OutputProposal from the L2OutputOracle, will revert if the output that
// corresponds to the given index has not been proposed yet. // corresponds to the given index has not been proposed yet.
Types.OutputProposal memory proposal = $l2Oracle.getL2Output( Types.OutputProposal memory proposal = l2Oracle.getL2Output(
provenWithdrawal.l2OutputIndex provenWithdrawal.l2OutputIndex
); );
...@@ -471,7 +456,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -471,7 +456,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/// @param _l2OutputIndex Index of the L2 output to check. /// @param _l2OutputIndex Index of the L2 output to check.
/// @return Whether or not the output is finalized. /// @return Whether or not the output is finalized.
function isOutputFinalized(uint256 _l2OutputIndex) external view returns (bool) { function isOutputFinalized(uint256 _l2OutputIndex) external view returns (bool) {
return _isFinalizationPeriodElapsed($l2Oracle.getL2Output(_l2OutputIndex).timestamp); return _isFinalizationPeriodElapsed(l2Oracle.getL2Output(_l2OutputIndex).timestamp);
} }
/// @notice Determines whether the finalization period has elapsed with respect to /// @notice Determines whether the finalization period has elapsed with respect to
...@@ -479,6 +464,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -479,6 +464,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/// @param _timestamp Timestamp to check. /// @param _timestamp Timestamp to check.
/// @return Whether or not the finalization period has elapsed. /// @return Whether or not the finalization period has elapsed.
function _isFinalizationPeriodElapsed(uint256 _timestamp) internal view returns (bool) { function _isFinalizationPeriodElapsed(uint256 _timestamp) internal view returns (bool) {
return block.timestamp > _timestamp + $l2Oracle.FINALIZATION_PERIOD_SECONDS(); return block.timestamp > _timestamp + l2Oracle.FINALIZATION_PERIOD_SECONDS();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment