// BEXCHAIN BEX20 reference for token: Bex World Game (BWG), decimals=18 // Deploy from Remix to get matching EVM bytecode, or import ABI via explorer API. // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; /** * Reference BEX20 token layout for BEXCHAIN native tokens deployed via the explorer. * Use this file in Remix to interact with your token address (read balances via explorer/RPC). * For full on-chain bytecode match verification, deploy this contract from Remix first. */ contract BEX20Reference { string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; address public owner; 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); constructor( string memory _name, string memory _symbol, uint8 _decimals, uint256 _initialSupply, address _owner ) { name = _name; symbol = _symbol; decimals = _decimals; owner = _owner; totalSupply = _initialSupply; balanceOf[_owner] = _initialSupply; emit Transfer(address(0), _owner, _initialSupply); } function transfer(address to, uint256 amount) external returns (bool) { _transfer(msg.sender, to, amount); return true; } function approve(address spender, uint256 amount) external returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transferFrom(address from, address to, uint256 amount) external returns (bool) { uint256 allowed = allowance[from][msg.sender]; require(allowed >= amount, "allowance"); allowance[from][msg.sender] = allowed - amount; _transfer(from, to, amount); return true; } function _transfer(address from, address to, uint256 amount) internal { require(to != address(0), "zero"); require(balanceOf[from] >= amount, "balance"); balanceOf[from] -= amount; balanceOf[to] += amount; emit Transfer(from, to, amount); } }