简体   繁体   中英

I need help to build ERC-721 contract with solidity version 5.0 or higher

I am trying to write a contract with ERC-721 token system. I have experience with ERC-20, so I thought I can find a tutorial and follow the tutorial. However, tutorials I found are based on solidity version between 4.0~4.2. Nowadays we use 5.0~6.0. Therefore tutorial codes are not working. Is there any tutorial, or code can I look and learn? HELP!

I tried to fix the code, and make suitable for 5.0 or higher, but I failed. Therefore I tried to downgrade solidity and use docker but still get

Error: CompileError: ParsedContract.sol:3:1: ParserError: Source "zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol" not found: Unknown exception in read callback. import 'zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol'; this error. :(

+ I found https://github.com/OpenZeppelin/openzeppelin-solidity , this but I do not know how to write test. Thank you for your time to read this !.

due to renaming, ERC721Token.sol is no longer available in the latest version of OpenZeppelin v2.3.0. change ERC721Token.sol to ERC721.sol , and it should work.

I suggest you have a look at the OpenZeppelin documentation: https://docs.openzeppelin.org/v2.3.0/tokens#erc721

If you have more questions about OpenZeppelin you can always ask in the community forum

I can put together a sample contract in the community forum if you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM