Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta transactions support for bridged ERC721 and ERC1155 tokens #42

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

k1rill-fedoseev
Copy link
Member

Closes #4
Closes #5
Closes #41

This PR adds a possibility of bridging NFTs without paying for gas explicitly. This feature is a combination of 2 separate approaches:

  • Calling ERC721.transferFrom/ERC721.safeTransferFrom/ERC721.setApprovalForAll/ERC1155.safeTransferFrom/ERC1155.safeBatchTransferFrom/ERC1155. setApprovalForAll through GSN.
    GSN is a generic way of working with ETHless transactions, so it is advised to use this approach in any non-trivial scenarios (e.g. paying for gas via third-party ERC20/ERC1155 tokens).
  • Native meta transactions, similar to permit functionality in DAI/STAKE tokens. The following functions are being added to the bridged tokens implementations contracts:
    • ERC721.metaSafeTransferFrom
    • ERC721.metaSetApprovalForAll
    • ERC1155.metaSafeTransferFrom
    • ERC1155.metaSafeBatchTransferFrom
    • ERC1155.metaSetApprovalForAll

Native meta-transaction functions accept a set of arguments for their non-meta analogue + nonce and signature parameters used for sender verification. Since safeTransferFrom and safeBatchTransferFrom functions include a callback to the tokens receiver contract in both ERC standards, no further changes in the mediator contracts are necessary to use them together with NFT OB mediators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant