Blueprint SDK overview
Summary: In the previous steps, we installed and configured all the tools required for TON smart contract development and created our first project template.
We recommend installing the Tact extension for VS Code. It offers syntax highlighting, error hints, and a smoother development experience.
Before we proceed to actual smart contract development, let's briefly describe the project structure and explain how to use the Blueprint SDK
.
Project structure
If you didn't choose the proposed names in the previous steps, source code file names and some of the in-code entities may differ.
- Tact
Example/
├── contracts/ # Folder containing smart contracts code
│ ├── hello_world.tact # Main contract file
├── scripts/ # Deployment and on-chain interaction scripts
│ ├── deployHelloWorld.ts # Script to deploy the contract
│ └── incrementHelloWorld.ts # Script to interact with the contract
├── tests/ # Test folder for local contract testing
│ └── HelloWorld.spec.ts # Test specifications for the contract
└─ ─ wrappers/ # TypeScript wrappers for contract interaction
├── HelloWorld.ts # Wrapper class for smart contract
└── HelloWorld.compile.ts # Script for contract compilation
/contracts
This folder contains your smart contract source code written in one of the available programming languages used for TON Blockchain smart contract development.
/scripts
The scripts
directory contains TypeScript
files that help you deploy and interact with your smart contracts on-chain using previously implemented wrappers.
/tests
This directory contains test files for your smart contracts. Testing contracts directly on the TON network is not the best option because deployment requires some amount of time and may lead to losing funds. This testing playground allows you to execute multiple smart contracts and even send messages between them in your "local network". Tests are crucial for ensuring your smart contracts behave as expected before deployment to the network.
/wrappers
To interact with your smart contract off-chain, you need to serialize and deserialize messages sent to it. Wrapper
classes are developed to mirror your smart contract implementation, making its functionality simple to use.
Development flow
Almost any smart contract project development consists of five simple steps:
- Edit the smart contract code in the
/contracts
folder and build it by running the build script:
npx blueprint build