Skip to content

Gas estimation issues with batched ERC20 transfers. #148

@developerspeak

Description

@developerspeak

I'm trying to batch several ERC20 transfers inside of execTransactions, but the call always fails with a TransactionError: batch transaction execution expected to fail error. Using v3.0.0 of the CPK. This happens even for a single transfer (i.e. transactions.length === 1).

const transactions = receivers.map(receiver => ({
    operation: CPK.CALL,
    to: token.address,
    value: 0,
    data: token.interface.functions.transfer.encode([receiver.address, receiver.amount])
  })
);

const txResult = await cpk.execTransactions(transactions);  // <--- throws exception

What am I doing wrong?

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