contract-proxy-kit icon indicating copy to clipboard operation
contract-proxy-kit copied to clipboard

Gas estimation issues with batched ERC20 transfers.

Open developerspeak opened this issue 4 years ago • 0 comments

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?

developerspeak avatar Mar 11 '21 06:03 developerspeak