deploy.js 1.64 KB
Newer Older
John Doe's avatar
John Doe committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
async function main() {
  const [deployer] = await ethers.getSigners();
  
  console.log("Deploying contracts with the account:", deployer.address);

  console.log("Account balance:", (await deployer.getBalance()).toString());

  const PriceConsumer = await ethers.getContractFactory("PriceConsumer");
  const priceConsumer = await PriceConsumer.deploy();

  await priceConsumer.deployed()

  const CommitmentCircuit = await ethers.getContractFactory("CommitmentCircuit");
  const commitmentCircuit = await CommitmentCircuit.deploy(
    "0x97c35747AbE05EFD38A1Fc081a42600fdfB1e2F1", // xft token address
    priceConsumer.address  // price consumer address
  );

  await commitmentCircuit.deployed()

  console.log("Price consumer address:", priceConsumer.address);
  console.log("Commitment circuit address:", commitmentCircuit.address);
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
// const hre = require("hardhat");
// async function main() {
//     const [deployer] = await hre.ethers.getSigners();
  
//     console.log("Deploying contracts with the account:", deployer.address);
  
//     // console.log("Account balance:", (await deployer.getBalance()).toString());
//     // await hre.run('compile');
  
//     const PedersenCommitment = await ethers.getContractFactory("PedersenCommitment");
//     const pedersenCommitment = await PedersenCommitment.deploy();
  
//     console.log("PedersenCommitment address:", pedersenCommitment.address);
//   }
  
//   main()
//     .then(() => process.exit(0))
//     .catch((error) => {
//       console.error(error);
//       process.exit(1);
//     });