Cycle Network Docs
  • 🙌Welcome
    • 📖Genesis of Cycle Network
    • 🌀What is Cycle Network
    • 😃Benefits of Cycle Bridgeless
      • 🧑‍🤝‍🧑For End User
      • 👨‍đŸ”ŦFor Developer
  • âš™ī¸Quick Start
    • đŸŦConnect to Cycle
      • Connect to Cycle Mainnet
        • â›ĩCycle Sailboat
      • Connect to Cycle Testnet
        • đŸĒŧCycle JellyFish
        • đŸĻ‘Cycle CuttleFish (Archived)
        • ⭐Cycle StarFish (Archived)
        • đŸ’ĩTestnet Tokens
      • Operator Guideline
    • 🔄Transfer within Cycle
    • 👉How to roll in tokens
    • 👈How to roll out tokens
    • ✋Claim assets on destination chain
  • đŸ› ī¸Technical Introduction
    • Overview
    • Technical Background
      • ZK-Rollup
      • Sequencer
      • Zero-knowledge hardware acceleration
      • Fully Homomorphic Encryption
    • Module Explanation
      • Omni State Channel Indexer (OSCI)
      • Decentralized Aggregate Sequencer
      • Zero-knowledge hardware acceleration
      • Fully Homomorphic Encryption
  • đŸ•šī¸Cycle-CORE-SDK
    • Introduction
    • Getting Started
    • Onchain Transaction
    • Query Service
  • 💡Case Study
    • 🐷Piggy Bank
    • 🎮TapUp
    • â¤ī¸â€đŸ”ĨBridgeless All Chain Trading
    • 🤑Bridgeless All Chain AI Application
  • đŸĸResources
    • Website
    • Medium
    • White Paper
    • GitHub
  • 😇Community and support
    • 📞Contact Us
    • đŸĩTwitter
    • 🤖Telegram
    • 💰Campaign
Powered by GitBook
On this page
  1. Quick Start

Transfer within Cycle

Transfer tokens within Cycle can be easily accomplished by using ether.js and web3.js. A coding example can be seen below:

import { Contract, Wallet, BigNumberish, providers } from 'ethers'
const rpc = 'https://rpc-testnet.cyclenetwork.io'
const abi = [
  'function transfer(address to, uint256 amount) external returns (bool)'
]

async erc20Transfer(
    privateKey: string,
    tokenAddress: string,
    toAddress: string,
    amount: BigNumberish
) {
    const provider = new providers.JsonRpcProvider(rpc)
    const signer = new Wallet(privateKey, provider)
    const contract = new Contract(tokenAddress, abi, signer)
    const tx = await contract.transfer(toAddress, amount)
    const recepit = await tx.wait()
}

We can also transfer tokens by MetaMask, which is connected to Cycle directly.

PreviousOperator GuidelineNextHow to roll in tokens

Last updated 1 year ago

âš™ī¸
🔄