diff --git a/staking-dashboard/src/components/Provider/StakingFlowModal.tsx b/staking-dashboard/src/components/Provider/StakingFlowModal.tsx index 837b91e06..bc5f79c7f 100644 --- a/staking-dashboard/src/components/Provider/StakingFlowModal.tsx +++ b/staking-dashboard/src/components/Provider/StakingFlowModal.tsx @@ -34,6 +34,7 @@ export const StakingFlowModal = ({ headerSubtitle="Select your staking source and amount to be staked" stakeCountLabel="Stake Count" maxStakesOverride={queueLength} + blockInsiderVaults /> ) } diff --git a/staking-dashboard/src/components/SourceSelectionModal.tsx b/staking-dashboard/src/components/SourceSelectionModal.tsx index f49e4d891..6a4c63087 100644 --- a/staking-dashboard/src/components/SourceSelectionModal.tsx +++ b/staking-dashboard/src/components/SourceSelectionModal.tsx @@ -8,6 +8,7 @@ import { useRollupData } from "@/hooks/rollup/useRollupData" import { useATP } from "@/hooks/useATP" import { useMultipleStakeableAmounts, type StakeableATPData } from "@/hooks/atp/useMultipleStakeableAmounts" import { formatTokenAmount } from "@/utils/atpFormatters" +import { INSIDER_DELEGATION_MESSAGE, isInsiderAtp } from "@/utils/insiderAtp" // Internal type for modal selection state - includes vault data for display type SelectedStakingSource = "wallet" | { type: "vault"; atp: StakeableATPData } @@ -23,6 +24,8 @@ export interface SourceSelectionModalProps { stakeCountLabel: string // Optional constraint (e.g., provider queue length) maxStakesOverride?: number + // Delegation only: insider ATPs earn no rewards on locked tokens (AZIP-32), so they can't be picked + blockInsiderVaults?: boolean } /** @@ -38,6 +41,7 @@ export const SourceSelectionModal = ({ headerSubtitle, stakeCountLabel, maxStakesOverride, + blockInsiderVaults = false, }: SourceSelectionModalProps) => { const { address } = useAccount() const { stakingAssetAddress, decimals, symbol } = useStakingAssetTokenDetails() @@ -197,15 +201,19 @@ export const SourceSelectionModal = ({ ? Math.min(maxFromVault, maxStakesOverride) : maxFromVault const isSelected = selectedSource !== "wallet" && selectedSource?.type === "vault" && selectedSource.atp.atpAddress === atp.atpAddress + const isBlocked = blockInsiderVaults && isInsiderAtp(atp.registry) return ( diff --git a/staking-dashboard/src/components/WalletConnectionAlert/WalletConnectionAlertModal.tsx b/staking-dashboard/src/components/WalletConnectionAlert/WalletConnectionAlertModal.tsx index c0e1b882a..18291f1ca 100644 --- a/staking-dashboard/src/components/WalletConnectionAlert/WalletConnectionAlertModal.tsx +++ b/staking-dashboard/src/components/WalletConnectionAlert/WalletConnectionAlertModal.tsx @@ -1,23 +1,13 @@ import { useEffect, useState } from "react" import { createPortal } from "react-dom" import { useAccount } from "wagmi" -import { isAddressEqual, type Address } from "viem" import { useATP } from "@/hooks/useATP" import { useRollupData } from "@/hooks/rollup/useRollupData" import { useStakingAssetTokenDetails } from "@/hooks/stakingRegistry" import { Icon } from "@/components/Icon" import { useMultipleStakeableAmounts } from "@/hooks/atp" import { formatTokenAmount } from "@/utils/atpFormatters" - -// Employee and investor ATP registries on mainnet. Their ATPs have no staking requirement -// before withdrawal, so they don't count towards this alert. -const INSIDER_ATP_REGISTRIES: Address[] = [ - "0xD938bE4A2cB41105Bc2FbE707dca124A2e5d0c80", - "0x667d2641cb96734f386adA6A9afCF07B1815fB8b", -] - -const isInsiderAtp = (registry: Address | undefined) => - !!registry && INSIDER_ATP_REGISTRIES.some((insider) => isAddressEqual(insider, registry)) +import { isInsiderAtp } from "@/utils/insiderAtp" interface WalletConnectionAlertModalProps { isSafeWarningShown: boolean diff --git a/staking-dashboard/src/utils/insiderAtp.ts b/staking-dashboard/src/utils/insiderAtp.ts new file mode 100644 index 000000000..ee45b1ad3 --- /dev/null +++ b/staking-dashboard/src/utils/insiderAtp.ts @@ -0,0 +1,15 @@ +import { isAddressEqual, type Address } from "viem" + +// ATP registries covered by AZIP-32. Their ATPs have no staking requirement before +// withdrawal, and their locked tokens earn no sequencer rewards. They may still run their +// own node, but delegating them to a provider is disabled. +export const INSIDER_ATP_REGISTRIES: Address[] = [ + "0xD938bE4A2cB41105Bc2FbE707dca124A2e5d0c80", + "0x667d2641cb96734f386adA6A9afCF07B1815fB8b", +] + +export const isInsiderAtp = (registry: Address | undefined) => + !!registry && INSIDER_ATP_REGISTRIES.some((insider) => isAddressEqual(insider, registry)) + +export const INSIDER_DELEGATION_MESSAGE = + "Locked tokens don't earn staking rewards. To delegate, claim your unlocked tokens from this Token Vault first, then stake them from your wallet."