On-chain architecture

Why are there so many contracts?

TON is a blockchain designed to handle immense workloads, achieved through sharding. In this system, everything is sharded, including smart contracts. This means that it's not feasible to direct all queries to a single contract or store everything in one contract, primarily because TON contracts incur a storage fee. This fee structure is implemented to discourage excessively large contract storage, as it would slow down transaction processing. Therefore, it's essential to create an architecture where each contract is responsible for a specific operation.

How does this help us?

As observed in the diagram above, each user has their individual user contract for each token. Consequently, each contract is responsible for only one token and one user. This distribution of responsibility results in greater flexibility and faster processing. It also facilitates the integration of various logics into the contracts. For example, they can restrict frequent minting to avoid overloading the network and apply different penalties for such actions.

Schemes

Last updated