Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x9B83f827928aBdf18cF1F7e67053572b9bceff3a
Balance 0 ETH
Nonce 1
Code Size 3092 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3092 bytes
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80633dfc918a116100a2578063a457c2d711610071578063a457c2d714610236578063a9059cbb14610249578063bbaa0bd21461025c578063dd62ed3e1461026f578063ef20accb146102a857600080fd5b80633dfc918a146101dd57806370a08231146101f05780638f2839701461021957806395d89b411461022e57600080fd5b806318160ddd116100de57806318160ddd1461019057806323b872dd146101a2578063313ce567146101b557806339509351146101ca57600080fd5b806301bc45c91461011057806306fdde0314610145578063095ea7b31461015a5780631800aadb1461017d575b600080fd5b6005546101289061010090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61014d6102b0565b60405161013c9190610b2c565b61016d610168366004610b03565b610342565b604051901515815260200161013c565b600654610128906001600160a01b031681565b6002545b60405190815260200161013c565b61016d6101b0366004610ac8565b610358565b60055460405160ff909116815260200161013c565b61016d6101d8366004610b03565b610407565b600754610128906001600160a01b031681565b6101946101fe366004610a75565b6001600160a01b031660009081526020819052604090205490565b61022c610227366004610a75565b610443565b005b61014d6104ef565b61016d610244366004610b03565b6104fe565b61016d610257366004610b03565b610597565b61022c61026a366004610a75565b6105a4565b61019461027d366004610a96565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61022c61061a565b6060600380546102bf90610ba3565b80601f01602080910402602001604051908101604052809291908181526020018280546102eb90610ba3565b80156103385780601f1061030d57610100808354040283529160200191610338565b820191906000526020600020905b81548152906001019060200180831161031b57829003601f168201915b5050505050905090565b600061034f3384846106e0565b50600192915050565b6000610365848484610804565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156103ef5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103fc85338584036106e0565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161034f91859061043e908690610b7f565b6106e0565b60055460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b60208201529061010090046001600160a01b031633146104965760405162461bcd60e51b81526004016103e69190610b2c565b50600680546001600160a01b0319166001600160a01b03838116918217909255600554604051919261010090910416907fabadef65e57dcbc94a1edc7f70476a3abca7121015c7358dd71b9ad8e434895f90600090a350565b6060600480546102bf90610ba3565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156105805760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103e6565b61058d33858584036106e0565b5060019392505050565b600061034f338484610804565b60055460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b60208201529061010090046001600160a01b031633146105f75760405162461bcd60e51b81526004016103e69190610b2c565b50600780546001600160a01b0319166001600160a01b0392909216919091179055565b60065460408051808201909152600b81526a185d5d1a0819985a5b195960aa1b6020820152906001600160a01b031633146106685760405162461bcd60e51b81526004016103e69190610b2c565b506006546005546040516001600160a01b0392831692610100909204909116907f7cb6040a31264d0f3fa4024e96aa137a3c4afbd8bb1162e1046ee09c5d7e162a90600090a36006805460058054610100600160a81b0319166101006001600160a01b038416021790556001600160a01b0319169055565b6001600160a01b0383166107425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103e6565b6001600160a01b0382166107a35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103e6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166108685760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103e6565b6001600160a01b0382166108ca5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103e6565b6007546001600160a01b031615610950576007546040516319b89ec360e21b81523060048201526001600160a01b038581166024830152848116604483015260648201849052909116906366e27b0c90608401600060405180830381600087803b15801561093757600080fd5b505af115801561094b573d6000803e3d6000fd5b505050505b6001600160a01b038316600090815260208190526040902054818110156109c85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103e6565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906109ff908490610b7f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a4b91815260200190565b60405180910390a350505050565b80356001600160a01b0381168114610a7057600080fd5b919050565b600060208284031215610a86578081fd5b610a8f82610a59565b9392505050565b60008060408385031215610aa8578081fd5b610ab183610a59565b9150610abf60208401610a59565b90509250929050565b600080600060608486031215610adc578081fd5b610ae584610a59565b9250610af360208501610a59565b9150604084013590509250925092565b60008060408385031215610b15578182fd5b610b1e83610a59565b946020939093013593505050565b6000602080835283518082850152825b81811015610b5857858101830151858201604001528201610b3c565b81811115610b695783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610b9e57634e487b7160e01b81526011600452602481fd5b500190565b600181811c90821680610bb757607f821691505b60208210811415610bd857634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212206d0701888990a82330d7c83c9aef19f270b121a4b1207a2727a7abfd94bca4ed64736f6c63430008040033

Verified Source Code Partial Match

Compiler: v0.8.4+commit.c7e474f2 EVM: istanbul Optimization: Yes (200 runs)
Erc20Token.sol 424 lines
// SPDX-License-Identifier: MIT

pragma solidity =0.8.4;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }
}

interface IStatsTracker {
    function updateTransferStats(address asset, address from, address to, uint256 amount) external;
}

/**
 * @dev Implementation of the {IERC20} interface.
 */
contract Erc20Token is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;
    
    address public _admin;
    address public _adminCandidate;
    address public _statsTracker;

    string private constant ERROR_AUTH_FAILED = "auth failed";
    
    event AdminChangeRequested(address indexed oldAdmin, address indexed newAdmin);
    event AdminChangeConfirmed(address indexed oldAdmin, address indexed newAdmin);

    constructor(
        address admin_,
        string memory name_,
        string memory symbol_,
        uint8 decimals_,
        uint256 totalSupply_,
        address recipient_,
        address statsTracker_) {

        _ensureNotZeroAddress(admin_);
        _ensureNotZeroAddress(recipient_);
        require(totalSupply_ != 0, "zero total supply");
        
        _admin = admin_;

        _name = name_;
        _symbol = symbol_;
        _decimals = decimals_;
        
        _mint(recipient_, totalSupply_);
        
        if (statsTracker_ != address(0)) {
            _statsTracker = statsTracker_;
        }
    }
    
    modifier onlyAdmin() {
        require(_admin == _msgSender(), ERROR_AUTH_FAILED);
        _;
    }
    
    modifier onlyAdminCandidate {
        require(_adminCandidate == _msgSender(), ERROR_AUTH_FAILED);
        _;
    }
    
    function changeAdmin(address adminCandidate) onlyAdmin external {
        _adminCandidate = adminCandidate;
        emit AdminChangeRequested(_admin, adminCandidate);
    }
    
    function confirmNewAdmin() onlyAdminCandidate external {
        emit AdminChangeConfirmed(_admin, _adminCandidate);
        _admin = _adminCandidate;
        _adminCandidate = address(0);
    }
    
    function setStatsTracker(address statsTracker) onlyAdmin external {
        _statsTracker = statsTracker;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() external view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() external view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() external view virtual override returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() external view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) external view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) external virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) external view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) external virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) private {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        if (_statsTracker != address(0)) {
            IStatsTracker(_statsTracker).updateTransferStats(address(this), sender, recipient, amount);
        }

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) private {
        require(account != address(0), "ERC20: mint to the zero address");

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) private {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }
    
    function _ensureNotZeroAddress(address _addr) private pure {
        require(_addr != address(0), "zero address");
    }
}

Read Contract

_admin 0x01bc45c9 → address
_adminCandidate 0x1800aadb → address
_statsTracker 0x3dfc918a → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 8 functions

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

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
changeAdmin 0x8f283970
address adminCandidate
confirmNewAdmin 0xef20accb
No parameters
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
setStatsTracker 0xbbaa0bd2
address statsTracker
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool

Recent Transactions

No transactions found for this address