File size: 953 Bytes
ddcff90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
const hre = require("hardhat");

async function main() {
  const [deployer] = await hre.ethers.getSigners();
  const creator = process.env.YOUR_WALLET || deployer.address;

  const Trigger = await hre.ethers.getContractFactory("Trigger");
  const trigger = await Trigger.deploy(creator);
  await trigger.waitForDeployment();
  console.log("Trigger:", await trigger.getAddress());

  const Treasury = await hre.ethers.getContractFactory("Treasury");
  const treasury = await Treasury.deploy(await trigger.getAddress());
  await treasury.waitForDeployment();
  console.log("Treasury (DAO):", await treasury.getAddress());

  const Splitter = await hre.ethers.getContractFactory("RevenueSplitter");
  const splitter = await Splitter.deploy(await treasury.getAddress(), creator);
  await splitter.waitForDeployment();
  console.log("Splitter (10% to you):", await splitter.getAddress());

  // Update env: DAO_TREASURY=...
}

main();