SEARCHING FOR KUDZU CONTAINERS FOR SALE.....
diff --git a/packages/nextjs/components/KudzuContainer.tsx b/packages/nextjs/components/KudzuContainer.tsx
index 4a68510..4920089 100644
--- a/packages/nextjs/components/KudzuContainer.tsx
+++ b/packages/nextjs/components/KudzuContainer.tsx
@@ -7,38 +7,32 @@ import { Abi } from "abitype";
import { formatEther, parseEther } from "viem";
import { useAccount, useContractRead, useContractWrite } from "wagmi";
import { RainbowKitCustomConnectButton } from "~~/components/scaffold-eth";
-import { useDeployedContractInfo, useScaffoldContractRead } from "~~/hooks/scaffold-eth";
+import { useDeployedContractInfo } from "~~/hooks/scaffold-eth";
import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork";
type KudzuContainerProps = {
contractAddress?: string;
mustBeForSale?: boolean;
mustBeOwnedBy?: string;
+ owner?: string;
+ tokenIndex?: number;
};
-export const KudzuContainer = ({ contractAddress, mustBeForSale, mustBeOwnedBy }: KudzuContainerProps) => {
+export const KudzuContainer = ({
+ contractAddress,
+ mustBeForSale,
+ mustBeOwnedBy,
+ owner,
+ tokenIndex,
+}: KudzuContainerProps) => {
const { address } = useAccount();
- const { data: tokenIndex } = useScaffoldContractRead({
- contractName: "KUDZU",
- functionName: "tokenOfOwnerByIndex",
- args: [contractAddress, 0n],
- });
-
const { targetNetwork } = useTargetNetwork();
const { data: deployedContractData } = useDeployedContractInfo("BasedKudzuContainerForSale");
const [ethAmount, setEthAmount] = React.useState("");
- const { data: owner } = useContractRead({
- chainId: targetNetwork.id,
- functionName: "owner",
- address: contractAddress,
- abi: deployedContractData?.abi,
- watch: true,
- });
-
const { writeAsync: setPrice } = useContractWrite({
chainId: targetNetwork.id,
address: contractAddress,
@@ -55,14 +49,6 @@ export const KudzuContainer = ({ contractAddress, mustBeForSale, mustBeOwnedBy }
watch: true,
});
- const { data: isInfected } = useContractRead({
- chainId: targetNetwork.id,
- functionName: "isInfected",
- address: contractAddress,
- abi: deployedContractData?.abi,
- watch: true,
- });
-
const { writeAsync: purchase } = useContractWrite({
chainId: targetNetwork.id,
address: contractAddress,
@@ -110,7 +96,7 @@ export const KudzuContainer = ({ contractAddress, mustBeForSale, mustBeOwnedBy }
{owner?.toLocaleLowerCase() === address?.toLocaleLowerCase() ? (
- {isInfected ? (
+ {tokenIndex ? (
<>
infect address from this kudzu: