Open nataouze opened 2 years ago
did you try specifying contract: "<path>:<contractName>"
?
It doesn't look like it will help much for my use-case, because the internal structure of the external libraries artifacts is the same:
I have these dependencies:
node_modules/projectA/artifacts/contracts/Contract.sol/
node_modules/projectB/artifacts/contracts/Contract.sol/
To use fully-qualified names, I need to have an external
config similar to this:
external: {
contracts: [
{artifacts: 'node_modules/projectA/artifacts'},
{artifacts: 'node_modules/projectB/artifacts'},
],
}
In the end, I have the same issue when deploying, still not specifying which folder to read the artifact from:
await deploy("Contract", {contract: "contracts/Contract.sol:Contract"});
What I am proposing works as follows:
await deploy("Contract", {contract: "Contract", importPath: "node_modules/projectA/artifacts"});
The solution should be to use Full Qualified Name.
await deploy('src/projectA/Contract.sol:ContractName');
or better yet with identifier
await deploy('ContractA, { contract: 'src/projectA/Contract.sol:ContractName'});
Is your feature request related to a problem? Please describe. When a project depends on artifacts from external libraries and several artifacts have the same name, calling
deploy
with a contract name does not allow selecting which artifact to load.Describe the solution you'd like An optional
importPath
field inDeployOptionsBase
which allows to retrieve the artifact by its name from a specific folder.Describe alternatives you've considered As a workaround, one can do: