Commit 220ad4ef authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-periphery: remove ownable upgradable from erc721 factory (#3541)

The ownable upgradable modifier was not used anywhere
in the contract. The erc20 factory does not follow that
pattern. This change simplifies things by moving
values to immutables instead of being in storage.

This is a cleanup PR before migrating these contracts to
`contracts-bedrock`.
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 710f17af
---
'@eth-optimism/contracts-periphery': patch
---
Remove ownable upgradable from erc721 factory
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.15;
import {
OwnableUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { OptimismMintableERC721 } from "./OptimismMintableERC721.sol"; import { OptimismMintableERC721 } from "./OptimismMintableERC721.sol";
import { Semver } from "@eth-optimism/contracts-bedrock/contracts/universal/Semver.sol"; import { Semver } from "@eth-optimism/contracts-bedrock/contracts/universal/Semver.sol";
...@@ -11,7 +8,7 @@ import { Semver } from "@eth-optimism/contracts-bedrock/contracts/universal/Semv ...@@ -11,7 +8,7 @@ import { Semver } from "@eth-optimism/contracts-bedrock/contracts/universal/Semv
* @title OptimismMintableERC721Factory * @title OptimismMintableERC721Factory
* @notice Factory contract for creating OptimismMintableERC721 contracts. * @notice Factory contract for creating OptimismMintableERC721 contracts.
*/ */
contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable { contract OptimismMintableERC721Factory is Semver {
/** /**
* @notice Emitted whenever a new OptimismMintableERC721 contract is created. * @notice Emitted whenever a new OptimismMintableERC721 contract is created.
* *
...@@ -23,12 +20,12 @@ contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable { ...@@ -23,12 +20,12 @@ contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable {
/** /**
* @notice Address of the ERC721 bridge on this network. * @notice Address of the ERC721 bridge on this network.
*/ */
address public bridge; address public immutable bridge;
/** /**
* @notice Chain ID for the remote network. * @notice Chain ID for the remote network.
*/ */
uint256 public remoteChainId; uint256 public immutable remoteChainId;
/** /**
* @notice Tracks addresses created by this factory. * @notice Tracks addresses created by this factory.
...@@ -41,15 +38,6 @@ contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable { ...@@ -41,15 +38,6 @@ contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable {
* @param _bridge Address of the ERC721 bridge on this network. * @param _bridge Address of the ERC721 bridge on this network.
*/ */
constructor(address _bridge, uint256 _remoteChainId) Semver(1, 0, 0) { constructor(address _bridge, uint256 _remoteChainId) Semver(1, 0, 0) {
initialize(_bridge, _remoteChainId);
}
/**
* @notice Initializes the factory.
*
* @param _bridge Address of the ERC721 bridge on this network.
*/
function initialize(address _bridge, uint256 _remoteChainId) public initializer {
require( require(
_bridge != address(0), _bridge != address(0),
"OptimismMintableERC721Factory: bridge cannot be address(0)" "OptimismMintableERC721Factory: bridge cannot be address(0)"
...@@ -61,9 +49,6 @@ contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable { ...@@ -61,9 +49,6 @@ contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable {
bridge = _bridge; bridge = _bridge;
remoteChainId = _remoteChainId; remoteChainId = _remoteChainId;
// Initialize upgradable OZ contracts
__Ownable_init();
} }
/** /**
......
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