update env example

This commit is contained in:
Alexey 2021-11-04 20:16:36 +03:00
parent cfc55931d6
commit bf28f0d633
No known key found for this signature in database
GPG Key ID: C77958099D784E76
3 changed files with 14 additions and 6 deletions

View File

@ -21,4 +21,5 @@ L2_RPC_URL=https://rpc.xdaichain.com/
L1_EXPLORER=https://etherscan.io/
L2_EXPLORER=
GAS_PRICE_IN_WEI=123000000000
L1_GAS_PRICE_IN_WEI=150000000000
L2_GAS_PRICE_IN_WEI=20000000000

View File

@ -3,7 +3,14 @@ const ethers = require('ethers')
const actions = require('../actions.json')
const abi = require('../abi/deployer.abi.json')
const { L1_EXPLORER, L2_EXPLORER, L1_RPC_URL, L2_RPC_URL, GAS_PRICE_IN_WEI } = process.env
const {
L1_EXPLORER,
L2_EXPLORER,
L1_RPC_URL,
L2_RPC_URL,
L1_GAS_PRICE_IN_WEI,
L2_GAS_PRICE_IN_WEI,
} = process.env
async function execute(isL1) {
const RPC_URL = isL1 ? L1_RPC_URL : L2_RPC_URL
@ -48,8 +55,8 @@ async function execute(isL1) {
}
console.log(`Deploying ${action.contract} to ${action.domain} (${action.expectedAddress})`)
const tx = await deployer.deploy(action.bytecode, actions.salt, {
gasLimit: 5e6,
gasPrice: GAS_PRICE_IN_WEI,
gasLimit: 4e6,
gasPrice: isL1 ? L1_GAS_PRICE_IN_WEI : L2_GAS_PRICE_IN_WEI,
})
console.log(`TX hash ${explorer}/tx/${tx.hash}`)
try {
@ -64,7 +71,7 @@ async function execute(isL1) {
// console.log(trace)
const tx2 = await wallet.sendTransaction({
gasLimit: 5e6,
gasPrice: GAS_PRICE_IN_WEI,
gasPrice: isL1 ? L1_GAS_PRICE_IN_WEI : L2_GAS_PRICE_IN_WEI,
data: action.bytecode,
})
console.log(`TX hash ${explorer}/tx/${tx2.hash}`)

@ -1 +1 @@
Subproject commit 9cf7dc384d1970d34f6fe63e7e8ad189710ec3c4
Subproject commit 2a6fca70fae35267f924c5288a2aad1bfb34199a