Learn how to develop a TAC Proxy - the connectors between TON and EVM applications
_crossChainLayer
(the CrossChainLayer contract address) to TacProxyV1’s constructor._onlyCrossChainLayer
is a security modifier inherited from TacProxyV1. It ensures that only the recognized cross-chain layer can call this function.IDappContract
is just an example interface for some external logic contract you may want to call._authorizeUpgrade
ensures only the owner can perform contract upgrades.myProxyFunction
, invokeWithCallback
, etc.), but it must accept two bytes arguments:
_sendMessageV1
method._sendMessageV1
method can also be used for regular asset bridging from TAC back to TON, without necessarily involving DApp interactions.myProxyFunction
in a non-upgradeable contract. The logic is the same for an upgradeable contract.
function myProxyFunction(bytes calldata, bytes calldata) external _onlyCrossChainLayer
ensures only the TAC infrastructure can call this function._decodeTacHeader(...)
is inherited from TacProxyV1 (or TacProxyV1Upgradeable); it transforms the raw bytes into TacHeaderV1 data.arguments
) using abi.decode(...)
with a struct you define.myProxyFunction(tacHeader, arguments)
on your proxy contract.uint64 shardsKey
- ID for linking sharded messages.uint256 timestamp
- last message’s shard block timestamp from TON.bytes32 operationId
- unique ID for the operation.string tvmCaller
- TON user’s wallet address. !!! Important !!! It is always base64 mainnet bounceable format and starts with EQ.bytes extraData
- For now it’s always a zero-bytes array and not used._sendMessageV1(outMsg, value)
function sends everything back to the CrossChainLayer so that tokens (including native TAC token) (and an optional message) can be bridged to TON.tvmProtocolFee
or tvmExecutorFee
manually.getProtocolFee
method on the proxy contract to get the current protocol fee.tvmProtocolFee
field in your OutMessageV1 accordingly.settings.getTrustedTVMExecutors()
on the Settings contract.msg.value
you send must be greater than or equal to tvmProtocolFee + tvmExecutorFee
. Any surplus TAC tokens will be bridged to tvmTarget
.
"myProxyFunction(bytes,bytes)"
.gasLimit
gas for executing the transaction on the TAC side. If this parameter is not specified, it will be calculated using the simulateEVMMessage
method (preferred).invokeWithCallback(...)
.TacLocalTestSdk
).TestToken
).TestProxy
.shardsKey
, operationId
, etc.).testSdk.sendMessage(...)
to simulate a cross-chain call to your proxy’s function.deployedTokens
(if you minted new tokens).outMessages
for tokens returning to TON.
IERC721Receiver
and implement the required onERC721Received
function to correctly receive ERC‑721 tokens.
@tonappchain/evm-ccl
local test SDK helps emulate bridging logic, ensuring your proxy behaves as expected in a cross-chain scenario.
functionName(bytes, bytes) external
._sendMessageV1(...)
to return tokens and a message back to TON._sendMessageV2(...)
to bridge both NFTs and ERC‑20 tokens back to TON.@tonappchain/evm-ccl
provides an easy way to validate your cross-chain logic without deploying a full cross-chain setup.