Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { Attribution } from "ox/erc8021";
import { useEffect, useState } from "react";
import { InheritanceTooltip } from "./InheritanceTooltip";
import { Abi, AbiFunction } from "abitype";
Expand Down Expand Up @@ -35,7 +34,6 @@ export const WriteOnlyFunctionForm = ({
}: WriteOnlyFunctionFormProps) => {
const [form, setForm] = useState<Record<string, any>>(() => getInitialFormState(abiFunction));
const [txValue, setTxValue] = useState<string>("");
const [builderCode, setBuilderCode] = useState<string>("");
const { chain } = useAccount();
const writeTxn = useTransactor();
const { targetNetwork } = useTargetNetwork();
Expand All @@ -53,7 +51,6 @@ export const WriteOnlyFunctionForm = ({
abi: abi,
args: getParsedContractFunctionArgs(form),
value: txValue ? BigInt(txValue) : BigInt(0),
...(builderCode ? { dataSuffix: Attribution.toDataSuffix({ codes: [builderCode] }) } : {}),
});
await writeTxn(makeWriteWithParams);
onChange();
Expand Down Expand Up @@ -88,8 +85,7 @@ export const WriteOnlyFunctionForm = ({
/>
);
});
// Builder code block is always rendered, so use column layout for consistent UX
const zeroInputs = false;
const zeroInputs = inputs.length === 0 && abiFunction.stateMutability !== "payable";

return (
<div className="py-5 space-y-3 first:pt-0 last:pb-1">
Expand All @@ -115,21 +111,6 @@ export const WriteOnlyFunctionForm = ({
/>
</div>
) : null}
<div className="flex flex-col gap-1.5 w-full">
<div className="flex items-center ml-2">
<span className="text-xs font-medium mr-2 leading-none">builder code</span>
<span className="block text-xs font-extralight leading-none">ERC-8021 (optional)</span>
</div>
<input
className="input input-ghost focus-within:border-transparent focus:outline-none focus:text-gray-400 h-[2.2rem] min-h-[2.2rem] px-4 border w-full font-medium placeholder:text-accent/50 text-gray-400 bg-base-200 rounded-full text-accent"
placeholder="e.g. coinbase"
value={builderCode}
onChange={e => {
setDisplayedTxResult(undefined);
setBuilderCode(e.target.value);
}}
/>
</div>
<div className="flex justify-between gap-2">
{!zeroInputs && (
<div className="flex-grow basis-0">
Expand Down
5 changes: 0 additions & 5 deletions with-next-app-router/packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useFormo } from "@formo/analytics";
import type { NextPage } from "next";
import { useAccount } from "wagmi";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { SendTransaction } from "~~/components/SendTransaction";
import { SignMessage } from "~~/components/SignMessage";
import { SignTypedData } from "~~/components/SignTypedData";
import { Address } from "~~/components/scaffold-eth";
Expand Down Expand Up @@ -154,10 +153,6 @@ const Home: NextPage = (): JSX.Element => {
<SignTypedData />
</div>

<div className="w-7/12 mt-12">
<SendTransaction />
</div>

<div className="w-7/12 mt-12">
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
<div className="flex flex-col gap-2">
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion with-next-app-router/packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"next": "~14.2.11",
"next-nprogress-bar": "~2.3.13",
"next-themes": "~0.3.0",
"ox": "^0.14.0",
"qrcode.react": "~3.1.0",
"react": "~18.3.1",
"react-copy-to-clipboard": "~5.1.0",
Expand Down
Loading