Closed
Conversation
There was a problem hiding this comment.
Hey - I've found 1 security issue, and left some high level feedback:
Security issues:
- Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (link)
General comments:
- In GenericDistributionHelper::onDistribution, the logic that selects gasFee/gdFee based on pool liquidity is incorrect: gasBalance/stableBalance are never updated inside the loops, so you always compare to the original pool’s balances and only update the fee without updating the reference balance; you likely want to track and update both the best balance and its corresponding fee as you iterate.
- In scripts/multichain-deploy/createUniswapTestPools.ts, the price calculations use JavaScript Number with large intermediate values (e.g. (10 ** 12) * (Number(sqrtPriceX96.toString()) / 2 ** 96) ** 2), which can overflow or lose precision; consider doing this math with BigNumber / JSBI or keeping it on-chain if you need reliable values rather than approximate logging.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In GenericDistributionHelper::onDistribution, the logic that selects gasFee/gdFee based on pool liquidity is incorrect: gasBalance/stableBalance are never updated inside the loops, so you always compare to the original pool’s balances and only update the fee without updating the reference balance; you likely want to track and update both the best balance and its corresponding fee as you iterate.
- In scripts/multichain-deploy/createUniswapTestPools.ts, the price calculations use JavaScript Number with large intermediate values (e.g. (10 ** 12) * (Number(sqrtPriceX96.toString()) / 2 ** 96) ** 2), which can overflow or lose precision; consider doing this math with BigNumber / JSBI or keeping it on-chain if you need reliable values rather than approximate logging.
## Individual Comments
### Comment 1
<location> `releases/deploy-settings.json:315` </location>
<code_context>
0x951857744785e80e2de051c32ee7b25f9c458c42
</code_context>
<issue_to_address>
**security (generic-api-key):** Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
*Source: gitleaks*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Identity v4
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
add multiple reverification frequencies