I am hoping someone can help with this. I have been trying to learn smart contracts on Tron with Solidity and tronbox, but I am running into issues when trying to create an ERC721 token.
I have created very simple ERC20.sol contracts using the openzeppelin docs, but get an error for the ERC721 contract found in the openzeppelin docs.
https://docs.openzeppelin.com/contracts/4.x/erc721
TypeError: Member "isContract" not unique after argument-dependent lookup in address.
--> @openzeppelin/contracts/token/ERC721/ERC721.sol:375:13:
|
375 | if (to.isContract()) {
| ^^^^^^^^^^^^^
Compilation failed. See above.
I initially thought it might be because of the Solidity version, but I have changed solidity and installed the appropriate openzeppelin version several times and the same error is present for other versions of openzeppelin.
Current setup:
Ubuntu 20.04
tronbox version
Tronbox v2.7.23
Solidity v0.8.0 (tron-solc)
@openzeppelin/contracts 4.2.0
tronbox$ tail -n7 tronbox.js
compilers: {
solc: {
version: '0.8.0'
}
}
}
}
Full output:
tronbox$ tronbox compile --network development
Compiling ./contracts/GameItem.sol...
Compiling ./contracts/Migrations.sol...
Compiling @openzeppelin/contracts/token/ERC721/ERC721.sol...
Compiling @openzeppelin/contracts/token/ERC721/IERC721.sol...
Compiling @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol...
Compiling @openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol...
Compiling @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol...
Compiling @openzeppelin/contracts/utils/Address.sol...
Compiling @openzeppelin/contracts/utils/Context.sol...
Compiling @openzeppelin/contracts/utils/Counters.sol...
Compiling @openzeppelin/contracts/utils/Strings.sol...
Compiling @openzeppelin/contracts/utils/introspection/ERC165.sol...
Compiling @openzeppelin/contracts/utils/introspection/IERC165.sol...
TypeError: Member "isContract" not unique after argument-dependent lookup in address.
--> @openzeppelin/contracts/token/ERC721/ERC721.sol:375:13:
|
375 | if (to.isContract()) {
| ^^^^^^^^^^^^^
Compilation failed. See above.