text: const hre = require("hardhat")
  require("@nomiclabs/hardhat-web3")
  const fs = require("fs-extra")
  
  async function main() {
  	fs.removeSync("cache")
  	fs.removeSync("artifacts")
  	await hre.run("compile")
  
  	let network = process.env.NETWORK ? process.env.NETWORK : "starnetscan"
  	console.log(">-> Network is set to " + network)
  
  	// ethers is avaialble in the global scope
  	const [deployer] = await ethers.getSigners()
  	const deployerAddress = await deployer.getAddress()
  	const account = await web3.utils.toChecksumAddress(deployerAddress)
  	const balance = await web3.eth.getBalance(account)
  
  	console.log(
  		"Deployer Account " + deployerAddress + " has balance: " + web3.utils.fromWei(balance, "ether"),
  		"ETH"
  	)
  
  	const TContract = await hre.ethers.getContractFactory("Simplest")
  	console.log("Deploying Simplest Contract...")
  
  	const deployed = await TContract.deploy()
  	let dep = await deployed.deployed()
  	console.log("Contract deployed to:", dep.address)
  }
  
  main()
  	.then(() => process.exit(0))
  	.catch((error) => {
  		console.error(error)
  		process.exit(1)
  	})
  