ETH Price: $2,254.34 (+7.00%)

Contract

0xad37FE3dDedF8cdEE1022Da1b17412CFB6495596
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
213621032024-12-09 2:58:1182 days ago1733713091
0xad37FE3d...FB6495596
0 ETH
213621032024-12-09 2:58:1182 days ago1733713091
0xad37FE3d...FB6495596
0 ETH
213621032024-12-09 2:58:1182 days ago1733713091
0xad37FE3d...FB6495596
0 ETH
213621032024-12-09 2:58:1182 days ago1733713091
0xad37FE3d...FB6495596
0 ETH
213577842024-12-08 12:30:4782 days ago1733661047
0xad37FE3d...FB6495596
0 ETH
213577842024-12-08 12:30:4782 days ago1733661047
0xad37FE3d...FB6495596
0 ETH
213577842024-12-08 12:30:4782 days ago1733661047
0xad37FE3d...FB6495596
0 ETH
213577842024-12-08 12:30:4782 days ago1733661047
0xad37FE3d...FB6495596
0 ETH
213513092024-12-07 14:48:2383 days ago1733582903
0xad37FE3d...FB6495596
0 ETH
213513092024-12-07 14:48:2383 days ago1733582903
0xad37FE3d...FB6495596
0 ETH
213513092024-12-07 14:48:2383 days ago1733582903
0xad37FE3d...FB6495596
0 ETH
213513092024-12-07 14:48:2383 days ago1733582903
0xad37FE3d...FB6495596
0 ETH
213297482024-12-04 14:31:5986 days ago1733322719
0xad37FE3d...FB6495596
0 ETH
213297482024-12-04 14:31:5986 days ago1733322719
0xad37FE3d...FB6495596
0 ETH
213297482024-12-04 14:31:5986 days ago1733322719
0xad37FE3d...FB6495596
0 ETH
213297482024-12-04 14:31:5986 days ago1733322719
0xad37FE3d...FB6495596
0 ETH
213173982024-12-02 21:06:2388 days ago1733173583
0xad37FE3d...FB6495596
0 ETH
213173982024-12-02 21:06:2388 days ago1733173583
0xad37FE3d...FB6495596
0 ETH
213173982024-12-02 21:06:2388 days ago1733173583
0xad37FE3d...FB6495596
0 ETH
213173982024-12-02 21:06:2388 days ago1733173583
0xad37FE3d...FB6495596
0 ETH
213162022024-12-02 17:05:4788 days ago1733159147
0xad37FE3d...FB6495596
0 ETH
213162022024-12-02 17:05:4788 days ago1733159147
0xad37FE3d...FB6495596
0 ETH
213162022024-12-02 17:05:4788 days ago1733159147
0xad37FE3d...FB6495596
0 ETH
213162022024-12-02 17:05:4788 days ago1733159147
0xad37FE3d...FB6495596
0 ETH
213150952024-12-02 13:23:1188 days ago1733145791
0xad37FE3d...FB6495596
0 ETH
View All Internal Transactions
Loading...
Loading

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

Contract Name:
BalancerWeightedPoolPriceOracle

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 100000 runs

Other Settings:
paris EvmVersion
File 1 of 11 : BalancerWeightedPoolPriceOracle.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;

import {IConditionalOrder} from "lib/composable-cow/src/BaseConditionalOrder.sol";
import {IERC20} from "lib/composable-cow/lib/@openzeppelin/contracts/interfaces/IERC20.sol";
import {Math} from "lib/composable-cow/lib/@openzeppelin/contracts/utils/math/Math.sol";

import {IVault, IWeightedPool} from "../interfaces/IBalancer.sol";
import {IPriceOracle} from "../interfaces/IPriceOracle.sol";

/**
 * @title CoW AMM Balancer Weighted Price Oracle
 * @author CoW Protocol Developers
 * @dev This contract creates an oracle that is compatible with the IPriceOracle
 * interface and can be used by a CoW AMM to determine the current price of the
 * traded tokens on specific Balancer weighted pools.
 * No other Balancer pool type is supported.
 */
