-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployL1.js
36 lines (30 loc) · 1.25 KB
/
deployL1.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
// 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.
const hre = require('hardhat')
require('dotenv').config()
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')
const l2ContractAddress = process.env.L2_CONTRACT
const l1BridgeAddress = '0xe87d317eb8dcc9afe24d9f63d6c760e52bc18a40'
// We get the contract to deploy
const L1Contract = await hre.ethers.getContractFactory('L1Contract')
const l1Contract = await L1Contract.deploy(l2ContractAddress, l1BridgeAddress)
await l1Contract.deployed()
console.log('L1Contract deployed to:', l1Contract.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)
})