ETH Price: $2,439.86 (-0.72%)
 

Overview

Max Total Supply

26,928,448 XRGB

Holders

2,971 (0.00%)

Market

Price

$0.01 @ 0.000004 ETH (-1.91%)

Onchain Market Cap

$294,043.84

Circulating Supply Market Cap

$0.00

Other Info

Token Contract (WITH 18 Decimals)

Balance
2,099.581583457555418875 XRGB

Value
$22.93 ( ~0.00939806725580819 Eth) [0.0078%]
0x6411592cf31de5c6ee08938b22d0fafbe1f650c1
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

The XRGB project is dedicated to enhancing the liquidity and utility of assets within the Bitcoin ecosystem.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
BRC404

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 20 runs

Other Settings:
paris EvmVersion
File 1 of 7 : BRC404.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

import {ERC404} from "./ERC404.sol";
import {IBRC404Factory} from "./interfaces/IBRC404Factory.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {Errors} from "./libraries/Errors.sol";

contract BRC404 is ERC404 {
    string public baseTokenURI;
    uint256 maxSupply;
    address public immutable factory;

    modifier onlyFactory() {
        if (msg.sender != factory) {
            revert Errors.OnlyCallByFactory();
        }
        _;
    }

    constructor() {
        (name, symbol, decimals, maxSupply, units) = IBRC404Factory(msg.sender)
            ._parameters();

        factory = msg.sender;
    }

    /**************Only Call By Factory Function **********/

    function setTokenURI(string memory _tokenURI) public onlyFactory {
        baseTokenURI = _tokenURI;
    }

    function tokenURI(uint256 id) public view override returns (string memory) {
        return string.concat(baseTokenURI, Strings.toString(id));
    }

    function mintBRC404(address to, uint256 amount) external onlyFactory {
        _mintBRC404(to, amount);
    }

    function burnBRC404(address from, uint256 amount) external onlyFactory {
        _burnBRC404(from, amount);
    }

    function setWhitelist(address target_, bool state_) external onlyFactory {
        _setWhitelist(target_, state_);
    }

    /**************Internal Function **********/

    function _mintBRC404(address to, uint256 amount) internal {
        if (totalSupply + amount > maxSupply) {
            revert Errors.ExceedMaxSupply();
        }
        _mintERC20WithERC721(to, amount);
    }

    function _burnBRC404(address from, uint256 amount) internal {
        _burnERC20WithERC721(from, amount);
    }
}

File 2 of 7 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 3 of 7 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 4 of 7 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 5 of 7 : ERC404.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

abstract contract ERC721Receiver {
    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC721Receiver.onERC721Received.selector;
    }
}

