What must I use instead of the speedy nodes for the moralis DAO?

Okay thanks i did that and get this

Okay so replaced this :


With this…
Screenshot 2022-08-17 at 23.40.47

and get this :

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
Screenshot 2022-08-18 at 00.24.14

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();