-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5db62c3
commit 4fccce0
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const {BigNumber} = require('ethers') | ||
const hre = require('hardhat') | ||
|
||
const uris = require('../metadata/uris') | ||
const contractURI = 'https://ipfs.io/ipfs/' + uris.collection.json | ||
|
||
async function deploy() { | ||
const Violet = await hre.ethers.getContractFactory('Violet') | ||
const violet = await Violet.deploy( | ||
contractURI, | ||
process.env.MAINNET_WITHDRAWAL_1, | ||
process.env.MAINNET_WITHDRAWAL_2, | ||
{gasPrice: BigNumber.from(process.env.MAINNET_GAS_PRICE)} | ||
) | ||
|
||
const tx = violet.deployTransaction | ||
console.log('Deployment tx:', tx.hash) | ||
|
||
await violet.deployed() | ||
;[deployer, ...addrs] = await ethers.getSigners() | ||
|
||
console.log('Violet deployed to:', violet.address) | ||
console.log('Deployed by:', deployer.address) | ||
} | ||
|
||
const tryToDeploy = async () => { | ||
// Repeat deploy() until gasPrice < block base fee | ||
deploy().catch((error) => { | ||
console.error(error) | ||
tryToDeploy() | ||
}) | ||
} | ||
|
||
tryToDeploy() |