Environment
localhost
Truffle 5.1.9
Node 11.12
solc 0.5.5
@openzeppelin/contracts 2.4.0
@openzeppelin/network 0.4.2
Details
My contract inherits from ownable, pausable, ERC721Full, ERC20 and recently GSNRecipient. I don’t use the initializable pattern so all my constructors are still constructors. I started getting this compilation error after adding GSNRecipient:
/MyContract.sol:6:1: DeclarationError: Identifier already declared.
import “…/node_modules/@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol”;
^-----------------------------------------------------------------------------------------------^
/C/Workspace/my-dapp/node_modules/@openzeppelin/contracts/GSN/Context.sol:13:1: The previous declaration is here:
contract Context {
^ (Relevant source part starts here and spans across multiple lines).
I understand that this is happening because Context is being declared in many of the contracts my contract is inheriting from but I am unsure about how to fix this. Do I keep a copy of all these contracts and remove Context inheritance from all so that only one remains?