Commit a19b2776 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: migrate ERC721 contracts to ISemver

Continue moving away from `Semver` in favor of the more
flexible `ISemver` contract.
parent 1fb32f99
...@@ -30,6 +30,6 @@ ...@@ -30,6 +30,6 @@
"src/periphery/op-nft/OptimistInviter.sol": "0xfdd5b9d45205ef9372ba37f7a6394724695e676d27a47cb154ee6e4148490013", "src/periphery/op-nft/OptimistInviter.sol": "0xfdd5b9d45205ef9372ba37f7a6394724695e676d27a47cb154ee6e4148490013",
"src/universal/OptimismMintableERC20.sol": "0x17fe6e955dc7e9e480e57bc62c227206838b204dcb660b8cb8f6f217319a22ba", "src/universal/OptimismMintableERC20.sol": "0x17fe6e955dc7e9e480e57bc62c227206838b204dcb660b8cb8f6f217319a22ba",
"src/universal/OptimismMintableERC20Factory.sol": "0x684a9445515e3797722b211e2c0d6a94b6244d6fa028cd2825a31538ef2dc59c", "src/universal/OptimismMintableERC20Factory.sol": "0x684a9445515e3797722b211e2c0d6a94b6244d6fa028cd2825a31538ef2dc59c",
"src/universal/OptimismMintableERC721.sol": "0x49dc863caf3e002bf0c90b3af3873990fb282771f4c63735fd61a885b7873983", "src/universal/OptimismMintableERC721.sol": "0x4c73bf8474fa7eb091796a4db7e57bc5f26d50a3d1cfcb78d5efa47ced5ced2b",
"src/universal/OptimismMintableERC721Factory.sol": "0x502438b009bfaf0ab187914662468261f10446fd85d44a79b29cdaef7b4982ba" "src/universal/OptimismMintableERC721Factory.sol": "0x935fd97018b6ef10fa813d9d43ab7a77c80885f7a8d7feb430097645cb2abd2c"
} }
\ No newline at end of file
...@@ -5,14 +5,14 @@ import { ERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extension ...@@ -5,14 +5,14 @@ import { ERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extension
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { IOptimismMintableERC721 } from "./IOptimismMintableERC721.sol"; import { IOptimismMintableERC721 } from "src/universal/IOptimismMintableERC721.sol";
import { Semver } from "../universal/Semver.sol"; import { ISemver } from "src/universal/ISemver.sol";
/// @title OptimismMintableERC721 /// @title OptimismMintableERC721
/// @notice This contract is the remote representation for some token that lives on another network, /// @notice This contract is the remote representation for some token that lives on another network,
/// typically an Optimism representation of an Ethereum-based token. Standard reference /// typically an Optimism representation of an Ethereum-based token. Standard reference
/// implementation that can be extended or modified according to your needs. /// implementation that can be extended or modified according to your needs.
contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721, Semver { contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721, ISemver {
/// @inheritdoc IOptimismMintableERC721 /// @inheritdoc IOptimismMintableERC721
uint256 public immutable REMOTE_CHAIN_ID; uint256 public immutable REMOTE_CHAIN_ID;
...@@ -31,7 +31,10 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721, Se ...@@ -31,7 +31,10 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721, Se
_; _;
} }
/// @custom:semver 1.2.0 /// @notice Semantic version.
/// @custom:semver 1.3.0
string public constant version = "1.3.0";
/// @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.
/// @param _remoteToken Address of the corresponding token on the other network. /// @param _remoteToken Address of the corresponding token on the other network.
...@@ -45,7 +48,6 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721, Se ...@@ -45,7 +48,6 @@ contract OptimismMintableERC721 is ERC721Enumerable, IOptimismMintableERC721, Se
string memory _symbol string memory _symbol
) )
ERC721(_name, _symbol) ERC721(_name, _symbol)
Semver(1, 2, 0)
{ {
require(_bridge != address(0), "OptimismMintableERC721: bridge cannot be address(0)"); require(_bridge != address(0), "OptimismMintableERC721: bridge cannot be address(0)");
require(_remoteChainId != 0, "OptimismMintableERC721: remote chain id cannot be zero"); require(_remoteChainId != 0, "OptimismMintableERC721: remote chain id cannot be zero");
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.15;
import { OptimismMintableERC721 } from "./OptimismMintableERC721.sol"; import { OptimismMintableERC721 } from "src/universal/OptimismMintableERC721.sol";
import { Semver } from "./Semver.sol"; import { ISemver } from "src/universal/ISemver.sol";
/// @title OptimismMintableERC721Factory /// @title OptimismMintableERC721Factory
/// @notice Factory contract for creating OptimismMintableERC721 contracts. /// @notice Factory contract for creating OptimismMintableERC721 contracts.
contract OptimismMintableERC721Factory is Semver { contract OptimismMintableERC721Factory is ISemver {
/// @notice Address of the ERC721 bridge on this network. /// @notice Address of the ERC721 bridge on this network.
address public immutable BRIDGE; address public immutable BRIDGE;
...@@ -22,13 +22,16 @@ contract OptimismMintableERC721Factory is Semver { ...@@ -22,13 +22,16 @@ contract OptimismMintableERC721Factory is Semver {
/// @param deployer Address of the initiator of the deployment /// @param deployer Address of the initiator of the deployment
event OptimismMintableERC721Created(address indexed localToken, address indexed remoteToken, address deployer); event OptimismMintableERC721Created(address indexed localToken, address indexed remoteToken, address deployer);
/// @custom:semver 1.3.0 /// @notice Semantic version.
/// @custom:semver 1.4.0
string public constant version = "1.4.0";
/// @notice The semver MUST be bumped any time that there is a change in /// @notice The semver MUST be bumped any time that there is a change in
/// the OptimismMintableERC721 token contract since this contract /// the OptimismMintableERC721 token contract since this contract
/// is responsible for deploying OptimismMintableERC721 contracts. /// is responsible for deploying OptimismMintableERC721 contracts.
/// @param _bridge Address of the ERC721 bridge on this network. /// @param _bridge Address of the ERC721 bridge on this network.
/// @param _remoteChainId Chain ID for the remote network. /// @param _remoteChainId Chain ID for the remote network.
constructor(address _bridge, uint256 _remoteChainId) Semver(1, 3, 0) { constructor(address _bridge, uint256 _remoteChainId) {
BRIDGE = _bridge; BRIDGE = _bridge;
REMOTE_CHAIN_ID = _remoteChainId; REMOTE_CHAIN_ID = _remoteChainId;
} }
......
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