Skip to content

Commit

Permalink
Sepolia tested
Browse files Browse the repository at this point in the history
  • Loading branch information
gotnoshoeson committed Jan 4, 2024
1 parent fe851d5 commit 50c050d
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 6 deletions.
220 changes: 220 additions & 0 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
13 changes: 8 additions & 5 deletions packages/nextjs/pages/clonesDebug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]>();
Expand All @@ -42,8 +44,9 @@ const ClonesDebug: NextPage = () => {


useEffect(() => {
if (contractRead.data.length > 0)
if (contractRead)
setCloneContracts(contractRead.data)
setSelectedContract(contractRead.data[0])
}, [contractRead]);


Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/scaffold.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 50c050d

Please sign in to comment.