Add meta transactions support for bridged ERC721 and ERC1155 tokens #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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).
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.