5afe / contract-proxy-kit

Enable batched transactions and contract account interactions using a unique deterministic Gnosis Safe.
103 stars 38 forks source link

Gas estimation issues with batched ERC20 transfers. #148

Open developerspeak opened 3 years ago

developerspeak commented 3 years ago

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?