New Shift Protocol token: Add hibaUSD contract #18693
New Shift Protocol token: Add hibaUSD contract #18693Gloom0x0 wants to merge 3 commits intoDefiLlama:mainfrom
Conversation
Add the new Arbitrum contract address for vGRVT (0x6d7C897cD8B402690C07e7263C9f59B3777ae3c2) to the arbitrum array in projects/shift-protocol/index.js so the deployment is included in the protocol configuration.
Add the new Arbitrum contract address for hibaUSD (0x7174f0bD02664BebDB6Aa79a99fAF949570A10bd) to the arbitrum array in projects/shift-protocol/index.js so the deployment is included in the protocol configuration.
📝 WalkthroughWalkthroughAn additional ERC-20 contract address was added to the Arbitrum chain token configuration in the shift-protocol project. This expands the token set from two to three addresses, causing the Arbitrum TVL calculation to include Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The adapter at projects/shift-protocol exports TVL: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@projects/shift-protocol/index.js`:
- Around line 8-9: The token addresses passed into api.add are mixed-case and
must be normalized to lowercase before being used; update the code that iterates
over the tokens (the array containing
"0x6d7C897cD8B402690C07e7263C9f59B3777ae3c2",
"0x7174f0bD02664BebDB6Aa79a99fAF949570A10bd" and any existing config) to call
.toLowerCase() on each address before calling api.add (reference api.add and the
token list in projects/shift-protocol/index.js) so balances are stored
consistently as `${chain}:${token.toLowerCase()}` and avoid duplicate keys.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: eaffac3d-2025-43d1-a963-c9f998ed84cc
📒 Files selected for processing (1)
projects/shift-protocol/index.js
| "0x6d7C897cD8B402690C07e7263C9f59B3777ae3c2", | ||
| "0x7174f0bD02664BebDB6Aa79a99fAF949570A10bd" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether this adapter passes mixed-case EVM addresses into api.add without normalization.
set -euo pipefail
echo "1) Locate adapter file and api.add usage:"
rg -n -C2 "api\.add\(|multiCall|const tokens =" projects/shift-protocol/index.js
echo
echo "2) Extract configured EVM addresses and report casing:"
python - <<'PY'
import re, pathlib
p = pathlib.Path("projects/shift-protocol/index.js")
s = p.read_text()
addrs = re.findall(r'"(0x[a-fA-F0-9]{40})"', s)
print(f"Found {len(addrs)} addresses")
for a in addrs:
kind = "lowercase" if a == a.lower() else "mixed/checksum"
print(f"{a} -> {kind}")
PYRepository: DefiLlama/DefiLlama-Adapters
Length of output: 779
Normalize token addresses to lowercase before passing them to api.add().
Currently, mixed-case token addresses (lines 8–9 and existing config) are passed directly to api.add() without normalization. The SDK stores balances keyed as ${chain}:${token} without internal lowercasing, so future address casing variations—whether from config changes or external data—will create separate balance entries, causing duplicate keys for the same token.
Proposed refactor
Object.keys(config).forEach(chain => {
- const tokens = config[chain]
+ const tokens = config[chain].map(t => t.toLowerCase())
module.exports[chain] = {
tvl: async (api) => {
const supply = await api.multiCall({ abi: 'erc20:totalSupply', calls: tokens })
api.add(tokens, supply)
}
}
})🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@projects/shift-protocol/index.js` around lines 8 - 9, The token addresses
passed into api.add are mixed-case and must be normalized to lowercase before
being used; update the code that iterates over the tokens (the array containing
"0x6d7C897cD8B402690C07e7263C9f59B3777ae3c2",
"0x7174f0bD02664BebDB6Aa79a99fAF949570A10bd" and any existing config) to call
.toLowerCase() on each address before calling api.add (reference api.add and the
token list in projects/shift-protocol/index.js) so balances are stored
consistently as `${chain}:${token.toLowerCase()}` and avoid duplicate keys.
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
If you would like to add a
volume/fees/revenueadapter please submit the PR here.Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
For updating listing info It is a different repo, you can find your listing in this file, you can edit it there and put up a PR
Please do not add new npm dependencies, do not edit/push
pnpm-lock.yamlfile as part of your changes(Needs to be filled only for new listings)
Name (to be shown on DefiLlama):
Twitter Link:
List of audit links if any:
Website Link:
Logo (High resolution, will be shown with rounded borders):
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain:
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one:
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
Github org/user (Optional, if your code is open source, we can track activity):
Does this project have a referral program?
Summary by CodeRabbit