---
title: Get Started with Wrapped Token Transfers (WTT)
description: Learn how to integrate Wormhole's Wrapped Token Transfers (WTT) for seamless multichain token transfers with a lock-and-mint mechanism and cross-chain asset management.
categories:
- WTT
- Transfer
url: https://wormhole.com/docs/products/token-transfers/wrapped-token-transfers/guides/wtt-contracts/
word_count: 1266
token_estimate: 2049
---

# Interact with Wrapped Token Transfer (WTT) Contracts

Wormhole's Wrapped Token Transfers (WTT) enable seamless cross-chain token transfers using a lock-and-mint mechanism. The bridge locks tokens on the source chain and mints them as wrapped assets on the destination chain. Additionally, WTT supports [Token Transfers with Messages](/docs/protocol/infrastructure/vaas/#token-transfer-with-message){target=\_blank}, where arbitrary byte payloads can be attached to the token transfer, enabling more complex chain interactions. 

This page outlines the core contract methods needed to integrate WTT functionality into your smart contracts. To understand the theoretical workings of WTT, refer to the [WTT](/docs/products/token-transfers/wrapped-token-transfers/overview/){target=\_blank} page in the Learn section.

!!! note "Terminology" 
    The SDK and smart contracts use the name Token Bridge. In documentation, this product is referred to as Wrapped Token Transfers (WTT). Both terms describe the same protocol.

## Prerequisites

To interact with the Wormhole WTT, you'll need the following:

- [The address of the WTT contract](/docs/products/reference/contract-addresses/#wrapped-token-transfers-wtt){target=\_blank} on the chains you're working with.
- [The Wormhole chain ID](/docs/products/reference/chain-ids/){target=\_blank} of the chains you're targeting for token transfers.

## How to Interact with WTT Contracts

The primary functions of the WTT contracts revolve around:

- **Attesting a token**: Registering a new token for cross-chain transfers.
- **Transferring tokens**: Locking and minting tokens across chains.
- **Transferring tokens with a payload**: Including additional data with transfers.

### Attest a Token

Suppose a token has never been transferred to the target chain before transferring it cross-chain. In that case, its metadata must be registered so WTT can recognize it and create a wrapped version if necessary.

The attestation process doesn't require you to manually input token details, such as name, symbol, or decimals. Instead, the WTT contract retrieves these values from the token contract itself when you call the `attestToken()` method.

```solidity
function attestToken(
    address tokenAddress,
    uint32 nonce
) external payable returns (uint64 sequence);
```

??? interface "Parameters"

    `tokenAddress` ++"address"++
        
    The contract address of the token to be attested.

    ---

    `nonce` ++"uint32"++  

    An arbitrary value provided by the caller to ensure uniqueness.

??? interface "Returns"

    `sequence` ++"uint64"++
    
    A unique identifier for the attestation transaction.

??? interface "Example"

    ```solidity
    IWormhole wormhole = IWormhole(wormholeAddr);
    ITokenBridge tokenBridge = ITokenBridge(tokenBridgeAddr);

    uint256 wormholeFee = wormhole.messageFee();

    tokenBridge.attestToken{value: wormholeFee}(
        address(tokenImpl), // the token contract to attest
        234                 // nonce for the transfer
    );
    ```

When `attestToken()` is called, the contract emits a Verifiable Action Approval (VAA) containing the token's metadata, which the Guardians sign and publish.

You must ensure the token is ERC-20 compliant. If it does not implement the standard functions, the attestation may fail or produce incomplete metadata.

### Transfer Tokens 

Once a token is attested, a cross-chain token transfer can be initiated following the lock-and-mint mechanism. On the source chain, tokens are locked (or burned if they're already a wrapped asset), and a VAA is emitted. On the destination chain, the VAA is used to mint or release the corresponding amount of wrapped tokens.

Call `transferTokens()` to lock/burn tokens and produce a VAA with transfer details.

```solidity
function transferTokens(
    address token,
    uint256 amount,
    uint16 recipientChain,
    bytes32 recipient,
    uint256 arbiterFee,
    uint32 nonce
) external payable returns (uint64 sequence);
```

??? interface "Parameters"

    `token` ++"address"++
        
    The address of the token being transferred.

    ---

    `amount` ++"uint256"++
 
    The amount of tokens to be transferred.

    ---

    `recipientChain` ++"uint16"++

    The Wormhole chain ID of the destination chain.

    ---

    `recipient` ++"bytes32"++

    The recipient's address on the destination chain.

    ---

    `arbiterFee` ++"uint256"++

    Optional fee to be paid to an arbiter for relaying the transfer.

    ---

    `nonce` ++"uint32"++

    A unique identifier for the transaction.

??? interface "Returns"

    `sequence` ++"uint64"++
    
    A unique identifier for the transfer transaction.

??? interface "Example"

    ```solidity
    IWormhole wormhole = IWormhole(wormholeAddr);
    ITokenBridge tokenBridge = ITokenBridge(tokenBridgeAddr);

    // Get the fee for publishing a message
    uint256 wormholeFee = wormhole.messageFee();

    tokenBridge.transferTokens{value: wormholeFee}(
        token,           // address of the ERC-20 token to transfer
        amount,          // amount of tokens to transfer
        recipientChain,  // Wormhole chain ID of the destination chain
        recipient,       // recipient address on the destination chain (as bytes32)
        arbiterFee,      // fee for relayer
        nonce            // nonce for this transfer
    );
    ```

Once a transfer VAA is obtained from the Wormhole Guardian network, the final step is to redeem the tokens on the destination chain. Redemption verifies the VAA's authenticity and releases (or mints) tokens to the specified recipient. To redeem the tokens, call `completeTransfer()`.

```solidity
function completeTransfer(bytes memory encodedVm) external;
```

??? interface "Parameters"

    `encodedVm` ++"bytes memory"++
    
    The signed VAA containing the transfer details.

!!!note
    - WTT normalizes token amounts to 8 decimals when passing them between chains. Make sure your application accounts for potential decimal truncation.
    - The VAA ensures the integrity of the message. Only after the Guardians sign the VAA can it be redeemed on the destination chain.

### Transfer Tokens with Payload

While a standard token transfer moves tokens between chains, a transfer with a payload allows you to embed arbitrary data in the VAA. This data can be used on the destination chain to execute additional logic—such as automatically depositing tokens into a DeFi protocol, initiating a swap on a DEX, or interacting with a custom smart contract.

Call `transferTokensWithPayload()` instead of `transferTokens()` to include a custom payload (arbitrary bytes) with the token transfer.

```solidity
function transferTokensWithPayload(
    address token,
    uint256 amount,
    uint16 recipientChain,
    bytes32 recipient,
    uint32 nonce,
    bytes memory payload
) external payable returns (uint64 sequence);
```

??? interface "Parameters"

    `token` ++"address"++
    
    The address of the token being transferred.

    ---

    `amount` ++"uint256"++

    The amount of tokens to be transferred.

    ---

    `recipientChain` ++"uint16"++

    The Wormhole chain ID of the destination chain.

    ---

    `recipient` ++"bytes32"++

    The recipient's address on the destination chain.

    ---

    `nonce` ++"uint32"++

    A unique identifier for the transaction.

    ---

    `payload` ++"bytes memory"++

    Arbitrary data payload attached to the transaction.

??? interface "Returns"
    
    `sequence` ++"uint64"++
    
    A unique identifier for the transfer transaction.

??? interface "Example"

    ```solidity
    IWormhole wormhole = IWormhole(wormholeAddr);
    ITokenBridge tokenBridge = ITokenBridge(tokenBridgeAddr);

    // Get the fee for publishing a message
    uint256 wormholeFee = wormhole.messageFee();

    tokenBridge.transferTokensWithPayload{value: wormholeFee}(
        token,           // address of the ERC-20 token to transfer
        amount,          // amount of tokens to transfer
        recipientChain,  // Wormhole chain ID of the destination chain
        recipient,       // recipient address on the destination chain (as bytes32)
        nonce,           // nonce for this transfer
        additionalPayload // additional payload data
    );
    ```

After initiating a transfer on the source chain, the Wormhole Guardian network observes and signs the resulting message, creating a Verifiable Action Approval (VAA). You'll need to fetch this VAA and then call `completeTransferWithPayload()`.

Only the designated recipient contract can redeem tokens. This ensures that the intended contract securely handles the attached payload. On successful redemption, the tokens are minted (if foreign) or released (if native) to the recipient address on the destination chain. For payload transfers, the designated contract can execute the payload's logic at this time.

```solidity
function completeTransferWithPayload(bytes memory encodedVm) external returns (bytes memory);
```

??? interface "Parameters"

    `encodedVm` ++"bytes memory"++

    The signed VAA containing the transfer details.

??? interface "Returns"

    `bytes memory`

    The extracted payload data.

## Source Code References

For a deeper understanding of WTT implementation and to review the actual source code, please refer to the following links:

- [WTT contract](https://github.com/wormhole-foundation/wormhole/blob/main/ethereum/contracts/bridge/Bridge.sol){target=\_blank}
- [WTT interface](https://github.com/wormhole-foundation/wormhole-solidity-sdk/blob/main/src/interfaces/ITokenBridge.sol){target=\_blank}

## Portal Bridge

A practical implementation of the Wormhole WTT can be seen in [Portal Bridge](https://portalbridge.com/){target=\_blank}, which provides an easy-to-use interface for transferring tokens across multiple blockchain networks. It leverages the Wormhole infrastructure to handle cross-chain asset transfers seamlessly, offering users a convenient way to bridge their assets while ensuring security and maintaining token integrity.
