Commit ffd9ed47 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix: initialization tests (#11674)

Fixes the initialization tests, existing tests were not properly
verifying that all of the initializable contracts were being
accounted for.
parent 91c7ed0d
......@@ -28,13 +28,15 @@ struct Deployment {
abstract contract Artifacts {
/// @notice Foundry cheatcode VM.
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
/// @notice Error for when attempting to fetch a deployment and it does not exist
/// @notice Error for when attempting to fetch a deployment and it does not exist
error DeploymentDoesNotExist(string);
/// @notice Error for when trying to save an invalid deployment
error InvalidDeployment(string);
/// @notice The set of deployments that have been done during execution.
/// @notice Error for when attempting to load the initialized slot of an unsupported contract.
error UnsupportedInitializableContract(string);
/// @notice The set of deployments that have been done during execution.
mapping(string => Deployment) internal _namedDeployments;
/// @notice The same as `_namedDeployments` but as an array.
Deployment[] internal _newDeployments;
......@@ -211,6 +213,13 @@ abstract contract Artifacts {
/// @notice Returns the value of the internal `_initialized` storage slot for a given contract.
function loadInitializedSlot(string memory _contractName) public returns (uint8 initialized_) {
// FaultDisputeGame and PermissionedDisputeGame are initializable but cannot be loaded with
// this function yet because they are not properly labeled in the deploy script.
// TODO: Remove this restriction once the deploy script is fixed.
if (LibString.eq(_contractName, "FaultDisputeGame") || LibString.eq(_contractName, "PermissionedDisputeGame")) {
revert UnsupportedInitializableContract(_contractName);
}
address contractAddress;
// Check if the contract name ends with `Proxy` and, if so, get the implementation address
if (LibString.endsWith(_contractName, "Proxy")) {
......
......@@ -3,6 +3,7 @@ pragma solidity ^0.8.0;
import { Vm } from "forge-std/Vm.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { LibString } from "@solady/utils/LibString.sol";
import { Executables } from "scripts/libraries/Executables.sol";
import { Process } from "scripts/libraries/Process.sol";
......@@ -83,6 +84,67 @@ library ForgeArtifacts {
ids_ = stdJson.readStringArray(string(res), "");
}
/// @notice Returns the kind of contract (i.e. library, contract, or interface).
/// @param _name The name of the contract to get the kind of.
/// @return kind_ The kind of contract ("library", "contract", or "interface").
function getContractKind(string memory _name) internal returns (string memory kind_) {
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
cmd[1] = "-c";
cmd[2] = string.concat(
Executables.jq,
" -r '.ast.nodes[] | select(.nodeType == \"ContractDefinition\") | .contractKind' < ",
_getForgeArtifactPath(_name)
);
bytes memory res = Process.run(cmd);
kind_ = string(res);
}
/// @notice Returns whether or not a contract is proxied.
/// @param _name The name of the contract to check.
/// @return out_ Whether or not the contract is proxied.
function isProxiedContract(string memory _name) internal returns (bool out_) {
// TODO: Using the `@custom:proxied` tag is to determine if a contract is meant to be
// proxied is functional but developers can easily forget to add the tag when writing a new
// contract. We should consider determining whether a contract is proxied based on the
// deployment script since it's the source of truth for that. Current deployment script
// does not make this easy but an updated script should likely make this possible.
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
cmd[1] = "-c";
cmd[2] = string.concat(
Executables.jq,
" -r '.rawMetadata' ",
_getForgeArtifactPath(_name),
" | ",
Executables.jq,
" -r '.output.devdoc' | jq -r 'has(\"custom:proxied\")'"
);
bytes memory res = Process.run(cmd);
out_ = stdJson.readBool(string(res), "");
}
/// @notice Returns whether or not a contract is predeployed.
/// @param _name The name of the contract to check.
/// @return out_ Whether or not the contract is predeployed.
function isPredeployedContract(string memory _name) internal returns (bool out_) {
// TODO: Similar to the above, using the `@custom:predeployed` tag is not reliable but
// functional for now. Deployment script should make this easier to determine.
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
cmd[1] = "-c";
cmd[2] = string.concat(
Executables.jq,
" -r '.rawMetadata' ",
_getForgeArtifactPath(_name),
" | ",
Executables.jq,
" -r '.output.devdoc' | jq -r 'has(\"custom:predeploy\")'"
);
bytes memory res = Process.run(cmd);
out_ = stdJson.readBool(string(res), "");
}
function _getForgeArtifactDirectory(string memory _name) internal returns (string memory dir_) {
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
......@@ -128,6 +190,14 @@ library ForgeArtifacts {
function getInitializedSlot(string memory _contractName) internal returns (StorageSlot memory slot_) {
string memory storageLayout = getStorageLayout(_contractName);
// FaultDisputeGame and PermissionedDisputeGame 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")) {
slotName = "initialized";
slotType = "t_bool";
}
string[] memory command = new string[](3);
command[0] = Executables.bash;
command[1] = "-c";
......@@ -138,7 +208,11 @@ library ForgeArtifacts {
"'",
" | ",
Executables.jq,
" '.storage[] | select(.label == \"_initialized\" and .type == \"t_uint8\")'"
" '.storage[] | select(.label == \"",
slotName,
"\" and .type == \"",
slotType,
"\")'"
);
bytes memory rawSlot = vm.parseJson(string(Process.run(command)));
slot_ = abi.decode(rawSlot, (StorageSlot));
......@@ -152,18 +226,21 @@ library ForgeArtifacts {
initialized_ = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF) != 0;
}
/// @notice Returns the function ABIs of all L1 contracts.
function getContractFunctionAbis(
string memory path,
string[] memory pathExcludes
/// @notice Returns the names of all contracts in a given directory.
/// @param _path The path to search for contracts.
/// @param _pathExcludes An array of paths to exclude from the search.
/// @return contractNames_ An array of contract names.
function getContractNames(
string memory _path,
string[] memory _pathExcludes
)
internal
returns (Abi[] memory abis_)
returns (string[] memory contractNames_)
{
string memory pathExcludesPat;
for (uint256 i = 0; i < pathExcludes.length; i++) {
pathExcludesPat = string.concat(pathExcludesPat, " -path \"", pathExcludes[i], "\"");
if (i != pathExcludes.length - 1) {
for (uint256 i = 0; i < _pathExcludes.length; i++) {
pathExcludesPat = string.concat(pathExcludesPat, " -path \"", _pathExcludes[i], "\"");
if (i != _pathExcludes.length - 1) {
pathExcludesPat = string.concat(pathExcludesPat, " -o ");
}
}
......@@ -174,7 +251,7 @@ library ForgeArtifacts {
command[2] = string.concat(
Executables.find,
" ",
path,
_path,
bytes(pathExcludesPat).length > 0 ? string.concat(" ! \\( ", pathExcludesPat, " \\)") : "",
" -type f ",
"-exec basename {} \\;",
......@@ -185,8 +262,19 @@ library ForgeArtifacts {
Executables.jq,
" -R -s 'split(\"\n\")[:-1]'"
);
string[] memory contractNames = abi.decode(vm.parseJson(string(Process.run(command))), (string[]));
contractNames_ = abi.decode(vm.parseJson(string(Process.run(command))), (string[]));
}
/// @notice Returns the function ABIs of all L1 contracts.
function getContractFunctionAbis(
string memory path,
string[] memory pathExcludes
)
internal
returns (Abi[] memory abis_)
{
string[] memory contractNames = getContractNames(path, pathExcludes);
abis_ = new Abi[](contractNames.length);
for (uint256 i; i < contractNames.length; i++) {
......
This diff is collapsed.
......@@ -40,7 +40,7 @@ struct AttestationsResult {
bytes32[] uids; // UIDs of the new attestations.
}
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000021
/// @title EAS
/// @notice The Ethereum Attestation Service protocol.
......@@ -80,8 +80,8 @@ contract EAS is IEAS, ISemver, EIP1271Verifier {
uint256[MAX_GAP - 3] private __gap;
/// @notice Semantic version.
/// @custom:semver 1.4.0
string public constant version = "1.4.0";
/// @custom:semver 1.4.1-beta.1
string public constant version = "1.4.1-beta.1";
/// @dev Creates a new EAS instance.
constructor() EIP1271Verifier("EAS", "1.3.0") { }
......
......@@ -6,7 +6,7 @@ import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol";
import { EMPTY_UID, MAX_GAP } from "src/EAS/Common.sol";
import { ISchemaRegistry, SchemaRecord } from "src/EAS/ISchemaRegistry.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000020
/// @title SchemaRegistry
/// @notice The global attestation schemas for the Ethereum Attestation Service protocol.
......@@ -20,8 +20,8 @@ contract SchemaRegistry is ISchemaRegistry, ISemver {
uint256[MAX_GAP - 1] private __gap;
/// @notice Semantic version.
/// @custom:semver 1.3.0
string public constant version = "1.3.0";
/// @custom:semver 1.3.1-beta.1
string public constant version = "1.3.1-beta.1";
/// @inheritdoc ISchemaRegistry
function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32) {
......
......@@ -29,6 +29,7 @@ struct Challenge {
uint256 resolvedBlock;
}
/// @custom:proxied true
/// @title DataAvailabilityChallenge
/// @notice This contract enables data availability of a data commitment at a given block number to be challenged.
/// To challenge a commitment, the challenger must first post a bond (bondSize).
......@@ -88,8 +89,8 @@ contract DataAvailabilityChallenge is OwnableUpgradeable, ISemver {
event BalanceChanged(address account, uint256 balance);
/// @notice Semantic version.
/// @custom:semver 1.0.0
string public constant version = "1.0.0";
/// @custom:semver 1.0.1-beta.1
string public constant version = "1.0.1-beta.1";
/// @notice The fixed cost of resolving a challenge.
/// @dev The value is estimated by measuring the cost of resolving with `bytes(0)`
......
......@@ -8,7 +8,7 @@ import { ISemver } from "src/universal/ISemver.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
/// @custom:proxied
/// @custom:proxied true
/// @title L1CrossDomainMessenger
/// @notice The L1CrossDomainMessenger is a message passing interface between L1 and L2 responsible
/// for sending and receiving data on the L1 side. Users are encouraged to use this
......@@ -25,8 +25,8 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
SystemConfig public systemConfig;
/// @notice Semantic version.
/// @custom:semver 2.4.0
string public constant version = "2.4.0";
/// @custom:semver 2.4.1-beta.1
string public constant version = "2.4.1-beta.1";
/// @notice Constructs the L1CrossDomainMessenger contract.
constructor() CrossDomainMessenger() {
......
......@@ -11,6 +11,7 @@ import { StandardBridge } from "src/universal/StandardBridge.sol";
import { Constants } from "src/libraries/Constants.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
/// @custom:proxied true
/// @title L1ERC721Bridge
/// @notice The L1 ERC721 bridge is a contract which works together with the L2 ERC721 bridge to
/// make it possible to transfer ERC721 tokens from Ethereum to Optimism. This contract
......@@ -24,8 +25,8 @@ contract L1ERC721Bridge is ERC721Bridge, ISemver {
SuperchainConfig public superchainConfig;
/// @notice Semantic version.
/// @custom:semver 2.1.1+beta.1
string public constant version = "2.1.1+beta.1";
/// @custom:semver 2.1.1-beta.2
string public constant version = "2.1.1-beta.2";
/// @notice Constructs the L1ERC721Bridge contract.
constructor() ERC721Bridge() {
......
......@@ -9,7 +9,7 @@ import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { OptimismPortal } from "src/L1/OptimismPortal.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
/// @custom:proxied
/// @custom:proxied true
/// @title L1StandardBridge
/// @notice The L1StandardBridge is responsible for transfering ETH and ERC20 tokens between L1 and
/// L2. In the case that an ERC20 token is native to L1, it will be escrowed within this
......@@ -71,8 +71,8 @@ contract L1StandardBridge is StandardBridge, ISemver {
);
/// @notice Semantic version.
/// @custom:semver 2.2.0
string public constant version = "2.2.0";
/// @custom:semver 2.2.1-beta.1
string public constant version = "2.2.1-beta.1";
/// @notice Address of the SuperchainConfig contract.
SuperchainConfig public superchainConfig;
......
......@@ -6,7 +6,7 @@ import { ISemver } from "src/universal/ISemver.sol";
import { Types } from "src/libraries/Types.sol";
import { Constants } from "src/libraries/Constants.sol";
/// @custom:proxied
/// @custom:proxied true
/// @title L2OutputOracle
/// @notice The L2OutputOracle contains an array of L2 state outputs, where each output is a
/// commitment to the state of the L2 chain. Other contracts like the OptimismPortal use
......@@ -56,8 +56,8 @@ contract L2OutputOracle is Initializable, ISemver {
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
/// @notice Semantic version.
/// @custom:semver 1.8.0
string public constant version = "1.8.0";
/// @custom:semver 1.8.1-beta.1
string public constant version = "1.8.1-beta.1";
/// @notice Constructs the L2OutputOracle contract. Initializes variables to the same values as
/// in the getting-started config.
......
......@@ -4,10 +4,10 @@ pragma solidity 0.8.15;
import { ISemver } from "src/universal/ISemver.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
/// @custom:proxied
/// @custom:proxied true
contract OPStackManager is ISemver {
/// @custom:semver 1.0.0-beta.1
string public constant version = "1.0.0-beta.1";
/// @custom:semver 1.0.0-beta.2
string public constant version = "1.0.0-beta.2";
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
struct Roles {
......
......@@ -19,7 +19,7 @@ import { L1Block } from "src/L2/L1Block.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import "src/libraries/PortalErrors.sol";
/// @custom:proxied
/// @custom:proxied true
/// @title OptimismPortal
/// @notice The OptimismPortal is a low-level contract responsible for passing messages between L1
/// and L2. Messages sent directly to the OptimismPortal have no form of replayability.
......@@ -128,9 +128,9 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
}
/// @notice Semantic version.
/// @custom:semver 2.8.1-beta.1
/// @custom:semver 2.8.1-beta.2
function version() public pure virtual returns (string memory) {
return "2.8.1-beta.1";
return "2.8.1-beta.2";
}
/// @notice Constructs the OptimismPortal contract.
......
......@@ -22,7 +22,7 @@ import { Predeploys } from "src/libraries/Predeploys.sol";
import "src/libraries/PortalErrors.sol";
import "src/dispute/lib/Types.sol";
/// @custom:proxied
/// @custom:proxied true
/// @title OptimismPortal2
/// @notice The OptimismPortal is a low-level contract responsible for passing messages between L1
/// and L2. Messages sent directly to the OptimismPortal have no form of replayability.
......@@ -153,9 +153,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
}
/// @notice Semantic version.
/// @custom:semver 3.11.0-beta.2
/// @custom:semver 3.11.0-beta.3
function version() public pure virtual returns (string memory) {
return "3.11.0-beta.2";
return "3.11.0-beta.3";
}
/// @notice Constructs the OptimismPortal contract.
......
......@@ -6,7 +6,7 @@ import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Constants } from "src/libraries/Constants.sol";
/// @custom:proxied
/// @custom:proxied true
/// @title OptimismPortalInterop
/// @notice The OptimismPortal is a low-level contract responsible for passing messages between L1
/// and L2. Messages sent directly to the OptimismPortal have no form of replayability.
......
......@@ -9,6 +9,7 @@ import { Constants } from "src/libraries/Constants.sol";
/// @notice ProtocolVersion is a numeric identifier of the protocol version.
type ProtocolVersion is uint256;
/// @custom:proxied true
/// @title ProtocolVersions
/// @notice The ProtocolVersions contract is used to manage superchain protocol version information.
contract ProtocolVersions is OwnableUpgradeable, ISemver {
......@@ -36,8 +37,8 @@ contract ProtocolVersions is OwnableUpgradeable, ISemver {
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
/// @notice Semantic version.
/// @custom:semver 1.0.0
string public constant version = "1.0.0";
/// @custom:semver 1.0.1-beta.1
string public constant version = "1.0.1-beta.1";
/// @notice Constructs the ProtocolVersion contract. Cannot set
/// the owner to `address(0)` due to the Ownable contract's
......
......@@ -5,6 +5,7 @@ import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable
import { ISemver } from "src/universal/ISemver.sol";
import { Storage } from "src/libraries/Storage.sol";
/// @custom:proxied true
/// @custom:audit none This contracts is not yet audited.
/// @title SuperchainConfig
/// @notice The SuperchainConfig contract is used to manage configuration of global superchain values.
......@@ -35,8 +36,8 @@ contract SuperchainConfig is Initializable, ISemver {
event ConfigUpdate(UpdateType indexed updateType, bytes data);
/// @notice Semantic version.
/// @custom:semver 1.1.0
string public constant version = "1.1.0";
/// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.1";
/// @notice Constructs the SuperchainConfig contract.
constructor() {
......
......@@ -10,6 +10,7 @@ import { OptimismPortal } from "src/L1/OptimismPortal.sol";
import { GasPayingToken, IGasToken } from "src/libraries/GasPayingToken.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
/// @custom:proxied true
/// @title SystemConfig
/// @notice The SystemConfig contract is used to manage configuration of an Optimism network.
/// All configuration is stored on L1 and picked up by L2 as part of the derviation of
......@@ -124,9 +125,9 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken {
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
/// @notice Semantic version.
/// @custom:semver 2.3.0-beta.2
/// @custom:semver 2.3.0-beta.3
function version() public pure virtual returns (string memory) {
return "2.3.0-beta.2";
return "2.3.0-beta.3";
}
/// @notice Constructs the SystemConfig contract. Cannot set
......
......@@ -11,6 +11,7 @@ import { StaticConfig } from "src/libraries/StaticConfig.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
import { Storage } from "src/libraries/Storage.sol";
/// @custom:proxied true
/// @title SystemConfigInterop
/// @notice The SystemConfig contract is used to manage configuration of an Optimism network.
/// All configuration is stored on L1 and picked up by L2 as part of the derviation of
......
......@@ -4,14 +4,14 @@ pragma solidity 0.8.15;
import { ISemver } from "src/universal/ISemver.sol";
import { FeeVault } from "src/universal/FeeVault.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000019
/// @title BaseFeeVault
/// @notice The BaseFeeVault accumulates the base fee that is paid by transactions.
contract BaseFeeVault is FeeVault, ISemver {
/// @notice Semantic version.
/// @custom:semver 1.5.0-beta.1
string public constant version = "1.5.0-beta.1";
/// @custom:semver 1.5.0-beta.2
string public constant version = "1.5.0-beta.2";
/// @notice Constructs the BaseFeeVault contract.
/// @param _recipient Wallet that will receive the fees.
......
......@@ -26,7 +26,7 @@ error InvalidChainId();
/// @notice Thrown when trying to execute a cross chain message and the target call fails.
error TargetCallFailed();
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000022
/// @title CrossL2Inbox
/// @notice The CrossL2Inbox is responsible for executing a cross chain message on the destination
......@@ -61,8 +61,8 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware {
address internal constant DEPOSITOR_ACCOUNT = 0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001;
/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.5
string public constant version = "1.0.0-beta.5";
/// @custom:semver 1.0.0-beta.6
string public constant version = "1.0.0-beta.6";
/// @notice Emitted when a cross chain message is being executed.
/// @param msgHash Hash of message payload being executed.
......
......@@ -7,7 +7,7 @@ import { L1Block } from "src/L2/L1Block.sol";
import { Constants } from "src/libraries/Constants.sol";
import { LibZip } from "@solady/utils/LibZip.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x420000000000000000000000000000000000000F
/// @title GasPriceOracle
/// @notice This contract maintains the variables responsible for computing the L1 portion of the
......@@ -26,8 +26,8 @@ contract GasPriceOracle is ISemver {
uint256 public constant DECIMALS = 6;
/// @notice Semantic version.
/// @custom:semver 1.3.0
string public constant version = "1.3.0";
/// @custom:semver 1.3.1-beta.1
string public constant version = "1.3.1-beta.1";
/// @notice This is the intercept value for the linear regression used to estimate the final size of the
/// compressed transaction.
......
......@@ -6,7 +6,7 @@ import { Constants } from "src/libraries/Constants.sol";
import { GasPayingToken, IGasToken } from "src/libraries/GasPayingToken.sol";
import "src/libraries/L1BlockErrors.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000015
/// @title L1Block
/// @notice The L1Block predeploy gives users access to information about the last known L1 block.
......@@ -57,9 +57,9 @@ contract L1Block is ISemver, IGasToken {
/// @notice The latest L1 blob base fee.
uint256 public blobBaseFee;
/// @custom:semver 1.4.1-beta.1
/// @custom:semver 1.4.1-beta.2
function version() public pure virtual returns (string memory) {
return "1.4.1-beta.1";
return "1.4.1-beta.2";
}
/// @notice Returns the gas paying token, its decimals, name and symbol.
......
......@@ -17,7 +17,7 @@ enum ConfigType {
REMOVE_DEPENDENCY
}
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000015
/// @title L1BlockInterop
/// @notice Interop extenstions of L1Block.
......
......@@ -4,14 +4,14 @@ pragma solidity 0.8.15;
import { ISemver } from "src/universal/ISemver.sol";
import { FeeVault } from "src/universal/FeeVault.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x420000000000000000000000000000000000001A
/// @title L1FeeVault
/// @notice The L1FeeVault accumulates the L1 portion of the transaction fees.
contract L1FeeVault is FeeVault, ISemver {
/// @notice Semantic version.
/// @custom:semver 1.5.0-beta.1
string public constant version = "1.5.0-beta.1";
/// @custom:semver 1.5.0-beta.2
string public constant version = "1.5.0-beta.2";
/// @notice Constructs the L1FeeVault contract.
/// @param _recipient Wallet that will receive the fees.
......
......@@ -10,15 +10,15 @@ import { Constants } from "src/libraries/Constants.sol";
import { L1Block } from "src/L2/L1Block.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000007
/// @title L2CrossDomainMessenger
/// @notice The L2CrossDomainMessenger is a high-level interface for message passing between L1 and
/// L2 on the L2 side. Users are generally encouraged to use this contract instead of lower
/// level message passing contracts.
contract L2CrossDomainMessenger is CrossDomainMessenger, ISemver {
/// @custom:semver 2.1.0
string public constant version = "2.1.0";
/// @custom:semver 2.1.1-beta.1
string public constant version = "2.1.1-beta.1";
/// @notice Constructs the L2CrossDomainMessenger contract.
constructor() CrossDomainMessenger() {
......
......@@ -10,6 +10,8 @@ import { ISemver } from "src/universal/ISemver.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000014
/// @title L2ERC721Bridge
/// @notice The L2 ERC721 bridge is a contract which works together with the L1 ERC721 bridge to
/// make it possible to transfer ERC721 tokens from Ethereum to Optimism. This contract
......@@ -20,8 +22,8 @@ import { Predeploys } from "src/libraries/Predeploys.sol";
/// wait for the one-week challenge period to elapse before their Optimism-native NFT
/// can be refunded on L2.
contract L2ERC721Bridge is ERC721Bridge, ISemver {
/// @custom:semver 1.7.1+beta.1
string public constant version = "1.7.1+beta.1";
/// @custom:semver 1.7.1-beta.2
string public constant version = "1.7.1-beta.2";
/// @notice Constructs the L2ERC721Bridge contract.
constructor() ERC721Bridge() {
......
......@@ -8,7 +8,7 @@ import { OptimismMintableERC20 } from "src/universal/OptimismMintableERC20.sol";
import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
import { L1Block } from "src/L2/L1Block.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000010
/// @title L2StandardBridge
/// @notice The L2StandardBridge is responsible for transfering ETH and ERC20 tokens between L1 and
......@@ -53,9 +53,9 @@ contract L2StandardBridge is StandardBridge, ISemver {
);
/// @notice Semantic version.
/// @custom:semver 1.11.0
/// @custom:semver 1.11.1-beta.1
function version() public pure virtual returns (string memory) {
return "1.11.0";
return "1.11.1-beta.1";
}
/// @notice Constructs the L2StandardBridge contract.
......
......@@ -27,7 +27,7 @@ interface MintableAndBurnable is IERC20 {
function burn(address, uint256) external;
}
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000010
/// @title L2StandardBridgeInterop
/// @notice The L2StandardBridgeInterop is an extension of the L2StandardBridge that allows for
......
......@@ -7,7 +7,7 @@ import { Encoding } from "src/libraries/Encoding.sol";
import { Burn } from "src/libraries/Burn.sol";
import { ISemver } from "src/universal/ISemver.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000016
/// @title L2ToL1MessagePasser
/// @notice The L2ToL1MessagePasser is a dedicated contract where messages that are being sent from
......@@ -48,8 +48,8 @@ contract L2ToL1MessagePasser is ISemver {
/// @param amount Amount of ETh that was burned.
event WithdrawerBalanceBurnt(uint256 indexed amount);
/// @custom:semver 1.1.0
string public constant version = "1.1.0";
/// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.1";
/// @notice Allows users to withdraw ETH by sending directly to this contract.
receive() external payable {
......
......@@ -36,7 +36,7 @@ error MessageAlreadyRelayed();
/// @notice Thrown when a reentrant call is detected.
error ReentrantCall();
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000023
/// @title L2ToL2CrossDomainMessenger
/// @notice The L2ToL2CrossDomainMessenger is a higher level abstraction on top of the CrossL2Inbox that provides
......@@ -57,8 +57,8 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra
uint16 public constant messageVersion = uint16(0);
/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.3
string public constant version = "1.0.0-beta.3";
/// @custom:semver 1.0.0-beta.4
string public constant version = "1.0.0-beta.4";
/// @notice Mapping of message hashes to boolean receipt values. Note that a message will only be present in this
/// mapping if it has successfully been relayed on this chain, and can therefore not be relayed again.
......
......@@ -23,7 +23,7 @@ error OnlyBridge();
/// @notice Thrown when attempting to mint or burn tokens and the account is the zero address.
error ZeroAddress();
/// @custom:proxied
/// @custom:proxied true
/// @title OptimismSuperchainERC20
/// @notice OptimismSuperchainERC20 is a standard extension of the base ERC20 token contract that unifies ERC20 token
/// bridging to make it fungible across the Superchain. This construction allows the L2StandardBridge to burn
......@@ -70,8 +70,8 @@ contract OptimismSuperchainERC20 is IOptimismSuperchainERC20Extension, ERC20, IS
}
/// @notice Semantic version.
/// @custom:semver 1.0.0-beta.1
string public constant version = "1.0.0-beta.1";
/// @custom:semver 1.0.0-beta.2
string public constant version = "1.0.0-beta.2";
/// @notice Constructs the OptimismSuperchainERC20 contract.
constructor() {
......
......@@ -4,14 +4,14 @@ pragma solidity 0.8.15;
import { ISemver } from "src/universal/ISemver.sol";
import { FeeVault } from "src/universal/FeeVault.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000011
/// @title SequencerFeeVault
/// @notice The SequencerFeeVault is the contract that holds any fees paid to the Sequencer during
/// transaction processing and block production.
contract SequencerFeeVault is FeeVault, ISemver {
/// @custom:semver 1.5.0-beta.1
string public constant version = "1.5.0-beta.1";
/// @custom:semver 1.5.0-beta.2
string public constant version = "1.5.0-beta.2";
/// @notice Constructs the SequencerFeeVault contract.
/// @param _recipient Wallet that will receive the fees.
......
......@@ -14,6 +14,7 @@ import "src/dispute/lib/Types.sol";
import { Unauthorized } from "src/libraries/errors/CommonErrors.sol";
import { UnregisteredGame, InvalidGameStatus } from "src/dispute/lib/Errors.sol";
/// @custom:proxied true
/// @title AnchorStateRegistry
/// @notice The AnchorStateRegistry is a contract that stores the latest "anchor" state for each available
/// FaultDisputeGame type. The anchor state is the latest state that has been proposed on L1 and was not
......@@ -27,8 +28,8 @@ contract AnchorStateRegistry is Initializable, IAnchorStateRegistry, ISemver {
}
/// @notice Semantic version.
/// @custom:semver 2.0.0-rc.1
string public constant version = "2.0.0-rc.1";
/// @custom:semver 2.0.1-beta.1
string public constant version = "2.0.1-beta.1";
/// @notice DisputeGameFactory address.
IDisputeGameFactory internal immutable DISPUTE_GAME_FACTORY;
......
......@@ -11,6 +11,7 @@ import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.
import "src/dispute/lib/Types.sol";
import "src/dispute/lib/Errors.sol";
/// @custom:proxied true
/// @title DisputeGameFactory
/// @notice A factory contract for creating `IDisputeGame` contracts. All created dispute games are stored in both a
/// mapping and an append only array. The timestamp of the creation time of the dispute game is packed tightly
......@@ -21,8 +22,8 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, ISemver
using LibClone for address;
/// @notice Semantic version.
/// @custom:semver 1.0.0
string public constant version = "1.0.0";
/// @custom:semver 1.0.1-beta.1
string public constant version = "1.0.1-beta.1";
/// @inheritdoc IDisputeGameFactory
mapping(GameType => IDisputeGame) public gameImpls;
......
......@@ -10,6 +10,7 @@ import { WETH98 } from "src/dispute/weth/WETH98.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
/// @custom:proxied true
/// @title DelayedWETH
/// @notice DelayedWETH is an extension to WETH9 that allows for delayed withdrawals. Accounts must trigger an unlock
/// function before they can withdraw WETH. Accounts must trigger unlock by specifying a sub-account and an
......@@ -21,8 +22,8 @@ import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
/// Not the prettiest contract in the world, but it gets the job done.
contract DelayedWETH is OwnableUpgradeable, WETH98, IDelayedWETH, ISemver {
/// @notice Semantic version.
/// @custom:semver 1.1.0-rc.1
string public constant version = "1.1.0-rc.1";
/// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.1";
/// @inheritdoc IDelayedWETH
mapping(address => mapping(address => WithdrawalRequest)) public withdrawals;
......
......@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
/// @custom:legacy
/// @custom:legacy true
/// @title AddressManager
/// @notice AddressManager is a legacy contract that was used in the old version of the Optimism
/// system to manage a registry of string names to addresses. We now use a more standard
......
......@@ -3,8 +3,8 @@ pragma solidity 0.8.15;
import { ISemver } from "src/universal/ISemver.sol";
/// @custom:legacy
/// @custom:proxied
/// @custom:legacy true
/// @custom:proxied true
/// @custom:predeployed 0x4200000000000000000000000000000000000002
/// @title DeployerWhitelist
/// @notice DeployerWhitelist is a legacy contract that was originally used to act as a whitelist of
......@@ -41,8 +41,8 @@ contract DeployerWhitelist is ISemver {
}
/// @notice Semantic version.
/// @custom:semver 1.1.0
string public constant version = "1.1.0";
/// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.1";
/// @notice Adds or removes an address from the deployment whitelist.
/// @param _deployer Address to update permissions for.
......
......@@ -5,8 +5,8 @@ import { L1Block } from "src/L2/L1Block.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import { ISemver } from "src/universal/ISemver.sol";
/// @custom:legacy
/// @custom:proxied
/// @custom:legacy true
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000013
/// @title L1BlockNumber
/// @notice L1BlockNumber is a legacy contract that fills the roll of the OVM_L1BlockNumber contract
......@@ -15,8 +15,8 @@ import { ISemver } from "src/universal/ISemver.sol";
/// contract instead.
contract L1BlockNumber is ISemver {
/// @notice Semantic version.
/// @custom:semver 1.1.0
string public constant version = "1.1.0";
/// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.1";
/// @notice Returns the L1 block number.
receive() external payable {
......
......@@ -4,7 +4,7 @@ pragma solidity 0.8.15;
import { Constants } from "src/libraries/Constants.sol";
import { IL1ChugSplashDeployer } from "src/legacy/interfaces/IL1ChugSplashProxy.sol";
/// @custom:legacy
/// @custom:legacy true
/// @title L1ChugSplashProxy
/// @notice Basic ChugSplash proxy contract for L1. Very close to being a normal proxy but has added
/// functions `setCode` and `setStorage` for changing the code or storage of the contract.
......
......@@ -3,8 +3,8 @@ pragma solidity 0.8.15;
import { ISemver } from "src/universal/ISemver.sol";
/// @custom:legacy
/// @custom:proxied
/// @custom:legacy true
/// @custom:proxied true
/// @custom:predeploy 0x4200000000000000000000000000000000000000
/// @title LegacyMessagePasser
/// @notice The LegacyMessagePasser was the low-level mechanism used to send messages from L2 to L1
......@@ -14,8 +14,8 @@ contract LegacyMessagePasser is ISemver {
mapping(bytes32 => bool) public sentMessages;
/// @notice Semantic version.
/// @custom:semver 1.1.0
string public constant version = "1.1.0";
/// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.1";
/// @notice Passes a message to L1.
/// @param _message Message to pass to L1.
......
......@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
import { AddressManager } from "src/legacy/AddressManager.sol";
/// @custom:legacy
/// @custom:legacy true
/// @title ResolvedDelegateProxy
/// @notice ResolvedDelegateProxy is a legacy proxy contract that makes use of the AddressManager to
/// resolve the implementation address. We're maintaining this contract for backwards
......
......@@ -6,7 +6,7 @@ import { ISemver } from "src/universal/ISemver.sol";
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import { IOptimismERC20Factory } from "src/L2/IOptimismERC20Factory.sol";
/// @custom:proxied
/// @custom:proxied true
/// @custom:predeployed 0x4200000000000000000000000000000000000012
/// @title OptimismMintableERC20Factory
/// @notice OptimismMintableERC20Factory is a factory contract that generates OptimismMintableERC20
......@@ -48,8 +48,8 @@ contract OptimismMintableERC20Factory is ISemver, Initializable, IOptimismERC20F
/// the OptimismMintableERC20 token contract since this contract
/// is responsible for deploying OptimismMintableERC20 contracts.
/// @notice Semantic version.
/// @custom:semver 1.10.0
string public constant version = "1.10.0";
/// @custom:semver 1.10.1-beta.1
string public constant version = "1.10.1-beta.1";
/// @notice Constructs the OptimismMintableERC20Factory contract.
constructor() {
......
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