Commit d6e1f3b2 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #3840 from ethereum-optimism/sc/ctb-lint-warns

fix(ctb): clear remaining lint warnings
parents c1ebc959 d58b0a39
---
'@eth-optimism/contracts-bedrock': patch
---
Cleans up remaining lint warnings
......@@ -9,7 +9,7 @@ import (
"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)
......
......@@ -9,7 +9,7 @@ import (
"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)
......
......@@ -16,6 +16,7 @@
"event-name-camelcase": "off",
"reason-string": "off",
"avoid-tx-origin": "off",
"var-name-mixedcase": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }]
}
}
......@@ -19,31 +19,26 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
/**
* @notice The interval in L2 blocks at which checkpoints must be submitted.
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable SUBMISSION_INTERVAL;
/**
* @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;
/**
* @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;
/**
* @notice The timestamp of the first L2 block recorded in this contract.
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable STARTING_TIMESTAMP;
/**
* @notice The time between L2 blocks in seconds.
*/
// solhint-disable-next-line var-name-mixedcase
uint256 public immutable L2_BLOCK_TIME;
/**
......@@ -170,6 +165,7 @@ contract L2OutputOracle is OwnableUpgradeable, Semver {
*
* @param _proposal Represents the output proposal to delete
*/
// solhint-disable-next-line ordering
function deleteL2Output(Types.OutputProposal memory _proposal) external onlyOwner {
Types.OutputProposal memory outputToDelete = l2Outputs[latestBlockNumber];
......
......@@ -32,13 +32,11 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
/**
* @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;
/**
* @notice Address of the L2OutputOracle.
*/
// solhint-disable-next-line var-name-mixedcase
L2OutputOracle public immutable L2_ORACLE;
/**
......@@ -113,6 +111,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* function for EOAs. Contracts should call the depositTransaction() function directly
* otherwise any deposited funds will be lost due to address aliasing.
*/
// solhint-disable-next-line ordering
receive() external payable {
depositTransaction(msg.sender, msg.value, RECEIVE_DEFAULT_GAS_LIMIT, false, bytes(""));
}
......
......@@ -19,14 +19,6 @@ contract BaseSystemDictator is Ownable {
*/
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.
*
......@@ -37,4 +29,12 @@ contract BaseSystemDictator is Ownable {
_;
currentStep++;
}
/**
* @param _config System configuration.
*/
constructor(SystemConfig memory _config) Ownable() {
config = _config;
_transferOwnership(config.globalConfig.controller);
}
}
......@@ -134,7 +134,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l1StandardBridgeProxy),
address(config.implementationAddressConfig.portalSenderImpl),
abi.encodeCall(PortalSender.send, ())
abi.encodeCall(PortalSender.donate, ())
);
// Upgrade the L1StandardBridge (no initializer).
......
......@@ -24,7 +24,7 @@ contract PortalSender {
/**
* @notice Sends balance of this contract to the OptimismPortal.
*/
function send() public {
function donate() public {
portal.donateETH{ value: address(this).balance }();
}
}
......@@ -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.
*/
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.
*
......@@ -47,21 +62,6 @@ abstract contract ERC721Bridge {
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.
*/
......
......@@ -27,21 +27,6 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
*/
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
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
......@@ -58,4 +43,19 @@ interface IOptimismMintableERC721 is IERC721Enumerable {
* @param _tokenId Token ID to burn.
*/
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 {
*/
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 _remoteChainId Chain ID where the remote token is deployed.
......@@ -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
*/
......
......@@ -9,19 +9,6 @@ import { Semver } from "./Semver.sol";
* @notice Factory contract for creating OptimismMintableERC721 contracts.
*/
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.
*/
......@@ -37,6 +24,19 @@ contract OptimismMintableERC721Factory is Semver {
*/
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
*
......
......@@ -11,19 +11,16 @@ contract Semver {
/**
* @notice Contract version number (major).
*/
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable MAJOR_VERSION;
/**
* @notice Contract version number (minor).
*/
// solhint-disable-next-line var-name-mixedcase
uint256 private immutable MINOR_VERSION;
/**
* @notice Contract version number (patch).
*/
// solhint-disable-next-line var-name-mixedcase
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