Skip to content

Commit

Permalink
automated front end
Browse files Browse the repository at this point in the history
  • Loading branch information
irfanbozkurt committed Jul 21, 2023
1 parent 0e3a17c commit e8234f8
Show file tree
Hide file tree
Showing 13 changed files with 2,492 additions and 795 deletions.
542 changes: 321 additions & 221 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 33 additions & 3 deletions packages/hardhat/contracts/YourContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,39 @@
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract YourContract is ERC20 {
constructor() ERC20("TTT", "TTT") {
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 5);
import "hardhat/console.sol";

contract A is ERC20 {
constructor() ERC20("AAA", "AAA") {
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 10);
}
}

contract Z is ERC20 {
constructor() ERC20("ZZZ", "ZZZ") {
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 10);
}
}

contract B is ERC721 {
constructor() ERC721("BBB", "BBB") {
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 0);
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 1);
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 2);
}
}

contract C is ERC1155, Ownable {
constructor() ERC1155("CCC") {
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 0, 100000, "");
super._mint(0x5F1442eF295BC2Ef0a65b7d49198a34B13c1E3aB, 1, 1, "");
}
}

contract YourContract {
constructor() {}
}
22 changes: 19 additions & 3 deletions packages/hardhat/deploy/00_deploy_your_contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,28 @@ const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEn
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;

await deploy("YourContract", {
await deploy("A", {
from: deployer,
args: [],
log: true,
autoMine: true,
});
await deploy("Z", {
from: deployer,
args: [],
log: true,
autoMine: true,
});
await deploy("B", {
from: deployer,
args: [],
log: true,
autoMine: true,
});
await deploy("C", {
from: deployer,
args: [],
log: true,
// autoMine: can be passed to the deploy function to make the deployment process faster on local networks by
// automatically mining the contract deployment transaction. There is no effect on live networks.
autoMine: true,
});

Expand Down
55 changes: 7 additions & 48 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,19 @@ import { getTargetNetwork } from "~~/utils/scaffold-eth";
* Site footer
*/
export const Footer = () => {
const nativeCurrencyPrice = useGlobalState(state => state.nativeCurrencyPrice);

return (
<div className="min-h-0 p-5 mb-11 lg:mb-0">
<div>
<div className="fixed flex justify-between items-center w-full z-20 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex space-x-2 pointer-events-auto">
{nativeCurrencyPrice > 0 && (
<div className="btn btn-primary btn-sm font-normal cursor-auto">
<CurrencyDollarIcon className="h-4 w-4 mr-0.5" />
<span>{nativeCurrencyPrice}</span>
</div>
)}
{getTargetNetwork().id === hardhat.id && <Faucet />}
</div>
<SwitchTheme className="pointer-events-auto" />
</div>
<div className="fixed flex justify-between items-center w-full z-20 p-4 bottom-0 left-0 pointer-events-none">
<SwitchTheme className="pointer-events-auto" />
</div>

<div className="w-full">
<ul className="menu menu-horizontal w-full">
<div className="flex justify-center items-center gap-2 text-sm w-full">
<div>
<a
href="https://github.com/scaffold-eth/se-2"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
Fork me
</a>
</div>
<span>·</span>
<div>
Built with <HeartIcon className="inline-block h-4 w-4" /> at 🏰{" "}
<a
href="https://buidlguidl.com/"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
BuidlGuidl
</a>
</div>
<span>·</span>
<div>
<a
href="https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
Support
</a>
</div>
Built with <HeartIcon className="inline-block h-4 w-4" /> at 🏰{" "}
<a href="https://buidlguidl.com/" target="_blank" rel="noreferrer" className="underline underline-offset-2">
BuidlGuidl
</a>
</div>
</ul>
</div>
Expand Down
23 changes: 0 additions & 23 deletions packages/nextjs/components/Header.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/nextjs/components/MetaHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type MetaHeaderProps = {
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}/` : "/";

export const MetaHeader = ({
title = "Scaffold-ETH 2 App",
title = "Flashbot Bundler for Recoveries",
description = "Built with 🏗 Scaffold-ETH 2",
image = "thumbnail.jpg",
twitterCard = "summary_large_image",
Expand Down
10 changes: 2 additions & 8 deletions packages/nextjs/components/SwitchTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,18 @@ export const SwitchTheme = ({ className }: { className?: string }) => {

useEffect(() => {
const body = document.body;
body.setAttribute("data-theme", isDarkMode ? "scaffoldEthDark" : "scaffoldEth");
body.setAttribute("data-theme", isDarkMode ? "scaffoldEthDark" : "scaffoldEthDark");
}, [isDarkMode]);

return (
<div className={`flex space-x-2 text-sm ${className}`}>
<div style={{ display: "none" }} className={`flex space-x-2 text-sm ${className}`}>
<input
id="theme-toggle"
type="checkbox"
className="toggle toggle-primary bg-primary"
onChange={toggle}
checked={isDarkMode}
/>
{isMounted() && (
<label htmlFor="theme-toggle" className={`swap swap-rotate ${!isDarkMode ? "swap-active" : ""}`}>
<SunIcon className="swap-on h-5 w-5" />
<MoonIcon className="swap-off h-5 w-5" />
</label>
)}
</div>
);
};
Loading

0 comments on commit e8234f8

Please sign in to comment.