Skip to content

Commit

Permalink
refactor: Remove BigNumber (pancakeswap#2092)
Browse files Browse the repository at this point in the history
  • Loading branch information
hachiojidev authored Sep 7, 2021
1 parent 2554a0f commit eafe39f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/views/Pools/hooks/useApprove.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useCallback, useEffect, useState } from 'react'
import { useWeb3React } from '@web3-react/core'
import { ethers, Contract } from 'ethers'
import BigNumber from 'bignumber.js'
import { useAppDispatch } from 'state'
import { updateUserAllowance } from 'state/actions'
import { useTranslation } from 'contexts/Localization'
Expand Down Expand Up @@ -100,8 +99,7 @@ export const useCheckVaultApprovalStatus = () => {
useEffect(() => {
const checkApprovalStatus = async () => {
try {
const response = await cakeContract.allowance(account, cakeVaultContract.address)
const currentAllowance = new BigNumber(response.toString())
const currentAllowance = await cakeContract.allowance(account, cakeVaultContract.address)
setIsVaultApproved(currentAllowance.gt(0))
} catch (error) {
setIsVaultApproved(false)
Expand Down

0 comments on commit eafe39f

Please sign in to comment.