Skip to content

Commit

Permalink
fix local deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-vieilleribiere committed Apr 5, 2024
1 parent a44750b commit 4b526e4
Showing 1 changed file with 17 additions and 34 deletions.
51 changes: 17 additions & 34 deletions backend/scripts/deploy.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
const hre = require("hardhat");
const ethers = require("ethers");
// const fs = require("fs");
const { ethers } = require("hardhat");

async function main() {
// const { chainId } = await ethers.provider.getNetwork();
const [deployer] = await ethers.getSigners();

const Admins = await hre.ethers.getContractFactory("Admins");
const admins = await Admins.deploy();
await admins.deployed();
console.log(`Admins deployed to ${admins.address}`);
console.log("Deploying contracts with the account:", deployer.address);

const data1 = {
address: admins.address,
abi: JSON.parse(admins.interface.format("json")),
};
// fs.writeFileSync('./../front/public/contracts/solarNft.json', JSON.stringify(data1))
// fs.writeFileSync(`./../front/public/contracts/${chainId}/solarNft.json`, JSON.stringify(data1))
}

main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
const Admins = await ethers.getContractFactory("Admins");
const admins = await Admins.deploy(deployer.address);

// async function main() {
// const [deployer] = await ethers.getSigners();
console.log("Admins deployed to:", admins.target);

// console.log("Deploying contracts with the account:", deployer.address);
// ALBUMS DEPLOYMENT

// const Admins = await hre.ethers.getContractFactory("Admins");
// const admins = await Admins.deploy();
// // await admins.deployed();
// console.log(`Admins deployed to ${admins.address}`);
// }
const Albums = await ethers.getContractFactory("Albums");
const albums = await Albums.deploy();

// main()
// .then(() => process.exit(0))
// .catch((error) => {
// console.error(error);
// process.exit(1);
// });
console.log("Albums deployed to:", albums.target);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit 4b526e4

Please sign in to comment.