Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
7cc54758
Unverified
Commit
7cc54758
authored
Jul 01, 2022
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ctp): remove reinitialization from ERC721 fact
Removes reinitialization from the ERC721 factory.
parent
91f40f82
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
22 deletions
+54
-22
L1ERC721Bridge.sol
...racts-periphery/contracts/L1/messaging/L1ERC721Bridge.sol
+6
-7
L2ERC721Bridge.sol
...racts-periphery/contracts/L2/messaging/L2ERC721Bridge.sol
+6
-7
Semver.sol
packages/contracts-periphery/contracts/universal/Semver.sol
+38
-0
OptimismMintableERC721Factory.sol
...cts/universal/op-erc721/OptimismMintableERC721Factory.sol
+4
-8
No files found.
packages/contracts-periphery/contracts/L1/messaging/L1ERC721Bridge.sol
View file @
7cc54758
...
...
@@ -10,6 +10,7 @@ import {
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { L2ERC721Bridge } from "../../L2/messaging/L2ERC721Bridge.sol";
import { Semver } from "../../universal/Semver.sol";
/**
* @title L1ERC721Bridge
...
...
@@ -17,12 +18,7 @@ import { L2ERC721Bridge } from "../../L2/messaging/L2ERC721Bridge.sol";
* make it possible to transfer ERC721 tokens between Optimism and Ethereum. This contract
* acts as an escrow for ERC721 tokens deposted into L2.
*/
contract L1ERC721Bridge is CrossDomainEnabled, OwnableUpgradeable {
/**
* @notice Contract version number.
*/
uint256 public constant VERSION = 2;
contract L1ERC721Bridge is Semver, CrossDomainEnabled, OwnableUpgradeable {
/**
* @notice Emitted when an ERC721 bridge to the other network is initiated.
*
...
...
@@ -77,7 +73,10 @@ contract L1ERC721Bridge is CrossDomainEnabled, OwnableUpgradeable {
* @param _messenger Address of the CrossDomainMessenger on this network.
* @param _otherBridge Address of the ERC721 bridge on the other network.
*/
constructor(address _messenger, address _otherBridge) CrossDomainEnabled(address(0)) {
constructor(address _messenger, address _otherBridge)
Semver(0, 0, 1)
CrossDomainEnabled(address(0))
{
initialize(_messenger, _otherBridge);
}
...
...
packages/contracts-periphery/contracts/L2/messaging/L2ERC721Bridge.sol
View file @
7cc54758
...
...
@@ -11,6 +11,7 @@ import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC16
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { L1ERC721Bridge } from "../../L1/messaging/L1ERC721Bridge.sol";
import { IOptimismMintableERC721 } from "../../universal/op-erc721/IOptimismMintableERC721.sol";
import { Semver } from "../../universal/Semver.sol";
/**
* @title L2ERC721Bridge
...
...
@@ -19,12 +20,7 @@ import { IOptimismMintableERC721 } from "../../universal/op-erc721/IOptimismMint
* acts as a minter for new tokens when it hears about deposits into the L1 ERC721 bridge.
* This contract also acts as a burner for tokens being withdrawn.
*/
contract L2ERC721Bridge is CrossDomainEnabled, OwnableUpgradeable {
/**
* @notice Contract version number.
*/
uint256 public constant VERSION = 2;
contract L2ERC721Bridge is Semver, CrossDomainEnabled, OwnableUpgradeable {
/**
* @notice Emitted when an ERC721 bridge to the other network is initiated.
*
...
...
@@ -91,7 +87,10 @@ contract L2ERC721Bridge is CrossDomainEnabled, OwnableUpgradeable {
* @param _messenger Address of the CrossDomainMessenger on this network.
* @param _otherBridge Address of the ERC721 bridge on the other network.
*/
constructor(address _messenger, address _otherBridge) CrossDomainEnabled(address(0)) {
constructor(address _messenger, address _otherBridge)
Semver(0, 0, 1)
CrossDomainEnabled(address(0))
{
initialize(_messenger, _otherBridge);
}
...
...
packages/contracts-periphery/contracts/universal/Semver.sol
0 → 100644
View file @
7cc54758
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/**
* @title Semver
* @notice Semver is a simple contract for managing contract versions.
*/
contract Semver {
/**
* @notice Contract version number (major).
*/
uint256 public immutable MAJOR_VERSION;
/**
* @notice Contract version number (minor).
*/
uint256 public immutable MINOR_VERSION;
/**
* @notice Contract version number (patch).
*/
uint256 public immutable PATCH_VERSION;
/**
* @param _major Version number (major).
* @param _minor Version number (minor).
* @param _patch Version number (patch).
*/
constructor(
uint256 _major,
uint256 _minor,
uint256 _patch
) {
MAJOR_VERSION = _major;
MINOR_VERSION = _minor;
PATCH_VERSION = _patch;
}
}
packages/contracts-periphery/contracts/universal/op-erc721/OptimismMintableERC721Factory.sol
View file @
7cc54758
...
...
@@ -5,17 +5,13 @@ import {
OwnableUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { OptimismMintableERC721 } from "./OptimismMintableERC721.sol";
import { Semver } from "../Semver.sol";
/**
* @title OptimismMintableERC721Factory
* @notice Factory contract for creating OptimismMintableERC721 contracts.
*/
contract OptimismMintableERC721Factory is OwnableUpgradeable {
/**
* @notice Contract version number.
*/
uint8 public constant VERSION = 2;
contract OptimismMintableERC721Factory is Semver, OwnableUpgradeable {
/**
* @notice Emitted whenever a new OptimismMintableERC721 contract is created.
*
...
...
@@ -42,7 +38,7 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable {
/**
* @param _bridge Address of the ERC721 bridge on this network.
*/
constructor(address _bridge, uint256 _remoteChainId) {
constructor(address _bridge, uint256 _remoteChainId)
Semver(0, 0, 1)
{
initialize(_bridge, _remoteChainId);
}
...
...
@@ -51,7 +47,7 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable {
*
* @param _bridge Address of the ERC721 bridge on this network.
*/
function initialize(address _bridge, uint256 _remoteChainId) public
reinitializer(VERSION)
{
function initialize(address _bridge, uint256 _remoteChainId) public
initializer
{
bridge = _bridge;
remoteChainId = _remoteChainId;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment