Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed May 24, 2024
1 parent 5334306 commit 0a9c4ea
Show file tree
Hide file tree
Showing 10 changed files with 2,124 additions and 165 deletions.
4 changes: 4 additions & 0 deletions packages/foundry/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {ScaffoldETHDeploy} from "./DeployHelpers.s.sol";
import {Hats} from "../contracts/Hats/Hats.sol";

import {DeployDemoScript} from "./DeployDemo.s.sol";
import {DeployFactoryScript} from "./DeployFactory.s.sol";

contract DeployScript is ScaffoldETHDeploy {
error InvalidPrivateKey(string);
Expand All @@ -15,6 +16,9 @@ contract DeployScript is ScaffoldETHDeploy {
DeployDemoScript deployer = new DeployDemoScript();
deployer.run();

DeployFactoryScript factoryDeployer = new DeployFactoryScript();

factoryDeployer.run();
exportDeployments();
}

Expand Down
36 changes: 36 additions & 0 deletions packages/foundry/script/DeployFactory.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {console} from "forge-std/console.sol";

import {ScaffoldETHDeploy} from "./DeployHelpers.s.sol";
import {ReputationTokensFactory} from
"@atxdao/contracts/reputation/ReputationTokensFactory.sol";
import {ReputationTokensUpgradeable} from
"@atxdao/contracts/reputation/ReputationTokensUpgradeable.sol";

contract DeployFactoryScript is ScaffoldETHDeploy {
error InvalidPrivateKey(string);

address controller = 0x2F15D4A66D22ecC6967928b6A76Ab06897b05676; //replace with burner or other address from wallet!

function run() external {
uint256 deployerPrivateKey = setupLocalhostEnv();
if (deployerPrivateKey == 0) {
revert InvalidPrivateKey(
"You don't have a deployer account. Make sure you have set DEPLOYER_PRIVATE_KEY in .env or use `yarn generate` to generate a new random account"
);
}
address deployerPubKey = vm.createWallet(deployerPrivateKey).addr;

vm.startBroadcast(deployerPrivateKey);
address[] memory admins = new address[](2);
admins[0] = deployerPubKey;
admins[1] = controller;

ReputationTokensUpgradeable implementation =
new ReputationTokensUpgradeable();
ReputationTokensFactory factory =
new ReputationTokensFactory(admins, admins, address(implementation));
}
}
15 changes: 15 additions & 0 deletions packages/nextjs/app/factory/_components/Factory.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use client";

export function Factory() {
return (
<>
<div className="py-5 space-y-5 flex flex-col justify-center items-center bg-primary bg-[length:100%_100%] py-1 px-5 sm:px-0 lg:py-auto max-w-[100vw] ">
<div className="flex flex-row justify-center items-center">
<div className="flex flex-col justify-center items-center">
<p>{"hello"}</p>
</div>
</div>
</div>
</>
);
}
18 changes: 18 additions & 0 deletions packages/nextjs/app/factory/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Factory } from "./_components/Factory";
import type { NextPage } from "next";
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";

export const metadata = getMetadata({
title: "Factory",
description: "Factory",
});

const FactoryPage: NextPage = () => {
return (
<>
<Factory />
</>
);
};

export default FactoryPage;
26 changes: 20 additions & 6 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ type HeaderMenuLink = {

export const menuLinks: HeaderMenuLink[] = [];

export const HeaderMenuLinks = () => {
type Props = {
menuLinks: HeaderMenuLink[];
};

export const HeaderMenuLinks = ({ menuLinks }: Props) => {
const pathname = usePathname();

console.log(menuLinks);

return (
<>
{menuLinks.map(({ label, href, icon }) => {
Expand Down Expand Up @@ -96,6 +102,11 @@ export const Header = () => {
href: "/hats",
});

linksToAdd.push({
label: "Factory",
href: "/factory",
});

linksToAdd.push({
label: "Debug Contracts",
href: "/debug",
Expand Down Expand Up @@ -131,11 +142,14 @@ export const Header = () => {
href: "/stewards-hideout",
},
]);

setInstancedHeaderLinks([...instancedHeaderLinks, linksToAdd]);
}

console.log(linksToAdd);

if (linksToAdd.length > 0) setInstancedHeaderLinks([...instancedHeaderLinks, ...linksToAdd]);

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [balanceOfClaimableHat2]);
}, []);

const [output, setOutput] = useState<any>();

Expand All @@ -160,7 +174,7 @@ export const Header = () => {
setIsDrawerOpen(false);
}}
>
<HeaderMenuLinks />
<HeaderMenuLinks menuLinks={instancedHeaderLinks} />
</ul>
)}
</div>
Expand All @@ -174,7 +188,7 @@ export const Header = () => {
</div>
</Link>
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2">
<HeaderMenuLinks />
<HeaderMenuLinks menuLinks={instancedHeaderLinks} />
</ul>
</div>
<div className="navbar-end flex-grow mr-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ type Props = {
export const TokenTypeCard = ({ token, tokenType, type = "default" }: Props) => {
let i = "Token Type: ";

console.log(token);

if (token) {
if (token?.tokenType === 0) {
i += "Transferable";
Expand Down
2 changes: 0 additions & 2 deletions packages/nextjs/components/rep-tokens/hooks/Hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ export const useRepTokens = (tokenIds: bigint[], address?: string, replacementTy
}
}

console.log(addresses);

// const { addresses } = useMemo(() => {
// const addresses: string[] = [];

Expand Down
Loading

0 comments on commit 0a9c4ea

Please sign in to comment.