As title specified, I would to know if can you deploy contracts organized in folders. In HardhatConfig you can specify only root folder but no others. My Hardhat.paths folder is "contracts" and it is so composed:
contracts | folder1 | Contract1.sol ... etc
I tried to deploy Contract1.sol but it returned Error: cannot find artifact "folder1/Contract1.sol"
hardhat.config.js
...
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts"
},
...
01_deploy.js
module.exports = async ({
getNamedAccounts,
deployments,
}) => {
const contractName = "folder1/Contract1";
var networkId = network.name
const {deploy} = deployments;
const {deployer} = await getNamedAccounts()
const contract = await deploy(contractName, {
from: deployer,
gasLimit: 4000000,
log: true
});
};