Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/disable-shutter-dao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@anticapture/dashboard": patch
---

Comment the Shutter DAO out of the dashboard DAO list.
2 changes: 1 addition & 1 deletion apps/dashboard/features/create-proposal/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const BODY_WARNING_THRESHOLD = 95_000;

export const canCreateProposalForDao = (daoId: DaoIdEnum | null | undefined) =>
daoId === DaoIdEnum.ENS ||
daoId === DaoIdEnum.SHU ||
// daoId === DaoIdEnum.SHU ||
daoId === DaoIdEnum.COMP ||
daoId === DaoIdEnum.GITCOIN;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Abi, type Address, type Hex } from "viem";
import { type useWriteContract } from "wagmi";

import { encodeDescription } from "@/features/create-proposal/utils/encodeDescription";
import { DaoIdEnum } from "@/shared/types/daos";
import type { DaoIdEnum } from "@/shared/types/daos";

type WriteContractFn = ReturnType<typeof useWriteContract>["writeContract"];

Expand Down Expand Up @@ -100,7 +100,8 @@ const SAFE_OPERATION_CALL = 0;
const AZORIUS_EMPTY_STRATEGY_DATA = "0x" as const;

/** DAOs whose proposals go through an Azorius module rather than an OZ Governor. */
export const isAzoriusDao = (daoId: DaoIdEnum) => daoId === DaoIdEnum.SHU;
// SHU, the only Azorius DAO, is disabled in DaoIdEnum.
export const isAzoriusDao = (_daoId: DaoIdEnum) => false;

