Deploying Smart Contracts

This guide explains how to deploy smart contracts to TetraChain using Blueprint. We'll use the SimpleCounter contract as a practical example.

Overview

Blueprint provides a streamlined deployment workflow for TON smart contracts. The deployment process involves:

  1. Configuring network settings

  2. Creating a contract and deployment script

  3. Executing the deployment

  4. Verifying the contract on-chain // todo (?)

Step 1: Network Configuration

Create a blueprint.config.ts file in your project root to configure the deployment network:

import { Config } from '@ton/blueprint';

export const config: Config = {
    network: {
        endpoint: 'https://tetra.tonapi.io', // API endpoint URL
        type: 'mainnet', // Network type
        version: 'tonapi', // API provider
    },
};

Step 2: Contract Implementation

Here's the FunC implementation of the SimpleCounter contract:

Step 3: Create Deployment Script

Create a deployment script at scripts/deploySimpleCounter.ts:

Step 4: Execute Deployment

Run the deployment script using Blueprint CLI:

Blueprint will prompt you to:

  1. Select a script: Choose deploySimpleCounter

  2. Choose a wallet: Select your deployment wallet

For all details about Smart Contracts, please use the links below

Last updated