Skip to content
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

chore(token-registry): xNIBI and early wrapped ERC20s #2208

Merged
merged 8 commits into from
Feb 26, 2025
Merged

Conversation

Unique-Divine
Copy link
Member

@Unique-Divine Unique-Divine commented Feb 12, 2025

Purpose / Abstract

  1. PR to sync with external registries
  2. ci: improve changelog-check.yml workflow to better handle a monorepo
  3. Fixes export paths for the @nibiruchain/evm-core" package and published them in v0.0.3.
  4. Add official token registry JSON files for ERC20s and Bank Coins (described below)

In an ERC20s JSON file

This PR adds JSON files to identify "verified" tokens in the Nibiru web app.

image

For more information, see https://github.com/NibiruChain/go-heartmonitor/issues/378

Format for registered tokens

[Expand to see example data]
[
  {
    "contractAddr": "0x7D4B7B8CA7E1a24928Bb96D59249c7a5bd1DfBe6",
    "displayName": "Wrapped Nibiru",
    "symbol": "WNIBI",
    "logoSrc": "https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/000_nibiru-evm.png",
    "priceInfo": {
      "source": "bybit",
      "priceId": "NIBIUSDT"
    }
  },
  {
    "contractAddr": "0xcA0a9Fb5FBF692fa12fD13c0A900EC56Bb3f0a7b",
    "displayName": "Liquid Staked Nibiru (Wrapped)",
    "symbol": "stNIBI",
    "logoSrc": "https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/001_stnibi-evm.png"
  },
  {
    "contractAddr": "0x7168634Dd1ee48b1C5cC32b27fD8Fc84E12D00E6",
    "displayName": "Astrovault (Wrapped)",
    "symbol": "AXV",
    "logoSrc": "https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/003_astrovault-axv.png"
  }
]

In the cosmos/chain-registry

Copy link
Contributor

coderabbitai bot commented Feb 12, 2025

📝 Walkthrough

Walkthrough

The changes update the monorepo’s CI workflow and token registry. In the CI workflow, a new changelog job is introduced to conditionally enforce changelog updates when Go-related files or specific changelog files are modified. The package.json has a version bump and adjusted export paths. In the token registry, documentation files are updated, new JSON configuration files for tokens are added, image URL conversions are revised, helper functions have been renamed and extended, and the main function now generates additional asset files. A new test suite validates these token registry enhancements.

Changes

Files Change Summary
.github/workflows/changelog-check.yml Added a new changelog job with steps to checkout the repository, use dorny/paths-filter@v3 to detect changes, and conditionally run the changelog enforcer.
evm-core-ts/package.json Updated the version (0.0.2 → 0.0.3) and simplified export paths by removing redundant directories.
token-registry/CHANGELOG.md, token-registry/README.md Updated documentation by adding a new changelog entry and new sections explaining token data export and the erc20s_official.json configuration details.
token-registry/cosmos_assetlist.go, token-registry/githubify.go Revised image URLs for tokens (switching from local to remote on GitHub) and renamed/extended functions to improve GitHub URL conversion logic.
token-registry/main/main.go Replaced the custom root path finder with tokenregistry.FindRootPath(), consolidated constants, and added functionality to generate new JSON files for official token data.
token-registry/official_bank_coins.json, token-registry/official_erc20s.json Introduced new JSON configuration files listing token objects for bank coins and ERC20 tokens with properties such as contractAddr, displayName, symbol, and optional priceInfo.
token-registry/official_tokens.go, token-registry/official_tokens_test.go Added a new token registry module with types, helper methods (including GitHubify and its reverse) and a corresponding test suite validating JSON data and image URL integrity.

Sequence Diagram(s)

sequenceDiagram
    participant R as Repository
    participant W as Changelog Workflow
    participant C as Checkout Action
    participant P as Paths Filter
    participant E as Changelog Enforcer

    R->>W: Trigger on push/PR
    W->>C: Checkout repository (actions/checkout@v4)
    W->>P: Run paths filter (dorny/paths-filter@v3)
    P-->>W: Output flags (Go files/changelog edits)
    alt Go changes or missing changelog
      W->>E: Execute changelog enforcer action (dangoslen/changelog-enforcer@v3)
      E-->>W: Complete check
    else
      W->>W: Skip changelog enforcer
    end
