I am trying to use the openzeppelin ReentrancyGuard contract within my ERC721 Token smart contract. Since this ReentrancyGuard contract has a constructor, from my understanding I am required to declare it in my contract. However, since I am already declaring the constructor for my ERC721 Token, I am receiving an error, stating “More than one constructor defined” if I try to declare them separately.
contract MyContract is ERC721, ReentrancyGuard {
constructor() ERC721("MyToken", "TOK") public {
}
constructor () ReentrancyGuard() internal {
}
}
Another solution would be to declare them together at once, as below:
constructor() ERC721("MyToken", "TOK") ReentrancyGuard() public {
}
However, in theory MyContract should be public, while the ReentrancyGuard one should be Internal. If I declare them both as above, both will be public. Is this an issue? Is there a better solution?
Thank you. J