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

safe_mint and safe_transfer should require _invokeNFTReceiver to return true #8

Closed
marc0olo opened this issue Aug 31, 2021 · 6 comments

Comments

@marc0olo
Copy link

I guess you would want this entrypoint to throw and error and fail if the recipient / receiver doesn't implement this interface or returns false.

see:

@marc0olo
Copy link
Author

basically I mean the require is missing somewhere here. either in this method or where the method is invoked, e.g.:

@arjanvaneersel
Copy link
Contributor

What I tried to say on Discord is that ERC-721 doesn't throw in case the receiver doesn't implement the method. So therefore I use the bool to indicate whether the call was successful or not. However what I do notice is that with the changes today I removed prolongating the bool result up. So instead of require and throw, it should at least return the bool, so that the developer of a contract can decide whether to throw or not.

@marc0olo
Copy link
Author

let me rephrase the issue to be more clear. IMO an entrypoint called safe_mint or safe_transfer should require that check to be true. do you agree? this is what I tried to explain

@marc0olo marc0olo changed the title _invokeNFTReceiver should throw error instead of returning false safe_mint and safe_transfer should require _invokeNFTReceiver to return true Aug 31, 2021
@arjanvaneersel
Copy link
Contributor

I agree with you, but it would mean that we break ERC-721 compatibility.

@marc0olo
Copy link
Author

I agree with you, but it would mean that we break ERC-721 compatibility.

can you elaborate on that one? I don't understand 😅 let's get first the discussion about the interface getting started in the AEX proposal and then digging deeper into implementation details

@arjanvaneersel
Copy link
Contributor

You are right. It should throw if the call fails. I included this in the AEX proposal

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

No branches or pull requests

2 participants