Comments (2)
Depends on the exact token implementation. This very specific implementation of the ERC721 is very basic and has security holes like the one you found.
You could approve a token to yourself, sell it to some else, and then use the approve functionality to claim the ownership back to you.
Check this reference implementation for an actual full fledged implementation of the ERC721 standard https://github.com/0xcert/ethereum-erc721/blob/master/src/contracts/tokens/nf-token.sol
from cryptozombie-lessons.
On the implementation I mentioned, the approval field is cleared when the token is transfered, preventing the situation you expose on your question.
function _transfer(address _to, uint256 _tokenId) internal {
address from = idToOwner[_tokenId];
_clearApproval(_tokenId); // <<<< Here <<<<
_removeNFToken(from, _tokenId);
_addNFToken(_to, _tokenId);
emit Transfer(from, _to, _tokenId);
}
from cryptozombie-lessons.
Related Issues (20)
- lesson 17 cant go next chapter HOT 1
- Lesson 3, Chapter 9: Might be nice to have the reminder of code checker limitations again HOT 2
- Unable to view Zombie Army.. browser is not rendering it?
- Lesson 5 chapter 1 code why must `pragma` replace `//Start here` comment on the first line?
- Lesson 5 chapter 8 is wrong?
- Login does not work anymore HOT 11
- I selected Japanese in the language settings, but some notations are displayed in Korean. HOT 1
- Connot register, there is something error. HOT 1
- Lesson 1 - Chapter 13 : Error in sample js implementation HOT 3
- Can't switch to th next chapter. HOT 2
- wrong pragma for lesson 1, chapter 11. HOT 1
- Unable to login HOT 1
- Can I reset my lessons progress? HOT 2
- Register is not working / Not able to register
- lesson 19 chapter 8, wrong Solution?
- Not moving to next chapter after completing previous chapter
- Outdated mention of consensus mechanism (proof of work)
- chapter 11
- Wrong typo for Lesson 16 chapter 9
- Wrong comment impact of Lesson 17 chapter 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryptozombie-lessons.