关于第34讲ERC721合约的示例代码,疑似 ERC721 合约继承 IERC721Metadata 接口,但未实现接口定义的所有函数,实测又能成功编译。 #788
-
https://github.com/AmazingAng/WTF-Solidity/blob/main/34_ERC721/ERC721.sol 中 ERC721 继承了 IERC721Metadata 接口,但 ERC721 合约中并没有实现 IERC721Metadata 接口定义的全部函数(name、symbol、tokenURI),只实现了 tokenURI 函数,为什么在remix实测编译不会报错呢?不是说继承接口的非抽象合约必须实现接口定义的所有功能吗? |
Beta Was this translation helpful? Give feedback.
Answered by
andOneBasketball
Sep 26, 2024
Replies: 1 comment
-
了解到 string public override name 的定义会自动生成 getter 函数,所以无需显式的编写 function name 函数 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
andOneBasketball
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
了解到 string public override name 的定义会自动生成 getter 函数,所以无需显式的编写 function name 函数