contract BalancerWeightedPoolPriceOracle is IPriceOracle {
    /**
     * Address of the Balancer vault.
     */
    IVault public vault;

    /**
     * Data required by the oracle to determine the current price.
     */
    struct Data {
        /**
         * The Balancer poolId that references an instance of a weighted pool.
         * Note that the contract doesn't verify that the pool is indeed a
         * weighted pool. If the id refers to another type of pool, then the
         * oracle may return an incorrect price.
         */
        bytes32 poolId;
    }

    /**
     * How many significant bits should be preserved from truncation.
     */
    uint256 public constant TOLERANCE = 14;

    /**
     * @param vault_ The address of the Balancer vault in the current chain.
     */
    constructor(IVault vault_) {
        vault = vault_;
    }

    /**
     * @inheritdoc IPriceOracle
     */
    function getPrice(address token0, address token1, bytes calldata data) external view returns (uint256, uint256) {
        IWeightedPool pool;
        IERC20[] memory tokens;
        uint256[] memory balances;
        uint256[] memory weights;
        {
            // Note: function calls in this scope aren't affected by the paused
            // state
            bytes32 poolId = abi.decode(data, (Data)).poolId;
            // If the pool isn't registered, then the next call reverts
            try vault.getPool(poolId) returns (address a, IVault.PoolSpecialization) {
                pool = IWeightedPool(a);
            } catch (bytes memory) {
                revert IConditionalOrder.OrderNotValid("invalid pool id");
            }

            (tokens, balances,) = vault.getPoolTokens(poolId);

            // Unfortunately, this function is available also for pools that
            // aren't weighted pools
            try pool.getNormalizedWeights() returns (uint256[] memory weights_) {
                weights = weights_;
            } catch (bytes memory) {
                revert IConditionalOrder.OrderNotValid("not a weighted pool");
            }
        }

        uint256 weightToken0 = 0;
        uint256 weightToken1 = 0;
        uint256 balanceToken0;
        uint256 balanceToken1;
        for (uint256 i; i < tokens.length;) {
            address token;
            unchecked {
                token = address(tokens[i]);
            }
            if (token == token0) {
                weightToken0 = weights[i];
                balanceToken0 = balances[i];
            } else if (token == token1) {
                weightToken1 = weights[i];
                balanceToken1 = balances[i];
            }
            unchecked {
                i++;
            }
        }

        if (weightToken0 == 0) {
            revert IConditionalOrder.OrderNotValid("pool does not trade token0");
        }
        if (weightToken1 == 0) {
            revert IConditionalOrder.OrderNotValid("pool does not trade token1");
        }

        // https://docs.balancer.fi/reference/math/weighted-math.html#spot-price
        uint256 priceNumerator = balanceToken0 * weightToken1;
        uint256 priceDenominator = balanceToken1 * weightToken0;

        // Numerator and denominator are very likely to be large. We limit the
        // bit size of the output as recommended in the IPriceOracle interface
        // so that this price oracle doesn't cause unexpected overflow reverts
        // when used by `getTradeableOrder`.
        return reduceOutputBytes(priceNumerator, priceDenominator);
    }

    /**
     * @dev The two input values are truncated off their least significant bits
     * by the same number of bits while trying to make them fit 128 bits.
     * The number of bits that is truncated is always the same for both values.
     * If truncating meant that less significant bits than `TOLERANCE` remained,
     * then this function truncates less to preserve `TOLERANCE` bits in the
     * smallest value, even if one of the output values ends up having more than
     * 128 bits of size.
     * @param num1 First input value.
     * @param num2 Second input value.
     * @return The two original input values in the original order with some of
     * the least significant bits truncated.
     */
    function reduceOutputBytes(uint256 num1, uint256 num2) internal pure returns (uint256, uint256) {
        uint256 max;
        uint256 min;
        if (num1 > num2) {
            (max, min) = (num1, num2);
        } else {
            (max, min) = (num2, num1);
        }
        uint256 logMax = Math.log2(max, Math.Rounding.Up);
        uint256 logMin = Math.log2(min, Math.Rounding.Down);

        if ((logMax <= 128) || (logMin <= TOLERANCE)) {
            return (num1, num2);
        }
        uint256 shift;
        unchecked {
            shift = logMax - 128;
            if (logMin < TOLERANCE + shift) {
                shift = logMin - TOLERANCE;
            }
        }
        return (num1 >> shift, num2 >> shift);
    }
}

File 2 of 11 : BaseConditionalOrder.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

import {GPv2Order} from "cowprotocol/libraries/GPv2Order.sol";

import "./interfaces/IConditionalOrder.sol";

// --- error strings
/// @dev This error is returned by the `verify` function if the *generated* order hash does not match
///      the hash passed as a parameter.
string constant INVALID_HASH = "invalid hash";

/**
 * @title Base logic for conditional orders.
 * @dev Enforces the order verification logic for conditional orders, allowing developers
 *      to focus on the logic for generating the tradeable order.
 * @author mfw78 <[email protected]>
 */
abstract contract BaseConditionalOrder is IConditionalOrderGenerator {
    /**
     * @inheritdoc IConditionalOrder
     * @dev As an order generator, the `GPv2Order.Data` passed as a parameter is ignored / not validated.
     */
    function verify(
        address owner,
        address sender,
        bytes32 _hash,
        bytes32 domainSeparator,
        bytes32 ctx,
        bytes calldata staticInput,
        bytes calldata offchainInput,
        GPv2Order.Data calldata
    ) external view override {
        GPv2Order.Data memory generatedOrder = getTradeableOrder(owner, sender, ctx, staticInput, offchainInput);

        /// @dev Verify that the *generated* order is valid and matches the payload.
        if (!(_hash == GPv2Order.hash(generatedOrder, domainSeparator))) {
            revert IConditionalOrder.OrderNotValid(INVALID_HASH);
        }
    }

    /**
     * @dev Set the visibility of this function to `public` to allow `verify` to call it.
     * @inheritdoc IConditionalOrderGenerator
     */
    function getTradeableOrder(
        address owner,
        address sender,
        bytes32 ctx,
        bytes calldata staticInput,
        bytes calldata offchainInput
    ) public view virtual override returns (GPv2Order.Data memory);

    /**
     * @inheritdoc IERC165
     */
    function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {
        return interfaceId == type(IConditionalOrderGenerator).interfaceId || interfaceId == type(IERC165).interfaceId;
    }
}

File 3 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 4 of 11 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

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

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

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

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

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

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

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

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 11 : IBalancer.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;

import {IERC20} from "lib/composable-cow/lib/@openzeppelin/contracts/interfaces/IERC20.sol";

/**
 * @title Balancer Vault Interface
 * @author CoW Protocol Developers
 * @dev This is an abridged version of the Balancer Vault interface that can be found at:
 * <https://github.com/balancer/balancer-v2-monorepo/blob/ac63d64018c6331248c7d77b9f317a06cced0243/pkg/interfaces/contracts/vault/IVault.sol>
 * All code is copied from that link except:
 *  - Autoformatting.
 *  - Import path of `IERC20`.
 */
interface IVault {
    // Pools
    //
    // There are three specialization settings for Pools, which allow for cheaper swaps at the cost of reduced
    // functionality:
    //
    //  - General: no specialization, suited for all Pools. IGeneralPool is used for swap request callbacks, passing the
    // balance of all tokens in the Pool. These Pools have the largest swap costs (because of the extra storage reads),
    // which increase with the number of registered tokens.
    //
    //  - Minimal Swap Info: IMinimalSwapInfoPool is used instead of IGeneralPool, which saves gas by only passing the
    // balance of the two tokens involved in the swap. This is suitable for some pricing algorithms, like the weighted
    // constant product one popularized by Balancer V1. Swap costs are smaller compared to general Pools, and are
    // independent of the number of registered tokens.
    //
    //  - Two Token: only allows two tokens to be registered. This achieves the lowest possible swap gas cost. Like
    // minimal swap info Pools, these are called via IMinimalSwapInfoPool.

    enum PoolSpecialization {
        GENERAL,
        MINIMAL_SWAP_INFO,
        TWO_TOKEN
    }

    /**
     * @dev Returns a Pool's contract address and specialization setting.
     */
    function getPool(bytes32 poolId) external view returns (address, PoolSpecialization);

    /**
     * @dev Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of
     * the tokens' `balances` changed.
     *
     * The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all
     * Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order.
     *
     * If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same
     * order as passed to `registerTokens`.
     *
     * Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are
     * the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo`
     * instead.
     */
    function getPoolTokens(bytes32 poolId)
        external
        view
        returns (IERC20[] memory tokens, uint256[] memory balances, uint256 lastChangeBlock);
}

/**
 * @title Balancer Weighted Pool Interface
 * @author CoW Protocol Developers
 * @dev This is an interface for the Balancer weighted pool type. It can be
 * found at:
 * <https://github.com/balancer/balancer-v2-monorepo/blob/ac63d64018c6331248c7d77b9f317a06cced0243/pkg/pool-weighted/contracts/BaseWeightedPool.sol#L99-L101>
 * The comment has been added for clarification.
 */
interface IWeightedPool {
    /**
     * @notice Returns all normalized weights, in the same order as the Pool's tokens.
     */
    function getNormalizedWeights() external view returns (uint256[] memory);
}

File 6 of 11 : IPriceOracle.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;

/**
 * @title CoW AMM Price Oracle Interface
 * @author CoW Protocol Developers
 * @dev A contract that can be used by the CoW AMM as as a price oracle.
 * The price source depends on the actual implementation; it could rely for
 * example on Uniswap, Balancer, Chainlink...
 */
interface IPriceOracle {
    /**
     * @dev Calling this function returns the price of token1 in terms of token0
     * as a fraction (numerator, denominator).
     * For example, in a pool where token0 is DAI, token1 is ETH, and ETH is
     * worth 2000 DAI, valid output tuples would be (2000, 1), (20000, 10), ...
     * @dev To keep the risk of multiplication overflow to a minimum, we
     * recommend to use return values that fit the size of a uint128.
     * @param token0 The first token, whose price is determined based on the
     * second token.
     * @param token1 The second token; the price of the first token is
     * determined relative to this token.
     * @param data Any additional data that may be required by the specific
     * oracle implementation. For example, it could be a specific pool id for
     * balancer, or the address of a specific price feed for Chainlink.
     * We recommend this data be implemented as the abi-encoding of a dedicated
     * data struct for ease of type-checking and decoding the input.
     * @return priceNumerator The numerator of the price, expressed in amount of
     * token1 per amount of token0.
     * @return priceDenominator The denominator of the price, expressed in
     * amount of token1 per amount of token0.
     */
    function getPrice(address token0, address token1, bytes calldata data)
        external
        view
        returns (uint256 priceNumerator, uint256 priceDenominator);
}

File 7 of 11 : GPv2Order.sol
// SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/interfaces/IERC20.sol";

/// @title Gnosis Protocol v2 Order Library
/// @author Gnosis Developers
library GPv2Order {
    /// @dev The complete data for a Gnosis Protocol order. This struct contains
    /// all order parameters that are signed for submitting to GP.
    struct Data {
        IERC20 sellToken;
        IERC20 buyToken;
        address receiver;
        uint256 sellAmount;
        uint256 buyAmount;
        uint32 validTo;
        bytes32 appData;
        uint256 feeAmount;
        bytes32 kind;
        bool partiallyFillable;
        bytes32 sellTokenBalance;
        bytes32 buyTokenBalance;
    }

    /// @dev The order EIP-712 type hash for the [`GPv2Order.Data`] struct.
    ///
    /// This value is pre-computed from the following expression:
    /// ```
    /// keccak256(
    ///     "Order(" +
    ///         "address sellToken," +
    ///         "address buyToken," +
    ///         "address receiver," +
    ///         "uint256 sellAmount," +
    ///         "uint256 buyAmount," +
    ///         "uint32 validTo," +
    ///         "bytes32 appData," +
    ///         "uint256 feeAmount," +
    ///         "string kind," +
    ///         "bool partiallyFillable," +
    ///         "string sellTokenBalance," +
    ///         "string buyTokenBalance" +
    ///     ")"
    /// )
    /// ```
    bytes32 internal constant TYPE_HASH =
        hex"d5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e489";

    /// @dev The marker value for a sell order for computing the order struct
    /// hash. This allows the EIP-712 compatible wallets to display a
    /// descriptive string for the order kind (instead of 0 or 1).
    ///
    /// This value is pre-computed from the following expression:
    /// ```
    /// keccak256("sell")
    /// ```
    bytes32 internal constant KIND_SELL =
        hex"f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775";

    /// @dev The OrderKind marker value for a buy order for computing the order
    /// struct hash.
    ///
    /// This value is pre-computed from the following expression:
    /// ```
    /// keccak256("buy")
    /// ```
    bytes32 internal constant KIND_BUY =
        hex"6ed88e868af0a1983e3886d5f3e95a2fafbd6c3450bc229e27342283dc429ccc";

    /// @dev The TokenBalance marker value for using direct ERC20 balances for
    /// computing the order struct hash.
    ///
    /// This value is pre-computed from the following expression:
    /// ```
    /// keccak256("erc20")
    /// ```
    bytes32 internal constant BALANCE_ERC20 =
        hex"5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9";

    /// @dev The TokenBalance marker value for using Balancer Vault external
    /// balances (in order to re-use Vault ERC20 approvals) for computing the
    /// order struct hash.
    ///
    /// This value is pre-computed from the following expression:
    /// ```
    /// keccak256("external")
    /// ```
    bytes32 internal constant BALANCE_EXTERNAL =
        hex"abee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea0632";

    /// @dev The TokenBalance marker value for using Balancer Vault internal
    /// balances for computing the order struct hash.
    ///
    /// This value is pre-computed from the following expression:
    /// ```
    /// keccak256("internal")
    /// ```
    bytes32 internal constant BALANCE_INTERNAL =
        hex"4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce";

    /// @dev Marker address used to indicate that the receiver of the trade
    /// proceeds should the owner of the order.
    ///
    /// This is chosen to be `address(0)` for gas efficiency as it is expected
    /// to be the most common case.
    address internal constant RECEIVER_SAME_AS_OWNER = address(0);

    /// @dev The byte length of an order unique identifier.
    uint256 internal constant UID_LENGTH = 56;

    /// @dev Returns the actual receiver for an order. This function checks
    /// whether or not the [`receiver`] field uses the marker value to indicate
    /// it is the same as the order owner.
    ///
    /// @return receiver The actual receiver of trade proceeds.
    function actualReceiver(Data memory order, address owner)
        internal
        pure
        returns (address receiver)
    {
        if (order.receiver == RECEIVER_SAME_AS_OWNER) {
            receiver = owner;
        } else {
            receiver = order.receiver;
        }
    }

    /// @dev Return the EIP-712 signing hash for the specified order.
    ///
    /// @param order The order to compute the EIP-712 signing hash for.
    /// @param domainSeparator The EIP-712 domain separator to use.
    /// @return orderDigest The 32 byte EIP-712 struct hash.
    function hash(Data memory order, bytes32 domainSeparator)
        internal
        pure
        returns (bytes32 orderDigest)
    {
        bytes32 structHash;

        // NOTE: Compute the EIP-712 order struct hash in place. As suggested
        // in the EIP proposal, noting that the order struct has 12 fields, and
        // prefixing the type hash `(1 + 12) * 32 = 416` bytes to hash.
        // <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#rationale-for-encodedata>
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let dataStart := sub(order, 32)
            let temp := mload(dataStart)
            mstore(dataStart, TYPE_HASH)
            structHash := keccak256(dataStart, 416)
            mstore(dataStart, temp)
        }

        // NOTE: Now that we have the struct hash, compute the EIP-712 signing
        // hash using scratch memory past the free memory pointer. The signing
        // hash is computed from `"\x19\x01" || domainSeparator || structHash`.
        // <https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory>
        // <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification>
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let freeMemoryPointer := mload(0x40)
            mstore(freeMemoryPointer, "\x19\x01")
            mstore(add(freeMemoryPointer, 2), domainSeparator)
            mstore(add(freeMemoryPointer, 34), structHash)
            orderDigest := keccak256(freeMemoryPointer, 66)
        }
    }

    /// @dev Packs order UID parameters into the specified memory location. The
    /// result is equivalent to `abi.encodePacked(...)` with the difference that
    /// it allows re-using the memory for packing the order UID.
    ///
    /// This function reverts if the order UID buffer is not the correct size.
    ///
    /// @param orderUid The buffer pack the order UID parameters into.
    /// @param orderDigest The EIP-712 struct digest derived from the order
    /// parameters.
    /// @param owner The address of the user who owns this order.
    /// @param validTo The epoch time at which the order will stop being valid.
    function packOrderUidParams(
        bytes memory orderUid,
        bytes32 orderDigest,
        address owner,
        uint32 validTo
    ) internal pure {
        require(orderUid.length == UID_LENGTH, "GPv2: uid buffer overflow");

        // NOTE: Write the order UID to the allocated memory buffer. The order
        // parameters are written to memory in **reverse order** as memory
        // operations write 32-bytes at a time and we want to use a packed
        // encoding. This means, for example, that after writing the value of
        // `owner` to bytes `20:52`, writing the `orderDigest` to bytes `0:32`
        // will **overwrite** bytes `20:32`. This is desirable as addresses are
        // only 20 bytes and `20:32` should be `0`s:
        //
        //        |           1111111111222222222233333333334444444444555555
        //   byte | 01234567890123456789012345678901234567890123456789012345
        // -------+---------------------------------------------------------
        //  field | [.........orderDigest..........][......owner.......][vT]
        // -------+---------------------------------------------------------
        // mstore |                         [000000000000000000000000000.vT]
        //        |                     [00000000000.......owner.......]
        //        | [.........orderDigest..........]
        //
        // Additionally, since Solidity `bytes memory` are length prefixed,
        // 32 needs to be added to all the offsets.
        //
        // solhint-disable-next-line no-inline-assembly
        assembly {
            mstore(add(orderUid, 56), validTo)
            mstore(add(orderUid, 52), owner)
            mstore(add(orderUid, 32), orderDigest)
        }
    }

    /// @dev Extracts specific order information from the standardized unique
    /// order id of the protocol.
    ///
    /// @param orderUid The unique identifier used to represent an order in
    /// the protocol. This uid is the packed concatenation of the order digest,
    /// the validTo order parameter and the address of the user who created the
    /// order. It is used by the user to interface with the contract directly,
    /// and not by calls that are triggered by the solvers.
    /// @return orderDigest The EIP-712 signing digest derived from the order
    /// parameters.
    /// @return owner The address of the user who owns this order.
    /// @return validTo The epoch time at which the order will stop being valid.
    function extractOrderUidParams(bytes calldata orderUid)
        internal
        pure
        returns (
            bytes32 orderDigest,
            address owner,
            uint32 validTo
        )
    {
        require(orderUid.length == UID_LENGTH, "GPv2: invalid uid");

        // Use assembly to efficiently decode packed calldata.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            orderDigest := calldataload(orderUid.offset)
            owner := shr(96, calldataload(add(orderUid.offset, 32)))
            validTo := shr(224, calldataload(add(orderUid.offset, 52)))
        }
    }
}

File 8 of 11 : IConditionalOrder.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;

import {GPv2Order} from "cowprotocol/libraries/GPv2Order.sol";
import {GPv2Interaction} from "cowprotocol/libraries/GPv2Interaction.sol";
import {IERC165} from "safe/interfaces/IERC165.sol";

/**
 * @title Conditional Order Interface
 * @author CoW Protocol Developers + mfw78 <[email protected]>
 */
interface IConditionalOrder {
    /// @dev This error is returned by the `getTradeableOrder` function if the order condition is not met.
    ///      A parameter of `string` type is included to allow the caller to specify the reason for the failure.
    error OrderNotValid(string);

    /**
     * @dev This struct is used to uniquely identify a conditional order for an owner.
     *      H(handler || salt || staticInput) **MUST** be unique for an owner.
     */
    struct ConditionalOrderParams {
        IConditionalOrder handler;
        bytes32 salt;
        bytes staticInput;
    }

    /**
     * Verify if a given discrete order is valid.
     * @dev Used in combination with `isValidSafeSignature` to verify that the order is signed by the Safe.
     *      **MUST** revert if the order condition is not met.
     * @dev The `order` parameter is ignored / not validated by the `IConditionalOrderGenerator` implementation.
     *      This parameter is included to allow more granular control over the order verification logic, and to
     *      allow a watch tower / user to propose a discrete order without it being generated by on-chain logic.
     * @param owner the contract who is the owner of the order
     * @param sender the `msg.sender` of the transaction
     * @param _hash the hash of the order
     * @param domainSeparator the domain separator used to sign the order
     * @param ctx the context key of the order (bytes32(0) if a merkle tree is used, otherwise H(params)) with which to lookup the cabinet
     * @param staticInput the static input for all discrete orders cut from this conditional order
     * @param offchainInput dynamic off-chain input for a discrete order cut from this conditional order
     * @param order `GPv2Order.Data` of a discrete order to be verified (if *not* an `IConditionalOrderGenerator`).
     */
    function verify(
        address owner,
        address sender,
        bytes32 _hash,
        bytes32 domainSeparator,
        bytes32 ctx,
        bytes calldata staticInput,
        bytes calldata offchainInput,
        GPv2Order.Data calldata order
    ) external view;
}

/**
 * @title Conditional Order Generator Interface
 * @author mfw78 <[email protected]>
 */
interface IConditionalOrderGenerator is IConditionalOrder, IERC165 {
    /**
     * @dev This event is emitted when a new conditional order is created.
     * @param owner the address that has created the conditional order
     * @param params the address / salt / data of the conditional order
     */
    event ConditionalOrderCreated(address indexed owner, IConditionalOrder.ConditionalOrderParams params);

