-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.ts
More file actions
91 lines (59 loc) · 2.77 KB
/
deploy.ts
File metadata and controls
91 lines (59 loc) · 2.77 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through `node <script>`.
//
// When running the script with `npx hardhat run <script>` you'll find the Hardhat
// Runtime Environment's members available in the global scope.
import { ethers, run } from 'hardhat';
async function main() {
// Hardhat always runs the compile task when running scripts with its command
// line interface.
//
// If this script is run directly using `node` you may want to call compile
// manually to make sure everything is compiled
// await hre.run('compile');
// We get the contract to deploy
const APIIdeaNFT = await ethers.getContractFactory("APIIdeaNFT");
const aPIIdeaNFT = await APIIdeaNFT.deploy();
await aPIIdeaNFT.deployed();
console.log("APIIdeaNFT deployed to:", aPIIdeaNFT.address);
const [_, addr1] = await ethers.getSigners()
const shares = [50]
const owner = _.address
//console.log(_.address)
const ApiToken = await ethers.getContractFactory("ApiToken");
const apiToken = await ApiToken.deploy([owner], shares);
await apiToken.deployed();
console.log("apitoken deployed to:", apiToken.address);
const GovernerCore = await ethers.getContractFactory("GovernerCore");
const governerCore = await GovernerCore.deploy();
await governerCore.deployed();
console.log("GovernerCore deployed to:", governerCore.address);
const PanacloudController = await ethers.getContractFactory("PanacloudController");
const panacloudController = await PanacloudController.deploy();
await panacloudController.deployed();
console.log("PanacloudController deployed to:", panacloudController.address);
const PanaCoin = await ethers.getContractFactory("PanaCoin");
const panaCoin = await PanaCoin.deploy();
await panaCoin.deployed();
console.log("PanaCoin deployed to:", panaCoin.address);
const PanaFactory = await ethers.getContractFactory("PanaFactory");
const panaFactory = await PanaFactory.deploy();
await panaFactory.deployed();
console.log("PanaFactory deployed to:", panaFactory.address);
const PlatformGoverner = await ethers.getContractFactory("PlatformGoverner");
const platformGoverner = await PlatformGoverner.deploy();
await platformGoverner.deployed();
console.log("PlatformGoverner deployed to:", platformGoverner.address);
const Timelock = await ethers.getContractFactory("Timelock");
const timelock = await Timelock.deploy(_.address, 10);
await timelock.deployed();
console.log("Timelock deployed to:", timelock.address);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});