File size: 1,497 Bytes
73ba4f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
const { ethers, network } = require("hardhat");

async function main() {
  console.log("==================================================================");
  console.log("Deploying ConsortiumIncentiveSettlement Smart Contract...");
  console.log(`Target Network: ${network.name}`);
  console.log("==================================================================");

  const [deployer] = await ethers.getSigners();
  console.log(`Deploying with account address: ${deployer.address}`);

  const balanceWei = await ethers.provider.getBalance(deployer.address);
  console.log(`Deployer balance: ${ethers.formatEther(balanceWei)} ETH`);

  const SETTLEMENT_CURRENCY = process.env.SETTLEMENT_CURRENCY || "e-TRY";

  const Factory = await ethers.getContractFactory("ConsortiumIncentiveSettlement");
  const contract = await Factory.deploy(SETTLEMENT_CURRENCY);

  await contract.waitForDeployment();
  const address = await contract.getAddress();

  console.log("\n------------------------------------------------------------------");
  console.log(`✅ ConsortiumIncentiveSettlement deployed successfully!`);
  console.log(`Contract Address:   ${address}`);
  console.log(`FL Coordinator:     ${await contract.coordinator()}`);
  console.log(`Currency Symbol:    ${await contract.settlementCurrency()}`);
  console.log("------------------------------------------------------------------\n");
}

main().catch((error) => {
  console.error("❌ Deployment failed:", error);
  process.exitCode = 1;
});