Skip to content

Commit

Permalink
Redeploy council
Browse files Browse the repository at this point in the history
  • Loading branch information
sembrestels committed Sep 17, 2024
1 parent a3d8494 commit 648cc38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
13 changes: 8 additions & 5 deletions apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ import { CouncilName } from "../components/CouncilName";
import VotingCard from "../components/VotingCard";
import { getGrantees } from "../utils/grantees";

const defaultCouncil = "0x5cE162b6e6Dd6B936B9dC183Df79F61DBf8c675f";

export default function Page() {
const router = useRouter();
const [council, setCouncil] = useState<`0x${string}` | undefined>(undefined);

useEffect(() => {
// Ensure the code runs only on the client side
if (!window.location.hash) {
router.push("#0xB62f1Be9460cf2BEF90dB45dc90689C52C23F1B0");
} else {
// Set the council value after the hash is present
const address = getAddress(window.location.hash.slice(1));
setCouncil(address);
router.push(`#${defaultCouncil}`);
}
// Set the council value once the hash is present
const address = getAddress(
window.location.hash?.slice(1) || defaultCouncil,
);
setCouncil(address);
}, [router]);

// Fetch data when the council is available
Expand Down
2 changes: 1 addition & 1 deletion contracts/councilhaus/scripts/createCouncil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function main() {

const councilFactory = await viem.getContractAt(
"CouncilFactory",
"0x207940b61c2b51ee1da56855ee745d10a34422ab",
"0x4f875b97cf4edb0d1d561a3d1926ed6663df08b2",
);

const hash = await councilFactory.write.createCouncil([
Expand Down
6 changes: 3 additions & 3 deletions contracts/councilhaus/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { run, viem } from "hardhat";
import { parseEventLogs, parseUnits } from "viem";
import { parseEventLogs } from "viem";

async function deployAndVerify(contractName: string, args: any[]) {
const contract = await viem.deployContract(contractName, args);
Expand Down Expand Up @@ -40,8 +40,8 @@ async function main() {
councilName: "Spacing Guild",
councilSymbol: "SPA",
councilMembers: [
[wallet.account.address, parseUnits("100", 18)],
["0xf632ce27ea72dea30d30c1a9700b6b3bceaa05cf", parseUnits("200", 18)],
[wallet.account.address, 100],
["0xf632ce27ea72dea30d30c1a9700b6b3bceaa05cf", 200],
],
grantees: [
["ENS Wayback Machine", "0x6ea869B6870dd98552B0C7e47dA90702a436358b"],
Expand Down

0 comments on commit 648cc38

Please sign in to comment.