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

User could send nft to sendToCosmos and lose it #192

Open
yihuang opened this issue Sep 15, 2021 · 1 comment
Open

User could send nft to sendToCosmos and lose it #192

yihuang opened this issue Sep 15, 2021 · 1 comment

Comments

@yihuang
Copy link
Contributor

yihuang commented Sep 15, 2021

crypto-org-chain/cronos#72

We find that user could call sendToCosmos with erc721 tokens, and the nft will end up bridged as a fungible token, with the same count as the token_id.
One possible solution is, erc721 actually have the onERC721Received to prevent user sending nft to unsupported contracts accidentally, but we are not using that because we are not calling the safeTransferFrom method on the token contract itself, but calling the one in SafeERC20 library.
So the proposal is in sendToCosmos we should call the safeTransferFrom on the token contract first, if it's not implemented we call the one in SafeERC20.

@yihuang
Copy link
Contributor Author

yihuang commented Sep 15, 2021

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

1 participant