I have a single contract that is on the verge of its size limit (One more function and i wont be able to deploy anymore)

Within this contract, there is a mapping that I want to feed with strings after deployment.

My question: How many strings can i store inside this mapping at max? And: What will happen if too many strings are stored?

Additional information: OnlyOwner can loop through the mapping and store strings inside. Outsiders cannot access the mapping directly.

1 Answer 1


In theory your contract can store 2^261 bytes of data (source: https://ethereum.stackexchange.com/a/1040/31933 ). There seems to be about 79 zettabytes (something like 2^90 bytes, thanks OpenAI for the conversion) of data in the entire world. So you can in theory store all the world's data many times over in your single contract.

So you won't have problems storing a lot of data in your contract. In reality you will be constrained by gas costs, since data storage is expensive.

  • thank you sir!!
    – PupSt4r
    Commented May 10, 2023 at 9:10

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.