Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas estimation issues with batched ERC20 transfers. #148

Open
developerspeak opened this issue Mar 11, 2021 · 0 comments
Open

Gas estimation issues with batched ERC20 transfers. #148

developerspeak opened this issue Mar 11, 2021 · 0 comments

Comments

@developerspeak
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant