Skip to content

Conversation

@notJoon
Copy link
Member

@notJoon notJoon commented Aug 11, 2025

Description

Use safe type conversion

Copy link
Member

@dongwon8247 dongwon8247 left a comment

Choose a reason for hiding this comment

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

Can you check these additional points?

  1. POOL
  • position.gno:122,127 - u256.MulDiv(...) for fee calculations (fee overflow)
  1. POSITION (String parsing issues)
  • mint.gno:261,270 - mustParseInt64(amount0Desired)
  • Large amounts fail to parse
  1. X96/X128 Operations Needing Protection
    All these MulDiv operations need overflow checks:
  • Pool fee growth: swap.gno:434
  • Position fees: position.gno:122,127
  • Liquidity calculations: Multiple files
  • Reward calculations: reward_manager.gno:119

@notJoon
Copy link
Member Author

notJoon commented Aug 11, 2025

Can you check these additional points?

@dongwon8247
trying to resolve them in this PR #816

For the mustParseInt64 function, a parameter value of 9.2 * 10^18 or greater would need to be passed. However, when passing such a value through gnokey as an entry function, the input itself is impossible, and since it's only used for native token wrapping, there would be no problem unless the user actually possesses that amount of tokens.

@dongwon8247 dongwon8247 merged commit 79978b8 into main Aug 11, 2025
6 of 7 checks passed
@sonarqubecloud
Copy link

@dongwon8247 dongwon8247 deleted the fix/use-safeConvertToInt64 branch August 11, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants