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

Shadn #886

Closed
wants to merge 2 commits into from
Closed

Shadn #886

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
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,11 @@
},
"engines": {
"node": ">=18.17.0"
},
"dependencies": {
"@t3-oss/env-core": "^0.10.1",
"@t3-oss/env-nextjs": "^0.10.1",
"jiti": "^1.21.6",
"zod": "^3.23.8"
}
}
4 changes: 2 additions & 2 deletions packages/hardhat/contracts/YourContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import "hardhat/console.sol";
contract YourContract {
// State Variables
address public immutable owner;
string public greeting = "Building Unstoppable Apps!!!";
string public greeting = "Building Unstoppable Apps";
bool public premium = false;
uint256 public totalCounter = 0;
uint256 public totalCounter = 1;
mapping(address => uint) public userGreetingCounter;

// Events: a way to emit log statements from smart contract that can be listened to by external parties
Expand Down
1 change: 1 addition & 0 deletions packages/hardhat/deployments/sepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11155111
256 changes: 256 additions & 0 deletions packages/hardhat/deployments/sepolia/YourContract.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/nextjs/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules/
**/*.png
**/*.svg
**/generated/**/*
**/components/ui/**/*
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { BackButton } from "./BackButton";
import { ContractTabs } from "./ContractTabs";
import { Address, Balance } from "~~/components/scaffold-eth";
import { AddressType } from "~~/types/utils";

export const AddressComponent = ({
address,
contractData,
}: {
address: string;
address: AddressType;
contractData: { bytecode: string; assembly: string } | null;
}) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import { TransactionsTable } from "./TransactionsTable";
import { createPublicClient, http } from "viem";
import { hardhat } from "viem/chains";
import { useFetchBlocks } from "~~/hooks/scaffold-eth";
import { AddressType } from "~~/types/utils";

type AddressCodeTabProps = {
bytecode: string;
assembly: string;
};

type PageProps = {
address: string;
address: AddressType;
contractData: AddressCodeTabProps | null;
};

Expand Down
7 changes: 4 additions & 3 deletions packages/nextjs/app/blockexplorer/address/[address]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import path from "path";
import { hardhat } from "viem/chains";
import { AddressComponent } from "~~/app/blockexplorer/_components/AddressComponent";
import deployedContracts from "~~/contracts/deployedContracts";
import { AddressType } from "~~/types/utils";
import { isZeroAddress } from "~~/utils/scaffold-eth/common";
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

type PageProps = {
params: { address: string };
params: { address: AddressType };
};

async function fetchByteCodeAndAssembly(buildInfoDirectory: string, contractPath: string) {
Expand Down Expand Up @@ -36,7 +37,7 @@ async function fetchByteCodeAndAssembly(buildInfoDirectory: string, contractPath
return { bytecode, assembly };
}

const getContractData = async (address: string) => {
const getContractData = async (address: AddressType) => {
const contracts = deployedContracts as GenericContractsDeclaration | null;
const chainId = hardhat.id;
let contractPath = "";
Expand Down Expand Up @@ -83,7 +84,7 @@ export function generateStaticParams() {
}

const AddressPage = async ({ params }: PageProps) => {
const address = params?.address as string;
const address = params?.address as `0x${string}`;

if (isZeroAddress(address)) return null;

Expand Down
71 changes: 71 additions & 0 deletions packages/nextjs/app/legacy/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"use client";

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

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

return (
<>
<div className="flex items-center flex-col flex-grow pt-10">
<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 flex-col sm:flex-row">
<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;
Loading