Skip to main content
This page is all about testing using cross-chain simulation. You can also test directly in our TON + TAC Testnet setup using SDK.
The @tonappchain/evm-ccl package includes a TacLocalTestSdk package that helps emulate full bridging logic and cross-chain operations locally, ensuring your proxy behaves as expected without deploying a full cross-chain setup. The TacLocalTestSdk provides a complete testing environment that simulates cross-chain message flows, token bridging, and NFT operations locally.
Full cross-chain emulation available within TacLocalTestSdk

Installation and Setup

The testing utilities come with the @tonappchain/evm-ccl package:
Ensure your package.json includes the necessary testing dependencies:
If your Dapp contracts are already deployed on another network, you can fork that network and test against it locally instead of deploying the contracts again.

Test Proxy Contract

Here’s the minimal test proxy:

Test Token Contract

Simple ERC20 token for testing:

Test Flow Pattern

1. Initialization

  • Create local cross-chain environment (TacLocalTestSdk)
  • Deploy test tokens and proxy contracts
  • Set up initial state

2. Bridging Simulation

  • Mint or lock tokens on the cross-chain layer
  • Create test parameters (shardsKey, operationId, etc.)
  • Prepare method call arguments

3. Invoke Proxy

  • Use testSdk.sendMessage(...) to simulate cross-chain call
  • Pass all required parameters for complete simulation

4. Verification

  • Confirm transaction succeeded (receipt.status === 1)
  • Inspect deployedTokens for newly minted jettons
  • Inspect outMessages for tokens returning to TON
  • Check emitted events for correct data

Complete Test Setup

Create a test file such as TestProxy.spec.ts under your test directory:

Key Testing Components

TacLocalTestSdk

The core testing utility that provides:

Data Structures

JettonInfo

TokenMintInfo

TokenUnlockInfo

sendMessage Method

The main testing method that simulates cross-chain operations:

sendMessageWithNFT Method

For testing NFT operations, use the specialized NFT testing method:

Running Tests

Inside your project directory: