ETH Price: $3,149.74 (+1.80%)

Contract

0xb4aD8df313109caaF8Fdcde9094e9d1DE41252bc

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x218EB9AC...1224Fa7A7
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PriceGetterUniV2

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.28;

import "../IPriceGetterProtocol.sol";
import "../../IPriceGetter.sol";
import "../../lib/UtilityLibrary.sol";
import "./interfaces/IApePair.sol";
import "./interfaces/IApeFactory.sol";

contract PriceGetterUniV2 is IPriceGetterProtocol {
    struct LocalVarsV2Price {
        uint256 usdStableTotal;
        uint256 wrappedNativeReserve;
        uint256 wrappedNativeTotal;
        uint256 wrappedNativeTotalUsd;
        uint256 tokenReserve;
        uint256 stableUsdReserve;
        uint256 tokenTotal;
        uint256 nativePrice;
        address wrappedNativePair;
        uint256 wNativeBalance;
        uint256 balanceStable;
        uint256 stableUsdPrice;
    }

    // ========== Get Token Prices ==========

    function getTokenPrice(
        address token,
        address factory,
        PriceGetterParams memory params
    ) public view override returns (uint256 price, uint256 usdBalance) {
        IApeFactory factoryV2 = IApeFactory(factory);
        LocalVarsV2Price memory vars;
        vars.nativePrice = params.mainPriceGetter.getNativePrice(IPriceGetter.Protocol.UniV2, address(factoryV2));
        if (token == params.wrappedNative.tokenAddress) {
            /// @dev Returning high total balance for wrappedNative to heavily weight value.
            return (vars.nativePrice, 1);
        }

        (vars.tokenReserve, vars.wrappedNativeReserve) = _getNormalizedReservesFromFactoryV2_Decimals(
            factoryV2,
            token,
            params.wrappedNative.tokenAddress,
            UtilityLibrary._getTokenDecimals(token),
            params.wrappedNative.decimals
        );
        vars.tokenTotal = 0;
        vars.wrappedNativePair = factoryV2.getPair(token, params.wrappedNative.tokenAddress);
        vars.wNativeBalance = IERC20(params.wrappedNative.tokenAddress).balanceOf(vars.wrappedNativePair);
        if (vars.wNativeBalance > params.nativeLiquidityThreshold) {
            vars.wrappedNativeTotalUsd = (vars.wrappedNativeReserve * vars.nativePrice) / 1e18;
            vars.tokenTotal = vars.tokenReserve;
        }

        for (uint256 i = 0; i < params.stableUsdTokens.length; i++) {
            IPriceGetter.TokenAndDecimals memory stableUsdToken = params.stableUsdTokens[i];
            (vars.tokenReserve, vars.stableUsdReserve) = _getNormalizedReservesFromFactoryV2_Decimals(
                factoryV2,
                token,
                stableUsdToken.tokenAddress,
                UtilityLibrary._getTokenDecimals(token),
                stableUsdToken.decimals
            );
            address stablePair = factoryV2.getPair(token, stableUsdToken.tokenAddress);
            vars.balanceStable = IERC20(stableUsdToken.tokenAddress).balanceOf(stablePair);
            if (vars.balanceStable > 10 * (10 ** stableUsdToken.decimals)) {
                vars.stableUsdPrice = params.mainPriceGetter.getOraclePriceNormalized(stableUsdToken.tokenAddress);
                if (vars.stableUsdPrice > 0) {
                    /// @dev Weighting the USD side of the pair by the price of the USD stable token if it exists.
                    vars.usdStableTotal += (vars.stableUsdReserve * vars.stableUsdPrice) / 1e18;
                } else {
                    vars.usdStableTotal += vars.stableUsdReserve;
                }
                vars.tokenTotal += vars.tokenReserve;
            }
        }

        if (vars.tokenTotal == 0) {
            return (0, 0);
        }
        usdBalance = vars.usdStableTotal + vars.wrappedNativeTotalUsd;
        price = ((vars.usdStableTotal + vars.wrappedNativeTotalUsd) * 1e18) / vars.tokenTotal;
    }

    // ========== LP PRICE ==========

    function getLPPrice(
        address lp,
        address factory,
        PriceGetterParams memory params
    ) public view override returns (uint256 price) {
        //if not a LP, handle as a standard token
        try IApePair(lp).getReserves() returns (uint112 reserve0, uint112 reserve1, uint32) {
            address token0 = IApePair(lp).token0();
            address token1 = IApePair(lp).token1();
            uint256 totalSupply = IApePair(lp).totalSupply();

            //price0*reserve0+price1*reserve1
            (uint256 token0Price, ) = getTokenPrice(token0, factory, params);
            (uint256 token1Price, ) = getTokenPrice(token1, factory, params);
            reserve0 = UtilityLibrary._normalizeToken112(reserve0, token0);
            reserve1 = UtilityLibrary._normalizeToken112(reserve1, token1);
            uint256 totalValue = (token0Price * uint256(reserve0)) + (token1Price * uint256(reserve1));

            return totalValue / totalSupply;
        } catch {
            /// @dev If the pair is not a valid LP, return the price of the token
            (uint256 lpPrice, ) = getTokenPrice(lp, factory, params);
            return lpPrice;
        }
    }

    // ========== NATIVE PRICE ==========

    function getNativePrice(
        address factory,
        PriceGetterParams memory params
    ) public view override returns (uint256 price) {
        IApeFactory factoryV2 = IApeFactory(factory);
        uint256 wrappedNativeTotal;

        /// @dev This method calculates the price of wrappedNative by comparing multiple stable pools and weighting by their oracle price
        uint256 usdStableTotal = 0;
        for (uint256 i = 0; i < params.stableUsdTokens.length; i++) {
            IPriceGetter.TokenAndDecimals memory stableUsdToken = params.stableUsdTokens[i];
            (uint256 wrappedNativeReserve, uint256 stableUsdReserve) = _getNormalizedReservesFromFactoryV2_Decimals(
                factoryV2,
                params.wrappedNative.tokenAddress,
                stableUsdToken.tokenAddress,
                params.wrappedNative.decimals,
                stableUsdToken.decimals
            );
            uint256 stableUsdPrice = params.mainPriceGetter.getOraclePriceNormalized(stableUsdToken.tokenAddress);
            if (stableUsdPrice > 0) {
                /// @dev Weighting the USD side of the pair by the price of the USD stable token if it exists.
                usdStableTotal += (stableUsdReserve * stableUsdPrice) / 1e18;
            } else {
                usdStableTotal += stableUsdReserve;
            }
            wrappedNativeTotal += wrappedNativeReserve;
        }

        price = (usdStableTotal * 1e18) / wrappedNativeTotal;
    }

    // ========== INTERNAL FUNCTIONS ==========

    /**
     * @dev Get normalized reserves for a given token pair from the ApeSwap Factory contract, specifying decimals.
     * @param factoryV2 The address of the V2 factory.
     * @param tokenA The address of the first token in the pair.
     * @param tokenB The address of the second token in the pair.
     * @param decimalsA The number of decimals for the first token in the pair.
     * @param decimalsB The number of decimals for the second token in the pair.
     * @return normalizedReserveA The normalized reserve of the first token in the pair.
     * @return normalizedReserveB The normalized reserve of the second token in the pair.
     */
    function _getNormalizedReservesFromFactoryV2_Decimals(
        IApeFactory factoryV2,
        address tokenA,
        address tokenB,
        uint8 decimalsA,
        uint8 decimalsB
    ) internal view returns (uint256 normalizedReserveA, uint256 normalizedReserveB) {
        address pairAddress = factoryV2.getPair(tokenA, tokenB);
        if (pairAddress == address(0)) {
            return (0, 0);
        }
        return _getNormalizedReservesFromPair_Decimals(pairAddress, tokenA, tokenB, decimalsA, decimalsB);
    }

    /**
     * @dev This internal function takes in a pair address, two token addresses (tokenA and tokenB), and their respective decimals.
     * It returns the normalized reserves for each token in the pair.
     *
     * This function uses the IApePair interface to get the current reserves of the given token pair
     * If successful, it returns the normalized reserves for each token in the pair by calling _normalize() on
     * the reserve values. The order of the returned normalized reserve values depends on the lexicographic ordering
     * of tokenA and tokenB.
     *
     * @param pair Address of the liquidity pool contract representing the token pair
     * @param tokenA Address of one of the tokens in the pair. Assumed to be a valid address in the pair to save on gas.
     * @param tokenB Address of the other token in the pair. Assumed to be a valid address in the pair to save on gas.
     * @param decimalsA The number of decimals for tokenA
     * @param decimalsB The number of decimals for tokenB
     * @return normalizedReserveA The normalized reserve value for tokenA
     * @return normalizedReserveB The normalized reserve value for tokenB
     */
    function _getNormalizedReservesFromPair_Decimals(
        address pair,
        address tokenA,
        address tokenB,
        uint8 decimalsA,
        uint8 decimalsB
    ) internal view returns (uint256 normalizedReserveA, uint256 normalizedReserveB) {
        (bool success, bytes memory returnData) = pair.staticcall(abi.encodeWithSignature("getReserves()"));

        if (success) {
            try this.decodeReservesWithLP(returnData) returns (uint112 reserve0, uint112 reserve1, uint32) {
                if (UtilityLibrary._isSorted(tokenA, tokenB)) {
                    return (
                        UtilityLibrary._normalize(reserve0, decimalsA),
                        UtilityLibrary._normalize(reserve1, decimalsB)
                    );
                } else {
                    return (
                        UtilityLibrary._normalize(reserve1, decimalsA),
                        UtilityLibrary._normalize(reserve0, decimalsB)
                    );
                }
            } catch {
                (success, returnData) = pair.staticcall(abi.encodeWithSignature("getFictiveReserves()"));
                try this.decodeReservesWithoutLP(returnData) returns (uint256 reserve0, uint256 reserve1) {
                    if (UtilityLibrary._isSorted(tokenA, tokenB)) {
                        return (
                            UtilityLibrary._normalize(reserve0, decimalsA),
                            UtilityLibrary._normalize(reserve1, decimalsB)
                        );
                    } else {
                        return (
                            UtilityLibrary._normalize(reserve1, decimalsA),
                            UtilityLibrary._normalize(reserve0, decimalsB)
                        );
                    }
                } catch {
                    return (0, 0);
                }
            }
        } else {
            return (0, 0);
        }
    }

    function decodeReservesWithLP(
        bytes memory data
    ) public pure returns (uint112 reserve0, uint112 reserve1, uint32 lp) {
        return abi.decode(data, (uint112, uint112, uint32));
    }

    function decodeReservesWithoutLP(bytes memory data) public pure returns (uint256 reserve0, uint256 reserve1) {
        return abi.decode(data, (uint256, uint256));
    }
}

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.28;

