S Price: $0.519042 (+2.88%)

Contract

0xf12De1cD1CD5d9Ab414E850BDD300A42aE9AA48A

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PriceGetterSolidly

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 7 : PriceGetterSolidly.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.16;

import "../IPriceGetterProtocol.sol";
import "../../IPriceGetter.sol";
import "../../lib/UtilityLibrary.sol";
import "./interfaces/ISolidlyPair.sol";
import "./interfaces/ISolidlyFactory.sol";

contract PriceGetterSolidly is IPriceGetterProtocol {
    struct LocalVarsSolidlyPrice {
        uint256 usdStableTotal;
        uint256 wrappedNativeReserve;
        uint256 wrappedNativeTotal;
        uint256 tokenReserve;
        uint256 stableUsdReserve;
    }

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

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

        LocalVarsSolidlyPrice memory vars;

        (vars.tokenReserve, vars.wrappedNativeReserve) = _getNormalizedReservesFromFactorySolidly_Decimals(
            factorySolidly,
            token,
            params.wrappedNative.tokenAddress,
            UtilityLibrary._getTokenDecimals(token),
            params.wrappedNative.decimals
        );
        vars.wrappedNativeTotal = (vars.wrappedNativeReserve * nativePrice) / 1e18;
        uint256 tokenTotal = vars.tokenReserve;

        for (uint256 i = 0; i < params.stableUsdTokens.length; i++) {
            IPriceGetter.TokenAndDecimals memory stableUsdToken = params.stableUsdTokens[i];
            (vars.tokenReserve, vars.stableUsdReserve) = _getNormalizedReservesFromFactorySolidly_Decimals(
                factorySolidly,
                token,
                stableUsdToken.tokenAddress,
                UtilityLibrary._getTokenDecimals(token),
                stableUsdToken.decimals
            );
            uint256 stableUsdPrice = params.mainPriceGetter.getOraclePriceNormalized(stableUsdToken.tokenAddress);

            if (vars.stableUsdReserve > 10e18) {
                if (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 * stableUsdPrice) / 1e18;
                } else {
                    vars.usdStableTotal += vars.stableUsdReserve;
                }
                tokenTotal += vars.tokenReserve;
            }
        }

        if (tokenTotal == 0) {
            return 0;
        }
        price = ((vars.usdStableTotal + vars.wrappedNativeTotal) * 1e18) / 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 ISolidlyPair(lp).getReserves() returns (uint256 reserve0, uint256 reserve1, uint256) {
            address token0 = ISolidlyPair(lp).token0();
            address token1 = ISolidlyPair(lp).token1();
            uint256 totalSupply = ISolidlyPair(lp).totalSupply();

            // price0 * reserve0 + price1 * reserve1
            uint256 token0Price = getTokenPrice(token0, factory, params);
            uint256 token1Price = getTokenPrice(token1, factory, params);
            reserve0 = UtilityLibrary._normalizeToken(reserve0, token0);
            reserve1 = UtilityLibrary._normalizeToken(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) {
        ISolidlyFactory factorySolidly = ISolidlyFactory(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
            ) = _getNormalizedReservesFromFactorySolidly_Decimals(
                    factorySolidly,
                    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 factorySolidly 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 _getNormalizedReservesFromFactorySolidly_Decimals(
        ISolidlyFactory factorySolidly,
        address tokenA,
        address tokenB,
        uint8 decimalsA,
        uint8 decimalsB
    ) internal view returns (uint256 normalizedReserveA, uint256 normalizedReserveB) {
        /// @dev Defaulting to stable == false
        try factorySolidly.getPair(tokenA, tokenB, false) returns (address pairAddress) {
            if (pairAddress == address(0)) {
                return (0, 0);
            }
            return _getNormalizedReservesFromPair_Decimals(pairAddress, tokenA, tokenB, decimalsA, decimalsB);
        } catch {}
        try factorySolidly.getPool(tokenA, tokenB, false) returns (address pairAddress) {
            if (pairAddress == address(0)) {
                return (0, 0);
            }
            return _getNormalizedReservesFromPair_Decimals(pairAddress, tokenA, tokenB, decimalsA, decimalsB);
        } catch {}
        revert("No pair found");
    }

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

File 2 of 7 : IPriceGetterProtocol.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.16;

import "../IPriceGetter.sol";

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

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

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

File 3 of 7 : ISolidlyFactory.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.6.6;

interface ISolidlyFactory {
    function getPair(address tokenA, address tokenB, bool stable) external view returns (address pair);

    function getPool(address tokenA, address tokenB, bool stable) external view returns (address pair);
}

File 4 of 7 : ISolidlyPair.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.6.6;

interface ISolidlyPair {
    struct Observation {
        uint256 timestamp;
        uint256 reserve0Cumulative;
        uint256 reserve1Cumulative;
    }

    event Approval(address indexed owner, address indexed spender, uint256 amount);
    event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
    event Claim(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1);
    event Fees(address indexed sender, uint256 amount0, uint256 amount1);
    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint256 reserve0, uint256 reserve1);
    event Transfer(address indexed from, address indexed to, uint256 amount);

    function allowance(address, address) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function balanceOf(address) external view returns (uint256);

    function blockTimestampLast() external view returns (uint256);

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

    function claimFees() external returns (uint256 claimed0, uint256 claimed1);

    function current(address tokenIn, uint256 amountIn) external view returns (uint256 amountOut);

    function currentCumulativePrices()
        external
        view
        returns (uint256 reserve0Cumulative, uint256 reserve1Cumulative, uint256 blockTimestamp);

    function decimals() external view returns (uint8);

    function factoryAddress() external view returns (address _factory);

    function feeRatio() external view returns (uint256);

    function fees() external view returns (address);

    function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256);

    function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast);

    function governanceAddress() external view returns (address _governanceAddress);

    function initialize(address _token0, address _token1, bool _stable) external;

    function lastObservation() external view returns (Observation memory);

    function metadata()
        external
        view
        returns (
            uint256 dec0,
            uint256 dec1,
            uint256 r0,
            uint256 r1,
            bool st,
            address t0,
            address t1,
            uint256 _feeRatio
        );

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

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

    function nonces(address) external view returns (uint256);

    function observationLength() external view returns (uint256);

    function observations(
        uint256
    ) external view returns (uint256 timestamp, uint256 reserve0Cumulative, uint256 reserve1Cumulative);

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

    function prices(address tokenIn, uint256 amountIn, uint256 points) external view returns (uint256[] memory);

    function quote(address tokenIn, uint256 amountIn, uint256 granularity) external view returns (uint256 amountOut);

    function reserve0() external view returns (uint256);

    function reserve0CumulativeLast() external view returns (uint256);

    function reserve1() external view returns (uint256);

    function reserve1CumulativeLast() external view returns (uint256);

    function sample(
        address tokenIn,
        uint256 amountIn,
        uint256 points,
        uint256 window
    ) external view returns (uint256[] memory);

    function skim(address to) external;

    function stable() external view returns (bool);

    function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes memory data) external;

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

    function sync() external;

    function syncFees() external;

    function token0() external view returns (address);

    function token1() external view returns (address);

    function tokens() external view returns (address, address);

    function totalSupply() external view returns (uint256);

    function transfer(address dst, uint256 amount) external returns (bool);

    function transferFrom(address src, address dst, uint256 amount) external returns (bool);
}

File 5 of 7 : IPriceGetter.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.16;

interface IPriceGetter {
    enum Protocol {
        __,
        ___,
        UniV2,
        UniV3,
        Algebra,
        _Gamma, // outdated
        _Steer, // outdated
        Solidly,
        Xfai,
        Curve,
        AlgebraIntegral
    }

    enum Wrappers {
        Gamma,
        Ichi,
        Steer
    }

    struct TokenAndDecimals {
        address tokenAddress;
        uint8 decimals;
    }

    function getTokenPrice(address token, Protocol protocol, address factory) external view returns (uint256 price);
    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);
}

File 6 of 7 : UtilityLibrary.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.16;

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)));
        }
    }
}

File 7 of 7 : IERC20.sol
// 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
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

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":"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":"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":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getTokenPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061137a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80631c4d118d1461005c5780635a51a2a0146100895780639bbcae16146100aa578063e9876564146100bd578063f9f4f732146100d0575b600080fd5b61006f61006a366004610d41565b61010f565b604080519283526020830191909152015b60405180910390f35b61009c610097366004610f4d565b61012f565b604051908152602001610080565b61009c6100b8366004610f4d565b61034c565b61009c6100cb366004610faf565b610633565b6100e36100de366004610d41565b610796565b604080516001600160701b03948516815293909216602084015263ffffffff1690820152606001610080565b600080828060200190518101906101269190610fff565b91509150915091565b6000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa92505050801561018b575060408051601f3d908101601f1916820190925261018891810190611023565b60015b6101a557600061019c85858561034c565b91506103459050565b6000876001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102099190611051565b90506000886001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190611051565b90506000896001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d5919061106e565b905060006102e4848b8b61034c565b905060006102f3848c8c61034c565b90506102ff88866107bc565b975061030b87856107bc565b96506000610319888361109d565b6103238a8561109d565b61032d91906110bc565b905061033984826110cf565b99505050505050505050505b9392505050565b805160405160016246908760e11b03198152600091849183916001600160a01b03169063ff72def2906103869060079086906004016110f1565b602060405180830381865afa1580156103a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c7919061106e565b90508360200151600001516001600160a01b0316866001600160a01b0316036103f35791506103459050565b6104256040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b61044a838887602001516000015161043c8b6107d9565b896020015160200151610849565b602083018190526060830191909152670de0b6b3a76400009061046e90849061109d565b61047891906110cf565b6040820152606081015160005b8660400151518110156105e3576000876040015182815181106104aa576104aa61112b565b602002602001015190506104d1868b83600001516104c78e6107d9565b8560200151610849565b608086015260608501528751815160405163427d626760e11b81526001600160a01b03918216600482015260009291909116906384fac4ce90602401602060405180830381865afa15801561052a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054e919061106e565b9050678ac7230489e80000856080015111156105ce5780156105a457670de0b6b3a7640000818660800151610583919061109d565b61058d91906110cf565b8551869061059c9083906110bc565b9052506105bc565b6080850151855186906105b89083906110bc565b9052505b60608501516105cb90856110bc565b93505b505080806105db90611141565b915050610485565b50806000036105f9576000945050505050610345565b60408201518251829161060b916110bc565b61061d90670de0b6b3a764000061109d565b61062791906110cf565b98975050505050505050565b6000828180805b85604001515181101561076e5760008660400151828151811061065f5761065f61112b565b60200260200101519050600080610691878a602001516000015185600001518c60200151602001518760200151610849565b8a51855160405163427d626760e11b81526001600160a01b0391821660048201529395509193506000929116906384fac4ce90602401602060405180830381865afa1580156106e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610708919061106e565b9050801561073e57670de0b6b3a7640000610723828461109d565b61072d91906110cf565b61073790876110bc565b955061074b565b61074882876110bc565b95505b61075583886110bc565b965050505050808061076690611141565b91505061063a565b508161078282670de0b6b3a764000061109d565b61078c91906110cf565b9695505050505050565b6000806000838060200190518101906107af9190611171565b9250925092509193909250565b60006107d0836107cb846107d9565b6109cd565b90505b92915050565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610835575060408051601f3d908101601f19168201909252610832918101906111c1565b60015b61084157506012919050565b90505b919050565b6040516306801cc360e41b81526001600160a01b0385811660048301528481166024830152600060448301819052918291881690636801cc3090606401602060405180830381865afa9250505080156108bf575060408051601f3d908101601f191682019092526108bc91810190611051565b60015b156108f6576001600160a01b0381166108df5760008092509250506109c3565b6108ec8188888888610a08565b92509250506109c3565b6040516379bc57d560e01b81526001600160a01b0387811660048301528681166024830152600060448301528816906379bc57d590606401602060405180830381865afa925050508015610967575060408051601f3d908101601f1916820190925261096491810190611051565b60015b15610987576001600160a01b0381166108df5760008092509250506109c3565b60405162461bcd60e51b815260206004820152600d60248201526c139bc81c185a5c88199bdd5b99609a1b604482015260640160405180910390fd5b9550959350505050565b60008160ff166012036109e15750816107d3565b6109ec82600a6112c2565b6109fe84670de0b6b3a764000061109d565b6107d091906110cf565b60408051600481526024810182526020810180516001600160e01b0316630240bc6b60e21b17905290516000918291829182916001600160a01b038b1691610a4f916112f5565b600060405180830381855afa9150503d8060008114610a8a576040519150601f19603f3d011682016040523d82523d6000602084013e610a8f565b606091505b50915091508115610c9857604051637cfa7b9960e11b8152309063f9f4f73290610abd908490600401611311565b606060405180830381865afa925050508015610af6575060408051601f3d908101601f19168201909252610af391810190611171565b60015b610c2f5760408051600481526024810182526020810180516001600160e01b0316639a20767b60e01b17905290516001600160a01b038b1691610b38916112f5565b600060405180830381855afa9150503d8060008114610b73576040519150601f19603f3d011682016040523d82523d6000602084013e610b78565b606091505b50604051631c4d118d60e01b815291935091503090631c4d118d90610ba1908490600401611311565b6040805180830381865afa925050508015610bd9575060408051601f3d908101601f19168201909252610bd691810190610fff565b60015b610beb576000809350935050506109c3565b610bf58a8a610ca6565b15610c1b57610c0482896109cd565b610c0e82896109cd565b95509550505050506109c3565b610c2581896109cd565b610c0e83896109cd565b610c398b8b610ca6565b15610c7257610c51836001600160701b03168a6109cd565b610c64836001600160701b03168a6109cd565b9650965050505050506109c3565b610c85826001600160701b03168a6109cd565b610c64846001600160701b03168a6109cd565b6000809350935050506109c3565b6000816001600160a01b0316836001600160a01b031610610cc85760006107d0565b60019392505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715610d0a57610d0a610cd1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610d3957610d39610cd1565b604052919050565b60006020808385031215610d5457600080fd5b823567ffffffffffffffff80821115610d6c57600080fd5b818501915085601f830112610d8057600080fd5b813581811115610d9257610d92610cd1565b610da4601f8201601f19168501610d10565b91508082528684828501011115610dba57600080fd5b8084840185840137600090820190930192909252509392505050565b6001600160a01b0381168114610deb57600080fd5b50565b60ff81168114610deb57600080fd5b600060408284031215610e0f57600080fd5b6040516040810181811067ffffffffffffffff82111715610e3257610e32610cd1565b6040529050808235610e4381610dd6565b81526020830135610e5381610dee565b6020919091015292915050565b600060a08284031215610e7257600080fd5b610e7a610ce7565b90508135610e8781610dd6565b81526020610e9784848301610dfd565b81830152606083013567ffffffffffffffff80821115610eb657600080fd5b818501915085601f830112610eca57600080fd5b813581811115610edc57610edc610cd1565b610eea848260051b01610d10565b818152848101925060069190911b830184019087821115610f0a57600080fd5b928401925b81841015610f3357610f218885610dfd565b83528483019250604084019350610f0f565b604086015250505050608091909101356060820152919050565b600080600060608486031215610f6257600080fd5b8335610f6d81610dd6565b92506020840135610f7d81610dd6565b9150604084013567ffffffffffffffff811115610f9957600080fd5b610fa586828701610e60565b9150509250925092565b60008060408385031215610fc257600080fd5b8235610fcd81610dd6565b9150602083013567ffffffffffffffff811115610fe957600080fd5b610ff585828601610e60565b9150509250929050565b6000806040838503121561101257600080fd5b505080516020909101519092909150565b60008060006060848603121561103857600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561106357600080fd5b815161034581610dd6565b60006020828403121561108057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156110b7576110b7611087565b500290565b808201808211156107d3576107d3611087565b6000826110ec57634e487b7160e01b600052601260045260246000fd5b500490565b60408101600b841061111357634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b634e487b7160e01b600052603260045260246000fd5b60006001820161115357611153611087565b5060010190565b80516001600160701b038116811461084457600080fd5b60008060006060848603121561118657600080fd5b61118f8461115a565b925061119d6020850161115a565b9150604084015163ffffffff811681146111b657600080fd5b809150509250925092565b6000602082840312156111d357600080fd5b815161034581610dee565b600181815b808511156112195781600019048211156111ff576111ff611087565b8085161561120c57918102915b93841c93908002906111e3565b509250929050565b600082611230575060016107d3565b8161123d575060006107d3565b8160018114611253576002811461125d57611279565b60019150506107d3565b60ff84111561126e5761126e611087565b50506001821b6107d3565b5060208310610133831016604e8410600b841016171561129c575081810a6107d3565b6112a683836111de565b80600019048211156112ba576112ba611087565b029392505050565b60006107d060ff841683611221565b60005b838110156112ec5781810151838201526020016112d4565b50506000910152565b600082516113078184602087016112d1565b9190910192915050565b60208152600082518060208401526113308160408501602087016112d1565b601f01601f1916919091016040019291505056fea26469706673582212201d2a248af7d537a0872030ee52be6d1558b53dcafaf3b4c71da5e4f2c19ea4e664736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c80631c4d118d1461005c5780635a51a2a0146100895780639bbcae16146100aa578063e9876564146100bd578063f9f4f732146100d0575b600080fd5b61006f61006a366004610d41565b61010f565b604080519283526020830191909152015b60405180910390f35b61009c610097366004610f4d565b61012f565b604051908152602001610080565b61009c6100b8366004610f4d565b61034c565b61009c6100cb366004610faf565b610633565b6100e36100de366004610d41565b610796565b604080516001600160701b03948516815293909216602084015263ffffffff1690820152606001610080565b600080828060200190518101906101269190610fff565b91509150915091565b6000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa92505050801561018b575060408051601f3d908101601f1916820190925261018891810190611023565b60015b6101a557600061019c85858561034c565b91506103459050565b6000876001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102099190611051565b90506000886001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190611051565b90506000896001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d5919061106e565b905060006102e4848b8b61034c565b905060006102f3848c8c61034c565b90506102ff88866107bc565b975061030b87856107bc565b96506000610319888361109d565b6103238a8561109d565b61032d91906110bc565b905061033984826110cf565b99505050505050505050505b9392505050565b805160405160016246908760e11b03198152600091849183916001600160a01b03169063ff72def2906103869060079086906004016110f1565b602060405180830381865afa1580156103a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c7919061106e565b90508360200151600001516001600160a01b0316866001600160a01b0316036103f35791506103459050565b6104256040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b61044a838887602001516000015161043c8b6107d9565b896020015160200151610849565b602083018190526060830191909152670de0b6b3a76400009061046e90849061109d565b61047891906110cf565b6040820152606081015160005b8660400151518110156105e3576000876040015182815181106104aa576104aa61112b565b602002602001015190506104d1868b83600001516104c78e6107d9565b8560200151610849565b608086015260608501528751815160405163427d626760e11b81526001600160a01b03918216600482015260009291909116906384fac4ce90602401602060405180830381865afa15801561052a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054e919061106e565b9050678ac7230489e80000856080015111156105ce5780156105a457670de0b6b3a7640000818660800151610583919061109d565b61058d91906110cf565b8551869061059c9083906110bc565b9052506105bc565b6080850151855186906105b89083906110bc565b9052505b60608501516105cb90856110bc565b93505b505080806105db90611141565b915050610485565b50806000036105f9576000945050505050610345565b60408201518251829161060b916110bc565b61061d90670de0b6b3a764000061109d565b61062791906110cf565b98975050505050505050565b6000828180805b85604001515181101561076e5760008660400151828151811061065f5761065f61112b565b60200260200101519050600080610691878a602001516000015185600001518c60200151602001518760200151610849565b8a51855160405163427d626760e11b81526001600160a01b0391821660048201529395509193506000929116906384fac4ce90602401602060405180830381865afa1580156106e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610708919061106e565b9050801561073e57670de0b6b3a7640000610723828461109d565b61072d91906110cf565b61073790876110bc565b955061074b565b61074882876110bc565b95505b61075583886110bc565b965050505050808061076690611141565b91505061063a565b508161078282670de0b6b3a764000061109d565b61078c91906110cf565b9695505050505050565b6000806000838060200190518101906107af9190611171565b9250925092509193909250565b60006107d0836107cb846107d9565b6109cd565b90505b92915050565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610835575060408051601f3d908101601f19168201909252610832918101906111c1565b60015b61084157506012919050565b90505b919050565b6040516306801cc360e41b81526001600160a01b0385811660048301528481166024830152600060448301819052918291881690636801cc3090606401602060405180830381865afa9250505080156108bf575060408051601f3d908101601f191682019092526108bc91810190611051565b60015b156108f6576001600160a01b0381166108df5760008092509250506109c3565b6108ec8188888888610a08565b92509250506109c3565b6040516379bc57d560e01b81526001600160a01b0387811660048301528681166024830152600060448301528816906379bc57d590606401602060405180830381865afa925050508015610967575060408051601f3d908101601f1916820190925261096491810190611051565b60015b15610987576001600160a01b0381166108df5760008092509250506109c3565b60405162461bcd60e51b815260206004820152600d60248201526c139bc81c185a5c88199bdd5b99609a1b604482015260640160405180910390fd5b9550959350505050565b60008160ff166012036109e15750816107d3565b6109ec82600a6112c2565b6109fe84670de0b6b3a764000061109d565b6107d091906110cf565b60408051600481526024810182526020810180516001600160e01b0316630240bc6b60e21b17905290516000918291829182916001600160a01b038b1691610a4f916112f5565b600060405180830381855afa9150503d8060008114610a8a576040519150601f19603f3d011682016040523d82523d6000602084013e610a8f565b606091505b50915091508115610c9857604051637cfa7b9960e11b8152309063f9f4f73290610abd908490600401611311565b606060405180830381865afa925050508015610af6575060408051601f3d908101601f19168201909252610af391810190611171565b60015b610c2f5760408051600481526024810182526020810180516001600160e01b0316639a20767b60e01b17905290516001600160a01b038b1691610b38916112f5565b600060405180830381855afa9150503d8060008114610b73576040519150601f19603f3d011682016040523d82523d6000602084013e610b78565b606091505b50604051631c4d118d60e01b815291935091503090631c4d118d90610ba1908490600401611311565b6040805180830381865afa925050508015610bd9575060408051601f3d908101601f19168201909252610bd691810190610fff565b60015b610beb576000809350935050506109c3565b610bf58a8a610ca6565b15610c1b57610c0482896109cd565b610c0e82896109cd565b95509550505050506109c3565b610c2581896109cd565b610c0e83896109cd565b610c398b8b610ca6565b15610c7257610c51836001600160701b03168a6109cd565b610c64836001600160701b03168a6109cd565b9650965050505050506109c3565b610c85826001600160701b03168a6109cd565b610c64846001600160701b03168a6109cd565b6000809350935050506109c3565b6000816001600160a01b0316836001600160a01b031610610cc85760006107d0565b60019392505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715610d0a57610d0a610cd1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610d3957610d39610cd1565b604052919050565b60006020808385031215610d5457600080fd5b823567ffffffffffffffff80821115610d6c57600080fd5b818501915085601f830112610d8057600080fd5b813581811115610d9257610d92610cd1565b610da4601f8201601f19168501610d10565b91508082528684828501011115610dba57600080fd5b8084840185840137600090820190930192909252509392505050565b6001600160a01b0381168114610deb57600080fd5b50565b60ff81168114610deb57600080fd5b600060408284031215610e0f57600080fd5b6040516040810181811067ffffffffffffffff82111715610e3257610e32610cd1565b6040529050808235610e4381610dd6565b81526020830135610e5381610dee565b6020919091015292915050565b600060a08284031215610e7257600080fd5b610e7a610ce7565b90508135610e8781610dd6565b81526020610e9784848301610dfd565b81830152606083013567ffffffffffffffff80821115610eb657600080fd5b818501915085601f830112610eca57600080fd5b813581811115610edc57610edc610cd1565b610eea848260051b01610d10565b818152848101925060069190911b830184019087821115610f0a57600080fd5b928401925b81841015610f3357610f218885610dfd565b83528483019250604084019350610f0f565b604086015250505050608091909101356060820152919050565b600080600060608486031215610f6257600080fd5b8335610f6d81610dd6565b92506020840135610f7d81610dd6565b9150604084013567ffffffffffffffff811115610f9957600080fd5b610fa586828701610e60565b9150509250925092565b60008060408385031215610fc257600080fd5b8235610fcd81610dd6565b9150602083013567ffffffffffffffff811115610fe957600080fd5b610ff585828601610e60565b9150509250929050565b6000806040838503121561101257600080fd5b505080516020909101519092909150565b60008060006060848603121561103857600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561106357600080fd5b815161034581610dd6565b60006020828403121561108057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156110b7576110b7611087565b500290565b808201808211156107d3576107d3611087565b6000826110ec57634e487b7160e01b600052601260045260246000fd5b500490565b60408101600b841061111357634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b634e487b7160e01b600052603260045260246000fd5b60006001820161115357611153611087565b5060010190565b80516001600160701b038116811461084457600080fd5b60008060006060848603121561118657600080fd5b61118f8461115a565b925061119d6020850161115a565b9150604084015163ffffffff811681146111b657600080fd5b809150509250925092565b6000602082840312156111d357600080fd5b815161034581610dee565b600181815b808511156112195781600019048211156111ff576111ff611087565b8085161561120c57918102915b93841c93908002906111e3565b509250929050565b600082611230575060016107d3565b8161123d575060006107d3565b8160018114611253576002811461125d57611279565b60019150506107d3565b60ff84111561126e5761126e611087565b50506001821b6107d3565b5060208310610133831016604e8410600b841016171561129c575081810a6107d3565b6112a683836111de565b80600019048211156112ba576112ba611087565b029392505050565b60006107d060ff841683611221565b60005b838110156112ec5781810151838201526020016112d4565b50506000910152565b600082516113078184602087016112d1565b9190910192915050565b60208152600082518060208401526113308160408501602087016112d1565b601f01601f1916919091016040019291505056fea26469706673582212201d2a248af7d537a0872030ee52be6d1558b53dcafaf3b4c71da5e4f2c19ea4e664736f6c63430008100033

Block Transaction 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

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.