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
Closed
fix(statics): route Polygon ERC-20 send-many via ERC-20 batcher#9096bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CoinFeature.ERC20_BULK_TRANSACTIONtoPOLYGON_TOKEN_FEATURES,POLYGON_TOKEN_FEATURES_EXCLUDE_SINGAPORE, andPOLYGON_TOKEN_FEATURES_WITH_FRANKFURTso everypolygon:*/tpolygon:*ERC-20 token now advertises the ERC-20 bulk routing capability — mirroring what thepolygoncoin-level features already declare.modules/statics/test/unit/coins.tsasserting everypolygon:/tpolygon:token exposesERC20_BULK_TRANSACTION, so this flag cannot regress for an individual token.Why
Customers running
sendManyforpolygon:usdton Polygon mainnet had their batched transfer encoded assendMultiSigToken(batchContract, totalAmount, ...)on thePolygonWalletSimpleproxy instead ofbatchTransferFrom(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 at0x3E1e5d78e44f15593B3B61ED278f12C27F0fF33eon mainnet, tx0xbcbcf2e2...) 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 declaringBULK_TRANSACTION, notERC20_BULK_TRANSACTION. The token therefore fell through to the native batcher path. Adding the flag aligns Polygon tokens with the existing convention used by thepolygoncoin-level features.Test plan
cd modules/statics && yarn unit-test— 30,585 passing, including the newPolygon ERC-20 tokens should have ERC20_BULK_TRANSACTION featuretestcd modules/statics && yarn check-fmtsendManyforpolygon:usdton Amoy / mainnet once the package is published, and confirm the on-chain method selector is0x4885b254(batchTransferFrom) and the call target is the BatchTransfer contract rather than thePolygonWalletSimpleproxy.Ticket: COINS-435