Skip to content

Comments

replace bip44 coin type with custom format#12

Merged
ihooni merged 6 commits intomainfrom
issues/11
Nov 10, 2025
Merged

replace bip44 coin type with custom format#12
ihooni merged 6 commits intomainfrom
issues/11

Conversation

@ihooni
Copy link
Collaborator

@ihooni ihooni commented Nov 6, 2025

Description

This PR updates the coin type format from the BIP44-based type to the new CustomCoinTypes format.

Related Issue

Closes #11

@ihooni ihooni self-assigned this Nov 6, 2025
Copy link
Collaborator Author

@ihooni ihooni left a comment

Choose a reason for hiding this comment

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

After approved, i'll upload broadcast files for GIWA Sepolia

@ihooni ihooni marked this pull request as ready for review November 6, 2025 07:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the BIP44-based coin type system with a custom format that uses ASCII ticker symbols packed into a uint256. The new format stores the ticker length in the most significant byte and the ticker characters in little-endian order in the lower bytes. The version is bumped from 0.2.0 to 0.3.0 to reflect this breaking change.

Key Changes

  • Introduces CustomCoinTypes library with encoding/decoding functions for ASCII ticker-based coin types
  • Replaces BIP44CoinTypes with CustomCoinTypes throughout the codebase
  • Updates test constants from numeric coin types (e.g., 0) to packed ticker format (e.g., 0x03...435442 for "BTC")

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/libraries/Types.sol Adds new CustomCoinTypes library with ticker-to-uint256 encoding/decoding logic
src/abstract/BalanceValidationResolverUpgradeable.sol Switches from BIP44CoinTypes to CustomCoinTypes import and using statement
src/BalanceDojangResolver.sol Updates version from 0.2.0 to 0.3.0
test/libraries/CustomCoinTypes.t.sol Comprehensive test suite for the new CustomCoinTypes library
test/abstract/BalanceValidationResolverUpgradeable.t.sol Updates test constants to use new coin type format
test/BalanceDojangResolver.t.sol Updates test constants and expected version to match new format
src/interfaces/IDojangScroll.sol Reformats function signature to single line
src/interfaces/IAttestationIndexer.sol Reformats function signature to single line
src/AttestationIndexer.sol Reformats function signature to single line
package.json Bumps version to 0.3.0
.node-version Adds Node.js version specification
.github/workflows/ci.yaml Updates path to read Node.js version from root directory

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Attestation memory attestation;
attestation.uid = bytes32("uid");
attestation.data = abi.encode(1 + 1 << 31, 1_700_000_000 - 1, BALANCE);
attestation.data = abi.encode(1 << 31 + 1, 1_700_000_000 - 1, BALANCE);
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Operator precedence issue: 1 << 31 + 1 evaluates as 1 << (31 + 1) due to operator precedence, which equals 1 << 32. This should be (1 << 31) + 1 to create an invalid coin type for testing purposes.

Suggested change
attestation.data = abi.encode(1 << 31 + 1, 1_700_000_000 - 1, BALANCE);
attestation.data = abi.encode((1 << 31) + 1, 1_700_000_000 - 1, BALANCE);

Copilot uses AI. Check for mistakes.
@ihooni ihooni merged commit 018dd95 into main Nov 10, 2025
3 checks passed
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.

replace bip44 coin type with custom format

2 participants