    /**
     * @dev Get a tradeable order that can be posted to the CoW Protocol API and would pass signature validation.
     *      **MUST** revert if the order condition is not met.
     * @param owner the contract who is the owner of the order
     * @param sender the `msg.sender` of the parent `isValidSignature` call
     * @param ctx the context of the order (bytes32(0) if merkle tree is used, otherwise the H(params))
     * @param staticInput the static input for all discrete orders cut from this conditional order
     * @param offchainInput dynamic off-chain input for a discrete order cut from this conditional order
     * @return the tradeable order for submission to the CoW Protocol API
     */
    function getTradeableOrder(
        address owner,
        address sender,
        bytes32 ctx,
        bytes calldata staticInput,
        bytes calldata offchainInput
    ) external view returns (GPv2Order.Data memory);
}

File 9 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 10 of 11 : GPv2Interaction.sol
// SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity >=0.8.0 <0.9.0;

/// @title Gnosis Protocol v2 Interaction Library
/// @author Gnosis Developers
library GPv2Interaction {
    /// @dev Interaction data for performing arbitrary contract interactions.
    /// Submitted to [`GPv2Settlement.settle`] for code execution.
    struct Data {
        address target;
        uint256 value;
        bytes callData;
    }

    /// @dev Execute an arbitrary contract interaction.
    ///
    /// @param interaction Interaction data.
    function execute(Data calldata interaction) internal {
        address target = interaction.target;
        uint256 value = interaction.value;
        bytes calldata callData = interaction.callData;

        // NOTE: Use assembly to call the interaction instead of a low level
        // call for two reasons:
        // - We don't want to copy the return data, since we discard it for
        // interactions.
        // - Solidity will under certain conditions generate code to copy input
        // calldata twice to memory (the second being a "memcopy loop").
        // <https://github.com/gnosis/gp-v2-contracts/pull/417#issuecomment-775091258>
        // solhint-disable-next-line no-inline-assembly
        assembly {
            let freeMemoryPointer := mload(0x40)
            calldatacopy(freeMemoryPointer, callData.offset, callData.length)
            if iszero(
                call(
                    gas(),
                    target,
                    value,
                    freeMemoryPointer,
                    callData.length,
                    0,
                    0
                )
            ) {
                returndatacopy(0, 0, returndatasize())
                revert(0, returndatasize())
            }
        }
    }

    /// @dev Extracts the Solidity ABI selector for the specified interaction.
    ///
    /// @param interaction Interaction data.
    /// @return result The 4 byte function selector of the call encoded in
    /// this interaction.
    function selector(Data calldata interaction)
        internal
        pure
        returns (bytes4 result)
    {
        bytes calldata callData = interaction.callData;
        if (callData.length >= 4) {
            // NOTE: Read the first word of the interaction's calldata. The
            // value does not need to be shifted since `bytesN` values are left
            // aligned, and the value does not need to be masked since masking
            // occurs when the value is accessed and not stored:
            // <https://docs.soliditylang.org/en/v0.7.6/abi-spec.html#encoding-of-indexed-event-parameters>
            // <https://docs.soliditylang.org/en/v0.7.6/assembly.html#access-to-external-variables-functions-and-libraries>
            // solhint-disable-next-line no-inline-assembly
            assembly {
                result := calldataload(callData.offset)
            }
        }
    }
}

