Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: check allowance before approve #166

Merged
merged 6 commits into from
Nov 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: run prettier 💅
bayological committed Nov 27, 2024
commit 4ed09d2bfa6d75f3d85e9d2d9c895e3d66305e84
3 changes: 1 addition & 2 deletions src/features/swap/useSwapTransaction.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ export function useSwapTransaction(

let canSwap = false


if (needsApproval) {
canSwap = isApproveConfirmed ?? false
} else {
@@ -56,7 +55,7 @@ export function useSwapTransaction(
logger.info('Returning null')
return null
}

const sdk = await getMentoSdk(chainId)
const fromTokenAddr = getTokenAddress(fromToken, chainId)
const toTokenAddr = getTokenAddress(toToken, chainId)