-
Notifications
You must be signed in to change notification settings - Fork 58
fix: use correct solv token #694
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe change updates the token address key for xSolvBTC in the Changes
Estimated code review effort1 (~2 minutes) Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
sdk/src/gateway/strategy.ts (1)
86-117
: Harden against casing errorsThis is the second time an address casing slip has caused a silent failure.
Consider wrapping address keys with.toLowerCase()
when constructingtokensPointsIncentives
(and similar maps) or introducing a helper that normalises addresses at insertion time.
// Solv (xSolvBTC) | ||
'0x0bef2a8b771e37763c1ce02a88f404c6b2573843', | ||
'0xCC0966D8418d412c599A6421b760a847eB169A8c', | ||
[solvPoints, babylonPoints], | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Mixed-case key breaks lookup
getTokensIncentives()
lower-cases the incoming token address (line 191).
Because this new map key is mixed-case, the lookup will fail and xSolvBTC will no longer receive its incentives.
- '0xCC0966D8418d412c599A6421b760a847eB169A8c',
+ '0xcc0966d8418d412c599a6421b760a847eb169a8c',
Make all keys lowercase (or normalise on insertion) to keep behaviour consistent.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// Solv (xSolvBTC) | |
'0x0bef2a8b771e37763c1ce02a88f404c6b2573843', | |
'0xCC0966D8418d412c599A6421b760a847eB169A8c', | |
[solvPoints, babylonPoints], | |
], | |
// Solv (xSolvBTC) | |
'0xcc0966d8418d412c599a6421b760a847eb169a8c', | |
[solvPoints, babylonPoints], | |
], |
🤖 Prompt for AI Agents
In sdk/src/gateway/strategy.ts around lines 93 to 96, the token address key for
xSolvBTC is mixed-case, but getTokensIncentives() lowercases addresses before
lookup, causing a mismatch and failed incentive retrieval. Fix this by
converting the token address key to lowercase when inserting it into the map to
ensure consistent case normalization and successful lookups.
Summary by CodeRabbit