Skip to content

eds: add BurnMintFactory URL resolution for utility-registry instruments #794

Merged
stackman27 merged 1 commit into
mainfrom
sish/eds-fix
Jul 20, 2026
Merged

eds: add BurnMintFactory URL resolution for utility-registry instruments #794
stackman27 merged 1 commit into
mainfrom
sish/eds-fix

Conversation

@stackman27

@stackman27 stackman27 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds URL-based factory resolution (FactoryTypeURL) for BurnMintTokenPool, enabling CCIP bridging for Splice utility-registry instruments whose factory contracts don't have an instanceId field and thus can't be resolved via the existing
FactoryTypeAddress branch.

Problem

The EDS's getBurnMintFactory only supported FactoryTypeAddress, which calls acs.Get(InstanceAddress) against the local ACS store. This requires the factory contract to have an instanceId create-arg field (used to compute
keccak256(instanceId@party) for address indexing).

Utility-registry factory contracts (e.g. AllocationFactory from utility-registry-app-v0) have create args {operator, provider, registrar} — no instanceId field. They're silently dropped from the address index (getInstanceAddresses in
active_contract_store.go requires instanceId), so acs.Get misses and the burn-mint-factory context key is never populated. The pool's lookupBurnMintFactory aborts with:

Missing context entry for: burn-mint-factory

Additionally, AllocationFactory_InternalBurnMint reads instrument-configuration and issuer-credentials from the choice context (extraArgs.context.values). The existing FactoryTypeAddress branch returns empty ChoiceContext{}, so even
if the factory were findable by address, the choice would fail on missing instrument config + credentials.

Solution

Config schema (eds/config/config.go)

  • Added TokenStandardURL + TokenStandardAuthConfig fields to BurnMintFactory (mirrors TransferFactory's existing URL fields)
  • Extended validate tag: oneof='' addressoneof='' address url

Resolver (eds/internal/api/tokenpool/token_standard.go)

  • Implemented FactoryTypeURL branch: calls DA's utility-registry backend endpoint via HTTP, parses FactoryWithChoiceContext response (factoryId + choiceContext.choiceContextData + choiceContext.disclosedContracts)
  • Changed burnMintFactory function signature to return (string, ChoiceContext, []DisclosedContract, error) — mirroring transferFactory — so the credentials and instrument config returned by the backend can flow through to the pool's
    context
  • Uses /mint/v0/request endpoint (read-only, does not actually mint) because DA's /burn-mint-factory endpoint currently has a bug returning issuer-credentials: []. Both endpoints return the same factoryId (AllocationFactory) and the same
    context keys. Revisit when DA fixes /burn-mint-factory — switch token_standard_url config to the burn-mint-factory path and change the request body shape.

Call sites (eds/internal/api/tokenpool/tokenpool.go)

  • Updated both send + execute paths to handle the new 4-return signature
  • Merge factory-returned ChoiceContext.Values (including issuer-credentials + instrument-configuration) into burnMintFactoryContext, which gets promoted to choiceContext["burn-mint-factory-extra-args-values"] by existing code — the
    context key the pool reads at BurnMintTokenPoolV2.daml:87-97

Tests (eds/config/config_validation_test.go)

  • Added validation test cases for FactoryTypeURL (valid + missing URL)

Config example

[token_pool_api.token_pools."<pool address>"]             
  type             = "burnMint"                                                                                                                                                                                                                      
  party_id         = "<registrar party>"                                                                                                                                                                                                             
  instance_address = "<pool address hex>"                                                                                                                                                                                                            
  pool_owner       = "<registrar party>"                                                                                                                                                                                                             
                                                                                                                                                                                                                                                     
  [token_pool_api.token_pools."<pool address>".burn_mint_factory]                                                                                                                                                                                    
    type               = "url"                                                                                                                                                                                                                       
    token_standard_url = "https://api.utilities.digitalasset-staging.com/api/utilities/v0/registry/mint/v0/request"                                                                                                                                  
    # token_standard_auth — NOT set, DA's endpoint is public (security: [])  

…egistry endpoint

Adds URL-based factory resolution for BurnMintTokenPool, enabling CCIP
bridging for Splice utility-registry instruments (e.g. USD1) whose
factory contracts (AllocationFactory) don't have an instanceId field
and thus can't be resolved via the existing FactoryTypeAddress branch.

Changes:
- config.go: Add TokenStandardURL + TokenStandardAuthConfig fields to
  BurnMintFactory, extend validate tag to oneof='' address url
- token_standard.go: Implement FactoryTypeURL branch calling DA's
  /mint/v0/request endpoint (read-only, returns factoryId + choice
  context with issuer-credentials + disclosed contracts). Use /mint/v0/request
  instead of /burn-mint-factory because the latter has a bug returning
  issuer-credentials: []. Both endpoints return the same factoryId
  (AllocationFactory) and context keys. Revisit when DA fixes
  /burn-mint-factory.
- token_standard.go: Change burnMintFactory signature to return
  ChoiceContext (mirroring transferFactory) so credentials flow through
- tokenpool.go: Merge factory-returned context into burn-mint-factory-
  extra-args-values context key at both send + execute paths
- config_validation_test.go: Add test cases for FactoryTypeURL
@stackman27
stackman27 marked this pull request as ready for review July 20, 2026 16:14
@stackman27
stackman27 requested a review from a team as a code owner July 20, 2026 16:14
@stackman27 stackman27 changed the title Eds fix eds: add BurnMintFactory URL resolution for utility-registry instruments Jul 20, 2026
@stackman27
stackman27 merged commit b059a36 into main Jul 20, 2026
40 checks passed
@stackman27
stackman27 deleted the sish/eds-fix branch July 20, 2026 16:41
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