question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ERC721_burn` transfers control of token to non(Account)

See original GitHub issue

The ERC721_burn function of the ERC721_base.cairo file attempts to clear approvals and delete the owner for a given tokenId. This attempt uses the pattern of setting the approval and owner address to be zero.

In the EVM this workflow fits in with its account model. But in this Startnet environment, functions can actually be invoked with caller the “zero” address when not routed through a contract such as Account.cairo.

This means that ERC721_burn actually makes the owner this “zero” address and now any user can seize control of this token by making calls not routed through such an Account.cairo contract.

I will push a PR promptly that should fix this issue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
martriaycommented, Jan 20, 2022

Just don’t find them ok???

1reaction
andrew-flemingcommented, Jan 20, 2022

If I understand this correctly, I believe we have a check for this. When transferFrom is called, it invokes _transfer which checks that the owner is not the zero address with ownerOf. See here. Thus, if you try to transfer a burned token (whose owner is 0 after the burn) as the zero address, the tx will still fail

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Build 'Burnable' and 'Pausable' ERC-721 tokens using ...
Below is the _burn function from ERC721.sol file. It removes the ownership and gives ownership to address(0) (No one has access to this...
Read more >
ERC 721 - OpenZeppelin Docs
Transfers a specific NFT ( tokenId ) from one account ( from ) to another ( to ). Requirements: - If the caller...
Read more >
erc 721 - ERC721 Token - Burn and mint again
An implementation which allows re-mint of a burned token will be considered a valid implementation of the ERC-721 standard.
Read more >
How To Burn an NFT. With an ERC721 Solidity contract
A non-fungible token (NFT) is a uniquely identifiable digital asset stored ... Then, the only address allowed to transfer or burn an NFT...
Read more >
How to build and use ERC-721 tokens in 2021
A non-fungible token (NFT) is a uniquely identifying token. ... all your tokens. Once you approve another address, it has full transfer control...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found