11import { formatEther , parseEther } from "ethers" ;
2- import fs from "fs" ;
3- import { HardhatRuntimeEnvironment } from "hardhat/types" ;
4- import path from "path" ;
52
63import { deployContract , getProvider , getWallet } from "./utils" ;
74
8- export default async function ( hre : HardhatRuntimeEnvironment ) {
5+ export default async function ( ) {
96 const provider = getProvider ( ) ;
107
118 const baseTokenURI = "https://nft.zksync.dev/nft/metadata.json" ;
@@ -16,24 +13,6 @@ export default async function (hre: HardhatRuntimeEnvironment) {
1613 console . log ( "NFT CONTRACT: " , await nftContract . getAddress ( ) ) ;
1714 console . log ( "PAYMASTER CONTRACT: " , await paymasterContract . getAddress ( ) ) ;
1815
19- if ( hre . network . config . ethNetwork . includes ( "localhost" ) ) {
20- // Update the .env.local file with the contract addresses for NFT Quest app
21- const envFilePath = path . join ( __dirname , "../../nft-quest/.env.local" ) ;
22-
23- // Check if the .env.local file exists, if not, create it
24- if ( ! fs . existsSync ( envFilePath ) ) {
25- fs . writeFileSync ( envFilePath , "" , { encoding : "utf8" } ) ;
26- console . log ( `.env.local file has been created at ${ envFilePath } ` ) ;
27- }
28- const nftContractAddress = await nftContract . getAddress ( ) ;
29- const paymasterContractAddress = await paymasterContract . getAddress ( ) ;
30-
31- const envContent = `NUXT_PUBLIC_CONTRACTS_NFT=${ nftContractAddress } \nNUXT_PUBLIC_CONTRACTS_PAYMASTER=${ paymasterContractAddress } \n` ;
32-
33- fs . writeFileSync ( envFilePath , envContent , { encoding : "utf8" } ) ;
34- console . log ( `.env.local file has been updated at ${ envFilePath } ` ) ;
35- }
36-
3716 // fund the paymaster contract with enough ETH to pay for transactions
3817 const wallet = getWallet ( ) ;
3918 await (
0 commit comments