The maximum size of a smart contract deployed on the TON Network depends on the complexity of the contract and the number of cells it utilizes. In general, the size of a smart contract's Bag-of-Cells (BoC) representation should not exceed the size limit of a single shardchain block, which is 2 MB
. However, practical limits for smart contracts are much smaller.
A single cell in the TON Network can store up to 1023 data
bits and has 4 references to other cells
. The more complex the smart contract, the more cells it will use. However, there isn't a strict rule regarding the number of cells that a smart contract can have, as it depends on the specific use case and complexity of the contract.
In practice, it's important to keep your smart contract's code as concise and efficient as possible to ensure that it can be deployed and executed efficiently on the network. As long as the smart contract fits within the block size limit and doesn't exceed practical cell usage limitations, it should be deployable on the TON Network.
*2MB based on here:
https://docs.ton.org/develop/howto/faq#average-block-size