Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x2C724d1FcA1B3D471EBAa004a054621aF85D417C
Balance 0 ETH
Nonce 1
Code Size 3823 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3823 bytes
0x608060405260043610610094575f3560e01c806370a082311161005857806370a08231146101f3578063902d55a51461022f57806395d89b4114610259578063a9059cbb14610283578063dd62ed3e146102bf576100cb565b806306fdde03146100fd578063095ea7b31461012757806318160ddd1461016357806323b872dd1461018d578063313ce567146101c9576100cb565b366100cb576040517f1231ae4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1231ae4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b348015610108575f5ffd5b506101116102fb565b60405161011e9190610b68565b60405180910390f35b348015610132575f5ffd5b5061014d60048036038101906101489190610c19565b61038b565b60405161015a9190610c71565b60405180910390f35b34801561016e575f5ffd5b506101776103ad565b6040516101849190610c99565b60405180910390f35b348015610198575f5ffd5b506101b360048036038101906101ae9190610cb2565b6103b6565b6040516101c09190610c71565b60405180910390f35b3480156101d4575f5ffd5b506101dd6103e4565b6040516101ea9190610d1d565b60405180910390f35b3480156101fe575f5ffd5b5061021960048036038101906102149190610d36565b6103ec565b6040516102269190610c99565b60405180910390f35b34801561023a575f5ffd5b50610243610431565b6040516102509190610c99565b60405180910390f35b348015610264575f5ffd5b5061026d610440565b60405161027a9190610b68565b60405180910390f35b34801561028e575f5ffd5b506102a960048036038101906102a49190610c19565b6104d0565b6040516102b69190610c71565b60405180910390f35b3480156102ca575f5ffd5b506102e560048036038101906102e09190610d61565b6104f2565b6040516102f29190610c99565b60405180910390f35b60606003805461030a90610dcc565b80601f016020809104026020016040519081016040528092919081815260200182805461033690610dcc565b80156103815780601f1061035857610100808354040283529160200191610381565b820191905f5260205f20905b81548152906001019060200180831161036457829003601f168201915b5050505050905090565b5f5f610395610574565b90506103a281858561057b565b600191505092915050565b5f600254905090565b5f5f6103c0610574565b90506103cd85828561058d565b6103d8858585610620565b60019150509392505050565b5f6012905090565b5f5f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6a52b7d2dcc80cd2e400000081565b60606004805461044f90610dcc565b80601f016020809104026020016040519081016040528092919081815260200182805461047b90610dcc565b80156104c65780601f1061049d576101008083540402835291602001916104c6565b820191905f5260205f20905b8154815290600101906020018083116104a957829003601f168201915b5050505050905090565b5f5f6104da610574565b90506104e7818585610620565b600191505092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f33905090565b6105888383836001610710565b505050565b5f61059884846104f2565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81101561061a578181101561060b578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161060293929190610e0b565b60405180910390fd5b61061984848484035f610710565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610690575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016106879190610e40565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610700575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106f79190610e40565b60405180910390fd5b61070b8383836108df565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610780575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016107779190610e40565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107f0575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016107e79190610e40565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555080156108d9578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108d09190610c99565b60405180910390a35b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361092f578060025f8282546109239190610e86565b925050819055506109fd565b5f5f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156109b8578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016109af93929190610e0b565b60405180910390fd5b8181035f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610a44578060025f8282540392505081905550610a8e565b805f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610aeb9190610c99565b60405180910390a3505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610b3a82610af8565b610b448185610b02565b9350610b54818560208601610b12565b610b5d81610b20565b840191505092915050565b5f6020820190508181035f830152610b808184610b30565b905092915050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610bb582610b8c565b9050919050565b610bc581610bab565b8114610bcf575f5ffd5b50565b5f81359050610be081610bbc565b92915050565b5f819050919050565b610bf881610be6565b8114610c02575f5ffd5b50565b5f81359050610c1381610bef565b92915050565b5f5f60408385031215610c2f57610c2e610b88565b5b5f610c3c85828601610bd2565b9250506020610c4d85828601610c05565b9150509250929050565b5f8115159050919050565b610c6b81610c57565b82525050565b5f602082019050610c845f830184610c62565b92915050565b610c9381610be6565b82525050565b5f602082019050610cac5f830184610c8a565b92915050565b5f5f5f60608486031215610cc957610cc8610b88565b5b5f610cd686828701610bd2565b9350506020610ce786828701610bd2565b9250506040610cf886828701610c05565b9150509250925092565b5f60ff82169050919050565b610d1781610d02565b82525050565b5f602082019050610d305f830184610d0e565b92915050565b5f60208284031215610d4b57610d4a610b88565b5b5f610d5884828501610bd2565b91505092915050565b5f5f60408385031215610d7757610d76610b88565b5b5f610d8485828601610bd2565b9250506020610d9585828601610bd2565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610de357607f821691505b602082108103610df657610df5610d9f565b5b50919050565b610e0581610bab565b82525050565b5f606082019050610e1e5f830186610dfc565b610e2b6020830185610c8a565b610e386040830184610c8a565b949350505050565b5f602082019050610e535f830184610dfc565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610e9082610be6565b9150610e9b83610be6565b9250828201905080821115610eb357610eb2610e59565b5b9291505056fea264697066735822122060332ca42d782e6e16a0c9e8b456a894a0e09fcc1733e10fbb1bf2c7a4cd402864736f6c63430008210033

Verified Source Code Full Match

Compiler: v0.8.33+commit.64118f21 EVM: osaka Optimization: No
BATTLE_DOGE.sol 403 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.33;

/*
    BattleDogeToken.sol (single file, no imports)

    Purpose:
    - Minimal, fixed-supply ERC-20 token for the BattleDoge ecosystem.
    - Uses OpenZeppelin Contracts v5.4.0 ERC20 logic embedded directly (no imports).

    Key Properties:
    - Name:    Battle Doge
    - Symbol:  BDOGE
    - Decimals: 18 (OpenZeppelin default)
    - Total supply: 100,000,000 * 1e18 (fully minted once, in the constructor)
    - Minting: one-time mint in constructor to deployer (msg.sender)
    - No Permit, no Ownable/admin surface, no token-level sales/airdrop logic
    - "Burn" is done by sink-transfer at the application layer (token does not implement burn())
    - Reject accidental ETH transfers via receive()/fallback()
      NOTE: no contract can fully prevent forced ETH via SELFDESTRUCT; this only blocks normal sends.

    Security stance:
    - Keep ERC-20 surface area small and familiar.
    - No privileged roles or upgrade hooks.
*/

/**
 * @dev Custom error used to revert if someone tries to send ETH to this token contract.
 * Using a custom error is cheaper than revert strings.
 */
error ETHNotAccepted();

/* ============ OpenZeppelin Contracts (v5.4.0) — embedded ============ */
/* Source basis: OpenZeppelin Contracts v5.4.0 ERC20 + dependencies. */

/**
 * @dev Provides information about the current execution context (msg.sender, msg.data).
 * In meta-transaction systems, msg.sender may differ from the account paying gas.
 * Here we keep it standard, but inheriting this matches OpenZeppelin's structure.
 */
