The Universal Token standard enables ERC-20 fungible tokens to be minted on any chain and seamlessly transferred between connected chains.
When transferring tokens between chains, a token is burned on the source chain. The token's amount is sent in a message to the token contract on the destination chain, where a corresponding token is minted.
The Universal Token standard works the same way as Universal NFT.
contracts/Connected.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import "@zetachain/standard-contracts/token/contracts/evm/UniversalNFT.sol";
contract Connected is UniversalToken {
constructor(
address payable gatewayAddress,
address owner,
string memory name,
string memory symbol,
uint256 gasLimit
)
UniversalToken(gatewayAddress, gasLimit)
Ownable(owner)
ERC20(name, symbol)
{}
}
contracts/Universal.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import "@zetachain/standard-contracts/token/contracts/zetachain/UniversalNFT.sol";
contract Universal is UniversalToken {
constructor(
address payable gatewayAddress,
address owner,
string memory name,
string memory symbol,
uint256 gasLimit,
address uniswapRouter
)
UniversalToken(gatewayAddress, gasLimit, uniswapRouter)
Ownable(owner)
ERC20(name, symbol)
{}
}