Bridging tokens
Overview
The bridge flow, powered by Squid, allows players to transfer tokens between various blockchains and Immutable zkEVM.
With the Immutable Marketplace package, you can generate the bridge URL and open it in the player’s default browser using the Application.OpenURL(link)
function,
as demonstrated in our sample game.
For additional questions, please contact our support team on Discord.
Generating the bridge widget URL
To generate the bridge URL, specify the desired environment. In this example, we set the token to be transferred to your game’s ERC-20 token and the destination chain ID to Immutable zkEVM.
using UnityEngine;
using Immutable.Marketplace;
using Environment = Immutable.Marketplace.Environment;
public class Bridge : MonoBehaviour
{
public void OnBridgeClicked()
{
var link = LinkFactory.GenerateBridgeLink(
environment: Environment.Sandbox,
queryParams: new BridgeQueryParams
{
ToTokenAddress = "YOUR_GAME_ERC20_TOKEN_ADDRESS",
ToChainID = "13371"
}
);
Application.OpenURL(link);
}
}
For further customisation, refer to the Unity Bridge tokens documentation.
Next steps
Congratulations! You've enabled players to bridge tokens from other blockchains to Immutable zkEVM, providing them with another option to fund their wallet.
This completes the tutorial on building a marketplace with Immutable's Unity SDK. For more related topics, explore the articles below.