Loading
sequenceDiagram
    participant M as Main Function
    participant TR as tokenregistry Package
    participant FS as File System

    M->>TR: Call FindRootPath()
    M->>TR: ParseOfficialSaveBz(ERC20S)
    M->>TR: ParseOfficialSaveBz(BANK_COINS)
    TR-->>M: Return JSON data
    M->>FS: Write official_erc20s.json and official_bank_coins.json
    M->>M: Log output messages
Loading

Possibly related PRs

Suggested labels

skip-changelog, x: evm

Suggested reviewers

  • onikonychev

Poem

I'm a nimble bunny with code in my ears,
Hopping through files with joyful cheers.
I nibble on updates—CI workflows and tokens so neat,
Transforming local paths into GitHub treats.
With each change the burrow grows bright and new,
Celebrating progress in every line I review!
🥕🐰


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.78%. Comparing base (1921af9) to head (ed26d76).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2208   +/-   ##
=======================================
  Coverage   64.78%   64.78%           
=======================================
  Files         277      277           
  Lines       22281    22281           
=======================================
  Hits        14435    14435           
  Misses       6861     6861           
  Partials      985      985           
Files with missing lines Coverage Δ
token-registry/assetlist.go 98.23% <100.00%> (ø)

@Unique-Divine Unique-Divine marked this pull request as ready for review February 26, 2025 19:00
@Unique-Divine Unique-Divine requested a review from a team as a code owner February 26, 2025 19:00
Copy link
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: 2

🧹 Nitpick comments (12)
token-registry/README.md (6)

6-8: Good documentation for export instructions.
The newly added section "Exporting for the cosmos/chain-registry" clearly explains the process for generating token registry files. Consider adding a hyperlink to the just documentation to help users unfamiliar with the tool.


14-17: Tool Installation Guidance.
The instructions for installing the just command using Cargo are straightforward. Please ensure that users are aware they must have Cargo installed beforehand, or include a note linking to the Cargo installation guide.


28-29: Refine symbol Field Description.
The description for the symbol field contains extra punctuation that can be simplified for clarity. For example, you might rephrase it as:

- - `symbol`: Symbol, or ticker, of the digital asset.  
-   Example: "ETH", "NIBI"
+ - `symbol`: The ticker symbol of the digital asset.  
+   Example: "ETH", "NIBI"
🧰 Tools
🪛 LanguageTool

