MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / deploy

Function deploy

contracts/scripts/deploy-gateway.template.ts:16–145  ·  view source on GitHub ↗
(libs: { [key in string]: string })

Source from the content-addressed store, hash-verified

14 return commitSha
15}
16export async function deploy(libs: { [key in string]: string }) {
17 if (!libs || Object.keys(libs).length === 0)
18 throw new Error(`Libraries are missing`)
19
20 // choose chain ID according to the network in
21 // environmental variable
22 let chainId = 31415926
23 if (process.env.NETWORK == 'calibrationnet') {
24 chainId = 314159
25 } else if (process.env.NETWORK == 'mainnet') {
26 chainId = 314
27 } else if (process.env.NETWORK == 'auto') {
28 chainId = parseInt(process.env.CHAIN_ID!, 16)
29 }
30
31 await hre.run('compile')
32
33 const [deployer] = await ethers.getSigners()
34 const balance = await ethers.provider.getBalance(deployer.address)
35 console.log(
36 'Deploying gateway with the account:',
37 deployer.address,
38 ' balance:',
39 ethers.utils.formatEther(balance),
40 )
41
42 const txArgs = await getTransactionFees()
43
44 const facetCuts = []
45
46 type Libraries = {
47 [libraryName: string]: string
48 }
49
50 const getterFacetLibs: Libraries = {
51 SubnetIDHelper: libs['SubnetIDHelper'],
52 LibQuorum: libs['LibQuorum'],
53 }
54
55 const managerFacetLibs: Libraries = {
56 CrossMsgHelper: libs['CrossMsgHelper'],
57 SubnetIDHelper: libs['SubnetIDHelper'],
58 }
59 const messengerFacetLibs: Libraries = {
60 SubnetIDHelper: libs['SubnetIDHelper'],
61 CrossMsgHelper: libs['CrossMsgHelper'],
62 }
63
64 const checkpointingFacetLibs: Libraries = {
65 AccountHelper: libs['AccountHelper'],
66 SubnetIDHelper: libs['SubnetIDHelper'],
67 CrossMsgHelper: libs['CrossMsgHelper'],
68 }
69
70 const xnetMessagingFacetLibs: Libraries = {
71 AccountHelper: libs['AccountHelper'],
72 CrossMsgHelper: libs['CrossMsgHelper'],
73 SubnetIDHelper: libs['SubnetIDHelper'],

Callers

nothing calls this directly

Calls 6

getTransactionFeesFunction · 0.90
getSelectorsFunction · 0.85
getGitCommitShaFunction · 0.85
logMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected