Skip to content
Verified contractPartialMIT

SimpleEthereumToken

Address0x99bd684940e7e7701bde0f0bb69c39c8c26b3dfd
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.23

 

Same code

1 more contract

 

Details

Compiler
solc 0.8.23+commit.f704f362
Language
solidity
Optimization
Yes, 200 runs
EVM version
shanghai
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
24,951,577
Creation transaction
0xe7a7058fa9…5c0ea94f8c
Main copy (most transactions)
0x54e2f59c…b19222d3

contracts/SimpleEthereumToken.sol

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

/// @title Simple Ethereum Token
/// @notice Plain fixed-supply ERC-20 token. Edit the constants before deployment.
contract SimpleEthereumToken {
    string public constant name = "ARENA";
    string public constant symbol = "ARENA";
    uint8 public constant decimals = 9;
    uint256 public constant totalSupply = 1_000_000_000 * 10 ** decimals;

    // Informational only. To show this on Etherscan, submit it in the token info form after verification.
    string public constant website = "https://arenadex.tech/";
    string public constant telegram = "https://t.me/Arenaadex";

    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);

    error InvalidAddress();
    error InsufficientBalance();
    error InsufficientAllowance();

    constructor() {
        balanceOf[msg.sender] = totalSupply;
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function approve(address spender, uint256 value) external returns (bool) {
        if (spender == address(0)) revert InvalidAddress();

        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        uint256 currentAllowance = allowance[from][msg.sender];
        if (currentAllowance < value) revert InsufficientAllowance();

        unchecked {
            allowance[from][msg.sender] = currentAllowance - value;
        }

        emit Approval(from, msg.sender, allowance[from][msg.sender]);
        _transfer(from, to, value);
        return true;
    }

    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) revert InvalidAddress();
        if (to == address(0)) revert InvalidAddress();

        uint256 fromBalance = balanceOf[from];
        if (fromBalance < value) revert InsufficientBalance();

        unchecked {
            balanceOf[from] = fromBalance - value;
            balanceOf[to] += value;
        }

        emit Transfer(from, to, value);
    }
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "shanghai"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.