Conversation
ihooni
left a comment
There was a problem hiding this comment.
After approved, i'll upload broadcast files for GIWA Sepolia
There was a problem hiding this comment.
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
CustomCoinTypeslibrary with encoding/decoding functions for ASCII ticker-based coin types - Replaces
BIP44CoinTypeswithCustomCoinTypesthroughout the codebase - Updates test constants from numeric coin types (e.g.,
0) to packed ticker format (e.g.,0x03...435442for "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); |
There was a problem hiding this comment.
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.
| 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); |
Description
This PR updates the coin type format from the BIP44-based type to the new CustomCoinTypes format.
Related Issue
Closes #11