Behind the Scenes of TON: Lessons Learned on Deploying Smart Contracts, Part 2

Published on by Cointele | Published on

In the first part, we introduced the network, detailed our experience of the contest, and explained how synchronous and asynchronous smart contracts work.

To deploy a smart contract, you need to write a deploy script in Fift and compile it to a.boc file.

To make a function call, write a script that will send an external message to the deployed smart contract.

Boc is compiled, a specific amount of GRAMs need to be sent to the smart contract address.

The amount of GRAMs depends on the size and volume of calculations of the deployed smart contract's external message cell.

The smart contract checks the signature of each internal message that will be received through the recv internal function.

Keep in mind that we need to pay fees from the P2P channel smart contract each time we successfully call recv internal or recv external functions.

It is important that TON is a sharded blockchain, so implementing smart contracts on it is more challenging.

Ethereum's contracts run synchronously and do not require handling situations such as waiting for an answer from another contract.

The asynchronous way of smart contract communication is the only option to make it scalable, and TON has these options.

x