abstract contract Context {
    /// @dev Returns the sender of the transaction (or the relayer in meta-tx contexts).
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    /// @dev Returns the full calldata of the transaction.
    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev Used by some advanced meta-transaction patterns in OZ to strip context suffixes.
     * Default is zero; retained for compatibility with OZ's internal patterns.
     */
    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

/**
 * @dev Interface of the ERC-20 standard (EIP-20).
 * This is the minimal external surface: transfer, approve, allowance, transferFrom, balances, totalSupply.
 */
interface IERC20 {
    /// @dev Emitted when `value` tokens move from `from` to `to`.
    event Transfer(address indexed from, address indexed to, uint256 value);

    /// @dev Emitted when `owner` sets `spender` allowance to `value`.
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /// @dev Total token supply in existence.
    function totalSupply() external view returns (uint256);

    /// @dev Balance of a given account.
    function balanceOf(address account) external view returns (uint256);

    /// @dev Transfer tokens from caller to `to`.
    function transfer(address to, uint256 value) external returns (bool);

    /// @dev Allowance `spender` has from `owner`.
    function allowance(address owner, address spender) external view returns (uint256);

    /// @dev Approve `spender` to spend `value` from caller.
    function approve(address spender, uint256 value) external returns (bool);

    /// @dev Transfer tokens from `from` to `to` using allowance mechanism.
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

/**
 * @dev Optional metadata functions from the ERC-20 standard (name/symbol/decimals).
 */
interface IERC20Metadata is IERC20 {
    /// @dev Human-readable token name.
    function name() external view returns (string memory);

    /// @dev Human-readable token symbol.
    function symbol() external view returns (string memory);

    /// @dev Number of decimals used to get the user representation (commonly 18).
    function decimals() external view returns (uint8);
}

/**
 * @dev ERC-6093 custom errors for ERC-20 tokens (the ERC-20 subset only).
 * These are standardized error names used by OpenZeppelin v5.x for clear revert reasons.
 */
interface IERC20Errors {
    /// @dev Thrown when an account tries to transfer/burn more tokens than it owns.
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /// @dev Thrown when a transfer/burn is initiated from the zero address.
    error ERC20InvalidSender(address sender);

    /// @dev Thrown when a transfer/mint is directed to the zero address.
    error ERC20InvalidReceiver(address receiver);

    /// @dev Thrown when allowance is insufficient for transferFrom / spendAllowance.
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /// @dev Thrown when approve is attempted from the zero address.
    error ERC20InvalidApprover(address approver);

    /// @dev Thrown when approve is attempted to the zero address.
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev OpenZeppelin ERC20 implementation (v5.4.0).
 *
 * Notes:
 * - v5.x centralizes all balance/supply changes in `_update(from, to, value)`:
 *   - mint:  from = address(0)
 *   - burn:  to   = address(0)
 *   - transfer: neither is zero
 * - This contract intentionally does NOT include EIP-2612 Permit or Ownable.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    /// @dev Mapping from account to balance.
    mapping(address account => uint256) private _balances;

    /// @dev Mapping owner => (spender => allowance).
    mapping(address account => mapping(address spender => uint256)) private _allowances;

    /// @dev Total token supply tracked by the contract.
    uint256 private _totalSupply;

    /// @dev Token name and symbol (immutable after construction).
    string private _name;
    string private _symbol;

    /**
     * @dev Sets token name and symbol at deployment time.
     * The derived token contract calls this via `ERC20("Name","SYM")`.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /// @inheritdoc IERC20Metadata
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /// @inheritdoc IERC20Metadata
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @inheritdoc IERC20Metadata
     */
     /*
     * OpenZeppelin default is 18, matching the common ERC-20 convention.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /// @inheritdoc IERC20
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /// @inheritdoc IERC20
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @inheritdoc IERC20
     */
     /*
     * Moves `value` tokens from caller to `to`.
     * Returns true on success per ERC-20 convention.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /// @inheritdoc IERC20
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @inheritdoc IERC20
     */
     /*
     * Sets allowance for `spender` to spend caller's tokens.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @inheritdoc IERC20
     */
     /*
     * Spends allowance from `from` by caller (spender), then transfers to `to`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Internal transfer primitive.
     * Reverts if `from` or `to` is the zero address.
     * Actual balance/supply bookkeeping is performed in `_update`.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Central accounting hook for transfers/mints/burns.
     *
     * Cases:
     * - Mint: from == address(0), to != address(0)
     * - Burn: from != address(0), to == address(0)
     * - Transfer: from != address(0), to != address(0)
     *
     * Emits a Transfer event in all cases (including mint/burn), per ERC-20 conventions.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Mint path: increase total supply
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            // Transfer/Burn path: decrease `from` balance
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            // Burn path: reduce total supply
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            // Transfer/Mint path: increase `to` balance
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        // ERC-20 canonical event for all token movements.
        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates `value` tokens and assigns them to `account`.
     * Reverts if `account` is the zero address.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys `value` tokens from `account`, reducing total supply.
     * Reverts if `account` is the zero address.
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Internal approve with default behavior: emits Approval event.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Internal approve primitive.
     * - `emitEvent` is used by `_spendAllowance` to avoid emitting Approval on transferFrom,
     *   saving gas and matching OZ v5 behavior.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }

        _allowances[owner][spender] = value;

        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Spends `value` from the allowance of `owner` toward `spender`.
     *
     * Special case:
     * - If allowance is `type(uint256).max`, it is treated as "infinite" and not decreased.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance < type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                // Update allowance without emitting Approval to save gas.
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

/* ======================= BattleDogeToken ======================= */

/**
 * @title BattleDogeToken
 * @dev Fixed-supply ERC-20 token for the BattleDoge ecosystem.
 *
 * Deployment notes:
 * - Deployer address receives the full supply.
 * - There are no administrative functions after deployment.
 * - ETH sends are rejected (receive/fallback revert).
 */
contract BattleDogeToken is ERC20 {
    /**
     * @dev Total supply constant (100M tokens with 18 decimals).
     * Declared as a compile-time constant so it cannot be changed.
     */
    uint256 public constant TOTAL_SUPPLY = 100_000_000 * 1e18;

    /**
     * @dev Initializes the token name/symbol and mints the full supply to the deployer.
     */
    constructor() ERC20("Battle Doge", "BDOGE") {
        _mint(_msgSender(), TOTAL_SUPPLY);
    }

    /**
     * @dev Reject direct ETH transfers.
     * Users should not send ETH to an ERC-20 token contract.
     */
    receive() external payable {
        revert ETHNotAccepted();
    }

    /**
     * @dev Reject unknown calls and ETH transfers to non-existent functions.
     */
    fallback() external payable {
        revert ETHNotAccepted();
    }
}

Read Contract

TOTAL_SUPPLY 0x902d55a5 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 3 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 value
returns: bool
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool

Recent Transactions

No transactions found for this address