Skip to content
Verified contractExactMIT

ZionToken

Address0xc53a2ba7ccd9eadc40c24d7b0ec24f7575c9d1aa
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.19

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.19+commit.7dd6d404
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
23,775,285
Creation transaction
0xead00e57a0…d5bda82583

ZionToken.sol

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

/// @title ZionToken (ZION) - Simple ERC20 Token (transfer enabled)
contract ZionToken {
    string public name = "ZionToken";
    string public symbol = "ZION";
    uint8 public decimals = 18;
    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /// @param _initialSupply Whole tokens (for example: 1000000 = 1 million ZION)
    constructor(uint256 _initialSupply) {
        uint256 initial = _initialSupply * (10 ** uint256(decimals));
        totalSupply = initial;
        balanceOf[msg.sender] = initial;
        emit Transfer(address(0), msg.sender, initial);
    }

    function transfer(address to, uint256 value) public returns (bool) {
        require(to != address(0), "Invalid address");
        require(balanceOf[msg.sender] >= value, "Insufficient balance");

        unchecked {
            balanceOf[msg.sender] -= value;
            balanceOf[to] += value;
        }

        emit Transfer(msg.sender, to, value);
        return true;
    }

    function approve(address spender, uint256 value) public returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) public returns (bool) {
        require(to != address(0), "Invalid address");
        require(balanceOf[from] >= value, "Insufficient balance");
        require(allowance[from][msg.sender] >= value, "Allowance exceeded");

        unchecked {
            balanceOf[from] -= value;
            allowance[from][msg.sender] -= value;
            balanceOf[to] += value;
        }

        emit Transfer(from, to, value);
        return true;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.