Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

refactor: replace NULL_ADDRESS with zeroAddress in Transfer component and helpers

yoginth.com 160fad58 52b0069b

verified
+5 -6
+3 -3
apps/web/src/components/Shared/Account/TopUp/Transfer.tsx
··· 1 1 import { ArrowUpRightIcon } from "@heroicons/react/24/outline"; 2 - import { NATIVE_TOKEN_SYMBOL, NULL_ADDRESS } from "@hey/data/constants"; 2 + import { NATIVE_TOKEN_SYMBOL } from "@hey/data/constants"; 3 3 import { useBalancesBulkQuery, useDepositMutation } from "@hey/indexer"; 4 4 import type { ApolloClientError } from "@hey/types/errors"; 5 5 import { ··· 11 11 useState 12 12 } from "react"; 13 13 import { toast } from "sonner"; 14 - import type { Hex } from "viem"; 14 + import { type Hex, zeroAddress } from "viem"; 15 15 import { useAccount, useWaitForTransactionReceipt } from "wagmi"; 16 16 import Skeleton from "@/components/Shared/Skeleton"; 17 17 import { Button, Card, Input, Spinner } from "@/components/Shared/UI"; ··· 204 204 const params = new URLSearchParams({ 205 205 inputChain: "lens", 206 206 isExactOut: "false", 207 - outToken: token?.contractAddress ?? NULL_ADDRESS, 207 + outToken: token?.contractAddress ?? zeroAddress, 208 208 utm_medium: "sites", 209 209 utm_source: "hey.xyz" 210 210 });
-1
packages/data/constants.ts
··· 14 14 export const IS_MAINNET = LENS_API_URL === LENS_ENDPOINT.Mainnet; 15 15 export const CHAIN = IS_MAINNET ? chains.mainnet : chains.testnet; 16 16 export const ADDRESS_PLACEHOLDER = "0x03Ba3...7EF"; 17 - export const NULL_ADDRESS = "0x0000000000000000000000000000000000000000"; 18 17 19 18 // Subscription 20 19 export const SUBSCRIPTION_AMOUNT = 20;
+2 -2
packages/helpers/isAccountDeleted.ts
··· 1 - import { NULL_ADDRESS } from "@hey/data/constants"; 2 1 import type { AccountFragment } from "@hey/indexer"; 2 + import { zeroAddress } from "viem"; 3 3 4 4 const isAccountDeleted = (account: AccountFragment): boolean => 5 - account.owner === NULL_ADDRESS; 5 + account.owner === zeroAddress; 6 6 7 7 export default isAccountDeleted;