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

Pool Stable: integer overflow will prevent depositors from adding liquidity to stable pool #360

Conversation

gangov
Copy link
Collaborator

@gangov gangov commented Jul 12, 2024

No description provided.

@gangov gangov added the audit label Jul 12, 2024
@gangov gangov self-assigned this Jul 12, 2024
@gangov gangov requested a review from ueco-jb July 15, 2024 15:01
@gangov gangov force-pushed the 343-phoam-013-integer-overflow-will-prevent-depositors-from-adding-liquidity-to-stable-pool branch from 6d9861b to 93effca Compare July 17, 2024 12:55
@gangov
Copy link
Collaborator Author

gangov commented Jul 18, 2024

the values are already using u256 when multiplying, this PR contains checks if to make sure we don't use values for stable pool pairs that can still overflow with u256

@gangov gangov force-pushed the 343-phoam-013-integer-overflow-will-prevent-depositors-from-adding-liquidity-to-stable-pool branch from 93effca to e78d1e9 Compare July 19, 2024 12:16
@gangov gangov requested a review from ueco-jb July 19, 2024 12:53
@gangov gangov force-pushed the 343-phoam-013-integer-overflow-will-prevent-depositors-from-adding-liquidity-to-stable-pool branch from 85aec45 to 737c992 Compare July 22, 2024 13:24
Copy link
Member

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those test cases needs to be refactored, right now they seems to be more confusing.

contracts/pool_stable/src/tests/liquidity.rs Outdated Show resolved Hide resolved
contracts/pool_stable/src/tests/swap.rs Outdated Show resolved Hide resolved
@gangov gangov force-pushed the 343-phoam-013-integer-overflow-will-prevent-depositors-from-adding-liquidity-to-stable-pool branch 3 times, most recently from 12fb91d to 1323fda Compare July 29, 2024 12:06
@gangov gangov force-pushed the 343-phoam-013-integer-overflow-will-prevent-depositors-from-adding-liquidity-to-stable-pool branch from f34e6ae to 2e5a4d0 Compare July 30, 2024 13:30
@gangov gangov requested a review from ueco-jb July 30, 2024 18:14
@ueco-jb ueco-jb closed this Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHOAM-013: Integer overflow will prevent depositors from adding liquidity to stable pool
2 participants