import { ethers, network, baseURI, proxy } from "hardhat"; async function main() { console.log(`\nUpdating base URI on '${network.name}'...`); // Get proxy owner account const [account] = await ethers.getSigners(); if (account.provider === undefined) { throw Error("missing provider"); } // Get proxy address if (proxy === undefined || proxy === "") { throw Error(`missing proxies entry for '${network.name}'`); } console.log(`Using proxy address '${proxy}'`); // Get new base URI if (baseURI === undefined || baseURI === "") { throw Error(`missing baseURIs entry for '${network.name}'`); } console.log(`Using base URI '${baseURI}'`); // Update base URI const tables = (await ethers.getContractFactory("TablelandTables")).attach( proxy ); const tx = await tables.setBaseURI(baseURI); const receipt = await tx.wait(); console.log(`base URI set with tx '${receipt.transactionHash}'`); } main().catch((error) => { console.error(error); process.exitCode = 1; });