stylusguide
  • 1. Welcome to Arbitrum Stylus and Rust
    • Brief Introduction to Arbitrum Stylus
    • Importance of Rust in Blockchain Development
    • What You'll Learn in This Tutorial Series
  • 2. Setting Up Your Development Environment
    • Installing Rust
    • Setting Up Arbitrum Stylus
    • Basic Commands
  • 3. Your First Smart Contract: Hello World
    • Introduction to Smart Contracts
    • Writing the Hello World Contract
    • Deploying and Testing Your Contract
  • 4. Understanding Smart Contract Storage: Simple Storage
    • Basics of Contract Storage
    • Writing the Simple Storage Contract
    • Interacting with Storage Variables
  • 5. Creating Your Own Token: Token Contract
    • Introduction to Tokens and Standards
    • Writing the Token Contract
    • Deploying and Testing Your Token
  • 6. Additional Resources and Next Steps
Powered by GitBook
On this page
  • Understanding Tokens and ERC Standards
  • What are Tokens?
  • Overview of ERC Standards
  1. 5. Creating Your Own Token: Token Contract

Introduction to Tokens and Standards

Understanding Tokens and ERC Standards

What are Tokens?

Tokens are digital assets created and managed on a blockchain. They can represent various assets or utilities, such as currency, property, or even access rights. Tokens can be fungible or non-fungible:

Fungible Tokens

These are interchangeable and identical to each other. The most common standard for fungible tokens on Ethereum is the ERC-20 standard. Examples include cryptocurrencies like DAI or USDC.

Non-Fungible Tokens (NFTs)

These are unique and cannot be exchanged on a one-to-one basis. Each token has distinct properties and metadata. The ERC-721 and ERC-1155 standards are used for NFTs. Examples include digital art and collectibles.

Overview of ERC Standards

ERC-20 Standard

ERC-20 is a technical standard used for fungible tokens on the Ethereum blockchain. It defines a common list of rules that all Ethereum tokens must follow, allowing developers to create interoperable tokens.

Key Functions of ERC-20:

  • totalSupply: Returns the total supply of the token.

  • balanceOf: Returns the account balance of another account with address owner.

  • transfer: Transfers a number of tokens to another address.

  • approve: Allows another account to withdraw a certain number of tokens, often for spending by smart contracts.

  • transferFrom: Transfers tokens from one address to another using an allowance.

  • allowance: Returns the number of tokens allowed to be spent by another account.

ERC-721 Standard

ERC-721 is a standard for creating non-fungible tokens (NFTs). Each token has unique characteristics and is represented by a unique ID.

ERC-1155 Standard

ERC-1155 is a multi-token standard that allows for the creation of both fungible and non-fungible tokens within the same smart contract.

These standards ensure that tokens created on the Ethereum blockchain can be used across various dApps and platforms without compatibility issues.

Previous5. Creating Your Own Token: Token ContractNextWriting the Token Contract

Last updated 10 months ago