This is the LSP3Account
contract: https://github.com/lukso-network/standards-implementations/blob/master/contracts/Accounts/LSP3Account.sol
I want to create a contract on Remix that inherits from it. I tried this:
pragma solidity ^0.6.0;
import "https://github.com/lukso-network/standards-implementations/blob/master/contracts/Accounts/LSP3Account.sol";
contract MyProfile is LSP3Account(msg.sender) {
}
But this results in: not found @openzeppelin/contracts/introspection/ERC165.sol
So I copied and pasted the entire LSP3Account.sol
contract in Remix, to try to fix the imports manually.
I figured once these imports were fixed, I would finally be able to inherit from the LSP3Account
contract.
However, when I fixed the ERC165.sol
import, another import error showed up (UniversalReceiverDelegate.sol
).
Once I fixed that, another import error showed up (UniversalReceiver.sol
). I fixed that too.
But my imports started getting out of hand. Here's the top of my file. I used OLD
and NEW
to mark the fixed imports:
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
// interfaces
//import "../_LSPs/ILSP1_UniversalReceiver.sol"; OLD 3
import "https://github.com/lukso-network/standards-implementations/blob/master/contracts/_LSPs/ILSP1_UniversalReceiver.sol"; // NEW 3
//import "../_LSPs/ILSP1_UniversalReceiverDelegate.sol"; OLD 2
import "https://github.com/lukso-network/standards-implementations/blob/master/contracts/_LSPs/ILSP1_UniversalReceiverDelegate.sol"; // NEW 2
// modules
import "erc725/contracts/ERC725/ERC725Account.sol";
//import "@openzeppelin/contracts/introspection/ERC165.sol"; OLD 1
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/docs-v3.x/contracts/introspection/ERC165.sol"; // NEW 1
contract LSP3Account is ERC165, ERC725Account, ILSP1 {
But guess what, now I get the error: not found @openzeppelin/contracts/cryptography/ECDSA.sol
This new import error isn't even from the LSP3Account
contract. It's from one of the contracts it inherits from.
The only solution I see, would be to copy and paste the entire inheritance tree, and fix the imports from the bottom-up. But this seems ridiculously complicated.
I also know I can clone the project locally, run npm install
, and all the dependencies will be installed. But:
- I ran into problems because the dependencies have different compiler versions.
- It's much easier to deploy from Remix, rather than deploy from local files.
So a couple of questions:
1. Can I cancel imports from contracts my contract is inheriting from?
2. More importantly, isn't there a way to simplify these inheritance and import problems on the Remix IDE?