Skip to content

fix(statics): route Polygon ERC-20 send-many via ERC-20 batcher#9096

Closed
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
coins-435-polygon-token-erc20-bulk-transaction
Closed

fix(statics): route Polygon ERC-20 send-many via ERC-20 batcher#9096
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
coins-435-polygon-token-erc20-bulk-transaction

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Adds CoinFeature.ERC20_BULK_TRANSACTION to POLYGON_TOKEN_FEATURES, POLYGON_TOKEN_FEATURES_EXCLUDE_SINGAPORE, and POLYGON_TOKEN_FEATURES_WITH_FRANKFURT so every polygon:* / tpolygon:* ERC-20 token now advertises the ERC-20 bulk routing capability — mirroring what the polygon coin-level features already declare.
  • Adds a coverage test in modules/statics/test/unit/coins.ts asserting every polygon: / tpolygon: token exposes ERC20_BULK_TRANSACTION, so this flag cannot regress for an individual token.

Why

Customers running sendMany for polygon:usdt on Polygon mainnet had their batched transfer encoded as sendMultiSigToken(batchContract, totalAmount, ...) on the PolygonWalletSimple proxy instead of batchTransferFrom(token, [recipients], [amounts]) on the BatchTransfer contract. The combined token amount was transferred to the batch contract as a single recipient (e.g. 2 USDT base units stuck at 0x3E1e5d78e44f15593B3B61ED278f12C27F0fF33e on mainnet, tx 0xbcbcf2e2...) rather than being split across the intended addresses.

Root cause: the ERC-20 batch routing checks token-level features, and polygon:usdt (along with every other Polygon ERC-20 token in the catalog) was only declaring BULK_TRANSACTION, not ERC20_BULK_TRANSACTION. The token therefore fell through to the native batcher path. Adding the flag aligns Polygon tokens with the existing convention used by the polygon coin-level features.

Test plan

  • cd modules/statics && yarn unit-test — 30,585 passing, including the new Polygon ERC-20 tokens should have ERC20_BULK_TRANSACTION feature test
  • cd modules/statics && yarn check-fmt
  • Re-run a sendMany for polygon:usdt on Amoy / mainnet once the package is published, and confirm the on-chain method selector is 0x4885b254 (batchTransferFrom) and the call target is the BatchTransfer contract rather than the PolygonWalletSimple proxy.

Ticket: COINS-435

Adds CoinFeature.ERC20_BULK_TRANSACTION to POLYGON_TOKEN_FEATURES,
POLYGON_TOKEN_FEATURES_EXCLUDE_SINGAPORE, and
POLYGON_TOKEN_FEATURES_WITH_FRANKFURT. Mirrors what is already wired
up for BSC and the polygon coin-level features.

Without this flag, send-many requests for Polygon ERC-20 tokens
(e.g. polygon:usdt) on mainnet fell through to the native batcher
path, which encoded the call as sendMultiSigToken(batchContract,
totalAmount) instead of batchTransferFrom([recipients], [amounts]).
The total token amount was transferred to the batch contract as a
single recipient, leaving funds stuck at the batcher contract and
forcing customers to fall back to one transfer per recipient.

Adds a coverage test asserting every polygon: / tpolygon: token
exposes ERC20_BULK_TRANSACTION.

Ticket: COINS-435
Session-Id: af73ff16-aaf1-4203-9eeb-2abe86d9474e
Task-Id: 2cb7c5db-bf77-49d6-9356-e06df65e43fc
@linear-code

linear-code Bot commented Jun 23, 2026

Copy link
Copy Markdown

COINS-435

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.

1 participant