Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes
Accepted

JSONRPC method should be specified for params: "undefined" while batching the requests in web3 js

The add() method in BatchRequest accepts a request object: batch.add(web3.eth.call.request(param, callBack)) Notice the .request that follows .call Final answer: function getBalanceInBatch(address)...
medvedev1088's user avatar
5 votes
Accepted

Ordering transactions in a batch multisend/multicall

If you look at Gnosis-Safe's MultiSend contract, you'll notice that you decide in which order you want to execute the "sub"-transaction. You need to encode each transaction you want to batch ...
Greg Jeanmart's user avatar
4 votes
Accepted

Web3.js batch request error: method.callback is not a function

For some reason (this is not documented anywhere I could find) the request method requires a callback function as a last parameter, as such: const batch = new web3.BatchRequest(); batch.add(web3.eth....
jasper's user avatar
  • 689
3 votes
Accepted

Web3 Chainstack Guide to Batch Transactions gives Error: This contract object doesn't have address set yet, please set an address first

new versions of web3js have been released with changes in the API so you have to make sure to run the code in the article with the specific versions. On the other hand, we've released an updated ...
Antonio U's user avatar
  • 649
3 votes

Best practice for multiple dependent requests in Web3.js

As you mentioned, I think the choice is scenario-based. Specifically, how complex your requests are and how many asynchronous calls you need to make. Other things to consider are (1) your familiarity ...
carlolm's user avatar
  • 2,326
2 votes

Ethminer "No GPU device with sufficient memory was found"

Specifying --opencl-platform 1 (2, 3, etc) before the -G key should help.
Sotha's user avatar
  • 151
2 votes

How can I split a transaction to two addresses using metamask?

It's probably easiest with a smart contract for it. A single transaction always targets just one address, and there is no native way to do batch transactions. Some wallet clients may offer some sort ...
Lauri Peltonen's user avatar
2 votes

The economics of batching transactions on main net

You shall check out MakerDAO’s multicall contract on the Ethereum mainnet; which is deployed at 0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441. Below is an example calling the smart contract with Makerdao’...
Wuzhong - Chainstack DevEx's user avatar
2 votes
Accepted

Is it possible to send batch of transactions in Ethereum?

What you're looking for is called flashbot bundles ( https://docs.flashbots.net/flashbots-auction/searchers/advanced/understanding-bundles) Everything you need should be in these docs. Good luck :)
Foxxxey's user avatar
  • 4,337
2 votes
Accepted

Best practice for multiple dependent requests in Web3.js

Thank you carlolm for the help. After a bit more research, it felt like promises was the right thing to do here, and the method that will be adopted by web3.js in the future by default. To solve my ...
Shawn Tabrizi's user avatar
1 vote
Accepted

Foundry Solidity Error: panic: array out-of-bounds access (0x32) while testing a batch mint function

I think the problem is here: uint[] memory tokenIds = new uint[](2); tokenIds[1] = 1; tokenIds[2] = 2; uint[] memory tokenAmts = new uint[](2); tokenAmts[1] = 1; tokenAmts[2] = ...
Zartaj Afser's user avatar
  • 4,271
1 vote
Accepted

differences between createTransaction and createTransactionBatch (@safe-global/protocol-kit)

Using createTransaction is recommended as createTransactionBatch will probably be moved to a utils file
Germán's user avatar
  • 688
1 vote
Accepted

I want mint N-number of NFT's to N-number of people using ERC1155

This function receives and array of target addresses, an array of ids and an array of amounts. It should work well in your erc1155 contract. function massMint(address[] memory _to, uint256[] memory ...
Carlitos's user avatar
  • 356
1 vote

How can I send erc20 tokens at once from MULTIPLE wallets to a single address?

If we are talking about the regular ERC20 or ERC721 tokens, then the only option is for the wallets to give allowance for some contract to withdraw the tokens. That requires a transaction from each of ...
Lauri Peltonen's user avatar
1 vote

Gas costs of multiple Writes / Reads to same slot in transaction

Writing multiple times to a specific storage slot is cheaper, but not free. The current state is defined by EIP-2929 Edit: Since you asked about temporary or so called transient storage. There is an ...
Richard's user avatar
  • 4,994
1 vote
Accepted

How is it possible to print tokens out of nowhere with the batchOverflow problem?

totalSupply stores the current amount of minted tokens, not the maximum amount of tokens which can be minted. In order to restrict this amount, one needs to apply additional code (not part of the ...
goodvibration's user avatar
1 vote

Calling Truffle Commands through a script

Your problem is the async behavior of promise returned by IDSCheck.deployed(). The variable ss might not be initialized if you call ss.GetHash() immediately after. You can fix it by executing the ...
Ismael's user avatar
  • 30.5k
1 vote

Is the cost to send n batch transactions linear?

You can't send Eth directly to multiple addresses with one transaction. One transaction is always to one address. And one Eth transfer (with no payload) costs 21000 gas - full cost depends on the used ...
Lauri Peltonen's user avatar
1 vote

Is the cost to send n batch transactions linear?

The so-called multiple is actually the number of addresses. For more information please refer to Ethereum YellowPager
zmy's user avatar
  • 376
1 vote

Web3.js Batch Request Limit?

Web3js doesn't have the request limit, but the node, you communicate with, could have. Unfortunately, web3js@1.* doesn't give the errors thrown by the network or server in batch requests. I had a ...
tenbits's user avatar
  • 2,438
1 vote

Consolidate Batch of ETH Wallets w/ERC20 Tokens?

You have to do that manually. Even if you create a script, you are going to need to add manually all your private keys to be able to sign transfer transactions.
Luiz Soares's user avatar
  • 1,054

Only top scored, non community-wiki answers of a minimum length are eligible