Skip to content
Verified contractPartialMIT

NoiseToken

Address0x8e15c2f7593d196cfcb7bc93d84754c6ae7f2f6d
Balance

0 ETH

 

Transactions

81

 

Compiler

solc 0.8.22

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.22+commit.4fc1097e
Language
solidity
Optimization
No
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
23,139,610
Creation transaction
0xfdb41f0bdb…c2e0c15e12

NoiseToken.sol

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

/**
 * @title NoiseToken (NOISE)
 * @notice ERC-20 standard, fixed supply 1,000,000,000 * 10^18 minted to deployer.
 * No owner functions, no pausability, no extras.
 */

/* ─────────────── Minimal IERC20 ─────────────── */

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

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

/* ─────────────── Context (minimal) ─────────────── */

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }
}

/* ─────────────── Minimal ERC20 ─────────────── */

contract NoiseToken is Context, IERC20 {
    string private _name = "Noise";
    string private _symbol = "NOISE";
    uint8  private constant _DECIMALS = 18;

    uint256 private _totalSupply;
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;

    /**
     * @dev Mints the fixed supply to the deployer.
     * Total supply: 1,000,000,000 * 10^18
     */
    constructor() {
        uint256 initialSupply = 1_000_000_000 * (10 ** _DECIMALS);
        _mint(_msgSender(), initialSupply);
    }

    /* ---------------- ERC20 public view ---------------- */

    function name() external view returns (string memory) { return _name; }
    function symbol() external view returns (string memory) { return _symbol; }
    function decimals() external pure returns (uint8) { return _DECIMALS; }
    function totalSupply() public view override returns (uint256) { return _totalSupply; }
    function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
    function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; }

    /* ---------------- ERC20 state-changing ---------------- */

    function transfer(address to, uint256 value) public override returns (bool) {
        _transfer(_msgSender(), to, value);
        return true;
    }

    function approve(address spender, uint256 value) public override returns (bool) {
        _approve(_msgSender(), spender, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) public override returns (bool) {
        uint256 currentAllowance = _allowances[from][_msgSender()];
        require(currentAllowance >= value, "ERC20: insufficient allowance");
        unchecked { _approve(from, _msgSender(), currentAllowance - value); }
        _transfer(from, to, value);
        return true;
    }

    /* ---------------- internal helpers ---------------- */

    function _transfer(address from, address to, uint256 value) internal {
        require(from != address(0), "ERC20: transfer from zero");
        require(to != address(0), "ERC20: transfer to zero");
        uint256 fromBal = _balances[from];
        require(fromBal >= value, "ERC20: transfer exceeds balance");
        unchecked {
            _balances[from] = fromBal - value;
        }
        _balances[to] += value;
        emit Transfer(from, to, value);
    }

    function _mint(address to, uint256 value) internal {
        require(to != address(0), "ERC20: mint to zero");
        _totalSupply += value;
        _balances[to] += value;
        emit Transfer(address(0), to, value);
    }

    function _approve(address owner, address spender, uint256 value) internal {
        require(owner != address(0), "ERC20: approve from zero");
        require(spender != address(0), "ERC20: approve to zero");
        _allowances[owner][spender] = value;
        emit Approval(owner, spender, value);
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.