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

Fix/minitswap sub overflow #16

Merged
merged 2 commits into from
Mar 20, 2024
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
Binary file modified precompile/binaries/stdlib/minitswap.mv
Binary file not shown.
6 changes: 6 additions & 0 deletions precompile/modules/initia_stdlib/sources/minitswap.move
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,12 @@ module initia_std::minitswap {
// when fully recovered rate is too close to 0.5 y can be same with sim_size
if (y == sim_size) break;

// when fully recovered rate is too close to 0.5 x can be slightly higher than sim_size
if (x > sim_size) {
x = sim_size;
break
};

if (x > x_prev) {
if (x - x_prev <= 1) break
} else {
Expand Down
Loading