Skip to content

New Shift Protocol token: Add hibaUSD contract #18693

Open
Gloom0x0 wants to merge 3 commits intoDefiLlama:mainfrom
Gloom0x0:main
Open

New Shift Protocol token: Add hibaUSD contract #18693
Gloom0x0 wants to merge 3 commits intoDefiLlama:mainfrom
Gloom0x0:main

Conversation

@Gloom0x0
Copy link
Copy Markdown
Contributor

@Gloom0x0 Gloom0x0 commented Apr 8, 2026

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  1. If you would like to add a volume/fees/revenue adapter please submit the PR here.

  2. 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.

  3. 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.

  4. 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

  5. Please do not add new npm dependencies, do not edit/push pnpm-lock.yaml file 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

  • Chores
    • Updated Arbitrum chain configuration to include an additional token in TVL calculations. The token list for Arbitrum now contains three tokens instead of two, ensuring more comprehensive total value locked metrics for the Arbitrum chain.

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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

An 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 totalSupply data from the newly added contract.

Changes

Cohort / File(s) Summary
Arbitrum Token Configuration
projects/shift-protocol/index.js
Added new ERC-20 token address 0x7174f0bD02664BebDB6Aa79a99fAF949570A10bd to the Arbitrum chain's token list, expanding TVL computation scope.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A token hops into the fold,
Arbitrum's treasury, bright and bold,
Three addresses dance instead of two,
TVL grows with something new! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the repository template with guidance but no actual completion of required new-listing metadata fields (name, chain, token address, description, etc.). Complete the new-listing metadata section by filling in relevant fields such as token name, chain, contract address, and description to properly document the added token.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a new token (hibaUSD) contract to the Shift Protocol adapter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@llamabutler
Copy link
Copy Markdown

The adapter at projects/shift-protocol exports TVL:

arbitrum                  958.67 k
base                      692.51 k

total                    1.65 M 

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6c2721b and 75e7ffd.

📒 Files selected for processing (1)
  • projects/shift-protocol/index.js

Comment on lines +8 to +9
"0x6d7C897cD8B402690C07e7263C9f59B3777ae3c2",
"0x7174f0bD02664BebDB6Aa79a99fAF949570A10bd"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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}")
PY

Repository: 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.

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.

2 participants