interface IPriceGetter {
    enum Protocol {
        UniV2,
        UniV3,
        UniV4,
        Algebra,
        AlgebraV4,
        Solidly,
        Curve
    }

    enum Wrappers {
        Gamma,
        Ichi,
        Steer
    }

    struct TokenAndDecimals {
        address tokenAddress;
        uint8 decimals;
    }

    function getTokenPrice(
        address token,
        Protocol protocol,
        address factory
    ) external view returns (uint256 price, uint256 usdBalance);
    function getLPPrice(address lp, Protocol protocol, address factory) external view returns (uint256 price);
    function getWrappedLPPrice(
        address lp,
        Protocol protocol,
        address factory,
        IPriceGetter.Wrappers wrapper
    ) external view returns (uint256 price);
    function getNativePrice(Protocol protocol, address factory) external view returns (uint256 nativePrice);
    function getOraclePriceNormalized(address token) external view returns (uint256 price);
}

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.28;

import "../IPriceGetter.sol";

interface IPriceGetterProtocol {
    struct PriceGetterParams {
        IPriceGetter mainPriceGetter;
        IPriceGetter.TokenAndDecimals wrappedNative;
        IPriceGetter.TokenAndDecimals[] stableUsdTokens;
        uint256 nativeLiquidityThreshold;
        uint256 stableUsdThreshold;
    }

