contract-proxy-kit
contract-proxy-kit copied to clipboard
Gas estimation issues with batched ERC20 transfers.
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?