diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 0d8c08d..ce737c1 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -225,6 +225,226 @@ const deployedContracts = { inheritedFunctions: {}, }, }, + 11155111: { + Factory: { + address: "0x693475277bbC61464eA8B746151d71bE98e43931", + abi: [ + { + inputs: [ + { + internalType: "address", + name: "_implementation", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "cloneContract", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "cloneList", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "implementation", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "readCloneList", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + ], + inheritedFunctions: {}, + }, + YourContract: { + address: "0x4f41764d31E0026a74a32941840b043F806c26C5", + abi: [ + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "greetingSetter", + type: "address", + }, + { + indexed: false, + internalType: "string", + name: "newGreeting", + type: "string", + }, + { + indexed: false, + internalType: "bool", + name: "premium", + type: "bool", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "GreetingChange", + type: "event", + }, + { + inputs: [], + name: "greeting", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "premium", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "_newGreeting", + type: "string", + }, + ], + name: "setGreeting", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "totalCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "userGreetingCounter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, + ], + inheritedFunctions: {}, + }, + }, } as const; export default deployedContracts satisfies GenericContractsDeclaration; diff --git a/packages/nextjs/pages/clonesDebug.tsx b/packages/nextjs/pages/clonesDebug.tsx index 3fd7850..0ca08fb 100644 --- a/packages/nextjs/pages/clonesDebug.tsx +++ b/packages/nextjs/pages/clonesDebug.tsx @@ -9,15 +9,17 @@ import deployedContracts from "~~/contracts/deployedContracts"; import { ChevronDownIcon } from "@heroicons/react/24/outline"; import { Address } from "~~/components/scaffold-eth"; import { useOutsideClick } from "~~/hooks/scaffold-eth"; - +import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork"; +import scaffoldConfig from "~~/scaffold.config.ts"; const selectedContractStorageKey = "scaffoldEth2.selectedContractClone"; const contractNames = getContractNames(); -const factory: object = deployedContracts["31337"].Factory; -const yourContract: object = deployedContracts["31337"].YourContract; - const ClonesDebug: NextPage = () => { + // add networks in scaffoldConfig, change the number in the targetNetwork[] below for deployed public network contracts + const chain = scaffoldConfig.targetNetworks[0]; + const factory: object = deployedContracts[chain.id].Factory; + const yourContract: object = deployedContracts[chain.id].YourContract; const [cloneContracts, setCloneContracts] = useState(); @@ -42,8 +44,9 @@ const ClonesDebug: NextPage = () => { useEffect(() => { - if (contractRead.data.length > 0) + if (contractRead) setCloneContracts(contractRead.data) + setSelectedContract(contractRead.data[0]) }, [contractRead]); diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index f5ead03..ae748f7 100644 --- a/packages/nextjs/scaffold.config.ts +++ b/packages/nextjs/scaffold.config.ts @@ -11,7 +11,7 @@ export type ScaffoldConfig = { const scaffoldConfig = { // The networks on which your DApp is live - targetNetworks: [chains.hardhat], + targetNetworks: [chains.sepolia], // The interval at which your front-end polls the RPC servers for new data // it has no effect if you only target the local network (default is 4000)