Skip to content

bulkTransfer reverts on every call: TRANSFER_HELPER_ABI does not match Seaport's TransferHelper #2035

Closed

Description

@erkancamli

Describe the bug

sdk.bulkTransfer(...) calls a function the TransferHelper does not have, so every bulk transfer reverts (at estimateGas, "execution reverted", no data), for any asset type.

TRANSFER_HELPER_ABI in src/abi/abis.ts declares a flat tuple:

bulkTransfer((uint8 itemType, address token, uint256 identifier, uint256 amount, address recipient)[] items, bytes32 conduitKey)
selector 0x4c384e51

Seaport's TransferHelper (the contract at TRANSFER_HELPER_ADDRESS, 0x0000000000c2d145a2526bd8c716263bfebe1a72) takes one entry per recipient, each with its own item list:

struct TransferHelperItem { ConduitItemType itemType; address token; uint256 identifier; uint256 amount; }
struct TransferHelperItemsWithRecipient { TransferHelperItem[] items; address recipient; bool validateERC721Receiver; }

function bulkTransfer(TransferHelperItemsWithRecipient[] calldata items, bytes32 conduitKey) external returns (bytes4);
// selector 0x32389b71

It has no fallback, so the call with 0x4c384e51 reverts with empty data. I checked every TransferHelper interface in Seaport's history and none has 0x4c384e51 (1.1 had bulkTransfer((uint8,address,uint256,uint256)[],address,bytes32) = 0x73b69d03; the current one, deployed by Seaport's TransferHelperDeployer.s.sol against the conduit controller the SDK uses, is 0x32389b71). The repo's own src/abi/TransferHelper.json, which nothing imports, already has the nested shape.

A second, smaller problem shows up once the ABI is fixed: bulkTransfer's approval preflight and batchApproveAssets call checkAssetApproval once per entry with that entry's amount. Two transfers of the same ERC20 (60 to alice and 60 to bob with an allowance of 100, which is common after an exact spending cap approval) both pass, so batchApproveAssets returns undefined and the preflight passes, but the conduit pulls 120 and the transfer reverts. seaport-js fixed the same class in #975 and #1049 (approve the batch total).

Steps to reproduce

Local hardhat node only. Seaport's TransferHelper compiled from the Seaport source pinned in seaport-js, its runtime set at TRANSFER_HELPER_ADDRESS with its immutables pointing at the canonical conduit controller and conduit code hash, the real Conduit runtime at the OpenSea conduit address with the TransferHelper channel open, and an ERC20 with an allowance of 100 to the conduit. Driven through the built SDK (new OpenSeaSDK(signer, { chain: Chain.Mainnet })):

[1] sdk.bulkTransfer([60 -> alice]) FAILED: execution reverted (no data present; likely require(false) occurred
    selector the SDK sends: 0x4c384e51
    TransferHelper exposes: 0x32389b71 bulkTransfer(((uint8,address,uint256,uint256)[],address,bool)[],bytes32)
[2] TransferHelper.bulkTransfer called directly with Seaport's ABI: mined, alice 60, allowance 40

With only the ABI fixed, the ERC20 total problem:

[3] sdk.batchApproveAssets([60, 60]) returned undefined (nothing to approve), allowance 100
[3] sdk.bulkTransfer([60 -> alice, 60 -> bob]) FAILED: execution reverted

Expected behavior

bulkTransfer encodes bulkTransfer(TransferHelperItemsWithRecipient[], bytes32) and transfers; batchApproveAssets and the preflight compare the allowance with the total per ERC20.

Environment

  • Package version: 13.0.0 (e6a22de)
  • Node.js version: 22.x
  • Operating system: Ubuntu 24.04
  • Chain / network: any (TransferHelper is at the same address on every chain); reproduced on a local hardhat node

Additional context

Suggested fix, which I have as a patch with tests if useful:

  1. TRANSFER_HELPER_ABI (and TransferHelper.json) to the nested shape; bulkTransfer groups the items per recipient (case insensitive, first seen order) and sets validateERC721Receiver: true, so the TransferHelper refuses an ERC721 sent to a contract that cannot receive it (false is also valid if you prefer plain transferFrom semantics).
  2. Merge entries of the same ERC20 into one summed amount before the approval checks in both bulkTransfer and batchApproveAssets.

With that, new tests in test/sdk/batchApproveAssets.spec.ts (selector equals Seaport's signature, args encode with the ABI, one entry per recipient, ERC20 total vs allowance) fail before and pass after; the full suite is 1384 passed (1380 before), check-types and biome clean. On the local node above, bulkTransfer then mines and the two recipient ERC20 batch gets one approval and transfers 60 to each.

Activity

  1. ryanio commented on Nov 9, 2026

    @ryanio
    Collaborator

    Thanks for the detailed report, it was right on both counts. The deployed TransferHelper only exposes 0x32389b71, and an eth_call with the old encoding reverts with empty data. The fix encodes Seaport's TransferHelperItemsWithRecipient[] (one entry per recipient, validateERC721Receiver: false to match transfer()), and both the bulkTransfer preflight and batchApproveAssets now compare each ERC20's allowance with its total. On a mainnet fork, the 60 + 60 against an allowance of 100 case is caught before sending, approves, then transfers.

    It shipped in @opensea/sdk 13.0.2, with credit to you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions