Skip to content

feat: nft bridge betwen l1 and optimism#2577

Closed
sam-goldman-zz wants to merge 1 commit intoethereum-optimism:developfrom
sam-goldman-zz:eth-nft-bridge
Closed

feat: nft bridge betwen l1 and optimism#2577
sam-goldman-zz wants to merge 1 commit intoethereum-optimism:developfrom
sam-goldman-zz:eth-nft-bridge

Conversation

@sam-goldman-zz
Copy link
Copy Markdown

Description
An ERC721 bridge between Mainnet and Optimism. The issue describing the bridge can be found here.

After the PR has been reviewed, the address of the L2ERC721Bridge needs to be updated from its placeholder address (0xA77...) here and here. Once this is done, the PR will be ready to merge.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2022

🦋 Changeset detected

Latest commit: e307559

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@eth-optimism/contracts Minor
@eth-optimism/data-transport-layer Patch
@eth-optimism/sdk Patch
@eth-optimism/message-relayer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added 2-reviewers C-protocol-critical Category: Modifies protocol-critical code labels May 18, 2022
@mergify mergify Bot requested review from Inphi, cfromknecht and tynes May 18, 2022 00:19
@sam-goldman-zz
Copy link
Copy Markdown
Author

@tynes It's all ready for review!

@mergify mergify Bot removed the request for review from cfromknecht May 23, 2022 02:08
event StandardL2ERC721Created(address indexed _l1Token, address indexed _l2Token);

// Address of the L2 ERC721 Bridge. It currently exists only on Optimistic Kovan.
address public constant L2_ERC721_BRIDGE = 0xA779A0cA89556A9dffD47527F0aad1c2e0d66e46;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be turned into a constructor argument


// Maps an L2 ERC721 token address to a boolean that returns true if the token was created
// with the L2StandardERC721Factory.
mapping(address => bool) public isStandardERC721;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this mapping for exactly? Because developers can deploy custom L2 ERC721s that implement the correct interface and not be included in this mapping. Is is supposed to signify a "token list"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose is just to give frontends an easy way to determine if an L2 ERC721 is a Standard ERC721. In other words, it gives frontends an easy way to tell users, "this L2 ERC721 contract doesn't implement any custom (i.e. potentially dangerous) functionality". The mapping isn't supposed to signify a token list, since that can include custom ERC721s too.


// Maps an L1 ERC721 token address to an L2 Standard ERC721 token address. This mapping can
// only be updated once per L1 ERC721 token.
mapping(address => address) public standardERC721Mapping;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above - I feel like an offchain tokenlist is better for this because using this factory is permissionless so its not the best indicator of legitimacy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this mapping isn't actually to maintain an on-chain token list. The mapping is there to ensure that there's one, and only one, L2 Standard ERC721 contract for each L1 ERC721 contract (which is enforced here). Since these standard contracts implement the exact same functionality, there's no need to have more than one for each L1 contract. Also, this mapping makes it easy for frontends to find out which L2 Standard ERC721 corresponds to an L1 ERC721, which makes it easy to know which L2 contract to bridge to.

Comment thread packages/contracts/contracts/standards/IL2StandardERC721.sol
Comment thread packages/contracts/contracts/standards/L2StandardERC721.sol
Comment thread .changeset/big-hotels-swim.md
@maurelian
Copy link
Copy Markdown
Contributor

Replaced by #2662

@maurelian maurelian closed this Jun 6, 2022
Copy link
Copy Markdown

@guoshijiang guoshijiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sdk test erc721 bridge code also need write

theochap pushed a commit that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-protocol-critical Category: Modifies protocol-critical code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants