[英]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. 我正在尝试与ERC-721令牌系统签订合同。 I have experience with ERC-20, so I thought I can find a tutorial and follow the tutorial.
我具有ERC-20的经验,因此我认为可以找到一个教程并按照该教程进行操作。 However, tutorials I found are based on solidity version between 4.0~4.2.
但是,我发现的教程基于4.0〜4.2之间的solidity版本。 Nowadays we use 5.0~6.0.
如今我们使用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. 我试图修复该代码,并使其适用于5.0或更高版本,但失败了。 Therefore I tried to downgrade solidity and use docker but still get
因此,我尝试降级稳定性并使用docker,但仍然得到
Error: CompileError: ParsedContract.sol:3:1: ParserError: Source "zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol" not found: Unknown exception in read callback.
错误:CompileError:ParsedContract.sol:3:1:ParserError:未找到源“ zeppelin-solidity / contracts / token / ERC721 / ERC721Token.sol”:读回调中的未知异常。 import 'zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol';
导入'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. +我找到了https://github.com/OpenZeppelin/openzeppelin-solidity ,但是我不知道如何编写测试。 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. 由于重命名,因此
ERC721Token.sol
在最新版本的OpenZeppelin v2.3.0中不再可用。 change ERC721Token.sol
to ERC721.sol
, and it should work. 将
ERC721Token.sol
更改为ERC721.sol
,它应该可以工作。
I suggest you have a look at the OpenZeppelin documentation: https://docs.openzeppelin.org/v2.3.0/tokens#erc721 我建议您看一下OpenZeppelin文档: https ://docs.openzeppelin.org/v2.3.0/tokens#erc721
If you have more questions about OpenZeppelin you can always ask in the community forum 如果您对OpenZeppelin有更多疑问,可以随时在社区论坛中提问
I can put together a sample contract in the community forum if you need. 如果需要,我可以在社区论坛中整理一份合同样本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.