Skip to content

Commit

Permalink
removed factory
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Jun 25, 2024
1 parent f22a8ea commit eefb5f6
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 108 deletions.
94 changes: 47 additions & 47 deletions packages/foundry/script/DeployFactory.s.sol
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
//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;

address tokensAddr = address(0);

uint256 chainId;
assembly {
chainId := chainid()
}

if (chainId == 10) {
tokensAddr = 0x4200000000000000000000000000000000000042;
}

ReputationTokensUpgradeable implementation = new ReputationTokensUpgradeable();
ReputationTokensFactory factory = new ReputationTokensFactory(
admins,
address(implementation),
address(0)
);
}
}
// //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;

// address tokensAddr = address(0);

// uint256 chainId;
// assembly {
// chainId := chainid()
// }

// if (chainId == 10) {
// tokensAddr = 0x4200000000000000000000000000000000000042;
// }

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

import Select from "react-select";
// import Select from "react-select";

type Props = {
index: number;
onTypeChanged: any;
onUriChanged: any;
};
// type Props = {
// index: number;
// onTypeChanged: any;
// onUriChanged: any;
// };

const options = [
{ value: 0, label: "Transferable" },
{ value: 1, label: "Lifetime" },
{ value: 2, label: "Redeemable" },
];
export function UpdateTokenCard({ index, onTypeChanged, onUriChanged }: Props) {
const defaultOption = options[0];
// const options = [
// { value: 0, label: "Transferable" },
// { value: 1, label: "Lifetime" },
// { value: 2, label: "Redeemable" },
// ];
// export function UpdateTokenCard({ index, onTypeChanged, onUriChanged }: Props) {
// const defaultOption = options[0];

// const [selectedDropdownOption, setSelectedDropdownOption] = useState(defaultOption);
// // const [selectedDropdownOption, setSelectedDropdownOption] = useState(defaultOption);

return (
<div className="rounded-lg bg-base-100 items-center justify-center flex flex-col p-1 m-1">
<p>Token {index}</p>
<p>Type</p>
<Select
options={options}
className="text-black bg-base-100"
onChange={(option: any) => {
// option ? setSelectedDropdownOption(option) : "";
// return (
// <div className="rounded-lg bg-base-100 items-center justify-center flex flex-col p-1 m-1">
// <p>Token {index}</p>
// <p>Type</p>
// <Select
// options={options}
// className="text-black bg-base-100"
// onChange={(option: any) => {
// // option ? setSelectedDropdownOption(option) : "";

onTypeChanged(index, option);
}}
defaultValue={defaultOption}
instanceId={`select-${index}`}
theme={theme => ({
...theme,
colors: {
...theme.colors,
primary25: "#efeaff",
primary50: "#c1aeff",
primary: "#551d98",
},
})}
styles={{
menuList: provided => ({ ...provided, maxHeight: 280, overflow: "auto" }),
}}
/>
<p>URI</p>
<input
type="text"
id="first_name"
onChange={val => {
onUriChanged(index, val);
}}
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="John"
required
/>
</div>
);
}
// onTypeChanged(index, option);
// }}
// defaultValue={defaultOption}
// instanceId={`select-${index}`}
// theme={theme => ({
// ...theme,
// colors: {
// ...theme.colors,
// primary25: "#efeaff",
// primary50: "#c1aeff",
// primary: "#551d98",
// },
// })}
// styles={{
// menuList: provided => ({ ...provided, maxHeight: 280, overflow: "auto" }),
// }}
// />
// <p>URI</p>
// <input
// type="text"
// id="first_name"
// onChange={val => {
// onUriChanged(index, val);
// }}
// className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
// placeholder="John"
// required
// />
// </div>
// );
// }
12 changes: 6 additions & 6 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
const deployedContracts = {
31337: {
ReputationTokens: {
address: "0xf4b146fba71f41e0592668ffbf264f1d186b2ca8",
address: "0xc0f115a19107322cfbf1cdbc7ea011c19ebdb4f8",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -1410,7 +1410,7 @@ const deployedContracts = {
},
},
ReputationFaucet: {
address: "0x46b142dd1e924fab83ecc3c08e4d46e82f005e0e",
address: "0xfaaddc93baf78e89dcf37ba67943e1be8f37bb8c",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -1535,7 +1535,7 @@ const deployedContracts = {
},
},
Hats: {
address: "0x49fd2be640db2910c2fab69bb8531ab6e76127ff",
address: "0x3aade2dcd2df6a8cac689ee797591b2913658659",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -3496,7 +3496,7 @@ const deployedContracts = {
},
},
MultiClaimsHatter: {
address: "0xa4899d35897033b927acfcf422bc745916139776",
address: "0x1f10f3ba7acb61b2f50b9d6ddcf91a6f787c0e82",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -3822,7 +3822,7 @@ const deployedContracts = {
},
},
ActiveModule: {
address: "0xaa292e8611adf267e563f334ee42320ac96d0463",
address: "0x525c7063e7c20997baae9bda922159152d0e8417",
abi: [
{
type: "function",
Expand Down Expand Up @@ -3852,7 +3852,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
ERC1155EligibiltiyModule: {
address: "0xe8d2a1e88c91dcd5433208d4152cc4f399a7e91d",
address: "0xb82008565fdc7e44609fa118a4a681e92581e680",
abi: [
{
type: "constructor",
Expand Down

0 comments on commit eefb5f6

Please sign in to comment.