☁️
Zus Docs
  • About Züs
  • System
    • Providers and Services
      • Miner
      • Sharder
      • Blobber
      • Validator
      • Authorizer
      • Node Locator (0DNS)
    • Storage
      • Architecture and Data Management
      • Protocol
        • Allocations
        • Reference Objects
        • Challenges
        • Write Markers
          • Chain Hashing
          • Two Commit
        • Blobber Repair Protocol
      • ZS3 Server
        • Backup, Recovery and Replication
        • Encryption and Compression
        • S3FS Setup and Usage
        • Backup & Recovery with Restic on Blimp + ZS3 Server
        • Backup & Recovery with Veeam on Blimp + ZS3 Server
      • File Operations
        • Upload
        • Download
        • File Sharing
        • Partial Error Recovery
        • Streaming
        • Rent a Blobber
    • Smart Contracts
      • Storage S.C.
      • Miner S.C.
      • ZCN S.C.
      • ERC-20 S.C.s
      • Bridge Protocol
    • Blockchain & Consensus
      • Entities
    • User Authentication and Wallet Management System
      • OKTA Integration
      • Key Management System (KMS)
  • APIs
    • 0DNS API
    • JS API
    • Mobile API
  • CLIs
    • Storage CLI
      • Quickstart
      • Configuring the tool
    • Wallet CLI
      • Wallet Configuration
      • Quickstart
      • Configuring the tool
  • SDKs
    • Go SDK
      • GO SDK Microservices
    • JS SDK
  • Tokenomics
    • Staking
    • Reward & Penalty
  • ✨Züs Apps
    • 🗝️Vult
      • Getting Started
        • Web
        • Mobile
      • Vult AI
        • Batch Processing
        • Memory Retention
        • Technical Implementation
        • Architecture Overview
      • Login / Register
      • File Management Pages
      • File Sharing
      • Storage Management Dashboard
      • Storage Maintenance and Troubleshooting
      • Züs Subscription
      • Wallet Management
      • Refer a friend
      • Settings
    • 🏗️Blimp
      • Getting Started
      • Login / Register
      • Configure Storage
        • Create Standard Storage Allocation
        • Create Enterprise Allocation
        • Create S3 Server Allocation
        • Create Cloud Migration Allocation
        • Allocation Maintenance and Troubleshooting
      • File Management Pages
      • File Sharing
      • Manage Allocations
      • Upgrade Storage
      • Blimp Vault
      • Refer a friend
      • Settings
      • Launching ZS3 Server
      • Using CLI to backup files into Blimp + ZS3 Server
    • 🏠Chimney
      • Getting Started
      • Login / Register
      • Create New Deployment
      • Manage Your Deployments
      • Homepage
      • Staking Dashboard
      • Rank Dashboard
      • Monitor Dashboard
      • Stats Dashboard
      • Logs Dashboard
      • Wallet Dashboard
      • Operations on your Deployments
      • Restricted Blobbers
      • Settings
        • Manage Profile
        • Wallet Settings
        • Update Blobber Settings
        • Update Blobber Version
        • Refer a friend
        • Help
    • 🌐Atlus
      • Getting Started
      • Home page
      • Service Providers Page
      • Charts Page
        • Market Charts
        • Network Charts
        • Storage Charts
      • Blockchain Page
      • Server Map Page
      • Storage Explainer Page
      • Details Pages
        • Block Details Page
        • Transaction Details Page
        • Wallet Details Page
        • Miner Details Page
        • Sharder Details Page
        • Blobber Details Page
        • Validator Details Page
        • Authorizer Details Page
        • Allocation Details Page
      • Appendix: Common Components
    • ⚡Bolt
      • Getting Started
        • Web
        • Mobile
      • Login / Register
      • Sign In with external wallet
      • Staking Dashboard
      • Staking/Unstaking a provider
      • Claiming Rewards
      • Send/Receive ZCN tokens
      • Buy ZCN
      • Deposit/Withdraw ZCN tokens
      • Activity Dashboard
      • Refer a friend
      • Settings
  • Releases
    • Hardfork
Powered by GitBook
On this page
  • Contract Overview
  • Smart Contract Code
  • Key Features
  • Deployment & Usage
  • Use Cases
  1. System
  2. Smart Contracts

ERC-20 S.C.s

The ZCN Token Smart Contract is an ERC-20 token built for the Züs blockchain ecosystem. It follows the ERC-20 standard while incorporating key features such as custom decimals, controlled minting, and allowance management.

