-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.js
51 lines (41 loc) · 1.79 KB
/
deploy.js
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
const {ethers} = require("hardhat");
async function main() {
// deployment of HSbT contract
const HSBTFactoryContractFactory = await ethers.getContractFactory("HatcherySBT");
const HSBTFactoryContract = await HSBTFactoryContractFactory.deploy();
await HSBTFactoryContract.deployed();
console.log("HatcheryDao contract deployed to:", HSBTFactoryContract.address);
// deployment of Core contract
const CoreContractFactory = await ethers.getContractFactory("Core");
const CoreContract = await CoreContractFactory.deploy(HSBTFactoryContract.address);
await CoreContract.deployed();
console.log("Core contract deployed to:", CoreContract.address);
//Deployment of DataExchange Contract
const DataExchangeContractFactory = await ethers.getContractFactory("Exchange");
const DataExchangeContract = await DataExchangeContractFactory.deploy(HSBTFactoryContract.address);
await DataExchangeContract.deployed();
console.log("DataExchange contract deployed to:", DataExchangeContract.address);
}
/*
Currently deployed using remix IDE:
Was getting error when running the command
--------------------------------------------------------
```npx hardhat run scripts/deploy.js --network hyperspace```
--------------------------------------------------------
with API of
--------------------------------------------------------
https://api.hyperspace.node.glif.io/rpc/v0
https://api.hyperspace.node.glif.io/rpc/v1
----------------------------------------------------------
(no issues when deploying on Mumbai testnet)
Error:
ProviderError: HttpProviderError
at HttpProvider.request
at LocalAccountsProvider.request
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at EthersProviderWrapper.send
*/
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});