Context
Follow-up from PR #5468 and the existing TODO at pkg/config/chain.go:14.
The BZZ token address is deterministic per chain, yet today it is resolved on-chain twice during node bootstrap:
via the chequebook factory ERC20Address(ctx) → feeds erc20Service (used by /wallet and chequebook), and
via postagecontract.LookupERC20Address at pkg/node/node.go:726 → feeds the postage stamp and staking contracts.
Proposal
Add BzzAddress common.Address to ChainConfig (pkg/config/chain.go), populated for mainnet and testnet.
Add a corresponding CLI/config override (e.g. --bzz-token-address) so custom/unknown chains can supply it.
Replace the LookupERC20Address call site with chainCfg.BzzAddress and remove the function (and TestLookupERC20Address).
Build erc20Service from the static address, decoupling /wallet from the chequebook factory entirely (simplifies the best-effort init added in fix(api): allow GET /wallet when swap or chequebook is disabled #5468 ).
AI Disclosure
Context
Follow-up from PR #5468 and the existing TODO at
pkg/config/chain.go:14.The BZZ token address is deterministic per chain, yet today it is resolved on-chain twice during node bootstrap:
ERC20Address(ctx)→ feedserc20Service(used by/walletand chequebook), andpostagecontract.LookupERC20Addressatpkg/node/node.go:726→ feeds the postage stamp and staking contracts.Proposal
BzzAddress common.AddresstoChainConfig(pkg/config/chain.go), populated for mainnet and testnet.--bzz-token-address) so custom/unknown chains can supply it.LookupERC20Addresscall site withchainCfg.BzzAddressand remove the function (andTestLookupERC20Address).erc20Servicefrom the static address, decoupling/walletfrom the chequebook factory entirely (simplifies the best-effort init added in fix(api): allow GET /wallet when swap or chequebook is disabled #5468).AI Disclosure