File 11 of 11 : IERC165.sol
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by `interfaceId`.
     * See the corresponding EIP section
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/",
    "lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/",
    "lib/composable-cow:@openzeppelin/=lib/composable-cow/lib/@openzeppelin/contracts/",
    "lib/composable-cow:@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/",
    "@openzeppelin/=lib/composable-cow/lib/@openzeppelin/",
    "@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/",
    "balancer/=lib/composable-cow/lib/balancer/src/",
    "canonical-weth/=lib/composable-cow/lib/canonical-weth/src/",
    "composable-cow/=lib/composable-cow/",
    "cowprotocol/=lib/composable-cow/lib/cowprotocol/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/composable-cow/lib/@openzeppelin/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/",
    "math/=lib/composable-cow/lib/balancer/src/lib/math/",
    "murky/=lib/composable-cow/lib/murky/src/",
    "openzeppelin-contracts/=lib/composable-cow/lib/canonical-weth/lib/openzeppelin-contracts/",
    "openzeppelin/=lib/composable-cow/lib/@openzeppelin/contracts/",
    "safe/=lib/composable-cow/lib/safe/",
    "uniswap-v2-core/=lib/uniswap-v2-core/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IVault","name":"vault_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"OrderNotValid","type":"error"},{"inputs":[],"name":"TOLERANCE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063355efdd914610046578063b52d5b1e14610073578063fbfa77cf14610089575b600080fd5b610059610054366004610821565b6100ce565b604080519283526020830191909152015b60405180910390f35b61007b600e81565b60405190815260200161006a565b6000546100a99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161006a565b6000808060608080836100e3888a018a610931565b516000546040517ff6c009270000000000000000000000000000000000000000000000000000000081526004810183905291925073ffffffffffffffffffffffffffffffffffffffff169063f6c00927906024016040805180830381865afa92505050801561018d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261018a91810190610973565b60015b610228573d8080156101bb576040519150601f19603f3d011682016040523d82523d6000602084013e6101c0565b606091505b506040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420706f6f6c206964000000000000000000000000000000000060448201526064015b60405180910390fd5b506000546040517ff94d46680000000000000000000000000000000000000000000000000000000081526004810184905291965073ffffffffffffffffffffffffffffffffffffffff169063f94d466890602401600060405180830381865afa158015610299573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526102df9190810190610a44565b5080945081955050508473ffffffffffffffffffffffffffffffffffffffff1663f89f27ed6040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561037257506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261036f9190810190610b12565b60015b610408573d8080156103a0576040519150601f19603f3d011682016040523d82523d6000602084013e6103a5565b606091505b506040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6e6f74206120776569676874656420706f6f6c00000000000000000000000000604482015260640161021f565b91505060008060008060005b875181101561052057600088828151811061043157610431610b4f565b602002602001015190508f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036104ab5786828151811061048057610480610b4f565b6020026020010151955087828151811061049c5761049c610b4f565b60200260200101519350610517565b8e73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610517578682815181106104f0576104f0610b4f565b6020026020010151945087828151811061050c5761050c610b4f565b602002602001015192505b50600101610414565b508360000361058b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f706f6f6c20646f6573206e6f7420747261646520746f6b656e30000000000000604482015260640161021f565b826000036105f5576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f706f6f6c20646f6573206e6f7420747261646520746f6b656e31000000000000604482015260640161021f565b60006106018484610b7e565b9050600061060f8684610b7e565b905061061b8282610632565b9b509b505050505050505050505094509492505050565b6000806000808486111561064a575084905083610650565b50839050845b600061065d83600161071b565b9050600061066c83600061071b565b905060808211158061067f5750600e8111155b156106935787879550955050505050610714565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8e830182101561070557507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff281015b88811c965087901c9450505050505b9250929050565b60008061072784610768565b9050600183600281111561073d5761073d610bbc565b14801561074d575083816001901b105b61075857600061075b565b60015b60ff160190505b92915050565b600080608083901c1561077d57608092831c92015b604083901c1561078f57604092831c92015b602083901c156107a157602092831c92015b601083901c156107b357601092831c92015b600883901c156107c557600892831c92015b600483901c156107d757600492831c92015b600283901c156107e957600292831c92015b600183901c156107625760010192915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461081e57600080fd5b50565b6000806000806060858703121561083757600080fd5b8435610842816107fc565b93506020850135610852816107fc565b9250604085013567ffffffffffffffff8082111561086f57600080fd5b818701915087601f83011261088357600080fd5b81358181111561089257600080fd5b8860208285010111156108a457600080fd5b95989497505060200194505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610929576109296108b3565b604052919050565b60006020828403121561094357600080fd5b6040516020810181811067ffffffffffffffff82111715610966576109666108b3565b6040529135825250919050565b6000806040838503121561098657600080fd5b8251610991816107fc565b6020840151909250600381106109a657600080fd5b809150509250929050565b600067ffffffffffffffff8211156109cb576109cb6108b3565b5060051b60200190565b600082601f8301126109e657600080fd5b815160206109fb6109f6836109b1565b6108e2565b8083825260208201915060208460051b870101935086841115610a1d57600080fd5b602086015b84811015610a395780518352918301918301610a22565b509695505050505050565b600080600060608486031215610a5957600080fd5b835167ffffffffffffffff80821115610a7157600080fd5b818601915086601f830112610a8557600080fd5b81516020610a956109f6836109b1565b82815260059290921b8401810191818101908a841115610ab457600080fd5b948201945b83861015610adb578551610acc816107fc565b82529482019490820190610ab9565b91890151919750909350505080821115610af457600080fd5b50610b01868287016109d5565b925050604084015190509250925092565b600060208284031215610b2457600080fd5b815167ffffffffffffffff811115610b3b57600080fd5b610b47848285016109d5565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8082028115828204841417610762577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220d7d295e90215950666a26a10bb386e4d60990e168edd14fdfa4f05ac5fab4de764736f6c63430008170033

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.