export interface EncodedActions {
targets: Address[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type {
DaoConfiguration,
DaoOverviewConfig,
} from "@/shared/dao-config/types";
import { DaoIdEnum } from "@/shared/types/daos";
import { cn } from "@/shared/utils";

interface DaoOverviewHeaderProps {
Expand Down Expand Up @@ -62,7 +61,7 @@ export const DaoOverviewHeader = ({
iconVariant="secondary"
className="bg-surface-opacity text-primary h-5 rounded-full text-xs"
>
1 {daoId} = ${lastPrice.toFixed(daoId === DaoIdEnum.SHU ? 4 : 2)}
1 {daoId} = ${lastPrice.toFixed(2)}
{daoOverview.priceDisclaimer && (
<TooltipInfo text={daoOverview.priceDisclaimer} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ConnectWalletCustom } from "@/shared/components/wallet/ConnectWalletCus
import { WhitelabelConnectWallet } from "@/shared/components/wallet/WhitelabelConnectWallet";
import daoConfigByDaoId from "@/shared/dao-config";
import { useGaslessEligibility } from "@/shared/hooks/useGaslessRelayer";
import { DaoIdEnum } from "@/shared/types/daos";
import type { DaoIdEnum } from "@/shared/types/daos";
import { getDaoGovernanceListPath } from "@/shared/utils/whitelabel";

type TabId = "description" | "votes" | "actions";
Expand Down Expand Up @@ -184,7 +184,8 @@ const ProposalExecutionButtons = ({
}) => {
if (!address) return null;

const isShu = daoId.toUpperCase() === DaoIdEnum.SHU;
// SHU is disabled in DaoIdEnum, so compare against its raw id.
const isShu = daoId.toUpperCase() === "SHU";

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { Button } from "@/shared/components";
import { BlankSlate } from "@/shared/components/design-system/blank-slate/BlankSlate";
import { ConnectWalletCustom } from "@/shared/components/wallet/ConnectWalletCustom";
import daoConfig from "@/shared/dao-config";
import { DaoIdEnum } from "@/shared/types/daos";
import type { DaoIdEnum } from "@/shared/types/daos";

/** How often to re-ask the API for a vote Snapshot has already accepted. */
const VOTE_INDEXING_POLL_MS = 5_000;
Expand Down Expand Up @@ -661,7 +661,8 @@ const MobileBottomBar = ({
} else if (address) {
if (
proposalStatus === "succeeded" &&
daoId.toUpperCase() !== DaoIdEnum.SHU
// SHU is disabled in DaoIdEnum, so compare against its raw id.
daoId.toUpperCase() !== "SHU"
) {
content = (
<Button className="flex w-full" onClick={onQueueClick}>
Expand All @@ -672,7 +673,7 @@ const MobileBottomBar = ({
proposalStatus === "pending_execution" ||
// Azorius (SHU) proposals are QUEUED while timelocked and
// executeProposal reverts until PENDING_EXECUTION
(proposalStatus === "queued" && daoId.toUpperCase() !== DaoIdEnum.SHU)
(proposalStatus === "queued" && daoId.toUpperCase() !== "SHU")
) {
content = (
<Button className="flex w-full" onClick={onExecuteClick}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const TREE_URL =
const REPO_DAO_DIR: Partial<Record<DaoIdEnum, string>> = {
[DaoIdEnum.ENS]: "ens",
[DaoIdEnum.UNISWAP]: "uniswap",
[DaoIdEnum.SHU]: "shutter",
// SHU is disabled in DaoIdEnum.
// [DaoIdEnum.SHU]: "shutter",
[DaoIdEnum.TORN]: "tornado",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,26 @@ const GovernorBravoAbi = [
},
] as const;

const AzoriusExecuteAbi = [
{
name: "executeProposal",
type: "function",
stateMutability: "nonpayable",
inputs: [
{ internalType: "uint32", name: "_proposalId", type: "uint32" },
{ internalType: "address[]", name: "_targets", type: "address[]" },
{ internalType: "uint256[]", name: "_values", type: "uint256[]" },
{ internalType: "bytes[]", name: "_data", type: "bytes[]" },
{
internalType: "enum Enum.Operation[]",
name: "_operations",
type: "uint8[]",
},
],
outputs: [],
},
] as const;
// SHU is disabled in DaoIdEnum; restore this with the SHU case below.
// const AzoriusExecuteAbi = [
// {
// name: "executeProposal",
// type: "function",
// stateMutability: "nonpayable",
// inputs: [
// { internalType: "uint32", name: "_proposalId", type: "uint32" },
// { internalType: "address[]", name: "_targets", type: "address[]" },
// { internalType: "uint256[]", name: "_values", type: "uint256[]" },
// { internalType: "bytes[]", name: "_data", type: "bytes[]" },
// {
// internalType: "enum Enum.Operation[]",
// name: "_operations",
// type: "uint8[]",
// },
// ],
// outputs: [],
// },
// ] as const;

export type GovernanceAction = "queue" | "execute";

Expand Down Expand Up @@ -91,30 +92,31 @@ const submitAction = async (
hash = await client.writeContract(request);
break;
}
case DaoIdEnum.SHU: {
if (action === "queue") {
throw new Error("Queue is not supported for Azorius governance (SHU)");
}
// Azorius: executeProposal(proposalId, targets, values, data, operations)
// All operations are Call (0) for standard governance proposals
const operations = args.targets.map(() => 0);
const { request } = await client.simulateContract({
abi: AzoriusExecuteAbi,
address,
functionName: "executeProposal",
args: [
Number(args.proposalId),
args.targets,
args.values,
args.calldatas,
operations,
],
account: args.account,
chain,
});
hash = await client.writeContract(request);
break;
}
// SHU is disabled in DaoIdEnum.
// case DaoIdEnum.SHU: {
// if (action === "queue") {
// throw new Error("Queue is not supported for Azorius governance (SHU)");
// }
// // Azorius: executeProposal(proposalId, targets, values, data, operations)
// // All operations are Call (0) for standard governance proposals
// const operations = args.targets.map(() => 0);
// const { request } = await client.simulateContract({
// abi: AzoriusExecuteAbi,
// address,
// functionName: "executeProposal",
// args: [
// Number(args.proposalId),
// args.targets,
// args.values,
// args.calldatas,
// operations,
// ],
// account: args.account,
// chain,
// });
// hash = await client.writeContract(request);
// break;
// }
default: {
if (action === "queue") {
const { request } = await client.simulateContract({
Expand Down
63 changes: 33 additions & 30 deletions apps/dashboard/features/governance/utils/voteOnProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ import {
mapRelayerError,
} from "@/shared/utils/gaslessRelayerError";

const LinearVotingStrategyAbi = [
{
inputs: [
{ internalType: "uint32", name: "_proposalId", type: "uint32" },
{ internalType: "uint8", name: "_voteType", type: "uint8" },
],
name: "vote",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
// SHU is disabled in DaoIdEnum; restore this with the Azorius handler below.
// const LinearVotingStrategyAbi = [
// {
// inputs: [
// { internalType: "uint32", name: "_proposalId", type: "uint32" },
// { internalType: "uint8", name: "_voteType", type: "uint8" },
// ],
// name: "vote",
// outputs: [],
// stateMutability: "nonpayable",
// type: "function",
// },
// ] as const;

// Shared by OZ Governor (returns uint256) and GovernorBravo (returns void).
// `outputs` must stay empty: Bravo's castVote returns no data, and declaring a
Expand Down Expand Up @@ -94,22 +95,23 @@ type VoteHandler = (
/**
* Azorius/Fractal: vote on LinearVotingStrategy. No reason support.
*/
const azoriusVoteHandler =
(daoId: DaoIdEnum): VoteHandler =>
async (client, params) => {
const address =
daoConfigByDaoId[daoId].daoOverview.contracts.votingStrategy;
if (!address) throw new Error("Voting strategy address not found");

const { request } = await client.simulateContract({
abi: LinearVotingStrategyAbi,
address,
functionName: "vote",
args: [Number(params.proposalId), params.voteNumber],
account: params.account,
});
return client.writeContract(request);
};
// SHU is disabled in DaoIdEnum.
// const azoriusVoteHandler =
// (daoId: DaoIdEnum): VoteHandler =>
// async (client, params) => {
// const address =
// daoConfigByDaoId[daoId].daoOverview.contracts.votingStrategy;
// if (!address) throw new Error("Voting strategy address not found");
//
// const { request } = await client.simulateContract({
// abi: LinearVotingStrategyAbi,
// address,
// functionName: "vote",
// args: [Number(params.proposalId), params.voteNumber],
// account: params.account,
// });
// return client.writeContract(request);
// };

const TornGovernorVoteAbi = [
{
Expand Down Expand Up @@ -239,8 +241,9 @@ function getVoteHandler(
return gaslessVoteHandler(daoId);
}
switch (daoId) {
case DaoIdEnum.SHU:
return azoriusVoteHandler(daoId);
// SHU is disabled in DaoIdEnum.
// case DaoIdEnum.SHU:
// return azoriusVoteHandler(daoId);
case DaoIdEnum.TORN:
return tornVoteHandler(daoId);
default:
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/shared/types/daos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export enum DaoIdEnum {
NOUNS = "NOUNS",
SCR = "SCR",
OBOL = "OBOL",
SHU = "SHU",
// SHU = "SHU",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove Shutter from config-backed discovery surfaces

Commenting out this enum member makes every /shu route fail toDaoIdEnum, but Shutter remains registered in shared/dao-config/index.ts. Consequently, app/sitemap.ts and app/llms.txt/route.ts, which enumerate Object.keys(daoConfigByDaoId), still publish /shu and its proposal URLs even though those URLs now return 404. Remove the config registration as well, or make these discovery surfaces enumerate enabled DAOs.

Useful? React with 👍 / 👎.

// OPTIMISM = "OP",
UNISWAP = "UNI",
GITCOIN = "GTC",
Expand Down
Loading