Skip to content

Commit

Permalink
fix(Lucky drop): balance less than gas (#9629)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhanseng authored May 18, 2023
1 parent ea95fae commit c2c6d51
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import {
formatBalance,
ZERO,
} from '@masknet/web3-shared-base'
import { type ChainId, type GasConfig, SchemaType, useRedPacketConstants } from '@masknet/web3-shared-evm'
import {
type ChainId,
type GasConfig,
SchemaType,
useRedPacketConstants,
isNativeTokenAddress,
} from '@masknet/web3-shared-evm'
import { MenuItem, Select, Box, InputBase, Typography } from '@mui/material'
import { NetworkPluginID } from '@masknet/shared-base'
import {
Expand Down Expand Up @@ -215,7 +221,8 @@ export function RedPacketERC20Form(props: RedPacketFormProps) {
if (!account) return tr('plugin_wallet_connect_a_wallet')
if (isZero(shares || '0')) return 'Enter shares'
if (isGreaterThan(shares || '0', 255)) return 'At most 255 recipients'
if (isZero(amount) || !gasOption?.gas || loadingTransactionValue) return 'Enter an amount'
if (isZero(amount) || ((!gasOption?.gas || loadingTransactionValue) && isNativeTokenAddress(token?.address)))
return 'Enter an amount'

if (!isDivisible)
return t.indivisible({
Expand Down

0 comments on commit c2c6d51

Please sign in to comment.