0

Is there any data limit on the amount of data that can be sent as arguments on the smart contract function?

We have some requirements where we want to send some 7 Mb of data on array "uint256[] memory" parameter. ( There are 2 parameters in the method and each parameter should take around 7 MB of data. In some cases it can be more.). We want to process some bulk operations in a single transaction.

The user will leave the system for 5 or 6 hours in Pending status as the transaction might take time.

1 Answer 1

1

Is there any data limit on the amount of data that can be sent as arguments on the smart contract function?

First of all: the biggest limit is probably going to be your wallet. Storage in Ethereum (even function parameter storage) is prohibitively expensive. You might want to re-evaluate whether you want to do data processing on Ethereum.

Apart from that, there is one other limit: a single block in Ethereum can use only up to 30 million gas. It takes around 20,000 gas to store a single word (256 bits). That means that to store 7 MB of data, it would cost:

7 MB * 1024 KB / MB * 1024 B / KB * 8 b / B * 20,000 gas / 256 b = 4,587,520,000 gas

So even if you had the $304,485.31 that would be required to store that much data on Ethereum, having to write all of it in a single transaction means that what you are describing is impossible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.