/// @notice ERC404
///         A gas-efficient, mixed ERC20 / ERC721 implementation
///         with native liquidity and fractionalization.
///
///         This is an experimental standard designed to integrate
///         with pre-existing ERC20 / ERC721 support as smoothly as
///         possible.
///
/// @dev    In order to support full functionality of ERC20 and ERC721
///         supply assumptions are made that slightly constraint usage.
///         Ensure decimals are sufficiently large (standard 18 recommended)
///         as ids are effectively encoded in the lowest range of amounts.
///
///         NFTs are spent on ERC20 functions in a FILO queue, this is by
///         design.
///
abstract contract ERC404 {
    // Events
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool approved
    );
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 amountOrId
    );
    event Transfer(
        address indexed from,
        address indexed to,
        uint256 amountOrId
    );
    // Errors
    error NotFound();
    error AlreadyExists();
    error InvalidRecipient();
    error InvalidSender();
    error UnsafeRecipient();
    error Unauthorized();

    // Metadata
    /// @dev Token name
    string public name;

    /// @dev Token symbol
    string public symbol;

    /// @dev Decimals for fractional representation
    uint8 public decimals;

    /// @dev Units for ERC-20 representation
    uint256 public units;

    /// @dev Total supply in fractionalized representation
    uint256 public totalSupply;

    /// @dev Current mint counter, monotonically increasing to ensure accurate ownership
    uint256 public minted;

    // Mappings
    /// @dev Balance of user in fractional representation
    mapping(address => uint256) public balanceOf;

    /// @dev Allowance of user in fractional representation
    mapping(address => mapping(address => uint256)) public allowance;

    /// @dev Approval in native representaion
    mapping(uint256 => address) public getApproved;

    /// @dev Approval for all in native representation
    mapping(address => mapping(address => bool)) public isApprovedForAll;

    /// @dev Owner of id in native representation
    mapping(uint256 => address) public _ownerOf;

    /// @dev Array of owned ids in native representation
    mapping(address => uint256[]) public _owned;

    /// @dev Tracks indices for the _owned mapping
    mapping(uint256 => uint256) public _ownedIndex;

    /// @dev Addresses whitelisted from minting / burning for gas savings (pairs, routers, etc)
    mapping(address => bool) public whitelist;

    /// @notice Initialization function to set pairs / etc
    ///         saving gas by avoiding mint / burn on unnecessary targets
    function _setWhitelist(address target, bool state) internal {
        whitelist[target] = state;
    }

    /// @notice Function to find owner of a given native token
    function ownerOf(uint256 id) public view virtual returns (address owner) {
        owner = _ownerOf[id];

        if (owner == address(0)) {
            revert NotFound();
        }
    }

    function erc721BalanceOf(
        address owner_
    ) public view virtual returns (uint256) {
        return _owned[owner_].length;
    }

    /// @notice tokenURI must be implemented by child contract
    function tokenURI(uint256 id) public view virtual returns (string memory);

    /// @notice Function for token approvals
    /// @dev This function assumes id / native if amount less than or equal to current max id
    function approve(
        address spender,
        uint256 amountOrId
    ) public virtual returns (bool) {
        if (amountOrId <= minted && amountOrId > 0) {
            address owner = _ownerOf[amountOrId];

            if (msg.sender != owner && !isApprovedForAll[owner][msg.sender]) {
                revert Unauthorized();
            }

            getApproved[amountOrId] = spender;

            emit Approval(owner, spender, amountOrId);
        } else {
            allowance[msg.sender][spender] = amountOrId;

            emit Approval(msg.sender, spender, amountOrId);
        }

        return true;
    }

    /// @notice Function native approvals
    function setApprovalForAll(address operator, bool approved) public virtual {
        isApprovedForAll[msg.sender][operator] = approved;

        emit ApprovalForAll(msg.sender, operator, approved);
    }

    /// @notice Function for mixed transfers
    /// @dev This function assumes id / native if amount less than or equal to current max id
    function transferFrom(
        address from,
        address to,
        uint256 amountOrId
    ) public virtual {
        if (amountOrId <= minted) {
            if (from != _ownerOf[amountOrId]) {
                revert InvalidSender();
            }

            if (to == address(0)) {
                revert InvalidRecipient();
            }

            if (
                msg.sender != from &&
                !isApprovedForAll[from][msg.sender] &&
                msg.sender != getApproved[amountOrId]
            ) {
                revert Unauthorized();
            }

            balanceOf[from] -= units;

            unchecked {
                balanceOf[to] += units;
            }

            _ownerOf[amountOrId] = to;
            delete getApproved[amountOrId];

            // update _owned for sender
            uint256 updatedId = _owned[from][_owned[from].length - 1];
            _owned[from][_ownedIndex[amountOrId]] = updatedId;
            // pop
            _owned[from].pop();
            // update index for the moved id
            _ownedIndex[updatedId] = _ownedIndex[amountOrId];
            // push token to to owned
            _owned[to].push(amountOrId);
            // update index for to owned
            _ownedIndex[amountOrId] = _owned[to].length - 1;

            emit Transfer(from, to, amountOrId);
            emit Transfer(from, to, units);
        } else {
            uint256 allowed = allowance[from][msg.sender];

            if (allowed != type(uint256).max)
                allowance[from][msg.sender] = allowed - amountOrId;

            _transfer(from, to, amountOrId);
        }
    }

    /// @notice Function for fractional transfers
    function transfer(
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        return _transfer(msg.sender, to, amount);
    }

    /// @notice Function for native transfers with contract support
    function safeTransferFrom(
        address from,
        address to,
        uint256 id
    ) public virtual {
        transferFrom(from, to, id);

        if (
            to.code.length != 0 &&
            ERC721Receiver(to).onERC721Received(msg.sender, from, id, "") !=
            ERC721Receiver.onERC721Received.selector
        ) {
            revert UnsafeRecipient();
        }
    }

    /// @notice Function for native transfers with contract support and callback data
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        bytes calldata data
    ) public virtual {
        transferFrom(from, to, id);

        if (
            to.code.length != 0 &&
            ERC721Receiver(to).onERC721Received(msg.sender, from, id, data) !=
            ERC721Receiver.onERC721Received.selector
        ) {
            revert UnsafeRecipient();
        }
    }

    /// @notice Internal function for fractional transfers
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal returns (bool) {
        uint256 balanceBeforeSender = balanceOf[from];
        uint256 balanceBeforeReceiver = balanceOf[to];

        balanceOf[from] -= amount;

        unchecked {
            balanceOf[to] += amount;
        }

        // Skip burn for certain addresses to save gas
        if (!whitelist[from]) {
            uint256 tokens_to_burn = (balanceBeforeSender / units) -
                (balanceOf[from] / units);
            for (uint256 i = 0; i < tokens_to_burn; i++) {
                _burn(from);
            }
        }

        // Skip minting for certain addresses to save gas
        if (!whitelist[to]) {
            uint256 tokens_to_mint = (balanceOf[to] / units) -
                (balanceBeforeReceiver / units);
            for (uint256 i = 0; i < tokens_to_mint; i++) {
                _mint(to);
            }
        }

        emit Transfer(from, to, amount);
        return true;
    }

    function _mintERC20WithERC721(address to, uint256 value) internal virtual {
        totalSupply += value;
        uint256 balanceBeforeReceiver = balanceOf[to];
        balanceOf[to] += value;

        if (!whitelist[to]) {
            uint256 tokens_to_mint = (balanceOf[to] / units) -
                (balanceBeforeReceiver / units);
            for (uint256 i = 0; i < tokens_to_mint; i++) {
                _mint(to);
            }
        }
    }

    function _burnERC20WithERC721(
        address from,
        uint256 value
    ) internal virtual {
        uint256 balanceBeforeSender = balanceOf[from];
        balanceOf[from] -= value;
        totalSupply -= value;

        if (!whitelist[from]) {
            uint256 tokens_to_burn = (balanceBeforeSender / units) -
                (balanceOf[from] / units);
            for (uint256 i = 0; i < tokens_to_burn; i++) {
                _burn(from);
            }
        }
    }

    function _mint(address to) internal virtual {
        if (to == address(0)) {
            revert InvalidRecipient();
        }
        unchecked {
            minted++;
        }

        uint256 id = minted;

        if (_ownerOf[id] != address(0)) {
            revert AlreadyExists();
        }

        _ownerOf[id] = to;
        _owned[to].push(id);
        _ownedIndex[id] = _owned[to].length - 1;

        emit Transfer(address(0), to, id);
    }

    function _burn(address from) internal virtual {
        if (from == address(0)) {
            revert InvalidSender();
        }

        uint256 id = _owned[from][_owned[from].length - 1];
        _owned[from].pop();
        delete _ownedIndex[id];
        delete _ownerOf[id];
        delete getApproved[id];

        emit Transfer(from, address(0), id);
    }
}

File 6 of 7 : IBRC404Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IBRC404Factory {
    function _parameters()
        external
        view
        returns (
            string memory name,
            string memory symbol,
            uint8 decimals,
            uint256 maxSupply,
            uint256 nftUnit
        );
}

File 7 of 7 : Errors.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

library Errors {
    error LengthError();
    error AlreadyMint();
    error OnlyCallByFactory();
    error AlreadyExpired();
    error InvalidSignature();
    error InvalidFee();
    error InvalidChainId();
    error InvalidEVMAddress();
    error InvalidBTCAddress();
    error ExceedMaxSupply();
    error InvalidTicker();
    error TickerAlreadyExist();
    error Unauthorized();

    error NotFound();
    error AlreadyExists();
    error InvalidRecipient();
    error InvalidSender();
    error UnsafeRecipient();
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 20,
    "details": {
      "yul": true
    }
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyExists","type":"error"},{"inputs":[],"name":"ExceedMaxSupply","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidSender","type":"error"},{"inputs":[],"name":"NotFound","type":"error"},{"inputs":[],"name":"OnlyCallByFactory","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsafeRecipient","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOrId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","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":"amountOrId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_owned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_ownedIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"amountOrId","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":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnBRC404","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"erc721BalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBRC404","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target_","type":"address"},{"internalType":"bool","name":"state_","type":"bool"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","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":"amountOrId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"units","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b50336001600160a01b031663ad9f08d96040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000051573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200007b91908101906200018a565b6003819055600f8290556002805460ff191660ff85161790556000806001620000a58782620002af565b50620000b490508682620002af565b505033608052506200037b92505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000ed57600080fd5b81516001600160401b03808211156200010a576200010a620000c5565b604051601f8301601f19908116603f01168101908282118183101715620001355762000135620000c5565b816040528381526020925086838588010111156200015257600080fd5b600091505b8382101562000176578582018301518183018401529082019062000157565b600093810190920192909252949350505050565b600080600080600060a08688031215620001a357600080fd5b85516001600160401b0380821115620001bb57600080fd5b620001c989838a01620000db565b96506020880151915080821115620001e057600080fd5b50620001ef88828901620000db565b945050604086015160ff811681146200020757600080fd5b6060870151608090970151959894975095949392505050565b600181811c908216806200023557607f821691505b6020821081036200025657634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002aa57600081815260208120601f850160051c81016020861015620002855750805b601f850160051c820191505b81811015620002a65782815560010162000291565b5050505b505050565b81516001600160401b03811115620002cb57620002cb620000c5565b620002e381620002dc845462000220565b846200025c565b602080601f8311600181146200031b5760008415620003025750858301515b600019600386901b1c1916600185901b178555620002a6565b600085815260208120601f198616915b828110156200034c578886015182559484019460019091019084016200032b565b50858210156200036b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051611b0b620003b3600039600081816103b0015281816109b801528181610ae401528181610c1e0152610da60152611b0b6000f3fe608060405234801561001057600080fd5b506004361061015f5760003560e01c806306fdde0314610164578063081812fc14610182578063095ea7b3146101c357806318160ddd146101e657806323b872dd146101fd57806325f7ce921461021257806327bcf48f14610225578063313ce56714610245578063383505411461026457806342842e0e1461028d5780634f02c420146102a057806353d6fd59146102a95780636352211e146102bc57806370a08231146102cf57806395d89b41146102ef578063976a8435146102f75780639b19251a14610300578063a22cb46514610323578063a9059cbb14610336578063b3f9ea3414610349578063b51ab5ea14610372578063b88d4fde14610385578063c34eb1c414610398578063c45a0155146103ab578063c87b56dd146103d2578063d547cfb7146103e5578063dd62ed3e146103ed578063e0df5b6f14610418578063e985e9c51461042b575b600080fd5b61016c610459565b6040516101799190611513565b60405180910390f35b6101ab610190366004611546565b6008602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610179565b6101d66101d1366004611576565b6104e7565b6040519015158152602001610179565b6101ef60045481565b604051908152602001610179565b61021061020b3660046115a0565b610638565b005b610210610220366004611576565b6109ad565b6101ef610233366004611546565b600c6020526000908152604090205481565b6002546102529060ff1681565b60405160ff9091168152602001610179565b6101ab610272366004611546565b600a602052600090815260409020546001600160a01b031681565b61021061029b3660046115a0565b610a04565b6101ef60055481565b6102106102b73660046115dc565b610ad9565b6101ab6102ca366004611546565b610b4a565b6101ef6102dd366004611618565b60066020526000908152604090205481565b61016c610b85565b6101ef60035481565b6101d661030e366004611618565b600d6020526000908152604090205460ff1681565b6102106103313660046115dc565b610b92565b6101d6610344366004611576565b610bff565b6101ef610357366004611618565b6001600160a01b03166000908152600b602052604090205490565b610210610380366004611576565b610c13565b610210610393366004611633565b610c66565b6101ef6103a6366004611576565b610d29565b6101ab7f000000000000000000000000000000000000000000000000000000000000000081565b61016c6103e0366004611546565b610d5a565b61016c610d8e565b6101ef6103fb3660046116cd565b600760209081526000928352604080842090915290825290205481565b610210610426366004611716565b610d9b565b6101d66104393660046116cd565b600960209081526000928352604080842090915290825290205460ff1681565b60008054610466906117c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906117c6565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b600060055482111580156104fb5750600082115b156105d2576000828152600a60205260409020546001600160a01b031633811480159061054c57506001600160a01b038116600090815260096020908152604080832033845290915290205460ff16155b15610569576040516282b42960e81b815260040160405180910390fd5b60008381526008602090815260409182902080546001600160a01b0319166001600160a01b038881169182179092559251868152908416917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35061062e565b3360008181526007602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35b5060015b92915050565b600554811161093e576000818152600a60205260409020546001600160a01b0384811691161461067b57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0382166106a257604051634e46966960e11b815260040160405180910390fd5b336001600160a01b038416148015906106df57506001600160a01b038316600090815260096020908152604080832033845290915290205460ff16155b801561070257506000818152600860205260409020546001600160a01b03163314155b1561071f576040516282b42960e81b815260040160405180910390fd5b6003546001600160a01b0384166000908152600660205260408120805490919061074a908490611816565b90915550506003546001600160a01b0380841660008181526006602090815260408083208054909601909555858252600a815284822080546001600160a01b031990811690941790556008815284822080549093169092559186168252600b905290812080546107bc90600190611816565b815481106107cc576107cc611829565b60009182526020808320909101546001600160a01b0387168352600b82526040808420868552600c9093529092205481549293508392811061081057610810611829565b60009182526020808320909101929092556001600160a01b0386168152600b909152604090208054806108455761084561183f565b600082815260208082208301600019908101839055909201909255838252600c8152604080832054848452818420556001600160a01b038616808452600b835290832080546001818101835582865293852001869055925290546108a99190611816565b600c600084815260200190815260200160002081905550826001600160a01b0316846001600160a01b0316600080516020611ab6833981519152846040516108f391815260200190565b60405180910390a3826001600160a01b0316846001600160a01b0316600080516020611ab683398151915260035460405161093091815260200190565b60405180910390a350505050565b6001600160a01b0383166000908152600760209081526040808320338452909152902054600019811461099a576109758282611816565b6001600160a01b03851660009081526007602090815260408083203384529091529020555b6109a5848484610df0565b50505b505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109f65760405163542c971960e01b815260040160405180910390fd5b610a008282610f9d565b5050565b610a0f838383610638565b6001600160a01b0382163b15801590610abb5750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611855565b6001600160e01b03191614155b156109a857604051633da6393160e01b815260040160405180910390fd5b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b225760405163542c971960e01b815260040160405180910390fd5b6001600160a01b0382166000908152600d60205260409020805460ff19168215151790555050565b6000818152600a60205260409020546001600160a01b031680610b805760405163c5723b5160e01b815260040160405180910390fd5b919050565b60018054610466906117c6565b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a35050565b6000610c0c338484610df0565b9392505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c5c5760405163542c971960e01b815260040160405180910390fd5b610a008282610fd7565b610c71858585610638565b6001600160a01b0384163b15801590610d0b5750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610cbb9033908a9089908990899060040161187f565b6020604051808303816000875af1158015610cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfe9190611855565b6001600160e01b03191614155b156109a557604051633da6393160e01b815260040160405180910390fd5b600b6020528160005260406000208181548110610d4557600080fd5b90600052602060002001600091509150505481565b6060600e610d6783610fe1565b604051602001610d789291906118d3565b6040516020818303038152906040529050919050565b600e8054610466906117c6565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610de45760405163542c971960e01b815260040160405180910390fd5b600e610a0082826119a8565b6001600160a01b03808416600081815260066020526040808220805494871683529082205492825290929190849084610e298386611816565b90915550506001600160a01b0380861660009081526006602090815260408083208054890190559289168252600d9052205460ff16610ecb576003546001600160a01b0387166000908152600660205260408120549091610e8991611a67565b600354610e969085611a67565b610ea09190611816565b905060005b81811015610ec857610eb688611073565b80610ec081611a89565b915050610ea5565b50505b6001600160a01b0385166000908152600d602052604090205460ff16610f5657600060035482610efb9190611a67565b6003546001600160a01b038816600090815260066020526040902054610f219190611a67565b610f2b9190611816565b905060005b81811015610f5357610f4187611186565b80610f4b81611a89565b915050610f30565b50505b846001600160a01b0316866001600160a01b0316600080516020611ab683398151915286604051610f8991815260200190565b60405180910390a350600195945050505050565b600f5481600454610fae9190611aa2565b1115610fcd57604051630f0c37b960e11b815260040160405180910390fd5b610a008282611281565b610a00828261134d565b60606000610fee83611419565b60010190506000816001600160401b0381111561100d5761100d611700565b6040519080825280601f01601f191660200182016040528015611037576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461104157509392505050565b6001600160a01b03811661109a57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812080546110c090600190611816565b815481106110d0576110d0611829565b90600052602060002001549050600b6000836001600160a01b03166001600160a01b031681526020019081526020016000208054806111115761111161183f565b600082815260208082206000199084018101839055909201909255828252600c81526040808320839055600a825280832080546001600160a01b03199081169091556008835281842080549091169055518381526001600160a01b03851691600080516020611ab68339815191529101610bf3565b6001600160a01b0381166111ad57604051634e46966960e11b815260040160405180910390fd5b60058054600101908190556000818152600a60205260409020546001600160a01b0316156111ee5760405163119b4fd360e11b815260040160405180910390fd5b6000818152600a6020908152604080832080546001600160a01b0319166001600160a01b038716908117909155808452600b835290832080546001818101835582865293852001859055925290546112469190611816565b6000828152600c602090815260408083209390935591518381526001600160a01b03851692600080516020611ab68339815191529101610bf3565b80600460008282546112939190611aa2565b90915550506001600160a01b03821660009081526006602052604081208054918391906112c08385611aa2565b90915550506001600160a01b0383166000908152600d602052604090205460ff166109a8576000600354826112f59190611a67565b6003546001600160a01b03861660009081526006602052604090205461131b9190611a67565b6113259190611816565b905060005b818110156109a55761133b85611186565b8061134581611a89565b91505061132a565b6001600160a01b03821660009081526006602052604081208054918391906113758385611816565b92505081905550816004600082825461138e9190611816565b90915550506001600160a01b0383166000908152600d602052604090205460ff166109a8576003546001600160a01b03841660009081526006602052604081205490916113da91611a67565b6003546113e79084611a67565b6113f19190611816565b905060005b818110156109a55761140785611073565b8061141181611a89565b9150506113f6565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106114585772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310611482576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106114a057662386f26fc10000830492506010015b6305f5e10083106114b8576305f5e100830492506008015b61271083106114cc57612710830492506004015b606483106114de576064830492506002015b600a83106106325760010192915050565b60005b8381101561150a5781810151838201526020016114f2565b50506000910152565b60208152600082518060208401526115328160408501602087016114ef565b601f01601f19169190910160400192915050565b60006020828403121561155857600080fd5b5035919050565b80356001600160a01b0381168114610b8057600080fd5b6000806040838503121561158957600080fd5b6115928361155f565b946020939093013593505050565b6000806000606084860312156115b557600080fd5b6115be8461155f565b92506115cc6020850161155f565b9150604084013590509250925092565b600080604083850312156115ef57600080fd5b6115f88361155f565b91506020830135801515811461160d57600080fd5b809150509250929050565b60006020828403121561162a57600080fd5b610c0c8261155f565b60008060008060006080868803121561164b57600080fd5b6116548661155f565b94506116626020870161155f565b93506040860135925060608601356001600160401b038082111561168557600080fd5b818801915088601f83011261169957600080fd5b8135818111156116a857600080fd5b8960208285010111156116ba57600080fd5b9699959850939650602001949392505050565b600080604083850312156116e057600080fd5b6116e98361155f565b91506116f76020840161155f565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561172857600080fd5b81356001600160401b038082111561173f57600080fd5b818401915084601f83011261175357600080fd5b81358181111561176557611765611700565b604051601f8201601f19908116603f0116810190838211818310171561178d5761178d611700565b816040528281528760208487010111156117a657600080fd5b826020860160208301376000928101602001929092525095945050505050565b600181811c908216806117da57607f821691505b6020821081036117fa57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561063257610632611800565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561186757600080fd5b81516001600160e01b031981168114610c0c57600080fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b60008084546118e1816117c6565b600182811680156118f9576001811461190e5761193d565b60ff198416875282151583028701945061193d565b8860005260208060002060005b858110156119345781548a82015290840190820161191b565b50505082870194505b5050505083516119518183602088016114ef565b01949350505050565b601f8211156109a857600081815260208120601f850160051c810160208610156119815750805b601f850160051c820191505b818110156119a05782815560010161198d565b505050505050565b81516001600160401b038111156119c1576119c1611700565b6119d5816119cf84546117c6565b8461195a565b602080601f831160018114611a0a57600084156119f25750858301515b600019600386901b1c1916600185901b1785556119a0565b600085815260208120601f198616915b82811015611a3957888601518255948401946001909101908401611a1a565b5085821015611a575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611a8457634e487b7160e01b600052601260045260246000fd5b500490565b600060018201611a9b57611a9b611800565b5060010190565b808201808211156106325761063261180056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122000f0215d5f86a6875cd24e7d77df23d033b4e4542510ae22814ffc18ca40d1d564736f6c63430008140033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061015f5760003560e01c806306fdde0314610164578063081812fc14610182578063095ea7b3146101c357806318160ddd146101e657806323b872dd146101fd57806325f7ce921461021257806327bcf48f14610225578063313ce56714610245578063383505411461026457806342842e0e1461028d5780634f02c420146102a057806353d6fd59146102a95780636352211e146102bc57806370a08231146102cf57806395d89b41146102ef578063976a8435146102f75780639b19251a14610300578063a22cb46514610323578063a9059cbb14610336578063b3f9ea3414610349578063b51ab5ea14610372578063b88d4fde14610385578063c34eb1c414610398578063c45a0155146103ab578063c87b56dd146103d2578063d547cfb7146103e5578063dd62ed3e146103ed578063e0df5b6f14610418578063e985e9c51461042b575b600080fd5b61016c610459565b6040516101799190611513565b60405180910390f35b6101ab610190366004611546565b6008602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610179565b6101d66101d1366004611576565b6104e7565b6040519015158152602001610179565b6101ef60045481565b604051908152602001610179565b61021061020b3660046115a0565b610638565b005b610210610220366004611576565b6109ad565b6101ef610233366004611546565b600c6020526000908152604090205481565b6002546102529060ff1681565b60405160ff9091168152602001610179565b6101ab610272366004611546565b600a602052600090815260409020546001600160a01b031681565b61021061029b3660046115a0565b610a04565b6101ef60055481565b6102106102b73660046115dc565b610ad9565b6101ab6102ca366004611546565b610b4a565b6101ef6102dd366004611618565b60066020526000908152604090205481565b61016c610b85565b6101ef60035481565b6101d661030e366004611618565b600d6020526000908152604090205460ff1681565b6102106103313660046115dc565b610b92565b6101d6610344366004611576565b610bff565b6101ef610357366004611618565b6001600160a01b03166000908152600b602052604090205490565b610210610380366004611576565b610c13565b610210610393366004611633565b610c66565b6101ef6103a6366004611576565b610d29565b6101ab7f000000000000000000000000d0c11fc959e22b8e9b69c97ea3cd334d480ce20381565b61016c6103e0366004611546565b610d5a565b61016c610d8e565b6101ef6103fb3660046116cd565b600760209081526000928352604080842090915290825290205481565b610210610426366004611716565b610d9b565b6101d66104393660046116cd565b600960209081526000928352604080842090915290825290205460ff1681565b60008054610466906117c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906117c6565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b600060055482111580156104fb5750600082115b156105d2576000828152600a60205260409020546001600160a01b031633811480159061054c57506001600160a01b038116600090815260096020908152604080832033845290915290205460ff16155b15610569576040516282b42960e81b815260040160405180910390fd5b60008381526008602090815260409182902080546001600160a01b0319166001600160a01b038881169182179092559251868152908416917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35061062e565b3360008181526007602090815260408083206001600160a01b03881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35b5060015b92915050565b600554811161093e576000818152600a60205260409020546001600160a01b0384811691161461067b57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0382166106a257604051634e46966960e11b815260040160405180910390fd5b336001600160a01b038416148015906106df57506001600160a01b038316600090815260096020908152604080832033845290915290205460ff16155b801561070257506000818152600860205260409020546001600160a01b03163314155b1561071f576040516282b42960e81b815260040160405180910390fd5b6003546001600160a01b0384166000908152600660205260408120805490919061074a908490611816565b90915550506003546001600160a01b0380841660008181526006602090815260408083208054909601909555858252600a815284822080546001600160a01b031990811690941790556008815284822080549093169092559186168252600b905290812080546107bc90600190611816565b815481106107cc576107cc611829565b60009182526020808320909101546001600160a01b0387168352600b82526040808420868552600c9093529092205481549293508392811061081057610810611829565b60009182526020808320909101929092556001600160a01b0386168152600b909152604090208054806108455761084561183f565b600082815260208082208301600019908101839055909201909255838252600c8152604080832054848452818420556001600160a01b038616808452600b835290832080546001818101835582865293852001869055925290546108a99190611816565b600c600084815260200190815260200160002081905550826001600160a01b0316846001600160a01b0316600080516020611ab6833981519152846040516108f391815260200190565b60405180910390a3826001600160a01b0316846001600160a01b0316600080516020611ab683398151915260035460405161093091815260200190565b60405180910390a350505050565b6001600160a01b0383166000908152600760209081526040808320338452909152902054600019811461099a576109758282611816565b6001600160a01b03851660009081526007602090815260408083203384529091529020555b6109a5848484610df0565b50505b505050565b336001600160a01b037f000000000000000000000000d0c11fc959e22b8e9b69c97ea3cd334d480ce20316146109f65760405163542c971960e01b815260040160405180910390fd5b610a008282610f9d565b5050565b610a0f838383610638565b6001600160a01b0382163b15801590610abb5750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610a8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aae9190611855565b6001600160e01b03191614155b156109a857604051633da6393160e01b815260040160405180910390fd5b336001600160a01b037f000000000000000000000000d0c11fc959e22b8e9b69c97ea3cd334d480ce2031614610b225760405163542c971960e01b815260040160405180910390fd5b6001600160a01b0382166000908152600d60205260409020805460ff19168215151790555050565b6000818152600a60205260409020546001600160a01b031680610b805760405163c5723b5160e01b815260040160405180910390fd5b919050565b60018054610466906117c6565b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a35050565b6000610c0c338484610df0565b9392505050565b336001600160a01b037f000000000000000000000000d0c11fc959e22b8e9b69c97ea3cd334d480ce2031614610c5c5760405163542c971960e01b815260040160405180910390fd5b610a008282610fd7565b610c71858585610638565b6001600160a01b0384163b15801590610d0b5750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610cbb9033908a9089908990899060040161187f565b6020604051808303816000875af1158015610cda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfe9190611855565b6001600160e01b03191614155b156109a557604051633da6393160e01b815260040160405180910390fd5b600b6020528160005260406000208181548110610d4557600080fd5b90600052602060002001600091509150505481565b6060600e610d6783610fe1565b604051602001610d789291906118d3565b6040516020818303038152906040529050919050565b600e8054610466906117c6565b336001600160a01b037f000000000000000000000000d0c11fc959e22b8e9b69c97ea3cd334d480ce2031614610de45760405163542c971960e01b815260040160405180910390fd5b600e610a0082826119a8565b6001600160a01b03808416600081815260066020526040808220805494871683529082205492825290929190849084610e298386611816565b90915550506001600160a01b0380861660009081526006602090815260408083208054890190559289168252600d9052205460ff16610ecb576003546001600160a01b0387166000908152600660205260408120549091610e8991611a67565b600354610e969085611a67565b610ea09190611816565b905060005b81811015610ec857610eb688611073565b80610ec081611a89565b915050610ea5565b50505b6001600160a01b0385166000908152600d602052604090205460ff16610f5657600060035482610efb9190611a67565b6003546001600160a01b038816600090815260066020526040902054610f219190611a67565b610f2b9190611816565b905060005b81811015610f5357610f4187611186565b80610f4b81611a89565b915050610f30565b50505b846001600160a01b0316866001600160a01b0316600080516020611ab683398151915286604051610f8991815260200190565b60405180910390a350600195945050505050565b600f5481600454610fae9190611aa2565b1115610fcd57604051630f0c37b960e11b815260040160405180910390fd5b610a008282611281565b610a00828261134d565b60606000610fee83611419565b60010190506000816001600160401b0381111561100d5761100d611700565b6040519080825280601f01601f191660200182016040528015611037576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461104157509392505050565b6001600160a01b03811661109a57604051636edaef2f60e11b815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812080546110c090600190611816565b815481106110d0576110d0611829565b90600052602060002001549050600b6000836001600160a01b03166001600160a01b031681526020019081526020016000208054806111115761111161183f565b600082815260208082206000199084018101839055909201909255828252600c81526040808320839055600a825280832080546001600160a01b03199081169091556008835281842080549091169055518381526001600160a01b03851691600080516020611ab68339815191529101610bf3565b6001600160a01b0381166111ad57604051634e46966960e11b815260040160405180910390fd5b60058054600101908190556000818152600a60205260409020546001600160a01b0316156111ee5760405163119b4fd360e11b815260040160405180910390fd5b6000818152600a6020908152604080832080546001600160a01b0319166001600160a01b038716908117909155808452600b835290832080546001818101835582865293852001859055925290546112469190611816565b6000828152600c602090815260408083209390935591518381526001600160a01b03851692600080516020611ab68339815191529101610bf3565b80600460008282546112939190611aa2565b90915550506001600160a01b03821660009081526006602052604081208054918391906112c08385611aa2565b90915550506001600160a01b0383166000908152600d602052604090205460ff166109a8576000600354826112f59190611a67565b6003546001600160a01b03861660009081526006602052604090205461131b9190611a67565b6113259190611816565b905060005b818110156109a55761133b85611186565b8061134581611a89565b91505061132a565b6001600160a01b03821660009081526006602052604081208054918391906113758385611816565b92505081905550816004600082825461138e9190611816565b90915550506001600160a01b0383166000908152600d602052604090205460ff166109a8576003546001600160a01b03841660009081526006602052604081205490916113da91611a67565b6003546113e79084611a67565b6113f19190611816565b905060005b818110156109a55761140785611073565b8061141181611a89565b9150506113f6565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106114585772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310611482576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106114a057662386f26fc10000830492506010015b6305f5e10083106114b8576305f5e100830492506008015b61271083106114cc57612710830492506004015b606483106114de576064830492506002015b600a83106106325760010192915050565b60005b8381101561150a5781810151838201526020016114f2565b50506000910152565b60208152600082518060208401526115328160408501602087016114ef565b601f01601f19169190910160400192915050565b60006020828403121561155857600080fd5b5035919050565b80356001600160a01b0381168114610b8057600080fd5b6000806040838503121561158957600080fd5b6115928361155f565b946020939093013593505050565b6000806000606084860312156115b557600080fd5b6115be8461155f565b92506115cc6020850161155f565b9150604084013590509250925092565b600080604083850312156115ef57600080fd5b6115f88361155f565b91506020830135801515811461160d57600080fd5b809150509250929050565b60006020828403121561162a57600080fd5b610c0c8261155f565b60008060008060006080868803121561164b57600080fd5b6116548661155f565b94506116626020870161155f565b93506040860135925060608601356001600160401b038082111561168557600080fd5b818801915088601f83011261169957600080fd5b8135818111156116a857600080fd5b8960208285010111156116ba57600080fd5b9699959850939650602001949392505050565b600080604083850312156116e057600080fd5b6116e98361155f565b91506116f76020840161155f565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561172857600080fd5b81356001600160401b038082111561173f57600080fd5b818401915084601f83011261175357600080fd5b81358181111561176557611765611700565b604051601f8201601f19908116603f0116810190838211818310171561178d5761178d611700565b816040528281528760208487010111156117a657600080fd5b826020860160208301376000928101602001929092525095945050505050565b600181811c908216806117da57607f821691505b6020821081036117fa57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561063257610632611800565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006020828403121561186757600080fd5b81516001600160e01b031981168114610c0c57600080fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b60008084546118e1816117c6565b600182811680156118f9576001811461190e5761193d565b60ff198416875282151583028701945061193d565b8860005260208060002060005b858110156119345781548a82015290840190820161191b565b50505082870194505b5050505083516119518183602088016114ef565b01949350505050565b601f8211156109a857600081815260208120601f850160051c810160208610156119815750805b601f850160051c820191505b818110156119a05782815560010161198d565b505050505050565b81516001600160401b038111156119c1576119c1611700565b6119d5816119cf84546117c6565b8461195a565b602080601f831160018114611a0a57600084156119f25750858301515b600019600386901b1c1916600185901b1785556119a0565b600085815260208120601f198616915b82811015611a3957888601518255948401946001909101908401611a1a565b5085821015611a575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611a8457634e487b7160e01b600052601260045260246000fd5b500490565b600060018201611a9b57611a9b611800565b5060010190565b808201808211156106325761063261180056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122000f0215d5f86a6875cd24e7d77df23d033b4e4542510ae22814ffc18ca40d1d564736f6c63430008140033

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.