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

Implement batch transactions #18

Open
rekmarks opened this issue Feb 27, 2020 · 5 comments
Open

Implement batch transactions #18

rekmarks opened this issue Feb 27, 2020 · 5 comments

Comments

@rekmarks
Copy link
Member

rekmarks commented Feb 27, 2020

We should add batch transaction functionality to the test dapp, for testing.

We should follow this:
https://codesandbox.io/s/metamask-batchrequest-bug-demo-emnph

Zipped:
metamask-batchrequest-bug-demo.zip

Contract on Rinkeby:
https://rinkeby.etherscan.io/address/0xfac5d594548b1ab5fb724d8011187ec51919b92e#code

Context:
MetaMask/metamask-extension#5852 (comment)

@danjm danjm added this to the Q4-Improvements milestone Oct 4, 2021
@danjm
Copy link
Contributor

danjm commented Oct 29, 2021

We will have to use ethers.providers.JsonRpcBatchProvider

It is not well documented, but as far as I can tell from the discussion here ethers-io/ethers.js#62 (comment), the provider can be instantiated the way the ethers provider is within the current test dapp code.

Then you can create multiple transactions as is done in the example here: https://ethereum.stackexchange.com/a/77169

But instead of awaiting each of them, create them all and then await a Promise.all

@EHaracic EHaracic self-assigned this Oct 29, 2021
@filipsekulic filipsekulic assigned filipsekulic and unassigned EHaracic Nov 5, 2021
@david0xd
Copy link

david0xd commented Nov 8, 2021

@danjm During the refinement we made a conclusion that the best approach to achieve this is to create a new button on the test-dapp which will call wrapped function that will perform few transactions in a batch which will target our deployed smart contract.

AC:

  • Add new button "Deposit in batch" under the "Contract" block
  • Make sure that the new button is available only when the contract is deployed (like the other buttons in that section)
  • Link new button to the new function that will perform 4 batched transactions to deposit ETH to the deployed smart contract

Couple of arguments for the proposal is:

  • To make it adapted to the current test dapp web page and keep it simple for use
  • We would probably like to use our smart contract that we deployed inside the test dapp instead of configuring an external

@danjm
Copy link
Contributor

danjm commented Dec 17, 2021

This proposal sounds good to me. Are there any other blockers to this?

@EHaracic
Copy link

Blocked by PR: #137

@david0xd
Copy link

david0xd commented Jan 31, 2022

Because of limitation of ethers library we've decided to integrate web3 library into the test-dapp. Web3 library with its functionality will make batch transactions possible.
This can be continued when #146 gets merged.

@EHaracic EHaracic assigned EHaracic and VSaric and unassigned EHaracic and filipsekulic Feb 1, 2022
@VSaric VSaric removed their assignment Dec 12, 2022
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

6 participants