Tact wallet contract
Deployment with API
Wallet deployment
For deployment wallet we have two demo options to run:
yarn deploy
yarn deploy-api
Deployment with user wallet application
As simple way offered to deploy smart contract with usual wallet application. The trick is that we just need specify our outgoing message with data we need(we've already done this) and input this data in message. Wallet applications supports transfer links and QR, so we can use it for our deployment message. The following scheme shows how deployment process via wallet applications works.
Step list here:
- Install wallet application on device from which we will do deployment.
- Get test Toncoins on our wallet application with bot.
- Run deployment script for deployment:
yarn deploy
- Use deployment link or QR with wallet application and confirm the sending of outgoing message.
- Notice our new smart contract deployed on the address we sent the message.
Deployment with TON public API
The way, some applications in production uses is public API. It is acceptable solution for services that not requires operative updating data and just need sometimes send messages. Demo script for this process needs to fill with your wallet 24 words of wallet in testnet, you also can use your wallet from previous step. So, this wallet will call deployment wallet and will be use in similar to wallet application way.
Step list here:
- Install wallet application on device from which we will do deployment and get toncoins.(Using same wallet from previous step)
- Input your test wallet 24 words in deployment script
soucre/wallet.deploy-api.ts
. - Run deployment with script:
yarn deploy-api
- Notice in blockchain explorer our new smart contract deployed according address in console log where we sent the deployment message.
Wallet tests overview
From the beginning example of unit tests distributed with contract in wallet.spec.contract.
You can launch test via yarn test
or specify your own with help of jest and ton-emulator library.
Summary about Tact wallet
Currently TON explorers uses interfaces(getters) and(sometimes) code hash as identifier of contract type, and wallet contract will absolutely different hash for its, so it will not work from the box. This contract is generic FunC contract, so in production all application already set up for using original FunC contract, but still it is most used contract so it was used for learning and explanation purposes of how it works. You can learn more about launching and testing your own tact contract from Jetton Tact article.
What to read next?
Useful materials
- Jetton.tact contract overview and deployment
- TON Hello World part 1: Step by step guide for working with your first TON wallet (opens in a new tab)
Useful social
- Tact Telegram chat (opens in a new tab)
- Ton Dev News (opens in a new tab)
- Ton Dev chat (opens in a new tab)