0

As far as I understand, there is a limit on the block size. But what if I want to upload a large contract that exceeds the blocksize? Will it not be allowed?

1
  • You can split your contract to smaller contracts. Jun 4, 2018 at 22:24

2 Answers 2

1

Blocks have Gas limit instead fixed size and the current Block Gas Limit of approximately 8000000 gas/block (https://ethstats.net). so theoretically if you exceed this gas limit your transaction won't be included in any block.

2
  • Thank you for your reply! But isn't it a serious limitation?
    – Learner
    Jun 5, 2018 at 14:07
  • I don't think so , you have to do calculations and experimentation to see what's would be your contract size.
    – Badr Bellaj
    Jun 5, 2018 at 14:14
0

Size of smart contract is implicitly limited by block gas limit, which may grow over time, and explicitly limited by EIP-170. So single smart contract may not be too large.

Though, it is still possible to deploy smart contracts or arbitrary complexity. You just need to split the code of complex smart contract among main smart contract, serving primarily as entry point, and a number of libraries deployed separately. As long as libraries may access storage and balance of calling contract and may send transaction on behalf of it, there is basically no difference whether code resides in main contract or in a library.

I believe it would be not too hard to modify Solidity compiler so it will be able to automatically split large smart contracts into smaller parts. Probably one day such enhancement will be implemented.

Your Answer

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

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