[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...en. Example: "Wrapped Ether". - symbol: Symbol, or ticker, of the digital asset...

(UNLIKELY_OPENING_PUNCTUATION)


33-34: Consistent List Indentation.
The nested list items under the decimals examples are indented with 3 spaces. For consistency with markdown style guidelines (which recommend 2 spaces), please adjust the indentation.

-   - Example: NIBI has 6 decimals. This means the base unit seen onchain is 10^{-6} NIBI.
-   - Example: ETH has 18 decimals. This means the base unit of ETH is 10^{-18} ether.
+  - Example: NIBI has 6 decimals. This means the base unit seen onchain is 10^{-6} NIBI.
+  - Example: ETH has 18 decimals. This means the base unit of ETH is 10^{-18} ether.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

33-33: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


34-34: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


35-37: Clarify logoSrc Field Description.
The explanation for the logoSrc field can be refined by rephrasing and reducing unnecessary punctuation. For instance, consider:

- - `logoSrc`: GitHub static asset link for the logo image that will often appear
- inside a circular frame.  
-   Example: "raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/0000_nibiru.png"
+ - `logoSrc`: A URL linking to the token's logo image (typically displayed within a circular frame).  
+   Example: "raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/0000_nibiru.png"
🧰 Tools
🪛 LanguageTool

[uncategorized] ~35-~35: Loose punctuation mark.
Context: ...it of ETH is 10^{-18} ether. - logoSrc: GitHub static asset link for the logo i...

(UNLIKELY_OPENING_PUNCTUATION)


39-39: Convert Bare URL to Markdown Link.
The bare URL in the "Related Ticket" section can be reformatted into a clickable markdown link for improved readability and consistency. For example:

-Related Ticket: https://github.com/NibiruChain/go-heartmonitor/issues/378
+Related Ticket: [GitHub Issue #378](https://github.com/NibiruChain/go-heartmonitor/issues/378)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

39-39: Bare URL used
null

(MD034, no-bare-urls)

.github/workflows/changelog-check.yml (2)

11-24: Documentation Cleanup in Comments

The newly added comments explain the changelog enforcement logic in a monorepo context. However, there are a couple of typos (e.g., "implemenation" should be "implementation" and "projecs" should be "projects"). A quick cleanup will improve clarity.


32-45: Filter Definitions and Trailing Whitespace

The filters are well defined to monitor changes in any CHANGELOG.md file and a variety of Go and proto files. Note: Static analysis flagged trailing spaces on line 34—please remove them for improved formatting.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 34-34: trailing spaces

(trailing-spaces)

token-registry/official_tokens.go (1)

47-47: Simplify token processing.

The token processing can be simplified by directly assigning the result of GitHubify.

-	parsedTokens[i] = *(&token).GitHubify()
+	tokenCopy := token
+	parsedTokens[i] = *tokenCopy.GitHubify()
token-registry/githubify.go (3)

22-24: Consider using package-level constants for repetitive URL segments

The URL components appear multiple times throughout the file. It would be more maintainable to define them as constants rather than repeating string literals.

package tokenregistry

import "strings"

+const (
+   // LocalImagePrefix is the prefix for local image paths
+   LocalImagePrefix = "./img/"
+   // GitHubRawURLPrefix is the prefix for GitHub raw image URLs
+   GitHubRawURLPrefix = "https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/"
+)

Also applies to: 30-32


24-28: Consider adding validation for the input

The function assumes the input is in the expected format but doesn't handle edge cases like empty strings or malformed paths.

func LocalImageToGitHub(local string) string {
+	if local == "" {
+		return ""
+	}
	prefix := "./img/"
	trimmed := strings.TrimPrefix(local, prefix)
+	if trimmed == local {
+		// Not a local image path format, return as is
+		return local
+	}
	return "https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/img/" + trimmed
}

75-90: Good implementation of reverse conversion functions

The GitHubImageToLocal and IsGitHubImage functions mirror their counterparts nicely, providing the reverse functionality in a consistent manner.

However, there is duplication of the GitHub URL prefix string. Consider using the constant suggested earlier.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8cae09b and be6efac.

⛔ Files ignored due to path filters (14)
  • token-registry/img/000_nibiru-evm.png is excluded by !**/*.png
  • token-registry/img/000_nibiru-evm.svg is excluded by !**/*.svg
  • token-registry/img/000_nibiru.png is excluded by !**/*.png
  • token-registry/img/000_nibiru.svg is excluded by !**/*.svg
  • token-registry/img/001_stnibi-bank.png is excluded by !**/*.png
  • token-registry/img/001_stnibi-evm.png is excluded by !**/*.png
  • token-registry/img/001_stnibi-evm.svg is excluded by !**/*.svg
  • token-registry/img/002_usdc-noble.png is excluded by !**/*.png
  • token-registry/img/002_usdc.png is excluded by !**/*.png
  • token-registry/img/002_usdc.svg is excluded by !**/*.svg
  • token-registry/img/003_astrovault-axv-bank.png is excluded by !**/*.png
  • token-registry/img/003_astrovault-axv.png is excluded by !**/*.png
  • token-registry/img/003_astrovault-axv.svg is excluded by !**/*.svg
  • token-registry/img/004_astrovault-xnibi.svg is excluded by !**/*.svg
📒 Files selected for processing (11)
  • .github/workflows/changelog-check.yml (1 hunks)
  • evm-core-ts/package.json (2 hunks)
  • token-registry/CHANGELOG.md (1 hunks)
  • token-registry/README.md (1 hunks)
  • token-registry/cosmos_assetlist.go (5 hunks)
  • token-registry/githubify.go (3 hunks)
  • token-registry/main/main.go (3 hunks)
  • token-registry/official_bank_coins.json (1 hunks)
  • token-registry/official_erc20s.json (1 hunks)
  • token-registry/official_tokens.go (1 hunks)
  • token-registry/official_tokens_test.go (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • token-registry/CHANGELOG.md
  • token-registry/official_bank_coins.json
  • token-registry/official_erc20s.json
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/changelog-check.yml

[error] 34-34: trailing spaces

(trailing-spaces)

🪛 LanguageTool
token-registry/README.md

[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...en. Example: "Wrapped Ether". - symbol: Symbol, or ticker, of the digital asset...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~35-~35: Loose punctuation mark.
Context: ...it of ETH is 10^{-18} ether. - logoSrc: GitHub static asset link for the logo i...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 markdownlint-cli2 (0.17.2)
token-registry/README.md

33-33: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


34-34: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


39-39: Bare URL used
null

(MD034, no-bare-urls)

🔇 Additional comments (27)
token-registry/README.md (5)

9-12: Command Usage Clarity.
The code block demonstrating the use of just gen-token-registry is clear and actionable.


19-20: Section Introduction for Token Registry File.
The header "## erc20s_official.json" effectively introduces a new, clearly defined section on token registry configuration.


21-24: Token Registry Description Clarity.
The description of the erc20s_official.json file is concise and informative, detailing its usage in both the Nibiru web application and the Nibiru Indexer. Consider periodically verifying that the embedded link remains active.


25-27: Detailed Field Descriptions.
The breakdown of fields in the "Fields of the erc20s_official.json configuration file" section is thorough and user-friendly, with clear examples provided.


30-32: Field Explanation for decimals.
The explanation for the decimals field is detailed and clear, effectively describing how the base unit is derived.

evm-core-ts/package.json (3)

4-4: Version Bump Update

The version has been updated to "0.0.3", which aligns with the intended release. Verify that all dependent projects and registry records reference this updated version.


27-28: Updated Export Paths for Ethers

The export paths for the "./ethers" entry have been simplified by removing the redundant src directory. Ensure that any consumers of this package update their import paths accordingly.


31-32: Simplified Default Export Paths

The default export has been updated to use a simplified path ("./dist/src.js" and "./dist/src.d.ts"). Confirm that downstream usage correctly reflects these changes for seamless integration.

.github/workflows/changelog-check.yml (4)

28-28: Checkout Action Confirmation

The use of actions/checkout@v4 ensures that the repository is properly checked out before subsequent steps run. This is a standard and valid approach.


29-31: Changelog and Go Files Filter Setup

The step named "Check for changelog and Go edits" uses dorny/paths-filter@v3 to detect modifications in both changelog files and Go-related files. The configuration appears proper; just ensure it remains in sync with the evolving repository structure.


46-47: Conditional Changelog Enforcer Execution

The conditional execution using

if: steps.check_changelog.outputs.nibiru-go == 'true' || steps.check_changelog.outputs.changelog == 'false'

appears to correctly determine when to enforce changelog updates. Verify that the outputs from the paths filter are set as expected.


49-49: Skip Labels Parameter

Setting skipLabels: "skip-changelog" allows PRs tagged with this label to bypass the changelog check, which can be useful for certain workflow scenarios.

token-registry/cosmos_assetlist.go (1)

43-44: Image sources updated to use cosmos/chain-registry URLs.

The changes update image sources to point to the cosmos/chain-registry GitHub repository instead of local paths, which improves consistency and ensures the images are accessible from a centralized location. This aligns with best practices for asset registries.

Also applies to: 49-50, 74-75, 79-80, 128-129, 137-138, 159-160, 168-169

token-registry/main/main.go (4)

14-19: Constants organization improved.

Good organization of constants into a single block, including the new paths for ERC20s and Bank Coins JSON files.


22-22: Refactored path finding logic.

The FindRootPath function has been moved to the tokenregistry package, improving code organization and reusability.


52-76: New token registry files generation added.

The changes add generation of two new JSON files for ERC20 tokens and Bank Coins, which aligns with the PR objective to add official token registry JSON files. Good error handling is maintained throughout the process.


88-95: Updated output messages.

Output messages have been updated to include information about the newly generated files, providing clear feedback to users about what was created.

token-registry/official_tokens_test.go (3)

16-22: Good use of Go embed for test files.

Using the embed directive is an excellent approach for testing with JSON files, as it ensures the test data is always available with the test code.


26-35: Test setup runs the main function.

The SetupSuite method properly ensures that the JSON files are generated before the tests run, which makes the tests self-contained and reproducible.


56-65: Comprehensive validation of token fields.

The test performs thorough validation of token fields, including ensuring logo sources are valid GitHub URLs and that corresponding local images exist, which is excellent.

token-registry/official_tokens.go (3)

9-22: Well-defined token structures.

The TokenOfficial and PriceInfo structs are well-designed with appropriate JSON tags and comments. The optional PriceInfo with omitempty tag is a good choice.


37-42: Token image path conversion logic.

The GitHubify method provides a clean way to convert local image paths to GitHub URLs, which helps maintain consistency in image sources.


52-75: Comprehensive token registry data.

The token registry includes detailed information for both ERC20 tokens and bank coins as described in the PR objectives. The inclusion of pricing information for select tokens is particularly valuable.

Also applies to: 77-110

token-registry/githubify.go (4)

5-7: Great documentation with helpful examples!

The updated comment including a concrete example of the transformation is very helpful for understanding the function's purpose.


39-52: LGTM: Consistent implementation across different types

The GitHubify implementations for LogoURIs and AssetImage follow the same pattern and correctly use the newly exported helper functions.

Also applies to: 54-73


92-106: Well-structured reverse conversion methods

The GitHubifyReverse methods for all three types (LogoURIs, AssetImage, Token) follow the same pattern as their GitHubify counterparts, making the API symmetrical and intuitive.

The comments with examples are particularly helpful for understanding the transformations.

Also applies to: 108-128, 130-146


22-37:

❓ Verification inconclusive

Verify impact of changing private methods to public

You've changed previously private methods (localImageToGitHub, isLocalImage) to public methods (LocalImageToGitHub, IsLocalImage). This expands your public API surface. Make sure this is intentional and documented appropriately.


🏁 Script executed:

#!/bin/bash
# Check for imports/usages of these newly exported functions
rg -l "tokenregistry\..*Image" --type go | grep -v "token-registry/githubify.go"

Length of output: 187


Action Required: Confirm and Document the Expanded Public API for Image Functions

The refactor to export LocalImageToGitHub and IsLocalImage now exposes them to external modules. Our verification shows that these functions are utilized in:

  • token-registry/main/main.go
  • token-registry/cosmos_assetlist_test.go
  • token-registry/official_tokens_test.go

Please ensure that this API expansion is intentional. If it is, update the corresponding documentation and inform downstream consumers to prevent any unexpected behavior changes.

@@ -190,11 +190,11 @@ func TOKENS() []Token {
Display: "xNIBI",
Symbol: "xNIBI",
LogoURIs: &LogoURIs{
Svg: some("./img/0004_astrovault-xnibi.svg"),
Svg: some("./img/004_astrovault-xnibi.svg"),
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

xNIBI image still uses local path while other tokens use GitHub URLs.

Unlike other tokens which have been updated to use GitHub URLs, the xNIBI token still references a local path. Consider updating these image paths to also use the GitHub repository format for consistency.

Also applies to: 197-197


🏁 Script executed:

#!/bin/bash
# Check if the xNIBI image exists locally and if there's a corresponding image in the chain registry
echo "Checking for local xNIBI image:"
find . -name "004_astrovault-xnibi.svg"

echo "Checking if this image exists in the chain registry:"
curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/cosmos/chain-registry/master/nibiru/images/astrovault-xnibi.svg"

Length of output: 416


Action Required: xNIBI image reference inconsistency and asset availability check

The xNIBI token still uses a local image path (./img/004_astrovault-xnibi.svg) in token-registry/cosmos_assetlist.go (lines 193 and 197). While other tokens have been updated to use GitHub-hosted URLs, our verification confirms that switching to the expected GitHub URL
https://raw.githubusercontent.com/cosmos/chain-registry/master/nibiru/images/astrovault-xnibi.svg
currently returns a 404 error.

  • Local file exists: Found at ./token-registry/img/004_astrovault-xnibi.svg.
  • Remote asset missing: GitHub URL returns 404.

Please confirm whether the xNIBI image should be available via GitHub (and if so, upload/move the asset accordingly) or if it is intended to remain a local path. Adjust the update strategy for consistency with the other tokens accordingly.

@Unique-Divine Unique-Divine merged commit eb64da0 into main Feb 26, 2025
9 of 10 checks passed
@Unique-Divine Unique-Divine deleted the ud/token-reg branch February 26, 2025 19:27
Copy link
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: 0

🧹 Nitpick comments (5)
token-registry/README.md (5)

6-8: Add Alt Text for Image Accessibility

The new image tag is a great visual addition. To improve accessibility and comply with markdownlint (MD045), consider adding an alt attribute describing the image (e.g., “Nibiru Token Registry illustration”).

-<img src="https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/nibiru-web-app.png">
+<img src="https://raw.githubusercontent.com/NibiruChain/nibiru/main/token-registry/nibiru-web-app.png" alt="Nibiru Token Registry illustration">
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

7-7: Images should have alternate text (alt text)
null

(MD045, no-alt-text)


21-26: File List Presentation

The bullet list clearly describes the files generated by the script. There is a minor stylistic note regarding punctuation consistency—ensure similar list items use consistent punctuation if desired. This is optional for readability.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: Loose punctuation mark.
Context: ... - token-registry/official_erc20s.json: Verified ERC20s for the Nibiru web app ...

(UNLIKELY_OPENING_PUNCTUATION)


33-47: Field Descriptions for official_erc20s.json

The bullet list detailing the configuration fields is comprehensive. However, note that the examples under the decimals field (lines 41-42) use a three-space indent for sub-items. For markdown consistency (MD007), consider reducing these to a two-space indent.

-   - Example: NIBI has 6 decimals. This means the base unit seen onchain is 10^{-6} NIBI.
-   - Example: ETH has 18 decimals. This means the base unit of ETH is 10^{-18} ether.
+  - Example: NIBI has 6 decimals. This means the base unit seen onchain is 10^{-6} NIBI.
+  - Example: ETH has 18 decimals. This means the base unit of ETH is 10^{-18} ether.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ...en. Example: "Wrapped Ether". - symbol: Symbol, or ticker, of the digital asset...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~43-~43: Loose punctuation mark.
Context: ...it of ETH is 10^{-18} ether. - logoSrc: GitHub static asset link for the logo i...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 markdownlint-cli2 (0.17.2)

41-41: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


42-42: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


48-48: Convert Bare URL to Markdown Link

The bare URL in the “Related Ticket” line may trigger markdownlint (MD034). It is preferable to convert it to a more descriptive markdown link.

-Related Ticket: https://github.com/NibiruChain/go-heartmonitor/issues/378
+Related Ticket: [go-heartmonitor#378](https://github.com/NibiruChain/go-heartmonitor/issues/378)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

48-48: Bare URL used
null

(MD034, no-bare-urls)


50-55: Improve File Path Readability in Exporting Section

The instructions under "Exporting for the cosmos/chain-registry" are clear. For consistency and improved readability, consider wrapping file paths in backticks. For example, use `dist/cosmos-assetlist.json` instead of quoting them with double quotes.

-2. Copy or move the "dist/cosmos-assetlist.json" file to replace
-   "nibiru/assetlist.json" in the "cosmos/chain-registry" repo.
+2. Copy or move the `dist/cosmos-assetlist.json` file to replace
+   `nibiru/assetlist.json` in the "cosmos/chain-registry" repo.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be6efac and 24a41a2.

⛔ Files ignored due to path filters (1)
  • token-registry/nibiru-web-app.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • token-registry/README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
token-registry/README.md

[uncategorized] ~24-~24: Loose punctuation mark.
Context: ... - token-registry/official_erc20s.json: Verified ERC20s for the Nibiru web app ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~36-~36: Loose punctuation mark.
Context: ...en. Example: "Wrapped Ether". - symbol: Symbol, or ticker, of the digital asset...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~43-~43: Loose punctuation mark.
Context: ...it of ETH is 10^{-18} ether. - logoSrc: GitHub static asset link for the logo i...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 markdownlint-cli2 (0.17.2)
token-registry/README.md

7-7: Images should have alternate text (alt text)
null

(MD045, no-alt-text)


41-41: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


42-42: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


48-48: Bare URL used
null

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e-evm
🔇 Additional comments (4)
token-registry/README.md (4)

9-10: New "Generation Script" Section Looks Clear

The addition of the "Generation Script" header and surrounding context provides a clear description of how to generate the token registry files. No changes are needed here.


11-14: Command for Generating Files is Well Documented

The code block showing the just gen-token-registry command is clear and formatted correctly. This will help users quickly run the command.


16-19: Cargo Installation Instruction is Clear

The instructions for installing the just command using Cargo are straightforward and complete. This helps with onboarding for users who might not have just installed.


27-32: Section on official_erc20s.json is Informative

The new section introducing official_erc20s.json and its description is well written and provides clear context for its use in the Nibiru web app.

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.

1 participant