ERC-20
Blockchain
Overview
Max Total Supply
1,134,945,049.549070003835784581 AMMX
Holders
3,326 (0.00%)
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$240,063.58
Circulating Supply Market Cap
$0.00
Other Info
Token Contract (WITH 18 Decimals)
Balance
20,000 AMMXValue
$4.23 ( ~0.00135042029284102 Eth) [0.0018%]Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x38e382F7...f5951DE93 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
BRC20
Compiler Version
v0.8.12+commit.f00d7308
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IBRC20Factory.sol"; contract BRC20 { string public name; string public symbol; uint8 public immutable decimals; address public immutable factory; uint256 public totalSupply; mapping (address => uint256) public balanceOf; mapping (address => mapping(address => uint256)) public allowance; mapping (address => uint256) public nonces; bytes32 public DOMAIN_SEPARATOR; bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); constructor() { (name, symbol, decimals) = IBRC20Factory(msg.sender).parameters(); factory = msg.sender; uint256 chainId; assembly { chainId := chainid() } DOMAIN_SEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes('1')), chainId, address(this))); } function mint(address to, uint256 amount) external { require(msg.sender == factory, "unauthorized"); _mint(to, amount); } function burn(uint256 amount) external { require(msg.sender == factory, "unauthorized"); _burn(msg.sender, amount); } function approve(address spender, uint256 amount) external returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) external returns (bool) { balanceOf[msg.sender] -= amount; unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom(address from, address to, uint256 amount) external returns (bool) { uint256 allowed = allowance[from][msg.sender]; if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external { require(deadline >= block.timestamp, 'EXPIRED'); unchecked { bytes32 digest = keccak256( abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) ) ); address recoveredAddress = ecrecover(digest, v, r, s); require(recoveredAddress != address(0) && recoveredAddress == owner, 'INVALID_SIGNATURE'); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function _mint(address to, uint256 amount) internal { totalSupply += amount; unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal { balanceOf[from] -= amount; unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBRC20Factory { function parameters() external view returns (string memory name, string memory symbol, uint8 decimals); }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b50336001600160a01b031663890357306040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000051573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200007b9190810190620002e6565b60ff8116608052815160009081906200009c90600190602087019062000173565b50508351620000b19190602086019062000173565b50503360a052505060405146907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f90620000ee90600090620003a8565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018290523060a082015260c00160408051601f198184030181529190528051602090910120600655506200044c565b82805462000181906200036b565b90600052602060002090601f016020900481019282620001a55760008555620001f0565b82601f10620001c057805160ff1916838001178555620001f0565b82800160010185558215620001f0579182015b82811115620001f0578251825591602001919060010190620001d3565b50620001fe92915062000202565b5090565b5b80821115620001fe576000815560010162000203565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200024157600080fd5b81516001600160401b03808211156200025e576200025e62000219565b604051601f8301601f19908116603f0116810190828211818310171562000289576200028962000219565b81604052838152602092508683858801011115620002a657600080fd5b600091505b83821015620002ca5785820183015181830184015290820190620002ab565b83821115620002dc5760008385830101525b9695505050505050565b600080600060608486031215620002fc57600080fd5b83516001600160401b03808211156200031457600080fd5b62000322878388016200022f565b945060208601519150808211156200033957600080fd5b5062000348868287016200022f565b925050604084015160ff811681146200036057600080fd5b809150509250925092565b600181811c908216806200038057607f821691505b60208210811415620003a257634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620003c557607f831692505b6020808410821415620003e657634e487b7160e01b86526022600452602486fd5b818015620003fd57600181146200040f576200043e565b60ff198616895284890196506200043e565b60008a81526020902060005b86811015620004365781548b8201529085019083016200041b565b505084890196505b509498975050505050505050565b60805160a051610bc66200048060003960008181610293015281816104f0015261056a015260006101ce0152610bc66000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c806340c10f19116100a257806395d89b411161007157806395d89b4114610273578063a9059cbb1461027b578063c45a01551461028e578063d505accf146102cd578063dd62ed3e146102e057600080fd5b806340c10f191461020b57806342966c681461022057806370a08231146102335780637ecebe001461025357600080fd5b806323b872dd116100de57806323b872dd1461018f57806330adf81f146101a2578063313ce567146101c95780633644e5151461020257600080fd5b806306fdde0314610110578063095ea7b31461012e57806318160ddd1461015157806320606b7014610168575b600080fd5b61011861030b565b6040516101259190610938565b60405180910390f35b61014161013c3660046109a9565b610399565b6040519015158152602001610125565b61015a60025481565b604051908152602001610125565b61015a7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61014161019d3660046109d3565b610405565b61015a7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6101f07f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610125565b61015a60065481565b61021e6102193660046109a9565b6104e5565b005b61021e61022e366004610a0f565b61055f565b61015a610241366004610a28565b60036020526000908152604090205481565b61015a610261366004610a28565b60056020526000908152604090205481565b6101186105d3565b6101416102893660046109a9565b6105e0565b6102b57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610125565b61021e6102db366004610a4a565b610646565b61015a6102ee366004610abd565b600460209081526000928352604080842090915290825290205481565b6000805461031890610af0565b80601f016020809104026020016040519081016040528092919081815260200182805461034490610af0565b80156103915780601f1061036657610100808354040283529160200191610391565b820191906000526020600020905b81548152906001019060200180831161037457829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103f49086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146104615761043c8382610b41565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b03851660009081526003602052604081208054859290610489908490610b41565b90915550506001600160a01b0380851660008181526003602052604090819020805487019055519091871690600080516020610b71833981519152906104d29087815260200190565b60405180910390a3506001949350505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105515760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b60448201526064015b60405180910390fd5b61055b828261087c565b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105c65760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b6044820152606401610548565b6105d033826108d6565b50565b6001805461031890610af0565b33600090815260036020526040812080548391908390610601908490610b41565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020610b71833981519152906103f49086815260200190565b428410156106805760405162461bcd60e51b81526020600482015260076024820152661156141254915160ca1b6044820152606401610548565b6006546001600160a01b0388811660008181526005602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e280820193601f1981019281900390910190855afa15801561079b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906107d15750886001600160a01b0316816001600160a01b0316145b6108115760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b6044820152606401610548565b6001600160a01b0390811660009081526004602090815260408083208b8516808552908352928190208a905551898152919350918a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b806002600082825461088e9190610b58565b90915550506001600160a01b038216600081815260036020908152604080832080548601905551848152600080516020610b7183398151915291015b60405180910390a35050565b6001600160a01b038216600090815260036020526040812080548392906108fe908490610b41565b90915550506002805482900390556040518181526000906001600160a01b03841690600080516020610b71833981519152906020016108ca565b600060208083528351808285015260005b8181101561096557858101830151858201604001528201610949565b81811115610977576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146109a457600080fd5b919050565b600080604083850312156109bc57600080fd5b6109c58361098d565b946020939093013593505050565b6000806000606084860312156109e857600080fd5b6109f18461098d565b92506109ff6020850161098d565b9150604084013590509250925092565b600060208284031215610a2157600080fd5b5035919050565b600060208284031215610a3a57600080fd5b610a438261098d565b9392505050565b600080600080600080600060e0888a031215610a6557600080fd5b610a6e8861098d565b9650610a7c6020890161098d565b95506040880135945060608801359350608088013560ff81168114610aa057600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610ad057600080fd5b610ad98361098d565b9150610ae76020840161098d565b90509250929050565b600181811c90821680610b0457607f821691505b60208210811415610b2557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610b5357610b53610b2b565b500390565b60008219821115610b6b57610b6b610b2b565b50019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220bd970baf35e6ee350dce926148c16dab64454197f76b517f1450206554d0a6c664736f6c634300080c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806340c10f19116100a257806395d89b411161007157806395d89b4114610273578063a9059cbb1461027b578063c45a01551461028e578063d505accf146102cd578063dd62ed3e146102e057600080fd5b806340c10f191461020b57806342966c681461022057806370a08231146102335780637ecebe001461025357600080fd5b806323b872dd116100de57806323b872dd1461018f57806330adf81f146101a2578063313ce567146101c95780633644e5151461020257600080fd5b806306fdde0314610110578063095ea7b31461012e57806318160ddd1461015157806320606b7014610168575b600080fd5b61011861030b565b6040516101259190610938565b60405180910390f35b61014161013c3660046109a9565b610399565b6040519015158152602001610125565b61015a60025481565b604051908152602001610125565b61015a7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61014161019d3660046109d3565b610405565b61015a7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6101f07f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610125565b61015a60065481565b61021e6102193660046109a9565b6104e5565b005b61021e61022e366004610a0f565b61055f565b61015a610241366004610a28565b60036020526000908152604090205481565b61015a610261366004610a28565b60056020526000908152604090205481565b6101186105d3565b6101416102893660046109a9565b6105e0565b6102b57f000000000000000000000000861e3c82bc2753ea64ae5f962d993df6853a670081565b6040516001600160a01b039091168152602001610125565b61021e6102db366004610a4a565b610646565b61015a6102ee366004610abd565b600460209081526000928352604080842090915290825290205481565b6000805461031890610af0565b80601f016020809104026020016040519081016040528092919081815260200182805461034490610af0565b80156103915780601f1061036657610100808354040283529160200191610391565b820191906000526020600020905b81548152906001019060200180831161037457829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103f49086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146104615761043c8382610b41565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b03851660009081526003602052604081208054859290610489908490610b41565b90915550506001600160a01b0380851660008181526003602052604090819020805487019055519091871690600080516020610b71833981519152906104d29087815260200190565b60405180910390a3506001949350505050565b336001600160a01b037f000000000000000000000000861e3c82bc2753ea64ae5f962d993df6853a670016146105515760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b60448201526064015b60405180910390fd5b61055b828261087c565b5050565b336001600160a01b037f000000000000000000000000861e3c82bc2753ea64ae5f962d993df6853a670016146105c65760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b6044820152606401610548565b6105d033826108d6565b50565b6001805461031890610af0565b33600090815260036020526040812080548391908390610601908490610b41565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020610b71833981519152906103f49086815260200190565b428410156106805760405162461bcd60e51b81526020600482015260076024820152661156141254915160ca1b6044820152606401610548565b6006546001600160a01b0388811660008181526005602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e280820193601f1981019281900390910190855afa15801561079b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906107d15750886001600160a01b0316816001600160a01b0316145b6108115760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b6044820152606401610548565b6001600160a01b0390811660009081526004602090815260408083208b8516808552908352928190208a905551898152919350918a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b806002600082825461088e9190610b58565b90915550506001600160a01b038216600081815260036020908152604080832080548601905551848152600080516020610b7183398151915291015b60405180910390a35050565b6001600160a01b038216600090815260036020526040812080548392906108fe908490610b41565b90915550506002805482900390556040518181526000906001600160a01b03841690600080516020610b71833981519152906020016108ca565b600060208083528351808285015260005b8181101561096557858101830151858201604001528201610949565b81811115610977576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146109a457600080fd5b919050565b600080604083850312156109bc57600080fd5b6109c58361098d565b946020939093013593505050565b6000806000606084860312156109e857600080fd5b6109f18461098d565b92506109ff6020850161098d565b9150604084013590509250925092565b600060208284031215610a2157600080fd5b5035919050565b600060208284031215610a3a57600080fd5b610a438261098d565b9392505050565b600080600080600080600060e0888a031215610a6557600080fd5b610a6e8861098d565b9650610a7c6020890161098d565b95506040880135945060608801359350608088013560ff81168114610aa057600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610ad057600080fd5b610ad98361098d565b9150610ae76020840161098d565b90509250929050565b600181811c90821680610b0457607f821691505b60208210811415610b2557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610b5357610b53610b2b565b500390565b60008219821115610b6b57610b6b610b2b565b50019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220bd970baf35e6ee350dce926148c16dab64454197f76b517f1450206554d0a6c664736f6c634300080c0033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.