Skip to main content
TAC proxy contracts can receive, process, and bridge NFTs between TON and EVM networks. This guide shows the example implementation patterns.
NFT proxy contracts must inherit from IERC721Receiver and implement the required onERC721Received function to correctly receive ERC-721 tokens.

NFT Proxy Implementation

The NFT proxy contract must inherit from IERC721Receiver and implement the required onERC721Received function to correctly receive ERC‑721 tokens.

Test ERC‑721 Token Contract

For testing purposes, you can use this simple ERC-721 implementation:

Key Implementation Points

1. Required Inheritance

  • Must inherit from both TacProxyV1 and IERC721Receiver
  • Order of inheritance matters for proper functionality

2. onERC721Received Implementation

  • Must return the correct selector to confirm token receipt
  • Without this, NFT transfers to your contract will fail

3. NFT Approval Pattern

  • Approve each NFT individually by tokenId before cross-chain transfer
  • Use _getCrossChainLayerAddress() to get the correct approval target

4. OutMessageV1 Structure for NFTs

5. NFTAmount Structure

The NFTAmount struct contains:
  • evmAddress - The NFT contract address
  • tokenId - The specific token ID
  • amount - Ignored for ERC721 (always 0)

Function Signature Requirements

NFT proxy functions follow the same signature requirements as regular proxy functions:
You can name the function whatever you want (e.g., processNFT, handleNFT, etc.) as long as it follows the function <name>(bytes calldata, bytes calldata) external pattern.

Argument Encoding for NFTs

When calling NFT proxy functions from the frontend, encode the NFTAmount array: