-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add artist-staging DAExpSettlementV0 deploy script
- Loading branch information
Showing
1 changed file
with
115 additions
and
0 deletions.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
scripts/minter-deployments/1_reference_goerli-staging_minter-DAExpSettlement_deployer.ts
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,115 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
// Created By: Art Blocks Inc. | ||
|
||
import hre, { ethers } from "hardhat"; | ||
// explorations | ||
import { MinterDAExpSettlementV0__factory } from "../contracts/factories/MinterDAExpSettlementV0__factory"; | ||
|
||
// delay to avoid issues with reorgs and tx failures | ||
import { delay } from "../util/utils"; | ||
const EXTRA_DELAY_BETWEEN_TX = 5000; // ms | ||
|
||
/** | ||
* This script was created to deploy the MinterMerkleV3 contract to the Ethereum | ||
* Goerli testnet, for the Art Blocks dev environment. | ||
* It is intended to document the deployment process and provide a reference | ||
* for the steps required to deploy the MinterMerkleV3 contract. | ||
*/ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// CONFIG BEGINS HERE | ||
////////////////////////////////////////////////////////////////////////////// | ||
const genArt721V3Core_Flagship = "0xB614C578062a62714c927CD8193F0b8Bfb90055C"; | ||
const minterFilter_Flagship = "0x6eA558Bb1A3C5437970AdA80f8c686448A9c31fC"; | ||
////////////////////////////////////////////////////////////////////////////// | ||
// CONFIG ENDS HERE | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
async function main() { | ||
const [deployer] = await ethers.getSigners(); | ||
const network = await ethers.provider.getNetwork(); | ||
const networkName = network.name == "homestead" ? "mainnet" : network.name; | ||
if (networkName != "goerli") { | ||
throw new Error("This script is intended to be ran on mainnet only"); | ||
} | ||
////////////////////////////////////////////////////////////////////////////// | ||
// DEPLOYMENT BEGINS HERE | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
// Deploy Minter contract(s) | ||
const minterDAExpSettlement = new MinterDAExpSettlementV0__factory(deployer); | ||
// flagship | ||
const minterDAExpSettlementFlagship = await minterDAExpSettlement.deploy( | ||
genArt721V3Core_Flagship, | ||
minterFilter_Flagship | ||
); | ||
await minterDAExpSettlementFlagship.deployed(); | ||
const minterDAExpSettlementFlagshipAddress = | ||
minterDAExpSettlementFlagship.address; | ||
console.log( | ||
`MinterDAExpSettlementV0 (flagship) deployed at ${minterDAExpSettlementFlagshipAddress}` | ||
); | ||
await delay(EXTRA_DELAY_BETWEEN_TX); | ||
|
||
////////////////////////////////////////////////////////////////////////////// | ||
// DEPLOYMENT ENDS HERE | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
////////////////////////////////////////////////////////////////////////////// | ||
// SETUP BEGINS HERE | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
// WARNING - ONLY allowlist the minters on the minter filter here if a new minter type | ||
// is on the MinterType enum in the subgraph. | ||
// Otherwise, the subgraph will fail to progress. | ||
|
||
// for this specific deployment, we could allowlist the new minter on the minter filter, | ||
// but we will just wait until after subgraph is synced before allowlisting to be safe. | ||
|
||
try { | ||
console.log( | ||
"Verifying MinterDAExpV0 (flagship) contract deployment on Etherscan..." | ||
); | ||
await hre.run("verify:verify", { | ||
address: minterDAExpSettlementFlagshipAddress, | ||
constructorArguments: [genArt721V3Core_Flagship, minterFilter_Flagship], | ||
}); | ||
console.log( | ||
"[INFO] MinterDAExpV0 (flagship) contract deployment verified on Etherscan!" | ||
); | ||
} catch (error) { | ||
console.log( | ||
"[WARN] MinterDAExpV0 (flagship) contract deployment NOT verified on Etherscan!" | ||
); | ||
console.log(error); | ||
} | ||
|
||
// Output instructions for manual Etherscan verification. | ||
const standardVerify = "yarn hardhat verify"; | ||
console.log(`Verify MinterDAExpV0 (flagship) contract deployment with:`); | ||
console.log( | ||
`${standardVerify} --network ${networkName} ${minterDAExpSettlementFlagshipAddress} ${genArt721V3Core_Flagship} ${minterFilter_Flagship}` | ||
); | ||
|
||
////////////////////////////////////////////////////////////////////////////// | ||
// SETUP ENDS HERE | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
console.log("Next Steps:"); | ||
console.log( | ||
"1. Deploy new subgraph with new minter added to subgraph's config" | ||
); | ||
console.log( | ||
"2. WAIT for subgraph to sync, and ensure enum with new minter type is added to subgraph" | ||
); | ||
console.log("3. AFTER subgraph syncs, run sync script"); | ||
console.log( | ||
`4a. Call addApprovedMinter on ${minterFilter_Flagship} with arg ${minterDAExpSettlementFlagshipAddress}` | ||
); | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |