Developing a TAC Proxy
This is the first version of generating automatic proxies. Please let us know if you have any feedback or suggestions.
Building a proxy is a crucial part of enabling cross-chain communication in the TAC ecosystem. Let’s walk through the process step by step.
Getting Started
First, install the core package in your Solidity project:
or if you use yarn:
Creating Your Proxy Contract
Start by creating a new file for your proxy (e.g., MyProxy.sol
) in your contracts folder. Here are the essential imports needed:
Here’s the basic structure of a proxy contract:
Building Proxy Functions
Please make sure that all proxy functions must follow this signature pattern:
Structuring Arguments
When using tac-console
for development, it’s best to structure arguments like this:
Complete Function Implementation
Here’s a full example of a proxy function implementation:
Before myProxyFunction
is called, the CrossChainLayer contract transfers all user tokens from TON to your contract. The function receives two arguments:
TacHeader Structure
uint64 shardedId
: Your specified ID for TVM contract messagesuint256 timestamp
: TON block timestamp of message creationstring operationId
: Unique TAC infrastructure message identifierstring tvmCaller
: TON user’s wallet addressbytes extraData
: Optional executor-provided data (empty if unused)
Basic Encoding Example
Here is a simple example of encoding arguments:
Handling Complex Structures
For nested structures like this:
The encoding looks like this:
For dynamic arrays in your structures:
The encoding should look like this, as a tuple:
SDK Integration
When using the TAC SDK, first define the function signature:
then prepare your message like this:
That covers everything needed to create a working TAC proxy. Remember to thoroughly test before deploying to production!