Now i get this issueâŚAt least its it the right directory now i think
Have you installed that package?
npm install -D @nomiclabs/hardhat-waffle
There should have been instructions when you set up the hardhat project for which additional packages you needed to install if you donât have it.
Did that just as you posted thanks manâŚReally appreciate it
And onto the next errorđ
Error HH100: Network mumbai doesnât exist
Check your hardhat.config.js if youâre trying to deploy a network named mumbai
; does this network exist?
It should look something like:
module.exports = {
networks: {
mumbai: {
url: urlhere,
accounts: privatekeyhere,
},
},
solidity: '0.8.4',
};
I installed the solidity extension but had to downgrade the version becuase of problems it was casuingâŚnow its at v0.0.135âŚharhat only supports 0.4.11 and above but now it gives me these errorsâŚ
Hello?..Sorry Under pressure here
It says it compiles succesfully
Gald mateâŚI really need your help here ASAP
Glad*Sorry typoâŚ
Make sure that you have that âLockâ contract (same name) that youâre using in your deployDAO script. If you do, try recompiling your contract, it says it canât find the artifact files for it.
That error means youâre trying to use the Dao
variable before youâve declared/created it (with const Dao
). Check your deploy script.
Put it there before now same error
Youâre trying to use Dao.deploy()
, this should be named something else since youâre trying to declare another variable of the same name with const Dao
. Can you post your deploy script?
Sure
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through node <script>
.
//
// You can also run a script with npx hardhat run <script>
. If you do that, Hardhat
// will compile your contracts, add the Hardhat Runtime Environmentâs members to the
// global scope, and execute the script.
const hre = require(âhardhatâ);
async function main() {
const currentTimestampInSeconds = Math.round(Date.now() / 1000);
const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60;
const unlockTime = currentTimestampInSeconds + ONE_YEAR_IN_SECS;
const lockedAmount = hre.ethers.utils.parseEther(â1â);
const Dao = await Dao.deploy();
hre.ethers.getContractFactory(âDaoâ);
await lock.deployed();
console.log(
Lock with 1 ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}
);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
You can read this on how to post code.
There is no Dao
defined anywhere when you try to use Dao.deploy()
. Did you follow a guide or tutorial for this particular script?
You can look at this guide for how to set up contract instances in your scripts.
So something like:
const Dao = await hre.ethers.getContractFactory("Dao");
const dao = await Dao.deploy();