How to transfer ERC 721 Token to a Reach Smart Contract #1304
Unanswered
asolpshinning
asked this question in
Q&A
Replies: 2 comments 2 replies
-
We don't support that API form right now, because we have no types like |
Beta Was this translation helpful? Give feedback.
2 replies
-
Just FYI, So you can write an API with this signature to support receiving ERC721s: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote a contract in Reach to receive ERC 721, but I found out the transaction was being reverted. I researched the reason for it and discovered for any smart contract to receive ERC 721, it must implement this interface:
IERC721Receiver.onERC721Received, which is called upon a safe transfer.
Wondering if I need to, or how to write this interface in Reach as an API. If I write as an API, it says the function has to return the solidity selector, which I am not sure how to implement that in the Reach function/API...
This is how it looks in solidity:
/~https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721Receiver.sol
Is there an equivalent to the
selector
function in Reach ?Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions