Developer Guide: Build Hybrid dApps with TAC
Create hybrid dApps with TAC SDK: Connect TON users to Uniswap V2 easily. Master development with our comprehensive guide.

Developer Guide: Build Hybrid dApps with TAC
Creating hybrid dApps that connect TON users with Uniswap V2 is now easier thanks to the TAC SDK. This article offers a comprehensive guide for developers who want to master decentralized application development using this innovative technology. Throughout this guide, the fundamentals of how to build these applications and the technical elements that make their implementation easier will be explored.
Introduction to the TAC SDK
The TAC SDK is a JavaScript library specifically designed to assist developers in the creation of hybrid dApps. Its primary function is to simplify the cross-chain messaging process, allowing developers to focus on building exceptional user experiences. The SDK automatically manages wallet connections, transaction routing, and asset bridging between the TON and EVM ecosystem.
The main advantage of using TAC lies in its design that allows cross-chain swaps to be made without relying on multiple wallets or network changes. Through just 50 lines of code, developers can implement an effective token swap that connects TON users with Uniswap V2 contracts.
CT Components
TAC is made up of three key elements that work together:
- TAC Coating EVM: A fully EVM-compatible blockchain built on top of the Cosmos SDK that allows existing Solidity contracts to be deployed without modifications.
- TON Adapter: A distributed sequencer network that validates and routes messages between TON and TAC EVM, ensuring multiple consensuses prior to execution.
- Proxy Contracts: Smart contracts that work as a bridge, handling message formatting, asset bridging and execution coordination.
Implementing a Token Exchange
Implementing a simple token swap is the first step towards creating a hybrid dApp. The following is the basic code required to run this functionality:
import "dotenv/config";
import { toNano } from "@ton/ton";
import { ethers } from "ethers";
import { AssetType, Network, SenderFactory, TacSdk } from "@tonappchain/sdk";
// Direcciones de tokens en la testnet de TON
const TVM_TKA_ADDRESS = "EQBLi0v_y-KiLlT1VzQJmmMbaoZnLcMAHrIEmzur13dwOmM1"; // token A
const TVM_TKB_ADDRESS = "EQCsQSo54ajAorOfDUAM-RPdDJgs0obqyrNSEtvbjB7hh2oK"; // token B
const UNISWAPV2_PROXY_ADDRESS = "0x14Ad9182F54903dFD8215CA2c1aD0F9A47Ac7Edb"; // dirección del proxy en testnet
async function executeSwap() {
const tacSdk = await TacSdk.create({ network: Network.TESTNET });
const sender = await SenderFactory.getSender({
network: Network.TESTNET,
version: "V4",
mnemonic: process.env.TVM_MNEMONICS || "",
});
const evmTKA = await tacSdk.getEVMTokenAddress(TVM_TKA_ADDRESS);
const evmTKB = await tacSdk.getEVMTokenAddress(TVM_TKB_ADDRESS);
const abi = new ethers.AbiCoder();
const encodedParams = abi.encode(
["tuple(uint256,uint256,address[],address,uint256)"],
[
[
Number(toNano(2)), // Monto en
Number(toNano(0)), // Monto mínimo a recibir
[evmTKA, evmTKB], // Ruta de swap
UNISWAPV2_PROXY_ADDRESS, // Destinatario
19010987500, // Fecha límite
],
]
);
const evmProxyMsg = {
evmTargetAddress: UNISWAPV2_PROXY_ADDRESS,
methodName: "swapExactTokensForTokens",
encodedParameters: encodedParams,
};
const assets = [
{
address: TVM_TKA_ADDRESS,
amount: 2,
type: AssetType.FT,
},
];
const result = await tacSdk.sendCrossChainTransaction(
evmProxyMsg,
sender,
assets
);
console.log("Intercambio ejecutado:", result.operationId);
tacSdk.closeConnections();
return result;
}
executeSwap().catch(console.error);
Breakdown of Operation
When running a token swap, the process follows these steps:
- Tokens are either locked in TON or burned, depending on the origin of the token, thus creating a crossover message.
- The network of sequencers validates the transaction across multiple pools.
- The EVM proxy contract receives the message, mints or unlocks the equivalent tokens, and runs the swap on Uniswap.
- The results flow back into the user’s wallet on TON.
Conclusion
By using the TAC SDK, developers can easily create hybrid dApps that integrate with EVM’s capabilities and offer TON users a streamlined direct swapping experience with Uniswap V2. This guide has provided an overview and a technical starting point to take advantage of the capabilities of this innovative system, allowing developers to carry out their projects efficiently and productively.
For more details and resources on TAC and hybrid dApp development, you can visit the main source of this guide: TAC Developer Guide.
Note: This original content has been modified with AI and reviewed by a specialist. Image generated by AI.


