Learn
Hello World
Hello World 5 of 6

Tact Hello World

Introduction to TON Smart Contracts using Tact

Tact's facts #5

Now we on finale stage. We need to deploy our contract to Blockchain. To do this, we will use Ton wallet application. In this way we avoid a lot of details about deployment process, but you can find more details about this in followed low-levels guides.

  • To deploy our new contract we need send message with init information in its to address of our contract.
  • We can know destination address of contract because of definition of Address depends on only from contract's data and code. We know both.
  • To send message in blockchain it is necessary to communicate with TON blockchain nodes. Wallet application will do this with own API, so we will avoid this details in current lesson.
  • To send outgoing message in TON, sender should pay fees. In our case, we need some funds on Ton wallet to pay this action.

Tact deploy

Note, this design of deployment used just for clearness. Deploying via Wallet App, Working with public API convenient for learning purposes and a bad way for real products.

Tactical Practice #5 - deploy the contract

Before deployment, according to said before we need to prepare Ton wallet contract with funds. We will use test environment, that maintained with test nodes and called testnet(production calls mainnet).

  1. To do this we need install one of ton wallet for testnet:
  1. Create wallet in application according native wallet apps instructions.

  2. Get test Toncoins for your wallet from Telegram testgiver bot (opens in a new tab).

  3. Get address from your wallet and input it in deployment script - contract.deploy.ts. For me, it was kQDND6yHEzKB82ZGRn58aY9Tt_69Ie_uz73e2VuuJ3fVVcxf:

tact-template/sources/contract.deploy.ts
  1. Run contract.deploy.ts script to get deployment link in terminal with following command in terminal:
yarn deploy

It will ask from you wallet you want use, choose what you used before(Tonkeeper/Sandbox).

  1. Read deployment link through reading QR or open link via your testnet TON wallet, confirm outgoing message in wallet application.

deployment-1

If you faced some compile issue and can't figure out what is wrong, just compare with target contract placed in sources/example/increment.tact or here (opens in a new tab).