    /**
     * @dev Returns the price of a token.
     * @param token The address of the token to get the price for.
     * @return price The current price of the token.
     */
    function getTokenPrice(
        address token,
        address factory,
        PriceGetterParams memory params
    ) external view returns (uint256 price, uint256 usdBalance);

    /**
     * @dev Returns the price of an LP token.
     * @param lp The address of the LP token to get the price for.
     * @return price The current price of the LP token.
     */
    function getLPPrice(
        address lp,
        address factory,
        PriceGetterParams memory params
    ) external view returns (uint256 price);

    /**
     * @dev Returns the current price of the native token in USD.
     * @return nativePrice The current price of the native token in USD.
     */
    function getNativePrice(
        address factory,
        PriceGetterParams memory params
    ) external view returns (uint256 nativePrice);
}

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.6.6;

interface IApeFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);

    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);

    function allPairs(uint) external view returns (address pair);

    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;

    function setFeeToSetter(address) external;
}

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.6.6;

interface IApePair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint);

    function balanceOf(address owner) external view returns (uint);

    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);

    function transfer(address to, uint value) external returns (bool);

    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

    function price0CumulativeLast() external view returns (uint);

    function price1CumulativeLast() external view returns (uint);

    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);

    function burn(address to) external returns (uint amount0, uint amount1);

    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;

    function skim(address to) external;

    function sync() external;

    function initialize(address, address) external;
}

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.28;

import "../token-lib/IERC20.sol";

library UtilityLibrary {
    function _isSorted(address tokenA, address tokenB) internal pure returns (bool isSorted) {
        //  (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        isSorted = tokenA < tokenB ? true : false;
    }

    function _getTokenDecimals(address token) internal view returns (uint8 decimals) {
        try IERC20(token).decimals() returns (uint8 dec) {
            decimals = dec;
        } catch {
            decimals = 18;
        }
    }

    /// @notice Normalize the amount of a token to wei or 1e18
    function _normalizeToken(uint256 amount, address token) internal view returns (uint256) {
        return _normalize(amount, _getTokenDecimals(token));
    }

    /// @notice Normalize the amount of a token to wei or 1e18
    function _normalizeToken112(uint112 amount, address token) internal view returns (uint112) {
        return _normalize112(amount, _getTokenDecimals(token));
    }

    /// @notice Normalize the amount passed to wei or 1e18 decimals
    function _normalize(uint256 amount, uint8 decimals) internal pure returns (uint256) {
        if (decimals == 18) return amount;
        return (amount * (10 ** 18)) / (10 ** decimals);
    }

    /// @notice Normalize the amount passed to wei or 1e18 decimals
    function _normalize112(uint112 amount, uint8 decimals) internal pure returns (uint112) {
        if (decimals == 18) {
            return amount;
        } else if (decimals > 18) {
            return uint112(amount / (10 ** (decimals - 18)));
        } else {
            return uint112(amount * (10 ** (18 - decimals)));
        }
    }
}

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.5.0;

interface IERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

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

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

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint);

    function balanceOf(address owner) external view returns (uint);

    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);

    function transfer(address to, uint value) external returns (bool);

    function transferFrom(address from, address to, uint value) external returns (bool);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"decodeReservesWithLP","outputs":[{"internalType":"uint112","name":"reserve0","type":"uint112"},{"internalType":"uint112","name":"reserve1","type":"uint112"},{"internalType":"uint32","name":"lp","type":"uint32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"decodeReservesWithoutLP","outputs":[{"internalType":"uint256","name":"reserve0","type":"uint256"},{"internalType":"uint256","name":"reserve1","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"lp","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"contract IPriceGetter","name":"mainPriceGetter","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals","name":"wrappedNative","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals[]","name":"stableUsdTokens","type":"tuple[]"},{"internalType":"uint256","name":"nativeLiquidityThreshold","type":"uint256"},{"internalType":"uint256","name":"stableUsdThreshold","type":"uint256"}],"internalType":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getLPPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"contract IPriceGetter","name":"mainPriceGetter","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals","name":"wrappedNative","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals[]","name":"stableUsdTokens","type":"tuple[]"},{"internalType":"uint256","name":"nativeLiquidityThreshold","type":"uint256"},{"internalType":"uint256","name":"stableUsdThreshold","type":"uint256"}],"internalType":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getNativePrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"contract IPriceGetter","name":"mainPriceGetter","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals","name":"wrappedNative","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals[]","name":"stableUsdTokens","type":"tuple[]"},{"internalType":"uint256","name":"nativeLiquidityThreshold","type":"uint256"},{"internalType":"uint256","name":"stableUsdThreshold","type":"uint256"}],"internalType":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getTokenPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"usdBalance","type":"uint256"}],"stateMutability":"view","type":"function"}]

0x608080604052346015576111a1908161001b8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c80631c4d118d1461029557806389dc4a0e1461027c578063cb9baae2146100c5578063ec88ea5a146100a05763f9f4f7321461005357600080fd5b3461009b5760606001600160701b0363ffffffff6100826100733661030b565b60208082518301019101610543565b9193908160405195168552166020840152166040820152f35b600080fd5b3461009b5760406100b96100b3366104c3565b91610805565b82519182526020820152f35b3461009b57604036600319011261009b576004356001600160a01b0381169081900361009b5760243567ffffffffffffffff811161009b5761010b9036906004016103cb565b906000808091604085019360208601925b8551805186101561022f5785610131916107ca565b51845180518251602092830151928401516101629360ff918216939116916001600160a01b03908116911687610d46565b8951925160405163427d626760e11b81526001600160a01b0391821660048201529294929360209185916024918391165afa928315610223576000936101ec575b506001936101d8939092909182156101e1576101cb6101d293670de0b6b3a764000092610598565b04906105ab565b946105ab565b9401939161011c565b906101d292506105ab565b90926020823d821161021b575b81610206602093836102b7565b810103126102185750519160016101a3565b80fd5b3d91506101f9565b6040513d6000823e3d90fd5b8382670de0b6b3a7640000810290808204670de0b6b3a764000014901517156102665760209161025e916105b8565b604051908152f35b634e487b7160e01b600052601160045260246000fd5b3461009b57602061025e61028f366104c3565b916105d8565b3461009b5760406100b96102a83661030b565b60208082518301019101610519565b90601f8019910116810190811067ffffffffffffffff8211176102d957604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116102d957601f01601f191660200190565b602060031982011261009b5760043567ffffffffffffffff811161009b578160238201121561009b57806004013590610343826102ef565b9261035160405194856102b7565b8284526024838301011161009b5781600092602460209301838601378301015290565b919082604091031261009b576040516040810181811067ffffffffffffffff8211176102d9576040529182908035906001600160a01b038216820361009b57602091835201359060ff8216820361009b5760200152565b91909160c08184031261009b576040519060a0820182811067ffffffffffffffff8211176102d957604052909283919081356001600160a01b038116810361009b57835261041c8160208401610374565b6020840152606082013567ffffffffffffffff811161009b57820181601f8201121561009b57803567ffffffffffffffff81116102d9576040519261046760208360051b01856102b7565b81845260208085019260061b8401019281841161009b57602001915b8383106104a9575050505060809160a09160408501528281013560608501520135910152565b60206040916104b88486610374565b815201920191610483565b606060031982011261009b576004356001600160a01b038116810361009b57916024356001600160a01b038116810361009b57916044359067ffffffffffffffff821161009b57610516916004016103cb565b90565b919082604091031261009b576020825192015190565b51906001600160701b038216820361009b57565b9081606091031261009b576105578161052f565b9160406105666020840161052f565b92015163ffffffff8116810361009b5790565b9081602091031261009b57516001600160a01b038116810361009b5790565b8181029291811591840414171561026657565b9190820180921161026657565b81156105c2570490565b634e487b7160e01b600052601260045260246000fd5b604051630240bc6b60e21b81529291906001600160a01b038116606085600481845afa9485600091600097610796575b5061061d5750506106199350610805565b5090565b604051630dfe168160e01b815293949193925090602083600481875afa92831561022357600093610775575b5060405163d21220a760e01b815294602086600481885afa94851561022357600496600096610743575b50602090604051978880926318160ddd60e01b82525afa95861561022357600096610707575b506106f4856001600160701b036106ec6105169a6106e06106e66106fc996106e06106d98b6107029f9e9c9b6106d28a9d8f8390610805565b509a610805565b509a610dd8565b90610e51565b99610dd8565b961690610598565b931690610598565b906105ab565b6105b8565b9192949395506020823d60201161073b575b81610726602093836102b7565b8101031261009b579051949293919081610699565b3d9150610719565b602091965061076790823d841161076e575b61075f81836102b7565b810190610579565b9590610673565b503d610755565b61078f91935060203d60201161076e5761075f81836102b7565b9138610649565b9096506107bb915060603d6060116107c3575b6107b381836102b7565b810190610543565b509538610608565b503d6107a9565b80518210156107de5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b60ff16604d811161026657600a0a90565b929160405191610180830183811067ffffffffffffffff8211176102d9576040526000835260006020840152600060408401526000606084015260006080840152600060a0840152600060c0840152600060e084015261010083016000815261012084019060008252600061014086015260006101608601526044602060018060a01b0386511660405192838092637fb96f7960e11b82526000600483015260018060a01b03891660248301525afa90811561022357600091610d14575b5060e086018190526020850151516001600160a01b03908116919089168214610d065750610910906108f489610dd8565b602087810151015160ff16918a6001600160a01b038816610d46565b6020878101919091526080870191909152600060c0870152848101515160405163e6a4390560e01b81526001600160a01b038a81166004830152918216602482015291908290604490829088165afa90811561022357600091610ce7575b506001600160a01b0390811691829052602085810151516040516370a0823160e01b81526004810194909452909183916024918391165afa90811561022357600091610cb5575b50809152606083015110610c84575b60005b60408301518051821015610c1757816109df916107ca565b518051610a56906001600160a01b0316610a166109fb8a610dd8565b91602085019260ff845116918c60018060a01b038a16610d46565b60a08901526080880152825160405163e6a4390560e01b81526001600160a01b038b81166004830152909116602482015291602090839081906044820190565b03816001600160a01b0389165afa91821561022357600092610bf7575b5082516040516370a0823160e01b81526001600160a01b0393841660048201529260209184916024918391165afa91821561022357600092610bc3575b5060ff610ac591836101408a015251166107f4565b9081600a0291600a8304036102665711610ae3575b506001016109c7565b8351905160405163427d626760e11b81526001600160a01b0391821660048201529160209183916024918391165afa90811561022357600091610b91575b5061016085018190526001919015610b7b57610b5b670de0b6b3a7640000610b5360a088015161016089015190610598565b0486516105ab565b85525b610b70608086015160c08701516105ab565b60c086015290610ada565b610b8a60a086015186516105ab565b8552610b5e565b906020823d8211610bbb575b81610baa602093836102b7565b810103126102185750516001610b21565b3d9150610b9d565b90916020823d8211610bef575b81610bdd602093836102b7565b810103126102185750519060ff610ab0565b3d9150610bd0565b610c1091925060203d811161076e5761075f81836102b7565b9038610a73565b5050505090915060c081015115610c7b57610c3881516060830151906105ab565b90610c4981516060830151906105ab565b670de0b6b3a7640000810290808204670de0b6b3a764000014901517156102665760c0610c78920151906105b8565b91565b50600090600090565b670de0b6b3a7640000610ca0602085015160e086015190610598565b046060840152608083015160c08401526109c4565b906020823d602011610cdf575b81610ccf602093836102b7565b81010312610218575051386109b5565b3d9150610cc2565b610d00915060203d60201161076e5761075f81836102b7565b3861096e565b975060019695505050505050565b906020823d602011610d3e575b81610d2e602093836102b7565b81010312610218575051386108c3565b3d9150610d21565b60405163e6a4390560e01b81526001600160a01b038381166004830152848116602483015290959493929160209187916044918391165afa94851561022357600095610db7575b506001600160a01b03851615610daa57610da694610f38565b9091565b5050505050600090600090565b610dd191955060203d60201161076e5761075f81836102b7565b9338610d8d565b60405163313ce56760e01b815290602090829060049082906001600160a01b03165afa8091600091610e11575b50906105165750601290565b6020813d602011610e49575b81610e2a602093836102b7565b81010312610e4557519060ff82168203610218575038610e05565b5080fd5b3d9150610e1d565b9060ff1660128103610e61575090565b6012811115610e97576011190160ff8111610266576001600160701b039182610e8c610e93936107f4565b91166105b8565b1690565b60120360ff8111610266576001600160701b039182610eb8610e93936107f4565b9116610598565b3d15610eea573d90610ed0826102ef565b91610ede60405193846102b7565b82523d6000602084013e565b606090565b91909160208152825180602083015260005b818110610f22575060409293506000838284010152601f8019910116010190565b8060208092870101516040828601015201610f01565b9493929190946000806040516020810190630240bc6b60e21b825260048152610f626024826102b7565b5190845afa610f6f610ebf565b90156110fc576060610f959160405180938192637cfa7b9960e11b835260048301610eef565b0381305afa90816000916000936110d8575b5061108e57505090600080610fff936040516020810190639a20767b60e01b825260048152610fd76024826102b7565b51915afa506040610fe6610ebf565b815180948192631c4d118d60e01b835260048301610eef565b0381305afa9586600093600098611057575b506110255750505050509050600090600090565b9061102f9161110b565b1561104857610516929161104291611128565b93611128565b93610516929161104291611128565b90975061107d91935060403d604011611087575b61107581836102b7565b810190610519565b9290929638611011565b503d61106b565b92909661109b925061110b565b156110bf576110b861051693926001600160701b03809316611128565b9416611128565b936110b861051693926001600160701b03809316611128565b9092506110f4915060603d6060116107c3576107b381836102b7565b509138610fa7565b50505050509050600090600090565b6001600160a01b039182169116101561112357600190565b600090565b601260ff83161461116657670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561026657611160610516926107f4565b906105b8565b90509056fea264697066735822122018f55badccb97c7642eb15b54a4cf8dd9e6f343dedb4732046faabe8f8e2023f64736f6c634300081c0033

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c80631c4d118d1461029557806389dc4a0e1461027c578063cb9baae2146100c5578063ec88ea5a146100a05763f9f4f7321461005357600080fd5b3461009b5760606001600160701b0363ffffffff6100826100733661030b565b60208082518301019101610543565b9193908160405195168552166020840152166040820152f35b600080fd5b3461009b5760406100b96100b3366104c3565b91610805565b82519182526020820152f35b3461009b57604036600319011261009b576004356001600160a01b0381169081900361009b5760243567ffffffffffffffff811161009b5761010b9036906004016103cb565b906000808091604085019360208601925b8551805186101561022f5785610131916107ca565b51845180518251602092830151928401516101629360ff918216939116916001600160a01b03908116911687610d46565b8951925160405163427d626760e11b81526001600160a01b0391821660048201529294929360209185916024918391165afa928315610223576000936101ec575b506001936101d8939092909182156101e1576101cb6101d293670de0b6b3a764000092610598565b04906105ab565b946105ab565b9401939161011c565b906101d292506105ab565b90926020823d821161021b575b81610206602093836102b7565b810103126102185750519160016101a3565b80fd5b3d91506101f9565b6040513d6000823e3d90fd5b8382670de0b6b3a7640000810290808204670de0b6b3a764000014901517156102665760209161025e916105b8565b604051908152f35b634e487b7160e01b600052601160045260246000fd5b3461009b57602061025e61028f366104c3565b916105d8565b3461009b5760406100b96102a83661030b565b60208082518301019101610519565b90601f8019910116810190811067ffffffffffffffff8211176102d957604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116102d957601f01601f191660200190565b602060031982011261009b5760043567ffffffffffffffff811161009b578160238201121561009b57806004013590610343826102ef565b9261035160405194856102b7565b8284526024838301011161009b5781600092602460209301838601378301015290565b919082604091031261009b576040516040810181811067ffffffffffffffff8211176102d9576040529182908035906001600160a01b038216820361009b57602091835201359060ff8216820361009b5760200152565b91909160c08184031261009b576040519060a0820182811067ffffffffffffffff8211176102d957604052909283919081356001600160a01b038116810361009b57835261041c8160208401610374565b6020840152606082013567ffffffffffffffff811161009b57820181601f8201121561009b57803567ffffffffffffffff81116102d9576040519261046760208360051b01856102b7565b81845260208085019260061b8401019281841161009b57602001915b8383106104a9575050505060809160a09160408501528281013560608501520135910152565b60206040916104b88486610374565b815201920191610483565b606060031982011261009b576004356001600160a01b038116810361009b57916024356001600160a01b038116810361009b57916044359067ffffffffffffffff821161009b57610516916004016103cb565b90565b919082604091031261009b576020825192015190565b51906001600160701b038216820361009b57565b9081606091031261009b576105578161052f565b9160406105666020840161052f565b92015163ffffffff8116810361009b5790565b9081602091031261009b57516001600160a01b038116810361009b5790565b8181029291811591840414171561026657565b9190820180921161026657565b81156105c2570490565b634e487b7160e01b600052601260045260246000fd5b604051630240bc6b60e21b81529291906001600160a01b038116606085600481845afa9485600091600097610796575b5061061d5750506106199350610805565b5090565b604051630dfe168160e01b815293949193925090602083600481875afa92831561022357600093610775575b5060405163d21220a760e01b815294602086600481885afa94851561022357600496600096610743575b50602090604051978880926318160ddd60e01b82525afa95861561022357600096610707575b506106f4856001600160701b036106ec6105169a6106e06106e66106fc996106e06106d98b6107029f9e9c9b6106d28a9d8f8390610805565b509a610805565b509a610dd8565b90610e51565b99610dd8565b961690610598565b931690610598565b906105ab565b6105b8565b9192949395506020823d60201161073b575b81610726602093836102b7565b8101031261009b579051949293919081610699565b3d9150610719565b602091965061076790823d841161076e575b61075f81836102b7565b810190610579565b9590610673565b503d610755565b61078f91935060203d60201161076e5761075f81836102b7565b9138610649565b9096506107bb915060603d6060116107c3575b6107b381836102b7565b810190610543565b509538610608565b503d6107a9565b80518210156107de5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b60ff16604d811161026657600a0a90565b929160405191610180830183811067ffffffffffffffff8211176102d9576040526000835260006020840152600060408401526000606084015260006080840152600060a0840152600060c0840152600060e084015261010083016000815261012084019060008252600061014086015260006101608601526044602060018060a01b0386511660405192838092637fb96f7960e11b82526000600483015260018060a01b03891660248301525afa90811561022357600091610d14575b5060e086018190526020850151516001600160a01b03908116919089168214610d065750610910906108f489610dd8565b602087810151015160ff16918a6001600160a01b038816610d46565b6020878101919091526080870191909152600060c0870152848101515160405163e6a4390560e01b81526001600160a01b038a81166004830152918216602482015291908290604490829088165afa90811561022357600091610ce7575b506001600160a01b0390811691829052602085810151516040516370a0823160e01b81526004810194909452909183916024918391165afa90811561022357600091610cb5575b50809152606083015110610c84575b60005b60408301518051821015610c1757816109df916107ca565b518051610a56906001600160a01b0316610a166109fb8a610dd8565b91602085019260ff845116918c60018060a01b038a16610d46565b60a08901526080880152825160405163e6a4390560e01b81526001600160a01b038b81166004830152909116602482015291602090839081906044820190565b03816001600160a01b0389165afa91821561022357600092610bf7575b5082516040516370a0823160e01b81526001600160a01b0393841660048201529260209184916024918391165afa91821561022357600092610bc3575b5060ff610ac591836101408a015251166107f4565b9081600a0291600a8304036102665711610ae3575b506001016109c7565b8351905160405163427d626760e11b81526001600160a01b0391821660048201529160209183916024918391165afa90811561022357600091610b91575b5061016085018190526001919015610b7b57610b5b670de0b6b3a7640000610b5360a088015161016089015190610598565b0486516105ab565b85525b610b70608086015160c08701516105ab565b60c086015290610ada565b610b8a60a086015186516105ab565b8552610b5e565b906020823d8211610bbb575b81610baa602093836102b7565b810103126102185750516001610b21565b3d9150610b9d565b90916020823d8211610bef575b81610bdd602093836102b7565b810103126102185750519060ff610ab0565b3d9150610bd0565b610c1091925060203d811161076e5761075f81836102b7565b9038610a73565b5050505090915060c081015115610c7b57610c3881516060830151906105ab565b90610c4981516060830151906105ab565b670de0b6b3a7640000810290808204670de0b6b3a764000014901517156102665760c0610c78920151906105b8565b91565b50600090600090565b670de0b6b3a7640000610ca0602085015160e086015190610598565b046060840152608083015160c08401526109c4565b906020823d602011610cdf575b81610ccf602093836102b7565b81010312610218575051386109b5565b3d9150610cc2565b610d00915060203d60201161076e5761075f81836102b7565b3861096e565b975060019695505050505050565b906020823d602011610d3e575b81610d2e602093836102b7565b81010312610218575051386108c3565b3d9150610d21565b60405163e6a4390560e01b81526001600160a01b038381166004830152848116602483015290959493929160209187916044918391165afa94851561022357600095610db7575b506001600160a01b03851615610daa57610da694610f38565b9091565b5050505050600090600090565b610dd191955060203d60201161076e5761075f81836102b7565b9338610d8d565b60405163313ce56760e01b815290602090829060049082906001600160a01b03165afa8091600091610e11575b50906105165750601290565b6020813d602011610e49575b81610e2a602093836102b7565b81010312610e4557519060ff82168203610218575038610e05565b5080fd5b3d9150610e1d565b9060ff1660128103610e61575090565b6012811115610e97576011190160ff8111610266576001600160701b039182610e8c610e93936107f4565b91166105b8565b1690565b60120360ff8111610266576001600160701b039182610eb8610e93936107f4565b9116610598565b3d15610eea573d90610ed0826102ef565b91610ede60405193846102b7565b82523d6000602084013e565b606090565b91909160208152825180602083015260005b818110610f22575060409293506000838284010152601f8019910116010190565b8060208092870101516040828601015201610f01565b9493929190946000806040516020810190630240bc6b60e21b825260048152610f626024826102b7565b5190845afa610f6f610ebf565b90156110fc576060610f959160405180938192637cfa7b9960e11b835260048301610eef565b0381305afa90816000916000936110d8575b5061108e57505090600080610fff936040516020810190639a20767b60e01b825260048152610fd76024826102b7565b51915afa506040610fe6610ebf565b815180948192631c4d118d60e01b835260048301610eef565b0381305afa9586600093600098611057575b506110255750505050509050600090600090565b9061102f9161110b565b1561104857610516929161104291611128565b93611128565b93610516929161104291611128565b90975061107d91935060403d604011611087575b61107581836102b7565b810190610519565b9290929638611011565b503d61106b565b92909661109b925061110b565b156110bf576110b861051693926001600160701b03809316611128565b9416611128565b936110b861051693926001600160701b03809316611128565b9092506110f4915060603d6060116107c3576107b381836102b7565b509138610fa7565b50505050509050600090600090565b6001600160a01b039182169116101561112357600190565b600090565b601260ff83161461116657670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561026657611160610516926107f4565b906105b8565b90509056fea264697066735822122018f55badccb97c7642eb15b54a4cf8dd9e6f343dedb4732046faabe8f8e2023f64736f6c634300081c0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.