Skip to content

Instantly share code, notes, and snippets.

@Daltonic
Created July 18, 2023 11:12
Show Gist options
  • Save Daltonic/9dc34e335b4f280ea7b5d1b6a1a36696 to your computer and use it in GitHub Desktop.
Save Daltonic/9dc34e335b4f280ea7b5d1b6a1a36696 to your computer and use it in GitHub Desktop.
Dapp Breeds
const { ethers } = require("hardhat");
const fs = require("fs");
async function main() {
const contract_name = "DappBreed";
const name = "Dapp Breeds";
const symbol = "DAB";
const baseURI =
"https://ipfs.io/ipfs/QmTWbe9wDns7aqZQNCuWh5PqybGbBF91kngC5Zf8qmCoyg/";
const maxSupply = 99;
const Contract = await ethers.getContractFactory(contract_name);
const contract = await Contract.deploy(name, symbol, baseURI, maxSupply);
await contract.deployed();
const address = JSON.stringify({ address: contract.address }, null, 4);
fs.writeFile("./src/abis/contractAddress.json", address, "utf8", (err) => {
if (err) {
console.error(err);
return;
}
console.log("Deployed contract address", contract.address);
});
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment