Knowledge Base
  • πŸ’‘Welcome To PointPay
  • πŸ“ƒWhitePapper v 1.0
    • Disclaimer
    • Market Overview
      • Overview of 2018-2023
      • Evolution and Statement
      • Challenges and Opportunities
    • PointPay 2.0
      • Ecosystem Overview
      • Services Synergy
    • Crypto Exchange
      • Main Benefits
      • Security Measures
      • Customer Support
    • Digital Vault
      • Role in Ecosystem
      • Features and Benefits
      • Integration with other Services
    • PointPay Token
      • Token Info
      • Utility and Benefits
    • Project Future
      • Project Vision
      • Upcoming Features
    • Conclusion
  • πŸ“ˆTokenomics
  • βš–οΈToken Swap Flow
  • πŸ”—Network
    • Mainnet&TestNet
    • Smart contracts
      • Contract Deployment
      • Deploy with Remix IDE
      • Deploy with Thirdweb
    • Explorer API
    • RPC API
  • Exchange API Documentation
    • Public endpoints | HTTP
      • Pairs List
      • Pairs Stats
      • Specific Pair Stats
      • Order Book Data
      • Market History
      • Market History Data
      • Products
      • Symbols
      • Depth List
      • Chart Data KLine
    • Private endpoints | HTTP
      • Authentication and API Keys
      • Create Limit Order
      • Cancel Order
      • My Active Orders
      • All My Trade Balances
      • My Specific Trade Balance
      • My Order Info
      • My Trades Info
      • My Order History
      • My Order History List
    • Basic structure | WEBSOKET
    • Public methods | WEBSOKET
      • Ping-Pong
      • System Time
      • KLine methods
      • Market Price methods
      • Market Status methods
      • Deals methods
      • Depth methods
    • Private methods | WEBSOKET
      • Authorization
      • My Assets methods
      • My Orders methods
Powered by GitBook
On this page
  • General Process πŸ› οΈ
  • Key Components and Tools 🌐
  • Smart Contract Example
  1. Network

Smart contracts

PreviousMainnet&TestNetNextContract Deployment

Last updated 5 months ago

The process of creating and deploying an ERC-20 token on the PointPay network is similar to deploying tokens on any Ethereum Virtual Machine EVM-Π‘ompatible blockchain. It involves writing the logic for the token, testing it, and deploying it to the blockchain. Here's a general overview of how it works.


General Process πŸ› οΈ

  1. Define the Token Logic: The first step is to define the behavior of your token by writing a smart contract. You can either write the contract from scratch using the Solidity programming language or use pre-built, audited templates like those provided by . These templates follow the ERC-20 standard and provide a secure starting point, minimizing risks of vulnerabilities.

  2. Set Up the Development Environment: You will need a development environment to write, compile, and deploy your contract. Tools like Remix IDE or platforms like Thirdweb simplify this process by offering intuitive interfaces for developers.

    • Remix IDE: A browser-based tool that allows you to write and deploy contracts without requiring installation of additional software.

    • Thirdweb: A platform for deploying and managing smart contracts with minimal technical setup, especially helpful for users new to blockchain development.

  3. Test the Contract: Before deploying your token to the mainnet, it's crucial to test it. This involves deploying it to the PointPay TestNet to simulate real-world behavior without spending real tokens. Testing ensures your token functions as intended and prevents costly errors on the mainnet.

  4. Deploy the Contract: Once you're confident in your token's functionality, you can deploy it to the PointPay Mainnet. This step involves publishing the smart contract to the blockchain, making your token operational and accessible to users. The deployment process requires PXP tokens to pay for transaction fees.

  5. Integration and Distribution: After deployment, the contract address becomes the unique identifier for your token. Share this address so users can add the token to their wallets or interact with it in applications. Integration with decentralized applications (dApps), exchanges, or custom platforms enables token utility and adoption.


Key Components and Tools 🌐

  • ERC-20 Standard: Defines the rules and functions that ensure compatibility with wallets and dApps.

  • Development Tools: Platforms like and help simplify the process, from writing contracts to deployment.

  • PointPay Network:

    • Mainnet RPC: https://rpc-mainnet.pointpay.io

    • TestNet RPC: https://rpc-testnet.pointpay.io

    • Native Token: PXP (required for transaction fees)

  • Block Explorers: Tools like the or allow you to verify and track your token's transactions and deployment status.


Smart Contract Example

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.16;

interface IERC20 {
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

contract SampleERC20Token is IERC20 {
    string public symbol;
    string public  name;
    uint8 public decimals;
    uint public _totalSupply;
    mapping(address => uint) balances;
    mapping(address => mapping(address => uint)) allowed;

    constructor() {
        symbol = "SYM";
        name = "Sample ERC20 Token";
        decimals = 2;
        _totalSupply = 100000;
        balances[msg.sender] = _totalSupply;
        emit Transfer(address(0), msg.sender, _totalSupply);
    }
    function totalSupply() external view returns (uint) {
        return _totalSupply  - balances[address(0)];
    }
    function balanceOf(address tokenOwner) external view returns (uint balance) {
        return balances[tokenOwner];
    }
    function transfer(address to, uint tokens) public returns (bool success) {
        balances[msg.sender] = balances[msg.sender] - tokens;
        balances[to] = balances[to] + tokens;
        emit Transfer(msg.sender, to, tokens);
        return true;
    }
    function approve(address spender, uint tokens) public returns (bool success) {
        allowed[msg.sender][spender] = tokens;
        emit Approval(msg.sender, spender, tokens);
        return true;
    }
    function transferFrom(address from, address to, uint tokens) public returns (bool success) {
        balances[from] = balances[from] - tokens;
        allowed[from][msg.sender] = allowed[from][msg.sender] - tokens;
        balances[to] = balances[to] + tokens;
        emit Transfer(from, to, tokens);
        return true;
    }
    function allowance(address tokenOwner, address spender) external view returns (uint remaining) {
        return allowed[tokenOwner][spender];
    }
}

By following these steps, you can create and deploy a fully functional ERC-20 token on the PointPay network. Whether you're using tools like and , the core process remains the same, ensuring flexibility for developers of all experience levels. For detailed instructions, refer to specific guides for each platform.

πŸ”—
OpenZeppelin
Remix IDE
Thirdweb
PointPay Explorer
TestNet Explorer
Remix IDE
Thirdweb