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?
2 Answers
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.
-
-
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
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.