Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Feb 13, 2024
1 parent bfaf01b commit f714dfc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ export default function DepositButton() {
const isDisabled = accountId && (isLocked || !baseTokenAmount)

const { address } = useAccount()
const { data: allowance } = useErc20Allowance({
const { data: allowance, error, isError } = useErc20Allowance({
address: Token.findAddressByTicker(baseTicker) as `0x${string}`,
args: [address ? address : "0x", env.NEXT_PUBLIC_DARKPOOL_CONTRACT as `0x${string}`],
watch: true
})
console.log("πŸš€ ~ DepositButton ~ isError:", isError)
console.log("πŸš€ ~ DepositButton ~ error:", error)
console.log("πŸš€ ~ DepositButton ~ allowance:", allowance)
const needsApproval = allowance === BigInt(0)
const needsApproval = !allowance || allowance === BigInt(0)
console.log("πŸš€ ~ DepositButton ~ needsApproval:", needsApproval)

const { config } = usePrepareErc20Approve({
Expand Down

0 comments on commit f714dfc

Please sign in to comment.