Contract 0xde77553da8756d481767f1dbaee510452e60a589

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf8dc617c1fcac8c5005a527c6e22c1015d96855758e8bfae5a02d1e92742dbf50x60806040270003872022-07-02 8:41:1893 days 18 hrs ago0xdc4a5fc7a3c2dd304f7b44a7954fd4e5cb64c076 IN  Create: Conversion0 MATIC0.02652730535
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Conversion

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2022-07-02
*/

// SPDX-License-Identifier: UNLICENSED

// File: @chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol

pragma solidity 0.7.6;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface 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 (uint256);

    /**
     * @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);
}

interface AggregatorV3Interface {
    function decimals() external view returns (uint8);

    function description() external view returns (string memory);

    function version() external view returns (uint256);

    // getRoundData and latestRoundData should both raise "No data present"
    // if they do not have data to report, instead of returning unset values
    // which could be misinterpreted as actual reported values.
    function getRoundData(uint80 _roundId)
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );

    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );
}

// File: contracts/SafeMathUpgradeable.sol

pragma solidity 0.7.6;

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

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

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        // 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.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        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.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return
            functionCallWithValue(
                target,
                data,
                value,
                "Address: low-level call with value failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(
            address(this).balance >= value,
            "Address: insufficient balance for call"
        );
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{value: value}(
            data
        );
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data)
        internal
        view
        returns (bytes memory)
    {
        return
            functionStaticCall(
                target,
                data,
                "Address: low-level static call failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(
            _initializing || _isConstructor() || !_initialized,
            "Initializable: contract is already initialized"
        );

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

// File @openzeppelin/contracts-upgradeable/utils/[email protected]

pragma solidity ^0.7.0;

/*
 * @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 GSN 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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {}

    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }

    uint256[50] private __gap;
}

// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.7.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function ownable_init() internal initializer {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(
            newOwner != address(0),
            "Ownable: new owner is the zero address"
        );
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

interface QuickswapRouter {
    function getAmountsOut(uint256 amountIn, address[] memory path)
        external
        view
        returns (uint256[] memory amounts);
}

interface QuickswapFactory {
    function getPair(address tokenA, address tokenB)
        external
        view
        returns (address pair);
}

interface QuickswapPair {
    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Metadata.sol

// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

contract Conversion is Initializable, Ownable {
    using SafeMathUpgradeable for uint256;
    address internal USX;
    address internal Trace;
    address constant USD = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174;

    QuickswapRouter router;
    QuickswapFactory factory;

    uint256 PRICE_PRECISION;
    uint256 USD_DECIMALS;
    mapping(address => mapping(address => address)) public priceFeed;
    event TokenAdded(address indexed tokenAddress);

    function initialize() public initializer {
        ownable_init();
        PRICE_PRECISION = 1E8;
        USD_DECIMALS = 8;
    }

    function adminUpdate(
        address _USX,
        address _Trace,
        QuickswapRouter _router,
        QuickswapFactory _factory
    ) public onlyOwner {
        USX = _USX;
        Trace = _Trace;
        router = _router;
        factory = _factory;
    }

    /**
     * @dev Returns the latest price.
     */
    function getChainlinkPrice(AggregatorV3Interface fetchPrice)
        public
        view
        returns (uint256)
    {
        (, int256 _price, , , ) = fetchPrice.latestRoundData();
        uint256 price = uint256(_price).mul(1E10);
        return price;
    }

    /**
     * @notice To convert usd to equivalent amount of token.
     */
    function convertMintFee(address paymentToken, uint256 mintFee)
        public
        view
        returns (uint256)
    {
        uint256 decimal = 18;
        if (paymentToken != address(0)) {
            decimal = IERC20(paymentToken).decimals();
        }
        if (paymentToken == USX) {
            return mintFee.mul(10**decimal).div(PRICE_PRECISION);
        }
        if (paymentToken == Trace) {
            return getTraceAmount(mintFee);
        }

        AggregatorV3Interface fetchPrice = AggregatorV3Interface(
            priceFeed[paymentToken][address(0)]
        );
        uint256 price = getChainlinkPrice(fetchPrice);

        price = mintFee.mul(1E18).mul(10**decimal).div(price).div(
            PRICE_PRECISION
        );
        return price;
    }

    function getTraceAmount(uint256 mintFee) public view returns (uint256) {
        return mintFee.mul(getSwapPrice(USD, Trace)).mul(100);
    }

    function getSwapPrice(address tokenA, address tokenB)
        public
        view
        returns (uint256)
    {
        (uint256 reserves0, uint256 reserves1, ) = QuickswapPair(
            factory.getPair(tokenA, tokenB)
        ).getReserves();
        uint256 price = reserves1.div(reserves0).div(10000);
        return price;
    }

    function getUSXPrice() public view returns (uint256) {
        return 100000000;
    }

    /**
     * @notice To convert usd to equivalent amount of token.
     */
    function convertUpdateFee(address paymentToken, uint256 updateFee)
        public
        view
        returns (uint256)
    {
        AggregatorV3Interface fetchPrice = AggregatorV3Interface(
            priceFeed[paymentToken][address(0)]
        );
        uint256 price = getChainlinkPrice(fetchPrice);
        uint256 decimal = 18;
        if (paymentToken != address(0)) {
            decimal = IERC20(paymentToken).decimals();
        }
        price = updateFee.mul(1E18).mul(10**decimal).div(price).div(
            PRICE_PRECISION
        );
        return price;
    }

    function addToken(address token0, address _priceFeed) public onlyOwner {
        priceFeed[token0][address(0)] = _priceFeed;
    }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"TokenAdded","type":"event"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"_priceFeed","type":"address"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_USX","type":"address"},{"internalType":"address","name":"_Trace","type":"address"},{"internalType":"contract QuickswapRouter","name":"_router","type":"address"},{"internalType":"contract QuickswapFactory","name":"_factory","type":"address"}],"name":"adminUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"mintFee","type":"uint256"}],"name":"convertMintFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"updateFee","type":"uint256"}],"name":"convertUpdateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract AggregatorV3Interface","name":"fetchPrice","type":"address"}],"name":"getChainlinkPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"getSwapPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintFee","type":"uint256"}],"name":"getTraceAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUSXPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"priceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610cc0806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80635af55d381161008c5780638da5cb5b116100665780638da5cb5b146102515780638f2834e414610259578063bd58fe5614610261578063f2fde38b14610287576100cf565b80635af55d3814610203578063715018a6146102415780638129fc1c14610249576100cf565b806303d70d57146100d45780630a3c748a146101035780631d13892b1461012f5780632d48065f1461015b5780634e2c7668146101a55780635476bd72146101d3575b600080fd5b6100f1600480360360208110156100ea57600080fd5b50356102ad565b60408051918252519081900360200190f35b6100f16004803603604081101561011957600080fd5b506001600160a01b0381351690602001356102f9565b6100f16004803603604081101561014557600080fd5b506001600160a01b038135169060200135610436565b6101896004803603604081101561017157600080fd5b506001600160a01b0381358116916020013516610506565b604080516001600160a01b039092168252519081900360200190f35b6100f1600480360360408110156101bb57600080fd5b506001600160a01b038135811691602001351661052c565b610201600480360360408110156101e957600080fd5b506001600160a01b0381358116916020013516610651565b005b6102016004803603608081101561021957600080fd5b506001600160a01b0381358116916020810135821691604082013581169160600135166106ec565b61020161079e565b61020161080c565b6101896108c3565b6100f16108d2565b6100f16004803603602081101561027757600080fd5b50356001600160a01b03166108da565b6102016004803603602081101561029d57600080fd5b50356001600160a01b0316610960565b6035546000906102f3906064906102ed906102e690732791bca1f2de4661ed88a30c99a7a9449aa84174906001600160a01b031661052c565b8590610a10565b90610a10565b92915050565b600060126001600160a01b0384161561037457836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561034557600080fd5b505afa158015610359573d6000803e3d6000fd5b505050506040513d602081101561036f57600080fd5b505190505b6034546001600160a01b03858116911614156103ad576038546103a59061039f85600a85900a610a10565b90610a70565b9150506102f3565b6035546001600160a01b03858116911614156103cc576103a5836102ad565b6001600160a01b038085166000908152603a60209081526040808320838052909152812054909116906103fe826108da565b905061042c60385461039f8361039f87600a0a6102ed670de0b6b3a76400008c610a1090919063ffffffff16565b9695505050505050565b6001600160a01b038083166000908152603a6020908152604080832083805290915281205490911681610468826108da565b905060126001600160a01b038616156104e357856001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156104b457600080fd5b505afa1580156104c8573d6000803e3d6000fd5b505050506040513d60208110156104de57600080fd5b505190505b60385461042c9061039f8481600a86900a6102ed8b670de0b6b3a7640000610a10565b603a6020908152600092835260408084209091529082529020546001600160a01b031681565b6037546040805163e6a4390560e01b81526001600160a01b038581166004830152848116602483015291516000938493849391169163e6a4390591604480820192602092909190829003018186803b15801561058757600080fd5b505afa15801561059b573d6000803e3d6000fd5b505050506040513d60208110156105b157600080fd5b505160408051630240bc6b60e21b815290516001600160a01b0390921691630902f1ac91600480820192606092909190829003018186803b1580156105f557600080fd5b505afa158015610609573d6000803e3d6000fd5b505050506040513d606081101561061f57600080fd5b5080516020909101516dffffffffffffffffffffffffffff9182169350169050600061042c61271061039f8486610a70565b610659610ad7565b6001600160a01b031661066a6108c3565b6001600160a01b0316146106b3576040805162461bcd60e51b81526020600482018190526024820152600080516020610c6b833981519152604482015290519081900360640190fd5b6001600160a01b039182166000908152603a60209081526040808320838052909152902080546001600160a01b03191691909216179055565b6106f4610ad7565b6001600160a01b03166107056108c3565b6001600160a01b03161461074e576040805162461bcd60e51b81526020600482018190526024820152600080516020610c6b833981519152604482015290519081900360640190fd5b603480546001600160a01b039586166001600160a01b0319918216179091556035805494861694821694909417909355603680549285169284169290921790915560378054919093169116179055565b6107a6610ad7565b6001600160a01b03166107b76108c3565b6001600160a01b031614610800576040805162461bcd60e51b81526020600482018190526024820152600080516020610c6b833981519152604482015290519081900360640190fd5b61080a6000610adb565b565b600054610100900460ff16806108255750610825610b2d565b80610833575060005460ff16155b61086e5760405162461bcd60e51b815260040180806020018281038252602e815260200180610c1c602e913960400191505060405180910390fd5b600054610100900460ff16158015610899576000805460ff1961ff0019909116610100171660011790555b6108a1610b3e565b6305f5e100603855600860395580156108c0576000805461ff00191690555b50565b6033546001600160a01b031690565b6305f5e10090565b600080826001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561091657600080fd5b505afa15801561092a573d6000803e3d6000fd5b505050506040513d60a081101561094057600080fd5b506020015190506000610958826402540be400610a10565b949350505050565b610968610ad7565b6001600160a01b03166109796108c3565b6001600160a01b0316146109c2576040805162461bcd60e51b81526020600482018190526024820152600080516020610c6b833981519152604482015290519081900360640190fd5b6001600160a01b038116610a075760405162461bcd60e51b8152600401808060200182810382526026815260200180610bf66026913960400191505060405180910390fd5b6108c081610adb565b600082610a1f575060006102f3565b82820282848281610a2c57fe5b0414610a695760405162461bcd60e51b8152600401808060200182810382526021815260200180610c4a6021913960400191505060405180910390fd5b9392505050565b6000808211610ac6576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610acf57fe5b049392505050565b3390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610b3830610bef565b15905090565b600054610100900460ff1680610b575750610b57610b2d565b80610b65575060005460ff16155b610ba05760405162461bcd60e51b815260040180806020018281038252602e815260200180610c1c602e913960400191505060405180910390fd5b600054610100900460ff16158015610bcb576000805460ff1961ff0019909116610100171660011790555b610bdb610bd6610ad7565b610adb565b80156108c0576000805461ff001916905550565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220ea1d649fa32f2fd6f089aea1d89446015e4f48edd9890f08e8e15d4867ebd4c864736f6c63430007060033

Deployed ByteCode Sourcemap

22342:3541:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24462:143;;;;;;;;;;;;;;;;-1:-1:-1;24462:143:0;;:::i;:::-;;;;;;;;;;;;;;;;23652:802;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;23652:802:0;;;;;;;;:::i;25144:596::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;25144:596:0;;;;;;;;:::i;22688:64::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;22688:64:0;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;22688:64:0;;;;;;;;;;;;;;24613:347;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;24613:347:0;;;;;;;;;;:::i;25748:132::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;25748:132:0;;;;;;;;;;:::i;:::-;;22955:273;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;22955:273:0;;;;;;;;;;;;;;;;;;;;;;;;:::i;20106:103::-;;;:::i;22814:133::-;;;:::i;19455:87::-;;;:::i;24968:88::-;;;:::i;23293:271::-;;;;;;;;;;;;;;;;-1:-1:-1;23293:271:0;-1:-1:-1;;;;;23293:271:0;;:::i;20364:238::-;;;;;;;;;;;;;;;;-1:-1:-1;20364:238:0;-1:-1:-1;;;;;20364:238:0;;:::i;24462:143::-;24581:5;;24524:7;;24551:46;;24593:3;;24551:37;;24563:24;;22518:42;;-1:-1:-1;;;;;24581:5:0;24563:12;:24::i;:::-;24551:7;;:11;:37::i;:::-;:41;;:46::i;:::-;24544:53;24462:143;-1:-1:-1;;24462:143:0:o;23652:802::-;23763:7;23806:2;-1:-1:-1;;;;;23823:26:0;;;23819:100;;23883:12;-1:-1:-1;;;;;23876:29:0;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;23876:31:0;;-1:-1:-1;23819:100:0;23949:3;;-1:-1:-1;;;;;23933:19:0;;;23949:3;;23933:19;23929:104;;;24005:15;;23976:45;;:24;:7;23988:2;:11;;;23976;:24::i;:::-;:28;;:45::i;:::-;23969:52;;;;;23929:104;24063:5;;-1:-1:-1;;;;;24047:21:0;;;24063:5;;24047:21;24043:84;;;24092:23;24107:7;24092:14;:23::i;24043:84::-;-1:-1:-1;;;;;24210:23:0;;;24139:32;24210:23;;;:9;:23;;;;;;;;:35;;;;;;;;;;;;;24283:29;24210:35;24283:17;:29::i;:::-;24267:45;;24333:90;24397:15;;24333:45;24372:5;24333:34;24359:7;24355:2;:11;24333:17;24345:4;24333:7;:11;;:17;;;;:::i;:90::-;24325:98;23652:802;-1:-1:-1;;;;;;23652:802:0:o;25144:596::-;-1:-1:-1;;;;;25355:23:0;;;25259:7;25355:23;;;:9;:23;;;;;;;;:35;;;;;;;;;25259:7;;25355:35;25259:7;25428:29;25355:35;25428:17;:29::i;:::-;25412:45;-1:-1:-1;25486:2:0;-1:-1:-1;;;;;25503:26:0;;;25499:100;;25563:12;-1:-1:-1;;;;;25556:29:0;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;25556:31:0;;-1:-1:-1;25499:100:0;25683:15;;25617:92;;:47;25658:5;25617:47;25641:2;:11;;;25617:19;:9;25631:4;25617:13;:19::i;22688:64::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;22688:64:0;;:::o;24613:347::-;24811:7;;:31;;;-1:-1:-1;;;24811:31:0;;-1:-1:-1;;;;;24811:31:0;;;;;;;;;;;;;;;;24715:7;;;;;;24811;;;:15;;:31;;;;;;;;;;;;;;;:7;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;24811:31:0;24783:84;;;-1:-1:-1;;;24783:84:0;;;;-1:-1:-1;;;;;24783:82:0;;;;;;:84;;;;;;;;;;;;;;;:82;:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;24783:84:0;;;;;;;24740:127;;;;;-1:-1:-1;24740:127:0;;-1:-1:-1;24878:13:0;24894:35;24923:5;24894:24;24740:127;;24894:13;:24::i;25748:132::-;19686:12;:10;:12::i;:::-;-1:-1:-1;;;;;19675:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;19675:23:0;;19667:68;;;;;-1:-1:-1;;;19667:68:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;19667:68:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;25830:17:0;;::::1;;::::0;;;:9:::1;:17;::::0;;;;;;;:29;;;;;;;;:42;;-1:-1:-1;;;;;;25830:42:0::1;::::0;;;::::1;;::::0;;25748:132::o;22955:273::-;19686:12;:10;:12::i;:::-;-1:-1:-1;;;;;19675:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;19675:23:0;;19667:68;;;;;-1:-1:-1;;;19667:68:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;19667:68:0;;;;;;;;;;;;;;;23129:3:::1;:10:::0;;-1:-1:-1;;;;;23129:10:0;;::::1;-1:-1:-1::0;;;;;;23129:10:0;;::::1;;::::0;;;23150:5:::1;:14:::0;;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;23175:6:::1;:16:::0;;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;23202:7:::1;:18:::0;;;;;::::1;::::0;::::1;;::::0;;22955:273::o;20106:103::-;19686:12;:10;:12::i;:::-;-1:-1:-1;;;;;19675:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;19675:23:0;;19667:68;;;;;-1:-1:-1;;;19667:68:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;19667:68:0;;;;;;;;;;;;;;;20171:30:::1;20198:1;20171:18;:30::i;:::-;20106:103::o:0;22814:133::-;16529:13;;;;;;;;:33;;;16546:16;:14;:16::i;:::-;16529:50;;;-1:-1:-1;16567:12:0;;;;16566:13;16529:50;16507:146;;;;-1:-1:-1;;;16507:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16666:19;16689:13;;;;;;16688:14;16713:101;;;;16748:13;:20;;-1:-1:-1;;;;16748:20:0;;;;;16783:19;16764:4;16783:19;;;16713:101;22866:14:::1;:12;:14::i;:::-;22909:3;22891:15;:21:::0;22938:1:::1;22923:12;:16:::0;16840:68;;;;16891:5;16875:21;;-1:-1:-1;;16875:21:0;;;16840:68;22814:133;:::o;19455:87::-;19528:6;;-1:-1:-1;;;;;19528:6:0;19455:87;:::o;24968:88::-;25039:9;24968:88;:::o;23293:271::-;23402:7;23430:13;23453:10;-1:-1:-1;;;;;23453:26:0;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;23453:28:0;;;;-1:-1:-1;23492:13:0;23508:25;23453:28;23528:4;23508:19;:25::i;:::-;23492:41;23293:271;-1:-1:-1;;;;23293:271:0:o;20364:238::-;19686:12;:10;:12::i;:::-;-1:-1:-1;;;;;19675:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;19675:23:0;;19667:68;;;;;-1:-1:-1;;;19667:68:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;19667:68:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;20467:22:0;::::1;20445:110;;;;-1:-1:-1::0;;;20445:110:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20566:28;20585:8;20566:18;:28::i;5135:220::-:0;5193:7;5217:6;5213:20;;-1:-1:-1;5232:1:0;5225:8;;5213:20;5256:5;;;5260:1;5256;:5;:1;5280:5;;;;;:10;5272:56;;;;-1:-1:-1;;;5272:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5346:1;5135:220;-1:-1:-1;;;5135:220:0:o;5833:153::-;5891:7;5923:1;5919;:5;5911:44;;;;;-1:-1:-1;;;5911:44:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5977:1;5973;:5;;;;;;;5833:153;-1:-1:-1;;;5833:153:0:o;17997:106::-;18085:10;17997:106;:::o;20762:191::-;20855:6;;;-1:-1:-1;;;;;20872:17:0;;;-1:-1:-1;;;;;;20872:17:0;;;;;;;20905:40;;20855:6;;;20872:17;20855:6;;20905:40;;20836:16;;20905:40;20762:191;;:::o;17008:125::-;17056:4;17081:44;17119:4;17081:29;:44::i;:::-;17080:45;17073:52;;17008:125;:::o;19278:96::-;16529:13;;;;;;;;:33;;;16546:16;:14;:16::i;:::-;16529:50;;;-1:-1:-1;16567:12:0;;;;16566:13;16529:50;16507:146;;;;-1:-1:-1;;;16507:146:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16666:19;16689:13;;;;;;16688:14;16713:101;;;;16748:13;:20;;-1:-1:-1;;;;16748:20:0;;;;;16783:19;16764:4;16783:19;;;16713:101;19334:32:::1;19353:12;:10;:12::i;:::-;19334:18;:32::i;:::-;16844:14:::0;16840:68;;;16891:5;16875:21;;-1:-1:-1;;16875:21:0;;;19278:96;:::o;9717:444::-;10097:20;10145:8;;;9717:444::o

Swarm Source

ipfs://ea1d649fa32f2fd6f089aea1d89446015e4f48edd9890f08e8e15d4867ebd4c8
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading