-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy_all.ts
32 lines (27 loc) · 1.34 KB
/
deploy_all.ts
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
import { deployFireComponentContracts } from "./deploy_fire_components";
import { deployFlightDelayComponentContracts } from "./deploy_flightdelay_components";
import { deployGifContracts } from "./deploy_gif";
import { createFireBundleAndPolicy } from "./deploy_gif_and_fire_and_create_policy";
import { getNamedAccounts } from "./libs/accounts";
import { loadVerificationQueueState } from "./libs/verification_queue";
import { logger } from "./logger";
/**
* - Deploys all contracts for gif
* - Deploys all contracts for fire
* - Creates a fire bundle and policy
* - Deploys all contracts for flight delay
*/
async function main() {
const { protocolOwner, masterInstanceOwner, instanceOwner, productOwner: fireOwner, investor, customer } = await getNamedAccounts();
loadVerificationQueueState();
const {services, libraries } = await deployGifContracts(protocolOwner, instanceOwner);
const { fireUsd, fireProduct, firePool } = await deployFireComponentContracts(libraries, services, fireOwner, protocolOwner);
await createFireBundleAndPolicy(fireOwner, investor, customer, fireUsd, fireProduct, firePool);
await deployFlightDelayComponentContracts(libraries, services, fireOwner, protocolOwner);
}
if (require.main === module) {
main().catch((error) => {
logger.error(error.stack);
process.exitCode = 1;
});
}