The contract is built using OpenZeppelin’s secure and tested libraries, ensuring interoperability with wallets, exchanges, and decentralized applications (dApps).

Contract Overview

  • Token Name: Configurable (set during deployment)

  • Symbol: Configurable (set during deployment)

  • Decimals: 10 (instead of the default 18)

  • Initial Supply: 500,000,000 ZCN

  • Total Supply: Can be increased via minting by the contract owner

  • Minting: Restricted to the owner

  • Allowance Management: Includes increaseApproval() for backward compatibility

  • Standard Functions: Implements all ERC-20 functions such as transfer, approve, allowance, etc.

Smart Contract Code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

/**
 * @title Token
 *
 * @notice Represents ERC20 implementation for ZCN tokens
 */
contract Token is ERC20, Ownable {
    constructor(string memory name_, string memory symbol_)
        ERC20(name_, symbol_)
    {
        _mint(msg.sender, 500000000 * 10**decimals());
    }

    /**
     * @notice Overrides ERC20 decimals function to modify amount of token decimals
     * @return uint8 The amount of token decimals
     */
    function decimals() public pure override returns (uint8){
        return 10;
    }

    /**
     * @notice Public mint function
     * @param account_ The address to mint tokens to
     * @param amount_ The amount of tokens to mint
     */
    function mint(address account_, uint256 amount_) external onlyOwner {
        _mint(account_, amount_);
    }

    /**
     * @notice Alias for an older version of ERC20 smart contract to use increaseAllowance method
     * @param spender_ The address to increase allowance for
     * @param amount_ The amount to increase
     */
    function increaseApproval(address spender_, uint256 amount_) external onlyOwner {
        increaseAllowance(spender_, amount_);
    }
}

Key Features

1. ERC-20 Compliance

This contract follows the ERC-20 standard, meaning it supports:

  • transfer(): Allows token transfers between users.

  • approve(): Grants spending permission to another address.

  • allowance(): Checks the approved spending limit.

  • transferFrom(): Executes transfers on behalf of a user.

2. Custom Decimals

Unlike the default 18 decimals in ERC-20, this token has 10 decimals:

function decimals() public pure override returns (uint8){
    return 10;
}
  • This allows for finer precision in transactions.

3. Minting New Tokens

  • Only the contract owner can mint new tokens:

function mint(address account_, uint256 amount_) external onlyOwner {
    _mint(account_, amount_);
}
  • Use case:

    • This function can be used for staking rewards, governance incentives, or controlled token supply expansion.

4. Increased Allowance Function (increaseApproval)

  • Provides backward compatibility for older ERC-20 implementations:

function increaseApproval(address spender_, uint256 amount_) external onlyOwner {
    increaseAllowance(spender_, amount_);
}
  • This function allows adjusting allowances without resetting them, which is useful in older DeFi applications.

Deployment & Usage

1. Deploying the Contract

To deploy the contract, provide the token name and symbol:

Token zcnToken = new Token("Zus Coin", "ZCN");

2. Interacting with the Contract

Minting New Tokens

zcnToken.mint(0xRecipientAddress, 1000 * 10**10);

✅ Mints 1,000 ZCN tokens.

Transferring Tokens

zcnToken.transfer(0xRecipientAddress, 500 * 10**10);

✅ Transfers 500 ZCN to the recipient.

Approving a Spender

zcnToken.approve(0xSpenderAddress, 200 * 10**10);

✅ Allows spender to transfer up to 200 ZCN on behalf of the owner.

Checking Balance

zcnToken.balanceOf(0xUserAddress);

✅ Returns the token balance of a user.

Using increaseApproval

zcnToken.increaseApproval(0xSpenderAddress, 50 * 10**10);

✅ Increases allowance by 50 ZCN.

Use Cases

  • Utility Token: Used for transactions, fees, and governance within the Züs ecosystem.

  • DeFi & Staking: Can be used in staking, farming, and liquidity pools.

  • Token Bridging: Supports cross-chain transfers between Ethereum and Züs.

The ZCN ERC-20 Smart Contract is designed for efficiency, security, and seamless integration within the Züs ecosystem. It offers controlled minting, customized decimals, and standard ERC-20 functions, ensuring compatibility with DeFi applications, wallets, and exchanges.

PreviousZCN S.C.NextBridge Protocol

Last updated 3 months ago