Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Sep 22, 2025

This is getting pretty large so I decided to split off the initial PR.

  • add both app/settlement chain RPC urls to the CLI
  • implement balances
  • refactor a few things
  • generate bindings for ERC20 and FeeToken
  • Deposit flow is implemented but it fails. It will be the next step after this.

@mkysel mkysel requested a review from a team as a code owner September 22, 2025 19:24
@graphite-app
Copy link

graphite-app bot commented Sep 22, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@macroscopeapp
Copy link

macroscopeapp bot commented Sep 22, 2025

Add partial CLI funds commands and dual RPC resolution by introducing cmd/xmtpd-cli/commands/funds.go with deposit, balances, hidden mint, and new RPC resolvers supporting --settlement-rpc-url and --app-rpc-url in root.go

This change adds a new funds command group with deposit, balances, and a hidden mint, introduces helpers to construct a dual-chain funds admin, and replaces single RPC URL usage with settlement/app-specific resolvers while updating configs and bindings to int64 chain IDs. Key changes include:

📍Where to Start

Start with the CLI entry points and RPC resolution in root.go, then review funds command wiring and handlers in funds.go, followed by the construction and methods of blockchain.NewFundsAdmin in funds_admin.go.


Macroscope summarized 7c830cd.

logger.Error("could not setup funds admin", zap.Error(err))
return err
}

Copy link

Choose a reason for hiding this comment

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

Invalid or non-hex address inputs cause the handler to silently query the zero address balances instead of reporting an input error.

The balancesHandler calls common.HexToAddress(opts.Address) without validating the string, and HexToAddress maps invalid hex strings to the zero address without an error.

Consider checking the address with common.IsHexAddress and returning an error if it's invalid before calling HexToAddress.

+    if !common.IsHexAddress(opts.Address) {
+        return fmt.Errorf("invalid address: %s", opts.Address)
+    }

🚀 Reply to ask Macroscope to explain or update this suggestion.

👍 Helpful? React to give us feedback.

@mkysel mkysel merged commit a6bd1bd into main Sep 23, 2025
11 checks passed
@mkysel mkysel deleted the mkysel/funds branch September 23, 2025 14:51
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.

3 participants