Skip to content

Enhance the batchRegisterIpAssetsWithOptimizedWorkflows method support multiple erc20 tokens #659

@bonnie57

Description

@bonnie57

Is your feature request related to a problem? Please describe.
The batchRegisterIpAssetsWithOptimizedWorkflows method currently needs to handle a large number of arguments. In some scenarios, token payments must occur simultaneously.

For example:

  1. We create two spgNftContract instances using different ERC20 tokens (spgNftContractForERC201 and spgNftContractForERC202):
const publicMintingCollectionResult = await client.nftClient.createNFTCollection({
  name: "Public Minting Collection",
  symbol: "PMC",
  isPublicMinting: true,
  mintOpen: true,
  mintFeeRecipient: TEST_WALLET_ADDRESS,
  mintFee: 10n,
  mintFeeToken: erc20Token, // different ERC20 token
  contractURI: "",
});
  1. Then we call batchRegisterIpAssetsWithOptimizedWorkflows as follows:
const result = await client.ipAsset.batchRegisterIpAssetsWithOptimizedWorkflows({
  requests: [
    {
      spgNftContract: spgNftContractForERC201,
      derivData,
    },
    {
      spgNftContract: spgNftContractForERC202,
      derivData,
    },
  ],
});

Because both requests share the same structure, they are grouped and executed via multicall in the DerivativeWorkflows contract.
However, the current method does not support paying multiple ERC20 tokens within a single multicall, nor does it support auto-approval for multiple tokens. This prevents the workflow from being executed successfully when different token payments are involved.

Describe the solution you'd like
Enhance the method so that it can:

  • Support multiple ERC20 token payments within the same batch request.

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