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

303 slippage impact for tokens with no decimals #304

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<li><a href='#run-project'>Basic usage</a></li>
</ul>
</li>
<li href='#how-to-manually-test-the-app'>How to manually test the app</li>
<li><a href='#how-to-manually-test-the-app'>How to manually test the app</a></li>
<li><a href='#ui-kit'>Contributors</a>
<ul>
<li><a href='#customizing-styles-with-tailwindcss'>Customizing Styles with Tailwind.css</a></li>
Expand Down
1 change: 1 addition & 0 deletions src/app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"insufficientTokenAmount": "Insufficient {{token}} amount",
"insufficientTokenLiquidity": "Insufficient {{token}} liquidity in pool",
"minimumTokenAmountExceeded": "Minimum asset token amount exceeded",
"toLowForSwap":"{{token}} amount too low - slippage impact",
"enterAmount": "Enter amount",
"selectToken": "Select token",
"swap": "Swap",
Expand Down
6 changes: 6 additions & 0 deletions src/components/organism/SwapTokens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ const SwapTokens = () => {
disabled: true,
};
}
if (Number(tokenBValueForSwap.tokenValue) < 1 && selectedTokens.tokenB.decimals === "0") {
return {
label: t("button.toLowForSwap", { token: selectedTokens.tokenB.tokenSymbol }),
disabled: true,
};
}
if (
selectedTokens.tokenA.tokenSymbol !== nativeTokenSymbol &&
tokenANumber >
Expand Down