Commit d58b0a39 authored by Kelvin Fichter's avatar Kelvin Fichter

fix(ctb): clear remaining lint warnings

Clears remaining contracts-bedrock lint warnings.
parent c1ebc959
---
'@eth-optimism/contracts-bedrock': patch
---
Cleans up remaining lint warnings
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2ERC721BridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":26261,\"contract\":\"contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_array(t_uint256)49_storage\"}],\"types\":{\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const L2ERC721BridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":26231,\"contract\":\"contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_array(t_uint256)49_storage\"}],\"types\":{\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var L2ERC721BridgeStorageLayout = new(solc.StorageLayout) var L2ERC721BridgeStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const OptimismMintableERC721FactoryStorageLayoutJSON = "{\"storage\":[{\"astId\":27013,\"contract\":\"contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory\",\"label\":\"isOptimismMintableERC721\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}" const OptimismMintableERC721FactoryStorageLayoutJSON = "{\"storage\":[{\"astId\":27004,\"contract\":\"contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory\",\"label\":\"isOptimismMintableERC721\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}"
var OptimismMintableERC721FactoryStorageLayout = new(solc.StorageLayout) var OptimismMintableERC721FactoryStorageLayout = new(solc.StorageLayout)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"event-name-camelcase": "off", "event-name-camelcase": "off",
"reason-string": "off", "reason-string": "off",
"avoid-tx-origin": "off", "avoid-tx-origin": "off",
"var-name-mixedcase": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }] "func-visibility": ["warn", { "ignoreConstructors": true }]
} }
} }
...@@ -19,31 +19,26 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { ...@@ -19,31 +19,26 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
/** /**
* @notice The interval in L2 blocks at which checkpoints must be submitted. * @notice The interval in L2 blocks at which checkpoints must be submitted.
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable SUBMISSION_INTERVAL; uint256 public immutable SUBMISSION_INTERVAL;
/** /**
* @notice The number of blocks in the chain before the first block in this contract. * @notice The number of blocks in the chain before the first block in this contract.
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable HISTORICAL_TOTAL_BLOCKS; uint256 public immutable HISTORICAL_TOTAL_BLOCKS;
/** /**
* @notice The number of the first L2 block recorded in this contract. * @notice The number of the first L2 block recorded in this contract.
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable STARTING_BLOCK_NUMBER; uint256 public immutable STARTING_BLOCK_NUMBER;
/** /**
* @notice The timestamp of the first L2 block recorded in this contract. * @notice The timestamp of the first L2 block recorded in this contract.
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable STARTING_TIMESTAMP; uint256 public immutable STARTING_TIMESTAMP;
/** /**
* @notice The time between L2 blocks in seconds. * @notice The time between L2 blocks in seconds.
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable L2_BLOCK_TIME; uint256 public immutable L2_BLOCK_TIME;
/** /**
...@@ -170,6 +165,7 @@ contract L2OutputOracle is OwnableUpgradeable, Semver { ...@@ -170,6 +165,7 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
* *
* @param _proposal Represents the output proposal to delete * @param _proposal Represents the output proposal to delete
*/ */
// solhint-disable-next-line ordering
function deleteL2Output(Types.OutputProposal memory _proposal) external onlyOwner { function deleteL2Output(Types.OutputProposal memory _proposal) external onlyOwner {
Types.OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber]; Types.OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber];
......
...@@ -32,13 +32,11 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -32,13 +32,11 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/** /**
* @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized. * @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized.
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable FINALIZATION_PERIOD_SECONDS; uint256 public immutable FINALIZATION_PERIOD_SECONDS;
/** /**
* @notice Address of the L2OutputOracle. * @notice Address of the L2OutputOracle.
*/ */
// solhint-disable-next-line var-name-mixedcase
L2OutputOracle public immutable L2_ORACLE; L2OutputOracle public immutable L2_ORACLE;
/** /**
...@@ -113,6 +111,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -113,6 +111,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* function for EOAs. Contracts should call the depositTransaction() function directly * function for EOAs. Contracts should call the depositTransaction() function directly
* otherwise any deposited funds will be lost due to address aliasing. * otherwise any deposited funds will be lost due to address aliasing.
*/ */
// solhint-disable-next-line ordering
receive() external payable { receive() external payable {
depositTransaction(msg.sender, msg.value, RECEIVE_DEFAULT_GAS_LIMIT, false, bytes("")); depositTransaction(msg.sender, msg.value, RECEIVE_DEFAULT_GAS_LIMIT, false, bytes(""));
} }
......
...@@ -19,14 +19,6 @@ contract BaseSystemDictator is Ownable { ...@@ -19,14 +19,6 @@ contract BaseSystemDictator is Ownable {
*/ */
uint256 public currentStep = 1; uint256 public currentStep = 1;
/**
* @param _config System configuration.
*/
constructor(SystemConfig memory _config) Ownable() {
config = _config;
_transferOwnership(config.globalConfig.controller);
}
/** /**
* @notice Checks that the current step is the expected step, then bumps the current step. * @notice Checks that the current step is the expected step, then bumps the current step.
* *
...@@ -37,4 +29,12 @@ contract BaseSystemDictator is Ownable { ...@@ -37,4 +29,12 @@ contract BaseSystemDictator is Ownable {
_; _;
currentStep++; currentStep++;
} }
/**
* @param _config System configuration.
*/
constructor(SystemConfig memory _config) Ownable() {
config = _config;
_transferOwnership(config.globalConfig.controller);
}
} }
...@@ -134,7 +134,7 @@ contract MigrationSystemDictator is BaseSystemDictator { ...@@ -134,7 +134,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
config.globalConfig.proxyAdmin.upgradeAndCall( config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l1StandardBridgeProxy), payable(config.proxyAddressConfig.l1StandardBridgeProxy),
address(config.implementationAddressConfig.portalSenderImpl), address(config.implementationAddressConfig.portalSenderImpl),
abi.encodeCall(PortalSender.send, ()) abi.encodeCall(PortalSender.donate, ())
); );
// Upgrade the L1StandardBridge (no initializer). // Upgrade the L1StandardBridge (no initializer).
......
...@@ -24,7 +24,7 @@ contract PortalSender { ...@@ -24,7 +24,7 @@ contract PortalSender {
/** /**
* @notice Sends balance of this contract to the OptimismPortal. * @notice Sends balance of this contract to the OptimismPortal.
*/ */
function send() public { function donate() public {
portal.donateETH{ value: address(this).balance }(); portal.donateETH{ value: address(this).balance }();
} }
} }
...@@ -9,6 +9,21 @@ import { Address } from "@openzeppelin/contracts/utils/Address.sol"; ...@@ -9,6 +9,21 @@ import { Address } from "@openzeppelin/contracts/utils/Address.sol";
* @notice ERC721Bridge is a base contract for the L1 and L2 ERC721 bridges. * @notice ERC721Bridge is a base contract for the L1 and L2 ERC721 bridges.
*/ */
abstract contract ERC721Bridge { abstract contract ERC721Bridge {
/**
* @notice Messenger contract on this domain.
*/
CrossDomainMessenger public immutable messenger;
/**
* @notice Address of the bridge on the other network.
*/
address public immutable otherBridge;
/**
* @notice Reserve extra slots (to a total of 50) in the storage layout for future upgrades.
*/
uint256[49] private __gap;
/** /**
* @notice Emitted when an ERC721 bridge to the other network is initiated. * @notice Emitted when an ERC721 bridge to the other network is initiated.
* *
...@@ -47,21 +62,6 @@ abstract contract ERC721Bridge { ...@@ -47,21 +62,6 @@ abstract contract ERC721Bridge {
bytes extraData bytes extraData
); );
/**
* @notice Messenger contract on this domain.
*/
CrossDomainMessenger public immutable messenger;
/**
* @notice Address of the bridge on the other network.
*/
address public immutable otherBridge;
/**
* @notice Reserve extra slots (to a total of 50) in the storage layout for future upgrades.
*/
uint256[49] private __gap;
/** /**
* @notice Ensures that the caller is a cross-chain message from the other bridge. * @notice Ensures that the caller is a cross-chain message from the other bridge.
*/ */
......
...@@ -27,21 +27,6 @@ interface IOptimismMintableERC721 is IERC721Enumerable { ...@@ -27,21 +27,6 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
*/ */
event Burn(address indexed account, uint256 tokenId); event Burn(address indexed account, uint256 tokenId);
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function remoteChainId() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function remoteToken() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address);
/** /**
* @notice Mints some token ID for a user, checking first that contract recipients * @notice Mints some token ID for a user, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked. * are aware of the ERC721 protocol to prevent tokens from being forever locked.
...@@ -58,4 +43,19 @@ interface IOptimismMintableERC721 is IERC721Enumerable { ...@@ -58,4 +43,19 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
* @param _tokenId Token ID to burn. * @param _tokenId Token ID to burn.
*/ */
function burn(address _from, uint256 _tokenId) external; function burn(address _from, uint256 _tokenId) external;
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function remoteChainId() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function remoteToken() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address);
} }
...@@ -36,6 +36,14 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 { ...@@ -36,6 +36,14 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 {
*/ */
string public baseTokenURI; string public baseTokenURI;
/**
* @notice Modifier that prevents callers other than the bridge from calling the function.
*/
modifier onlyBridge() {
require(msg.sender == bridge, "OptimismMintableERC721: only bridge can call this function");
_;
}
/** /**
* @param _bridge Address of the bridge on this network. * @param _bridge Address of the bridge on this network.
* @param _remoteChainId Chain ID where the remote token is deployed. * @param _remoteChainId Chain ID where the remote token is deployed.
...@@ -74,14 +82,6 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 { ...@@ -74,14 +82,6 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721 {
); );
} }
/**
* @notice Modifier that prevents callers other than the bridge from calling the function.
*/
modifier onlyBridge() {
require(msg.sender == bridge, "OptimismMintableERC721: only bridge can call this function");
_;
}
/** /**
* @inheritdoc IOptimismMintableERC721 * @inheritdoc IOptimismMintableERC721
*/ */
......
...@@ -9,19 +9,6 @@ import { Semver } from "./Semver.sol"; ...@@ -9,19 +9,6 @@ import { Semver } from "./Semver.sol";
* @notice Factory contract for creating OptimismMintableERC721 contracts. * @notice Factory contract for creating OptimismMintableERC721 contracts.
*/ */
contract OptimismMintableERC721Factory is Semver { contract OptimismMintableERC721Factory is Semver {
/**
* @notice Emitted whenever a new OptimismMintableERC721 contract is created.
*
* @param localToken Address of the token on the this domain.
* @param remoteToken Address of the token on the remote domain.
* @param deployer Address of the initiator of the deployment
*/
event OptimismMintableERC721Created(
address indexed localToken,
address indexed remoteToken,
address deployer
);
/** /**
* @notice Address of the ERC721 bridge on this network. * @notice Address of the ERC721 bridge on this network.
*/ */
...@@ -37,6 +24,19 @@ contract OptimismMintableERC721Factory is Semver { ...@@ -37,6 +24,19 @@ contract OptimismMintableERC721Factory is Semver {
*/ */
mapping(address => bool) public isOptimismMintableERC721; mapping(address => bool) public isOptimismMintableERC721;
/**
* @notice Emitted whenever a new OptimismMintableERC721 contract is created.
*
* @param localToken Address of the token on the this domain.
* @param remoteToken Address of the token on the remote domain.
* @param deployer Address of the initiator of the deployment
*/
event OptimismMintableERC721Created(
address indexed localToken,
address indexed remoteToken,
address deployer
);
/** /**
* @custom:semver 1.0.0 * @custom:semver 1.0.0
* *
......
...@@ -11,19 +11,16 @@ contract Semver { ...@@ -11,19 +11,16 @@ contract Semver {
/** /**
* @notice Contract version number (major). * @notice Contract version number (major).
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable MAJOR_VERSION; uint256 private immutable MAJOR_VERSION;
/** /**
* @notice Contract version number (minor). * @notice Contract version number (minor).
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable MINOR_VERSION; uint256 private immutable MINOR_VERSION;
/** /**
* @notice Contract version number (patch). * @notice Contract version number (patch).
*/ */
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable PATCH_VERSION; uint256 private immutable PATCH_VERSION;
/** /**
......
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