Rayls Docs

Teleport tokens

ERC 20 Token Teleport

Now, let's create our first ERC20 token with the ability to be teleported across the Private Subnet.

To do it, we will inherit RaylsErc20Handlerabstract contract in our token example.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@rayls/contracts/tokens/RaylsErc20Handler.sol";

contract TokenExample is RaylsErc20Handler {
    constructor(
        string memory _name,
        string memory _symbol,
        bytes32 _resourceId,
        address _endpoint,
        address _owner,
        uint256 _cCchainId,
        address _balanceCommitmentsContract
    )
        RaylsErc20Handler(
            _name,
            _symbol,
            _resourceId,
            _endpoint,
            _owner,
            _cCchainId,
            _balanceCommitmentsContract
        )
    {
       //your logic here
    }
}

To deploy this contract, a unique identifier, termed as resourceId , is required for the token. This identifier is essential because the token's address may vary across different Privacy Ledgers, making resourceId a more reliable reference.

The concept of _endpoint has been detailed in the preceding section. The parameter _cCchainId represents the chain ID of the Commit Chain, while _balanceCommitmentsContract refers to the address of the BalanceCommitment contract, which is deployed on the Commit Chain