* Register the redeem extension on the creator contract. Must be sent from the * creator's owner/admin wallet (Manifold's `adminRequired`). * npx hardhat run scripts/register-extension.js --network sepolia * CREATOR / EXTENSION default to deployments/<network>.json * Until this runs, the extension cannot mint and the creator will not delegate import { addressFor, connect, creatorAt, main } from "./_lib.js"; const { ethers, net, signer } = await connect(); const creatorAddress = addressFor("creator", net); const extension = addressFor("extension", net); const creator = creatorAt(ethers, creatorAddress, signer); const owner = await creator.owner(); const isAdmin = owner === signer.address || (await creator.isAdmin(signer.address)); `${signer.address} is neither owner (${owner}) nor an admin of ${creatorAddress}.\n` + ` Send this from the Manifold admin wallet, or approveAdmin() it first.`, const already = await creator.getExtensions(); if (already.includes(extension)) { console.log(`extension ${extension} is already registered — nothing to do`); const tx = await creator.registerExtension(extension, ""); console.log(`registerExtension ${extension}\n tx ${tx.hash}`); const now = await creator.getExtensions(); if (!now.includes(extension)) throw new Error("registration did not take effect"); console.log(`\nregistered. extensions on ${creatorAddress}:`); for (const e of now) console.log(` ${e}${e === extension ? " <- this one" : ""}`);