1

In my solidity code I define 3 arrays with around 700 elements inside. However, when I try to deploy the contract using Geth I am having the following error message:

Error: oversized data undefined

When I try to test the contract in Remix, the browser is telling me that it has not enough memory.

What are the limitations of Solidity? Isn't it possibe to have 3 arrays with just 700 uint elements?

One of the arrays are as below:

int[] array1 = [28, 28, 28, 27, 28, 28, 28, 27, 27, 28, 28, 29, 30, 31, 31, 30, 30, 31, 31, 31, 30, 29, 28, 28, 28, 27, 27, 27, 27, 27, 27, 26, 27, 25, 25, 24, 24, 23, 23, 23, 23, 26, 27, 30, 30, 30, 31, 31, 31, 31, 31, 30, 30, 30, 29, 28, 28, 28, 28, 28, 28, 28, 26, 26, 26, 25, 25, 24, 24, 24, 23, 24, 27, 29, 32, 32, 33, 34, 34, 34, 34, 33, 33, 33, 33, 32, 32, 32, 32, 31, 31, 31, 30, 29, 29, 29, 28, 29, 29, 27, 26, 28, 28, 31, 32, 35, 35, 36, 37, 36, 36, 36, 36, 36, 36, 35, 34, 33, 32, 32, 33, 33, 32, 32, 31, 31, 30, 31, 28, 28, 29, 29, 29, 29, 31, 34, 36, 36, 35, 35, 34, 33, 33, 33, 33, 32, 32, 33, 33, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 30, 29, 30, 30, 32, 35, 38, 38, 40, 43, 44, 44, 40, 39, 38, 38, 37, 37, 37, 36, 36, 36, 37, 33, 33, 33, 34, 34, 34, 34, 33, 32, 33, 33, 35, 35, 37, 37, 39, 40, 40, 37, 37, 36, 36, 36, 33, 34, 34, 34, 33, 34, 33, 33, 33, 33, 33, 33, 32, 32, 32, 32, 31, 30, 32, 32, 34, 35, 37, 37, 38, 37, 37, 39, 39, 39, 39, 36, 36, 37, 36, 33, 33, 33, 32, 32, 32, 33, 32, 31, 31, 31, 30, 30, 30, 29, 29, 30, 30, 33, 34, 36, 36, 38, 39, 39, 39, 38, 38, 37, 37, 37, 35, 34, 33, 34, 34, 34, 34, 34, 33, 33, 33, 32, 31, 31, 30, 29, 30, 30, 32, 34, 34, 34, 34, 35, 35, 36, 38, 38, 37, 35, 34, 34, 35, 33, 33, 33, 33, 34, 34, 33, 31, 31, 31, 31, 30, 30, 30, 32, 33, 36, 36, 37, 37, 36, 36, 37, 37, 37, 37, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 32, 33, 31, 32, 32, 30, 30, 31, 31, 33, 35, 37, 37, 39, 39, 39, 39, 39, 39, 38, 38, 35, 33, 32, 32, 33, 33, 32, 32, 32, 31, 31, 30, 31, 30, 31, 31, 34, 37, 38, 38, 40, 40, 39, 39, 39, 39, 38, 38, 38, 37, 36, 36, 35, 35, 35, 34, 34, 34, 33, 33, 32, 32, 31, 30, 30, 30, 32, 33, 35, 35, 38, 39, 36, 36, 36, 35, 35, 34, 33, 32, 32, 31, 31, 31, 31, 30, 30, 30, 28, 27, 26, 26, 26, 25, 26, 28, 31, 32, 32, 34, 35, 37, 36, 36, 35, 35, 34, 33, 32, 30, 30, 31, 31, 31, 31, 31, 31, 30, 29, 28, 28, 28, 27, 29, 29, 30, 32, 33, 33, 34, 34, 36, 35, 36, 34, 34, 34, 34, 32, 32, 31, 31, 31, 31, 31, 32, 32, 31, 30, 30, 30, 30, 30, 31, 31, 34, 36, 39, 42, 40, 40, 40, 40, 41, 40, 40, 39, 37, 36, 36, 35, 36, 35, 35, 34, 34, 33, 34, 33, 33, 33, 32, 32, 34, 38, 40, 42, 42, 42, 42, 42, 41, 41, 41, 40, 38, 36, 36, 35, 35, 34, 34, 34, 34, 34, 33, 32, 32, 32, 32, 32, 32, 35, 37, 39, 39, 42, 41, 41, 40, 39, 37, 37, 36, 35, 35, 35, 35, 35, 35, 34, 33, 33, 33, 32, 32, 31, 31, 32, 32, 35, 37, 40, 40, 41, 40, 38, 38, 38, 37, 37, 37, 36, 35, 35, 34, 34, 34, 33, 33, 32, 32, 31, 30, 30, 30, 29, 28, 28, 29, 30, 31, 33, 33, 36, 36, 36, 36, 35, 35, 35, 35, 34, 32, 32, 32, 31, 31, 31, 31, 31, 29, 29, 29, 28, 28, 28, 27, 27, 28, 28, 30, 32, 33, 33, 34, 34, 34, 34, 33, 33, 33, 32, 32, 31, 30, 30, 30, 30, 30, 29, 28, 28, 28, 27, 27, 26, 26, 26, 28, 30, 32, 32, 34, 36, 34, 34, 34, 35, 33, 33, 33, 32, 31, 30, 30, 30, 30, 29, 29, 28, 27, 26, 26, 26, 25, 26, 28, 30, 33, 36, 38, 37, 38, 37, 36, 36, 35, 33, 33, 33, 33, 33, 33, 32, 31, 30, 30, 29, 29, 29, 29, 29, 29, 30, 30, 32, 34, 37, 37, 36, 36, 36, 36, 36, 36, 35, 35, 34, 34, 34, 34, 34, 33, 33, 32, 31, 30, 30, 30, 30, 30, 30, 30, 28, 28, 31, 32, 32, 33, 33, 34, 34, 34, 33, 33, 32, 31, 30, 30, 30, 29, 29, 29, 29, 29, 27, 26, 25, 25, 25, 25, 26, 26, 28, 30, 31, 33, 33, 34, 34, 34, 33, 33, 33, 34, 33, 32, 32, 30, 30, 30, 30, 29, 29, 28, 27, 27, 26, 26, 26, 25, 26, 26, 28, 31, 31, 31, 33, 36, 37, 36, 36, 35, 34, 33, 33, 33, 32, 31, 31, 31, 31, 30, 30, 30, 29, 29, 29, 28, 28, 28, 28, 30, 32, 35, 35, 38, 37, 36, 36, 36, 37, 38, 38, 37, 36, 35, 35, 35, 35, 34, 34, 33, 33, 32, 32, 31, 30, 30, 30, 29, 29, 30, 32, 34, 36, 36, 40, 40, 40, 40, 39, 39, 39, 39, 38, 38, 37, 36, 36, 36, 36, 36, 35, 35, 35, 33, 32, 31, 31, 31, 30, 30, 32, 35, 38, 38, 39, 40, 40, 40, 38, 40, 40, 40, 40, 41, 38, 38, 36, 36, 35, 34, 34, 34, 33];
  • The limitation is as big as the storage. 2^256 words. But can you actually write all the storage? Probably not, since SSTORE is one of the most expensive OPCODEs. You are most likely going to hit the block gas limit – libertylocked Nov 13 '17 at 10:08
  • What is the block gas limit? Is it 4.700.000? Isn't there no way to increase it? – Önder Gürcan Nov 13 '17 at 10:22
  • Currently it's between 6m and 7m iirc. But can you actually pay for it? You might want to remodel your contract so that you don't have to store everything on chain. Maybe IPFS or Swarm can help? – libertylocked Nov 13 '17 at 10:59
1

the limit of a array, its 2^256-1.

in your case, when you try to deploy the contract with a 3 arrays with 700 elements, you are passing the gas limits.

in example ropsten network actually haves 58,000,000 gas limit per block

also you haves a gas limit in transaction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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