Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
18648376 | 220 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
BalancerOracle
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; import {Owned} from "solmate/auth/Owned.sol"; import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; import {IOracle} from "../interfaces/IOracle.sol"; import {IBalancerTwapOracle} from "../interfaces/IBalancerTwapOracle.sol"; /// @title Oracle using Balancer TWAP oracle as data source /// @author zefram.eth /// @notice The oracle contract that provides the current price to purchase /// the underlying token while exercising options. Uses Balancer TWAP oracle /// as data source, and then applies a multiplier & lower bound. /// @dev IMPORTANT: The Balancer pool must use the payment token of the options /// token as the first token and the underlying token as the second token, due to /// how the Balancer oracle represents the price. /// Furthermore, the payment token and the underlying token must use 18 decimals. /// This is because the Balancer oracle returns the TWAP value in 18 decimals /// and the OptionsToken contract also expects 18 decimals. contract BalancerOracle is IOracle, Owned { /// ----------------------------------------------------------------------- /// Library usage /// ----------------------------------------------------------------------- using FixedPointMathLib for uint256; /// ----------------------------------------------------------------------- /// Errors /// ----------------------------------------------------------------------- error BalancerOracle__TWAPOracleNotReady(); /// ----------------------------------------------------------------------- /// Events /// ----------------------------------------------------------------------- event SetParams(uint16 multiplier, uint56 secs, uint56 ago, uint128 minPrice); /// ----------------------------------------------------------------------- /// Constants /// ----------------------------------------------------------------------- /// @notice The denominator for converting the multiplier into a decimal number. /// i.e. multiplier uses 4 decimals. uint256 internal constant MULTIPLIER_DENOM = 10000; // keccak256(abi.encodePacked("BAL#313")) bytes32 internal constant ORACLE_NOT_INITIALIZED_ERROR = 0x4c60f3e159edfac6fe0f71d6dacd55beccc3b6d9632b5d259c4cbedb84e13d32; /// ----------------------------------------------------------------------- /// Immutable parameters /// ----------------------------------------------------------------------- /// @notice The Balancer TWAP oracle contract (usually a pool with oracle support) IBalancerTwapOracle public immutable balancerTwapOracle; /// ----------------------------------------------------------------------- /// Storage variables /// ----------------------------------------------------------------------- /// @notice The multiplier applied to the TWAP value. Encodes the discount of /// the options token. Uses 4 decimals. uint16 public multiplier; /// @notice The size of the window to take the TWAP value over in seconds. uint56 public secs; /// @notice The number of seconds in the past to take the TWAP from. The window /// would be (block.timestamp - secs - ago, block.timestamp - ago]. uint56 public ago; /// @notice The minimum value returned by getPrice(). Maintains a floor for the /// price to mitigate potential attacks on the TWAP oracle. uint128 public minPrice; /// ----------------------------------------------------------------------- /// Constructor /// ----------------------------------------------------------------------- constructor( IBalancerTwapOracle balancerTwapOracle_, address owner_, uint16 multiplier_, uint56 secs_, uint56 ago_, uint128 minPrice_ ) Owned(owner_) { balancerTwapOracle = balancerTwapOracle_; multiplier = multiplier_; secs = secs_; ago = ago_; minPrice = minPrice_; emit SetParams(multiplier_, secs_, ago_, minPrice_); } /// ----------------------------------------------------------------------- /// IOracle /// ----------------------------------------------------------------------- /// @inheritdoc IOracle function getPrice() external view override returns (uint256 price) { /// ----------------------------------------------------------------------- /// Storage loads /// ----------------------------------------------------------------------- uint256 multiplier_ = multiplier; uint256 secs_ = secs; uint256 ago_ = ago; uint256 minPrice_ = minPrice; /// ----------------------------------------------------------------------- /// Validation /// ----------------------------------------------------------------------- // ensure the Balancer oracle can return a TWAP value for the specified window { uint256 largestSafeQueryWindow = balancerTwapOracle.getLargestSafeQueryWindow(); if (secs_ + ago_ > largestSafeQueryWindow) revert BalancerOracle__TWAPOracleNotReady(); } /// ----------------------------------------------------------------------- /// Computation /// ----------------------------------------------------------------------- // query Balancer oracle to get TWAP value { IBalancerTwapOracle.OracleAverageQuery[] memory queries = new IBalancerTwapOracle.OracleAverageQuery[](1); queries[0] = IBalancerTwapOracle.OracleAverageQuery({ variable: IBalancerTwapOracle.Variable.PAIR_PRICE, secs: secs_, ago: ago_ }); bytes memory query = abi.encodeWithSelector(0x1dccd830, queries); (bool success, bytes memory result) = address(balancerTwapOracle).staticcall(query); if (!success) { // If the _res length is less than 68, then the transaction failed silently (without a revert message) if (result.length < 68) revert("oracle failed"); assembly { // Slice the sighash. result := add(result, 0x04) } // if oracle wasn't initialized we just use the min price (BAL#313 == ORACLE_NOT_INITIALIZED) if (ORACLE_NOT_INITIALIZED_ERROR == keccak256(abi.encodePacked(abi.decode(result, (string))))) { return minPrice; } revert("ORACLE_FAILED"); } price = abi.decode(result, (uint[]))[0]; } // apply multiplier to price price = price.mulDivUp(multiplier_, MULTIPLIER_DENOM); // bound price above minPrice price = price < minPrice_ ? minPrice_ : price; } /// ----------------------------------------------------------------------- /// Owner functions /// ----------------------------------------------------------------------- /// @notice Updates the oracle parameters. Only callable by the owner. /// @param multiplier_ The multiplier applied to the TWAP value. Encodes the discount of /// the options token. Uses 4 decimals. /// @param secs_ The size of the window to take the TWAP value over in seconds. /// @param ago_ The number of seconds in the past to take the TWAP from. The window /// would be (block.timestamp - secs - ago, block.timestamp - ago]. /// @param minPrice_ The minimum value returned by getPrice(). Maintains a floor for the /// price to mitigate potential attacks on the TWAP oracle. function setParams(uint16 multiplier_, uint56 secs_, uint56 ago_, uint128 minPrice_) external onlyOwner { multiplier = multiplier_; secs = secs_; ago = ago_; minPrice = minPrice_; emit SetParams(multiplier_, secs_, ago_, minPrice_); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Simple single owner authorization mixin. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) abstract contract Owned { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event OwnershipTransferred(address indexed user, address indexed newOwner); /*////////////////////////////////////////////////////////////// OWNERSHIP STORAGE //////////////////////////////////////////////////////////////*/ address public owner; modifier onlyOwner() virtual { require(msg.sender == owner, "UNAUTHORIZED"); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _owner) { owner = _owner; emit OwnershipTransferred(address(0), _owner); } /*////////////////////////////////////////////////////////////// OWNERSHIP LOGIC //////////////////////////////////////////////////////////////*/ function transferOwnership(address newOwner) public virtual onlyOwner { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Arithmetic library with operations for fixed-point numbers. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol) /// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol) library FixedPointMathLib { /*////////////////////////////////////////////////////////////// SIMPLIFIED FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ uint256 internal constant MAX_UINT256 = 2**256 - 1; uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s. function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down. } function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up. } function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down. } function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up. } /*////////////////////////////////////////////////////////////// LOW LEVEL FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ function mulDivDown( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // Divide x * y by the denominator. z := div(mul(x, y), denominator) } } function mulDivUp( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // If x * y modulo the denominator is strictly greater than 0, // 1 is added to round up the division of x * y by the denominator. z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator)) } } function rpow( uint256 x, uint256 n, uint256 scalar ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { switch x case 0 { switch n case 0 { // 0 ** 0 = 1 z := scalar } default { // 0 ** n = 0 z := 0 } } default { switch mod(n, 2) case 0 { // If n is even, store scalar in z for now. z := scalar } default { // If n is odd, store x in z for now. z := x } // Shifting right by 1 is like dividing by 2. let half := shr(1, scalar) for { // Shift n right by 1 before looping to halve it. n := shr(1, n) } n { // Shift n right by 1 each iteration to halve it. n := shr(1, n) } { // Revert immediately if x ** 2 would overflow. // Equivalent to iszero(eq(div(xx, x), x)) here. if shr(128, x) { revert(0, 0) } // Store x squared. let xx := mul(x, x) // Round to the nearest number. let xxRound := add(xx, half) // Revert if xx + half overflowed. if lt(xxRound, xx) { revert(0, 0) } // Set x to scaled xxRound. x := div(xxRound, scalar) // If n is even: if mod(n, 2) { // Compute z * x. let zx := mul(z, x) // If z * x overflowed: if iszero(eq(div(zx, x), z)) { // Revert if x is non-zero. if iszero(iszero(x)) { revert(0, 0) } } // Round to the nearest number. let zxRound := add(zx, half) // Revert if zx + half overflowed. if lt(zxRound, zx) { revert(0, 0) } // Return properly scaled zxRound. z := div(zxRound, scalar) } } } } } /*////////////////////////////////////////////////////////////// GENERAL NUMBER UTILITIES //////////////////////////////////////////////////////////////*/ function sqrt(uint256 x) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { let y := x // We start y at x, which will help us make our initial estimate. z := 181 // The "correct" value is 1, but this saves a multiplication later. // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically. // We check y >= 2^(k + 8) but shift right by k bits // each branch to ensure that if x >= 256, then y >= 256. if iszero(lt(y, 0x10000000000000000000000000000000000)) { y := shr(128, y) z := shl(64, z) } if iszero(lt(y, 0x1000000000000000000)) { y := shr(64, y) z := shl(32, z) } if iszero(lt(y, 0x10000000000)) { y := shr(32, y) z := shl(16, z) } if iszero(lt(y, 0x1000000)) { y := shr(16, y) z := shl(8, z) } // Goal was to get z*z*y within a small factor of x. More iterations could // get y in a tighter range. Currently, we will have y in [256, 256*2^16). // We ensured y >= 256 so that the relative difference between y and y+1 is small. // That's not possible if x < 256 but we can just verify those cases exhaustively. // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256. // Correctness can be checked exhaustively for x < 256, so we assume y >= 256. // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps. // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256. // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18. // There is no overflow risk here since y < 2^136 after the first branch above. z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181. // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough. z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) // If x+1 is a perfect square, the Babylonian method cycles between // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor. // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case. // If you don't care whether the floor or ceil square root is returned, you can remove this statement. z := sub(z, lt(div(x, z), z)) } } function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Mod x by y. Note this will return // 0 instead of reverting if y is zero. z := mod(x, y) } } function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) { /// @solidity memory-safe-assembly assembly { // Divide x by y. Note this will return // 0 instead of reverting if y is zero. r := div(x, y) } } function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Add 1 to x * y if x % y > 0. Note this will // return 0 instead of reverting if y is zero. z := add(gt(mod(x, y), 0), div(x, y)) } } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.7.0 <0.9.0; /// @title Interface for an oracle of the options token's strike price /// @author zefram.eth /// @notice An oracle of the options token's strike price interface IOracle { /// @notice Computes the current strike price of the option /// @return price The strike price in terms of the payment token, scaled by 18 decimals. /// For example, if the payment token is $2 and the strike price is $4, the return value /// would be 2e18. function getPrice() external view returns (uint256 price); }
// SPDX-License-Identifier: GPL-3.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; /** * @dev Interface for querying historical data from a Pool that can be used as a Price Oracle. * * This lets third parties retrieve average prices of tokens held by a Pool over a given period of time, as well as the * price of the Pool share token (BPT) and invariant. Since the invariant is a sensible measure of Pool liquidity, it * can be used to compare two different price sources, and choose the most liquid one. * * Once the oracle is fully initialized, all queries are guaranteed to succeed as long as they require no data that * is not older than the largest safe query window. */ interface IBalancerTwapOracle { // The three values that can be queried: // // - PAIR_PRICE: the price of the tokens in the Pool, expressed as the price of the second token in units of the // first token. For example, if token A is worth $2, and token B is worth $4, the pair price will be 2.0. // Note that the price is computed *including* the tokens decimals. This means that the pair price of a Pool with // DAI and USDC will be close to 1.0, despite DAI having 18 decimals and USDC 6. // // - BPT_PRICE: the price of the Pool share token (BPT), in units of the first token. // Note that the price is computed *including* the tokens decimals. This means that the BPT price of a Pool with // USDC in which BPT is worth $5 will be 5.0, despite the BPT having 18 decimals and USDC 6. // // - INVARIANT: the value of the Pool's invariant, which serves as a measure of its liquidity. enum Variable { PAIR_PRICE, BPT_PRICE, INVARIANT } /** * @dev Returns the time average weighted price corresponding to each of `queries`. Prices are represented as 18 * decimal fixed point values. */ function getTimeWeightedAverage(OracleAverageQuery[] memory queries) external view returns (uint256[] memory results); /** * @dev Returns latest sample of `variable`. Prices are represented as 18 decimal fixed point values. */ function getLatest(Variable variable) external view returns (uint256); /** * @dev Information for a Time Weighted Average query. * * Each query computes the average over a window of duration `secs` seconds that ended `ago` seconds ago. For * example, the average over the past 30 minutes is computed by settings secs to 1800 and ago to 0. If secs is 1800 * and ago is 1800 as well, the average between 60 and 30 minutes ago is computed instead. */ struct OracleAverageQuery { Variable variable; uint256 secs; uint256 ago; } /** * @dev Returns largest time window that can be safely queried, where 'safely' means the Oracle is guaranteed to be * able to produce a result and not revert. * * If a query has a non-zero `ago` value, then `secs + ago` (the oldest point in time) must be smaller than this * value for 'safe' queries. */ function getLargestSafeQueryWindow() external view returns (uint256); /** * @dev Returns the accumulators corresponding to each of `queries`. */ function getPastAccumulators(OracleAccumulatorQuery[] memory queries) external view returns (int256[] memory results); /** * @dev Information for an Accumulator query. * * Each query estimates the accumulator at a time `ago` seconds ago. */ struct OracleAccumulatorQuery { Variable variable; uint256 ago; } }
{ "remappings": [ "create3-factory/=lib/create3-factory/", "ds-test/=lib/solmate/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 1000000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IBalancerTwapOracle","name":"balancerTwapOracle_","type":"address"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint16","name":"multiplier_","type":"uint16"},{"internalType":"uint56","name":"secs_","type":"uint56"},{"internalType":"uint56","name":"ago_","type":"uint56"},{"internalType":"uint128","name":"minPrice_","type":"uint128"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BalancerOracle__TWAPOracleNotReady","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"multiplier","type":"uint16"},{"indexed":false,"internalType":"uint56","name":"secs","type":"uint56"},{"indexed":false,"internalType":"uint56","name":"ago","type":"uint56"},{"indexed":false,"internalType":"uint128","name":"minPrice","type":"uint128"}],"name":"SetParams","type":"event"},{"inputs":[],"name":"ago","outputs":[{"internalType":"uint56","name":"","type":"uint56"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balancerTwapOracle","outputs":[{"internalType":"contract IBalancerTwapOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPrice","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiplier","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secs","outputs":[{"internalType":"uint56","name":"","type":"uint56"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"multiplier_","type":"uint16"},{"internalType":"uint56","name":"secs_","type":"uint56"},{"internalType":"uint56","name":"ago_","type":"uint56"},{"internalType":"uint128","name":"minPrice_","type":"uint128"}],"name":"setParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a03461019457601f610f0538819003918201601f19168301916001600160401b038311848410176101995780849260c0946040528339810103126101945780516001600160a01b03919082811681036101945760208201519283168093036101945760408201519161ffff83169081840361019457610081606082016101af565b9060a0610090608083016101af565b9101516001600160801b03811693909290848403610194577fe4d55b8aa197e9d241ef3622ca1138063e907f2cd7c6c6d33a697d9d0d8aed229760809760005491604051988160007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a38a5260a09190911b61ffff60a01b166001600160e81b0319909216171760b083901b66ffffffffffffff60b01b1617600055600180546001600160b81b03191666ffffffffffffff94851690811760389690961b600160381b600160b81b0316959095179055855216602084015260408301526060820152a1604051610d4190816101c4823960805181818161018501526109d70152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b519066ffffffffffffff821682036101945756fe6080604052600436101561001257600080fd5b6000803560e01c90816319f7671b146100aa575080631b3ed722146100a55780635daf61eb146100a05780638da5cb5b1461009b5780639439fd121461009657806398d5fdca14610091578063cb1aa9311461008c578063e45be8eb146100875763f2fde38b1461008257600080fd5b6104ba565b610469565b610424565b6103e3565b610227565b6101a9565b61013a565b6100f2565b346100ef57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ef5766ffffffffffffff905460b01c1660805260206080f35b80fd5b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602061ffff60005460a01c16604051908152f35b600080fd5b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b6024359066ffffffffffffff8216820361013557565b6044359066ffffffffffffff8216820361013557565b346101355760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101355760043561ffff811681036101355761026c6101fb565b610274610211565b91606435926fffffffffffffffffffffffffffffffff84168403610135577fe4d55b8aa197e9d241ef3622ca1138063e907f2cd7c6c6d33a697d9d0d8aed22936103de916000546102dc73ffffffffffffffffffffffffffffffffffffffff8216331461056c565b7cffffffffffffff000000000000000000000000000000000000000000008660b01b16907fffffff000000000000000000ffffffffffffffffffffffffffffffffffffffff75ffff00000000000000000000000000000000000000008760a01b169116171760005560015476ffffffffffffffffffffffffffffffff000000000000008360381b16907fffffffffffffffffff000000000000000000000000000000000000000000000066ffffffffffffff8416911617176001556040519485948592936060926fffffffffffffffffffffffffffffffff92969561ffff608087019816865266ffffffffffffff809216602087015216604085015216910152565b0390a1005b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602061041c61098e565b604051908152f35b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602066ffffffffffffff60015416604051908152f35b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101355760206fffffffffffffffffffffffffffffffff60015460381c16604051908152f35b346101355760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101355760043573ffffffffffffffffffffffffffffffffffffffff9081811680910361013557807fffffffffffffffffffffffff00000000000000000000000000000000000000006000936105408554918216331461056c565b16178255337f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b1561057357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761061c57604052565b6105d1565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761061c57604052565b90816020910312610135575190565b6040513d6000823e3d90fd5b9190820180921161068a57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b604051906106c682610600565b565b67ffffffffffffffff811161061c5760051b60200190565b60409081519180830183811067ffffffffffffffff82111761061c5781526001835282916000805b6020808210156107395784516020929161072182610600565b84825284818301528487830152828901015201610708565b50505091925050565b80511561074f5760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020808201908083528351809252806040809401940192600090815b8483106107aa5750505050505090565b9091929394958651805160038110156107e1578252808601518683015283015183820152606001958401949392600101919061079a565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b67ffffffffffffffff811161061c57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d15610873573d906108598261080e565b916108676040519384610621565b82523d6000602084013e565b606090565b60005b83811061088b5750506000910152565b818101518382015260200161087b565b6020818303126101355780519067ffffffffffffffff8211610135570181601f820112156101355780516108ce8161080e565b926108dc6040519485610621565b81845260208284010111610135576108fa9160208085019101610878565b90565b9061091060209282815194859201610878565b0190565b60209081818403126101355780519067ffffffffffffffff821161013557019180601f8401121561013557825161094a816106c8565b936109586040519586610621565b818552838086019260051b820101928311610135578301905b82821061097f575050505090565b81518152908301908301610971565b600080549066ffffffffffffff91828160b01c16926fffffffffffffffffffffffffffffffff6001549182169160381c169373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166040908151927fffd088eb0000000000000000000000000000000000000000000000000000000084526020938481600481865afa908115610cc5578891610c98575b50610a44868361067d565b11610c6f5786918291610a556106e0565b96610a5e6106b9565b918483528783015285820152610a7387610742565b52610a7d86610742565b5083519586610ab5878201927f1dccd8300000000000000000000000000000000000000000000000000000000084526024830161077e565b0396610ae77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe098898101835282610621565b51915afa610af3610848565b93849115610b3e57505050610b208282610b259361ffff610b2b9796519660a01c16958301019101610914565b610742565b51610cca565b905081811015610b39575090565b905090565b91979695509193506044835110610c1157610b6b610b86926024806004610b7a970151830101910161089b565b938751938491820180966108fd565b03908101835282610621565b5190207f4c60f3e159edfac6fe0f71d6dacd55beccc3b6d9632b5d259c4cbedb84e13d3214610c0d5782517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4f5241434c455f4641494c4544000000000000000000000000000000000000006044820152606490fd5b9150565b86517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f6f7261636c65206661696c6564000000000000000000000000000000000000006044820152606490fd5b600483517fb79608be000000000000000000000000000000000000000000000000000000008152fd5b610cb89150853d8711610cbe575b610cb08183610621565b810190610662565b38610a39565b503d610ca6565b610671565b9061271091817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04811182021583021561013557029080820491061515019056fea26469706673582212205dc8b8842a04b543170463b6dcbcec968202384c4da3a2a6d1f83c80abe8c43664736f6c63430008130033000000000000000000000000577a7f7ee659aa14dc16fd384b3f8078e23f19200000000000000000000000002c3b135cd7dc6c673b358bef214843dab34642780000000000000000000000000000000000000000000000000000000000001d4c000000000000000000000000000000000000000000000000000000000000a8c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e14
Deployed Bytecode
0x6080604052600436101561001257600080fd5b6000803560e01c90816319f7671b146100aa575080631b3ed722146100a55780635daf61eb146100a05780638da5cb5b1461009b5780639439fd121461009657806398d5fdca14610091578063cb1aa9311461008c578063e45be8eb146100875763f2fde38b1461008257600080fd5b6104ba565b610469565b610424565b6103e3565b610227565b6101a9565b61013a565b6100f2565b346100ef57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ef5766ffffffffffffff905460b01c1660805260206080f35b80fd5b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602061ffff60005460a01c16604051908152f35b600080fd5b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000577a7f7ee659aa14dc16fd384b3f8078e23f1920168152f35b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b6024359066ffffffffffffff8216820361013557565b6044359066ffffffffffffff8216820361013557565b346101355760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101355760043561ffff811681036101355761026c6101fb565b610274610211565b91606435926fffffffffffffffffffffffffffffffff84168403610135577fe4d55b8aa197e9d241ef3622ca1138063e907f2cd7c6c6d33a697d9d0d8aed22936103de916000546102dc73ffffffffffffffffffffffffffffffffffffffff8216331461056c565b7cffffffffffffff000000000000000000000000000000000000000000008660b01b16907fffffff000000000000000000ffffffffffffffffffffffffffffffffffffffff75ffff00000000000000000000000000000000000000008760a01b169116171760005560015476ffffffffffffffffffffffffffffffff000000000000008360381b16907fffffffffffffffffff000000000000000000000000000000000000000000000066ffffffffffffff8416911617176001556040519485948592936060926fffffffffffffffffffffffffffffffff92969561ffff608087019816865266ffffffffffffff809216602087015216604085015216910152565b0390a1005b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602061041c61098e565b604051908152f35b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261013557602066ffffffffffffff60015416604051908152f35b346101355760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101355760206fffffffffffffffffffffffffffffffff60015460381c16604051908152f35b346101355760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101355760043573ffffffffffffffffffffffffffffffffffffffff9081811680910361013557807fffffffffffffffffffffffff00000000000000000000000000000000000000006000936105408554918216331461056c565b16178255337f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b1561057357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761061c57604052565b6105d1565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761061c57604052565b90816020910312610135575190565b6040513d6000823e3d90fd5b9190820180921161068a57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b604051906106c682610600565b565b67ffffffffffffffff811161061c5760051b60200190565b60409081519180830183811067ffffffffffffffff82111761061c5781526001835282916000805b6020808210156107395784516020929161072182610600565b84825284818301528487830152828901015201610708565b50505091925050565b80511561074f5760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020808201908083528351809252806040809401940192600090815b8483106107aa5750505050505090565b9091929394958651805160038110156107e1578252808601518683015283015183820152606001958401949392600101919061079a565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b67ffffffffffffffff811161061c57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d15610873573d906108598261080e565b916108676040519384610621565b82523d6000602084013e565b606090565b60005b83811061088b5750506000910152565b818101518382015260200161087b565b6020818303126101355780519067ffffffffffffffff8211610135570181601f820112156101355780516108ce8161080e565b926108dc6040519485610621565b81845260208284010111610135576108fa9160208085019101610878565b90565b9061091060209282815194859201610878565b0190565b60209081818403126101355780519067ffffffffffffffff821161013557019180601f8401121561013557825161094a816106c8565b936109586040519586610621565b818552838086019260051b820101928311610135578301905b82821061097f575050505090565b81518152908301908301610971565b600080549066ffffffffffffff91828160b01c16926fffffffffffffffffffffffffffffffff6001549182169160381c169373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000577a7f7ee659aa14dc16fd384b3f8078e23f1920166040908151927fffd088eb0000000000000000000000000000000000000000000000000000000084526020938481600481865afa908115610cc5578891610c98575b50610a44868361067d565b11610c6f5786918291610a556106e0565b96610a5e6106b9565b918483528783015285820152610a7387610742565b52610a7d86610742565b5083519586610ab5878201927f1dccd8300000000000000000000000000000000000000000000000000000000084526024830161077e565b0396610ae77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe098898101835282610621565b51915afa610af3610848565b93849115610b3e57505050610b208282610b259361ffff610b2b9796519660a01c16958301019101610914565b610742565b51610cca565b905081811015610b39575090565b905090565b91979695509193506044835110610c1157610b6b610b86926024806004610b7a970151830101910161089b565b938751938491820180966108fd565b03908101835282610621565b5190207f4c60f3e159edfac6fe0f71d6dacd55beccc3b6d9632b5d259c4cbedb84e13d3214610c0d5782517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4f5241434c455f4641494c4544000000000000000000000000000000000000006044820152606490fd5b9150565b86517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f6f7261636c65206661696c6564000000000000000000000000000000000000006044820152606490fd5b600483517fb79608be000000000000000000000000000000000000000000000000000000008152fd5b610cb89150853d8711610cbe575b610cb08183610621565b810190610662565b38610a39565b503d610ca6565b610671565b9061271091817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04811182021583021561013557029080820491061515019056fea26469706673582212205dc8b8842a04b543170463b6dcbcec968202384c4da3a2a6d1f83c80abe8c43664736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000577a7f7ee659aa14dc16fd384b3f8078e23f19200000000000000000000000002c3b135cd7dc6c673b358bef214843dab34642780000000000000000000000000000000000000000000000000000000000001d4c000000000000000000000000000000000000000000000000000000000000a8c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e14
-----Decoded View---------------
Arg [0] : balancerTwapOracle_ (address): 0x577A7f7EE659Aa14Dc16FD384B3F8078E23F1920
Arg [1] : owner_ (address): 0x2C3B135cd7dc6C673b358BEF214843DAb3464278
Arg [2] : multiplier_ (uint16): 7500
Arg [3] : secs_ (uint56): 43200
Arg [4] : ago_ (uint56): 0
Arg [5] : minPrice_ (uint128): 7700
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000577a7f7ee659aa14dc16fd384b3f8078e23f1920
Arg [1] : 0000000000000000000000002c3b135cd7dc6c673b358bef214843dab3464278
Arg [2] : 0000000000000000000000000000000000000000000000000000000000001d4c
Arg [3] : 000000000000000000000000000000000000000000000000000000000000a8c0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000001e14
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
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.