Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update burner version #847

Merged
merged 1 commit into from
May 15, 2024
Merged

update burner version #847

merged 1 commit into from
May 15, 2024

Conversation

technophile-04
Copy link
Collaborator

Description

This was noticed by @carletex , that while playing around with the wagmi useSendTranaaction hook and burner wallet we get an error (since there was mistake in gas calculation checkout scaffold-eth/burner-connector#16 for more details)

To try the bug on main branch, copy paste this and try clicking send button

Test Code :
"use client";

import Link from "next/link";
import type { NextPage } from "next";
import { parseEther } from "viem";
import { useAccount, useSendTransaction } from "wagmi";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { Address } from "~~/components/scaffold-eth";
import { useTransactor } from "~~/hooks/scaffold-eth";

const Home: NextPage = () => {
  const { address: connectedAddress } = useAccount();

  const { sendTransactionAsync } = useSendTransaction();

  const writeTx = useTransactor();

  return (
    <>
      <div className="flex items-center flex-col flex-grow pt-10">
        <button
          onClick={async () => {
            try {
              await sendTransactionAsync({
                to: "0x55b9CB0bCf56057010b9c471e7D42d60e1111EEa",
                value: parseEther("1"),
              });
              await writeTx({
                to: "0x55b9CB0bCf56057010b9c471e7D42d60e1111EEa",
                value: parseEther("1"),
              });
            } catch (e) {
              console.error(e);
            }
          }}
          className="btn btn-primary"
        >
          Send ETH
        </button>
        <div className="px-5">
          <h1 className="text-center">
            <span className="block text-2xl mb-2">Welcome to</span>
            <span className="block text-4xl font-bold">Scaffold-ETH 2</span>
          </h1>
          <div className="flex justify-center items-center space-x-2">
            <p className="my-2 font-medium">Connected Address:</p>
            <Address address={connectedAddress} />
          </div>
          <p className="text-center text-lg">
            Get started by editing{" "}
            <code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
              packages/nextjs/app/page.tsx
            </code>
          </p>
          <p className="text-center text-lg">
            Edit your smart contract{" "}
            <code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
              YourContract.sol
            </code>{" "}
            in{" "}
            <code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
              packages/hardhat/contracts
            </code>
          </p>
        </div>

        <div className="flex-grow bg-base-300 w-full mt-16 px-8 py-12">
          <div className="flex justify-center items-center gap-12 flex-col sm:flex-row">
            <div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
              <BugAntIcon className="h-8 w-8 fill-secondary" />
              <p>
                Tinker with your smart contract using the{" "}
                <Link href="/debug" passHref className="link">
                  Debug Contracts
                </Link>{" "}
                tab.
              </p>
            </div>
            <div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
              <MagnifyingGlassIcon className="h-8 w-8 fill-secondary" />
              <p>
                Explore your local transactions with the{" "}
                <Link href="/blockexplorer" passHref className="link">
                  Block Explorer
                </Link>{" "}
                tab.
              </p>
            </div>
          </div>
        </div>
      </div>
    </>
  );
};

export default Home;

This was fixed in latest version of burner connector, if you paste the above code in this branch it should work nicely

Copy link
Member

@carletex carletex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working great!!

@carletex carletex merged commit 44110ed into main May 15, 2024
1 check passed
@carletex carletex deleted the burner-version-bump branch May 15, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants