ETH Price: $3,465.47 (+2.10%)
Gas: 10 Gwei

Contract

0xbe1E6eF049B15BC77bb796BaBEcBeeA2707770D7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x61277361109295182020-09-25 3:57:321375 days ago1601006252IN
 Create: Orchestrator
0 ETH0.2003679990

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Orchestrator

Compiler Version
v0.5.15+commit.6a57276f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-10-22
*/

// hevm: flattened sources of src/Orchestrator.sol
pragma solidity >0.4.13 >=0.4.23 >=0.5.0 <0.6.0 >=0.5.7 <0.6.0;

////// lib/abdk-libraries-solidity/src/ABDKMath64x64.sol
/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <[email protected]>
 */
/* pragma solidity ^0.5.7; */

/**
 * Smart contract library of mathematical functions operating with signed
 * 64.64-bit fixed point numbers.  Signed 64.64-bit fixed point number is
 * basically a simple fraction whose numerator is signed 128-bit integer and
 * denominator is 2^64.  As long as denominator is always the same, there is no
 * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are
 * represented by int128 type holding only the numerator.
 */
library ABDKMath64x64 {
  /**
   * Minimum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;

  /**
   * Maximum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Convert signed 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromInt (int256 x) internal pure returns (int128) {
    require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF);
    return int128 (x << 64);
  }

  /**
   * Convert signed 64.64 fixed point number into signed 64-bit integer number
   * rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64-bit integer number
   */
  function toInt (int128 x) internal pure returns (int64) {
    return int64 (x >> 64);
  }

  /**
   * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromUInt (uint256 x) internal pure returns (int128) {
    require (x <= 0x7FFFFFFFFFFFFFFF);
    return int128 (x << 64);
  }

  /**
   * Convert signed 64.64 fixed point number into unsigned 64-bit integer
   * number rounding down.  Revert on underflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return unsigned 64-bit integer number
   */
  function toUInt (int128 x) internal pure returns (uint64) {
    require (x >= 0);
    return uint64 (x >> 64);
  }

  /**
   * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point
   * number rounding down.  Revert on overflow.
   *
   * @param x signed 128.128-bin fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function from128x128 (int256 x) internal pure returns (int128) {
    int256 result = x >> 64;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Convert signed 64.64 fixed point number into signed 128.128 fixed point
   * number.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 128.128 fixed point number
   */
  function to128x128 (int128 x) internal pure returns (int256) {
    return int256 (x) << 64;
  }

  /**
   * Calculate x + y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function add (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) + y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x - y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sub (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) - y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding down.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function mul (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) * y >> 64;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point
   * number and y is signed 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y signed 256-bit integer number
   * @return signed 256-bit integer number
   */
  function muli (int128 x, int256 y) internal pure returns (int256) {
    if (x == MIN_64x64) {
      require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF &&
        y <= 0x1000000000000000000000000000000000000000000000000);
      return -y << 63;
    } else {
      bool negativeResult = false;
      if (x < 0) {
        x = -x;
        negativeResult = true;
      }
      if (y < 0) {
        y = -y; // We rely on overflow behavior here
        negativeResult = !negativeResult;
      }
      uint256 absoluteResult = mulu (x, uint256 (y));
      if (negativeResult) {
        require (absoluteResult <=
          0x8000000000000000000000000000000000000000000000000000000000000000);
        return -int256 (absoluteResult); // We rely on overflow behavior here
      } else {
        require (absoluteResult <=
          0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
        return int256 (absoluteResult);
      }
    }
  }

  /**
   * Calculate x * y rounding down, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y unsigned 256-bit integer number
   * @return unsigned 256-bit integer number
   */
  function mulu (int128 x, uint256 y) internal pure returns (uint256) {
    if (y == 0) return 0;

    require (x >= 0);

    uint256 lo = (uint256 (x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
    uint256 hi = uint256 (x) * (y >> 128);

    require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    hi <<= 64;

    require (hi <=
      0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo);
    return hi + lo;
  }

  /**
   * Calculate x / y rounding towards zero.  Revert on overflow or when y is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function div (int128 x, int128 y) internal pure returns (int128) {
    require (y != 0);
    int256 result = (int256 (x) << 64) / y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are signed 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x signed 256-bit integer number
   * @param y signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divi (int256 x, int256 y) internal pure returns (int128) {
    require (y != 0);

    bool negativeResult = false;
    if (x < 0) {
      x = -x; // We rely on overflow behavior here
      negativeResult = true;
    }
    if (y < 0) {
      y = -y; // We rely on overflow behavior here
      negativeResult = !negativeResult;
    }
    uint128 absoluteResult = divuu (uint256 (x), uint256 (y));
    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divu (uint256 x, uint256 y) internal pure returns (int128) {
    require (y != 0);
    uint128 result = divuu (x, y);
    require (result <= uint128 (MAX_64x64));
    return int128 (result);
  }

  /**
   * Calculate -x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function neg (int128 x) internal pure returns (int128) {
    require (x != MIN_64x64);
    return -x;
  }

  /**
   * Calculate |x|.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function abs (int128 x) internal pure returns (int128) {
    require (x != MIN_64x64);
    return x < 0 ? -x : x;
  }

  /**
   * Calculate 1 / x rounding towards zero.  Revert on overflow or when x is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function inv (int128 x) internal pure returns (int128) {
    require (x != 0);
    int256 result = int256 (0x100000000000000000000000000000000) / x;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function avg (int128 x, int128 y) internal pure returns (int128) {
    return int128 ((int256 (x) + int256 (y)) >> 1);
  }

  /**
   * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down.
   * Revert on overflow or in case x * y is negative.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function gavg (int128 x, int128 y) internal pure returns (int128) {
    int256 m = int256 (x) * int256 (y);
    require (m >= 0);
    require (m <
        0x4000000000000000000000000000000000000000000000000000000000000000);
    return int128 (sqrtu (uint256 (m), uint256 (x) + uint256 (y) >> 1));
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y uint256 value
   * @return signed 64.64-bit fixed point number
   */
  function pow (int128 x, uint256 y) internal pure returns (int128) {
    uint256 absoluteResult;
    bool negativeResult = false;
    if (x >= 0) {
      absoluteResult = powu (uint256 (x) << 63, y);
    } else {
      // We rely on overflow behavior here
      absoluteResult = powu (uint256 (uint128 (-x)) << 63, y);
      negativeResult = y & 1 > 0;
    }

    absoluteResult >>= 63;

    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate sqrt (x) rounding down.  Revert if x < 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sqrt (int128 x) internal pure returns (int128) {
    require (x >= 0);
    return int128 (sqrtu (uint256 (x) << 64, 0x10000000000000000));
  }

  /**
   * Calculate binary logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function log_2 (int128 x) internal pure returns (int128) {
    require (x > 0);

    int256 msb = 0;
    int256 xc = x;
    if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
    if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
    if (xc >= 0x10000) { xc >>= 16; msb += 16; }
    if (xc >= 0x100) { xc >>= 8; msb += 8; }
    if (xc >= 0x10) { xc >>= 4; msb += 4; }
    if (xc >= 0x4) { xc >>= 2; msb += 2; }
    if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

    int256 result = msb - 64 << 64;
    uint256 ux = uint256 (x) << 127 - msb;
    for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) {
      ux *= ux;
      uint256 b = ux >> 255;
      ux >>= 127 + b;
      result += bit * int256 (b);
    }

    return int128 (result);
  }

  /**
   * Calculate natural logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function ln (int128 x) internal pure returns (int128) {
    require (x > 0);

    return int128 (
        uint256 (log_2 (x)) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128);
  }

  /**
   * Calculate binary exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp_2 (int128 x) internal pure returns (int128) {
    require (x < 0x400000000000000000); // Overflow

    if (x < -0x400000000000000000) return 0; // Underflow

    uint256 result = 0x80000000000000000000000000000000;

    if (x & 0x8000000000000000 > 0)
      result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128;
    if (x & 0x4000000000000000 > 0)
      result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128;
    if (x & 0x2000000000000000 > 0)
      result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128;
    if (x & 0x1000000000000000 > 0)
      result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128;
    if (x & 0x800000000000000 > 0)
      result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128;
    if (x & 0x400000000000000 > 0)
      result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128;
    if (x & 0x200000000000000 > 0)
      result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128;
    if (x & 0x100000000000000 > 0)
      result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128;
    if (x & 0x80000000000000 > 0)
      result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128;
    if (x & 0x40000000000000 > 0)
      result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128;
    if (x & 0x20000000000000 > 0)
      result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128;
    if (x & 0x10000000000000 > 0)
      result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128;
    if (x & 0x8000000000000 > 0)
      result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128;
    if (x & 0x4000000000000 > 0)
      result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128;
    if (x & 0x2000000000000 > 0)
      result = result * 0x1000162E525EE054754457D5995292026 >> 128;
    if (x & 0x1000000000000 > 0)
      result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128;
    if (x & 0x800000000000 > 0)
      result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128;
    if (x & 0x400000000000 > 0)
      result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128;
    if (x & 0x200000000000 > 0)
      result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128;
    if (x & 0x100000000000 > 0)
      result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128;
    if (x & 0x80000000000 > 0)
      result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128;
    if (x & 0x40000000000 > 0)
      result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128;
    if (x & 0x20000000000 > 0)
      result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128;
    if (x & 0x10000000000 > 0)
      result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128;
    if (x & 0x8000000000 > 0)
      result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128;
    if (x & 0x4000000000 > 0)
      result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128;
    if (x & 0x2000000000 > 0)
      result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128;
    if (x & 0x1000000000 > 0)
      result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128;
    if (x & 0x800000000 > 0)
      result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128;
    if (x & 0x400000000 > 0)
      result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128;
    if (x & 0x200000000 > 0)
      result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128;
    if (x & 0x100000000 > 0)
      result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128;
    if (x & 0x80000000 > 0)
      result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128;
    if (x & 0x40000000 > 0)
      result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128;
    if (x & 0x20000000 > 0)
      result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128;
    if (x & 0x10000000 > 0)
      result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128;
    if (x & 0x8000000 > 0)
      result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128;
    if (x & 0x4000000 > 0)
      result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128;
    if (x & 0x2000000 > 0)
      result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128;
    if (x & 0x1000000 > 0)
      result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128;
    if (x & 0x800000 > 0)
      result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128;
    if (x & 0x400000 > 0)
      result = result * 0x100000000002C5C85FDF477B662B26945 >> 128;
    if (x & 0x200000 > 0)
      result = result * 0x10000000000162E42FEFA3AE53369388C >> 128;
    if (x & 0x100000 > 0)
      result = result * 0x100000000000B17217F7D1D351A389D40 >> 128;
    if (x & 0x80000 > 0)
      result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128;
    if (x & 0x40000 > 0)
      result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128;
    if (x & 0x20000 > 0)
      result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128;
    if (x & 0x10000 > 0)
      result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128;
    if (x & 0x8000 > 0)
      result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128;
    if (x & 0x4000 > 0)
      result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128;
    if (x & 0x2000 > 0)
      result = result * 0x1000000000000162E42FEFA39F02B772C >> 128;
    if (x & 0x1000 > 0)
      result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128;
    if (x & 0x800 > 0)
      result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128;
    if (x & 0x400 > 0)
      result = result * 0x100000000000002C5C85FDF473DEA871F >> 128;
    if (x & 0x200 > 0)
      result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128;
    if (x & 0x100 > 0)
      result = result * 0x100000000000000B17217F7D1CF79E949 >> 128;
    if (x & 0x80 > 0)
      result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128;
    if (x & 0x40 > 0)
      result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128;
    if (x & 0x20 > 0)
      result = result * 0x100000000000000162E42FEFA39EF366F >> 128;
    if (x & 0x10 > 0)
      result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128;
    if (x & 0x8 > 0)
      result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128;
    if (x & 0x4 > 0)
      result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128;
    if (x & 0x2 > 0)
      result = result * 0x1000000000000000162E42FEFA39EF358 >> 128;
    if (x & 0x1 > 0)
      result = result * 0x10000000000000000B17217F7D1CF79AB >> 128;

    result >>= 63 - (x >> 64);
    require (result <= uint256 (MAX_64x64));

    return int128 (result);
  }

  /**
   * Calculate natural exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp (int128 x) internal pure returns (int128) {
    require (x < 0x400000000000000000); // Overflow

    if (x < -0x400000000000000000) return 0; // Underflow

    return exp_2 (
        int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128));
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return unsigned 64.64-bit fixed point number
   */
  function divuu (uint256 x, uint256 y) private pure returns (uint128) {
    require (y != 0);

    uint256 result;

    if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
      result = (x << 64) / y;
    else {
      uint256 msb = 192;
      uint256 xc = x >> 192;
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1);
      require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

      uint256 hi = result * (y >> 128);
      uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

      uint256 xh = x >> 192;
      uint256 xl = x << 64;

      if (xl < lo) xh -= 1;
      xl -= lo; // We rely on overflow behavior here
      lo = hi << 128;
      if (xl < lo) xh -= 1;
      xl -= lo; // We rely on overflow behavior here

      assert (xh == hi >> 128);

      result += xl / y;
    }

    require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    return uint128 (result);
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is unsigned 129.127 fixed point
   * number and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x unsigned 129.127-bit fixed point number
   * @param y uint256 value
   * @return unsigned 129.127-bit fixed point number
   */
  function powu (uint256 x, uint256 y) private pure returns (uint256) {
    if (y == 0) return 0x80000000000000000000000000000000;
    else if (x == 0) return 0;
    else {
      int256 msb = 0;
      uint256 xc = x;
      if (xc >= 0x100000000000000000000000000000000) { xc >>= 128; msb += 128; }
      if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      int256 xe = msb - 127;
      if (xe > 0) x >>= xe;
      else x <<= -xe;

      uint256 result = 0x80000000000000000000000000000000;
      int256 re = 0;

      while (y > 0) {
        if (y & 1 > 0) {
          result = result * x;
          y -= 1;
          re += xe;
          if (result >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            result >>= 128;
            re += 1;
          } else result >>= 127;
          if (re < -127) return 0; // Underflow
          require (re < 128); // Overflow
        } else {
          x = x * x;
          y >>= 1;
          xe <<= 1;
          if (x >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            x >>= 128;
            xe += 1;
          } else x >>= 127;
          if (xe < -127) return 0; // Underflow
          require (xe < 128); // Overflow
        }
      }

      if (re > 0) result <<= re;
      else if (re < 0) result >>= -re;

      return result;
    }
  }

  /**
   * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer
   * number.
   *
   * @param x unsigned 256-bit integer number
   * @return unsigned 128-bit integer number
   */
  function sqrtu (uint256 x, uint256 r) private pure returns (uint128) {
    if (x == 0) return 0;
    else {
      require (r > 0);
      while (true) {
        uint256 rr = x / r;
        if (r == rr || r + 1 == rr) return uint128 (r);
        else if (r == rr + 1) return uint128 (rr);
        r = r + rr + 1 >> 1;
      }
    }
  }
}

////// src/interfaces/IAssimilator.sol
// 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.5.0; */

interface IAssimilator {
    function intakeRaw (uint256 amount) external returns (int128);
    function intakeRawAndGetBalance (uint256 amount) external returns (int128, int128);
    function intakeNumeraire (int128 amount) external returns (uint256);
    function outputRaw (address dst, uint256 amount) external returns (int128);
    function outputRawAndGetBalance (address dst, uint256 amount) external returns (int128, int128);
    function outputNumeraire (address dst, int128 amount) external returns (uint256);
    function viewRawAmount (int128) external view returns (uint256);
    function viewNumeraireAmount (uint256) external view returns (int128);
    function viewNumeraireBalance (address) external view returns (int128);
    function viewNumeraireAmountAndBalance (address, uint256) external view returns (int128, int128);
}
////// src/Assimilators.sol
// 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.5.0; */

/* import "./interfaces/IAssimilator.sol"; */
/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

library Assimilators {

    using ABDKMath64x64 for int128;
    IAssimilator constant iAsmltr = IAssimilator(address(0));

    function delegate(address _callee, bytes memory _data) internal returns (bytes memory) {

        (bool _success, bytes memory returnData_) = _callee.delegatecall(_data);

        assembly { if eq(_success, 0) { revert(add(returnData_, 0x20), returndatasize()) } }

        return returnData_;

    }

    function viewRawAmount (address _assim, int128 _amt) internal view returns (uint256 amount_) {

        amount_ = IAssimilator(_assim).viewRawAmount(_amt);

    }

    function viewNumeraireAmount (address _assim, uint256 _amt) internal view returns (int128 amt_) {

        amt_ = IAssimilator(_assim).viewNumeraireAmount(_amt);

    }

    function viewNumeraireAmountAndBalance (address _assim, uint256 _amt) internal view returns (int128 amt_, int128 bal_) {

        ( amt_, bal_ ) = IAssimilator(_assim).viewNumeraireAmountAndBalance(address(this), _amt);

    }

    function viewNumeraireBalance (address _assim) internal view returns (int128 bal_) {

        bal_ = IAssimilator(_assim).viewNumeraireBalance(address(this));

    }

    function intakeRaw (address _assim, uint256 _amt) internal returns (int128 amt_) {

        bytes memory data = abi.encodeWithSelector(iAsmltr.intakeRaw.selector, _amt);

        amt_ = abi.decode(delegate(_assim, data), (int128));

    }

    function intakeRawAndGetBalance (address _assim, uint256 _amt) internal returns (int128 amt_, int128 bal_) {

        bytes memory data = abi.encodeWithSelector(iAsmltr.intakeRawAndGetBalance.selector, _amt);

        ( amt_, bal_ ) = abi.decode(delegate(_assim, data), (int128,int128));

    }

    function intakeNumeraire (address _assim, int128 _amt) internal returns (uint256 amt_) {

        bytes memory data = abi.encodeWithSelector(iAsmltr.intakeNumeraire.selector, _amt);

        amt_ = abi.decode(delegate(_assim, data), (uint256));

    }

    function outputRaw (address _assim, address _dst, uint256 _amt) internal returns (int128 amt_ ) {

        bytes memory data = abi.encodeWithSelector(iAsmltr.outputRaw.selector, _dst, _amt);

        amt_ = abi.decode(delegate(_assim, data), (int128));

        amt_ = amt_.neg();

    }

    function outputRawAndGetBalance (address _assim, address _dst, uint256 _amt) internal returns (int128 amt_, int128 bal_) {

        bytes memory data = abi.encodeWithSelector(iAsmltr.outputRawAndGetBalance.selector, _dst, _amt);

        ( amt_, bal_ ) = abi.decode(delegate(_assim, data), (int128,int128));

        amt_ = amt_.neg();

    }

    function outputNumeraire (address _assim, address _dst, int128 _amt) internal returns (uint256 amt_) {

        bytes memory data = abi.encodeWithSelector(iAsmltr.outputNumeraire.selector, _dst, _amt.abs());

        amt_ = abi.decode(delegate(_assim, data), (uint256));

    }

}
////// src/UnsafeMath64x64.sol
/* pragma solidity ^0.5.0; */

library UnsafeMath64x64 {

  /**
   * Calculate x * y rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */

  function us_mul (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) * y >> 64;
    return int128 (result);
  }

  /**
   * Calculate x / y rounding towards zero.  Revert on overflow or when y is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */

  function us_div (int128 x, int128 y) internal pure returns (int128) {
    int256 result = (int256 (x) << 64) / y;
    return int128 (result);
  }

}

////// src/PartitionedLiquidity.sol
/* pragma solidity ^0.5.0; */

/* import "./Assimilators.sol"; */

/* import "./ShellStorage.sol"; */

/* import "./UnsafeMath64x64.sol"; */

library PartitionedLiquidity {

    using ABDKMath64x64 for uint;
    using ABDKMath64x64 for int128;
    using UnsafeMath64x64 for int128;

    event PoolPartitioned(bool);

    event PartitionRedeemed(address indexed token, address indexed redeemer, uint value);

    int128 constant ONE = 0x10000000000000000;

    function partition (
        ShellStorage.Shell storage shell,
        mapping (address => ShellStorage.PartitionTicket) storage partitionTickets
    ) external {

        uint _length = shell.assets.length;

        ShellStorage.PartitionTicket storage totalSupplyTicket = partitionTickets[address(this)];

        totalSupplyTicket.initialized = true;

        for (uint i = 0; i < _length; i++) totalSupplyTicket.claims.push(shell.totalSupply);

        emit PoolPartitioned(true);

    }

    function viewPartitionClaims (
        ShellStorage.Shell storage shell,
        mapping (address => ShellStorage.PartitionTicket) storage partitionTickets,
        address _addr
    ) external view returns (
        uint[] memory claims_
    ) {

        ShellStorage.PartitionTicket storage ticket = partitionTickets[_addr];

        if (ticket.initialized) return ticket.claims;

        uint _length = shell.assets.length;
        uint[] memory claims_ = new uint[](_length);
        uint _balance = shell.balances[msg.sender];

        for (uint i = 0; i < _length; i++) claims_[i] = _balance;

        return claims_;

    }

    function partitionedWithdraw (
        ShellStorage.Shell storage shell,
        mapping (address => ShellStorage.PartitionTicket) storage partitionTickets,
        address[] calldata _derivatives,
        uint[] calldata _withdrawals
    ) external returns (
        uint[] memory
    ) {

        uint _length = shell.assets.length;
        uint _balance = shell.balances[msg.sender];

        ShellStorage.PartitionTicket storage totalSuppliesTicket = partitionTickets[address(this)];
        ShellStorage.PartitionTicket storage ticket = partitionTickets[msg.sender];

        if (!ticket.initialized) {

            for (uint i = 0; i < _length; i++) ticket.claims.push(_balance);
            ticket.initialized = true;

        }

        _length = _derivatives.length;

        uint[] memory withdrawals_ = new uint[](_length);

        for (uint i = 0; i < _length; i++) {

            ShellStorage.Assimilator memory _assim = shell.assimilators[_derivatives[i]];

            require(totalSuppliesTicket.claims[_assim.ix] >= _withdrawals[i], "Shell/burn-exceeds-total-supply");
            
            require(ticket.claims[_assim.ix] >= _withdrawals[i], "Shell/insufficient-balance");

            require(_assim.addr != address(0), "Shell/unsupported-asset");

            int128 _reserveBalance = Assimilators.viewNumeraireBalance(_assim.addr);

            int128 _multiplier = _withdrawals[i].divu(1e18)
                .div(totalSuppliesTicket.claims[_assim.ix].divu(1e18));

            totalSuppliesTicket.claims[_assim.ix] = totalSuppliesTicket.claims[_assim.ix] - _withdrawals[i];

            ticket.claims[_assim.ix] = ticket.claims[_assim.ix] - _withdrawals[i];

            uint _withdrawal = Assimilators.outputNumeraire(
                _assim.addr,
                msg.sender,
                _reserveBalance.mul(_multiplier)
            );

            withdrawals_[i] = _withdrawal;

            emit PartitionRedeemed(_derivatives[i], msg.sender, withdrawals_[i]);

        }

        return withdrawals_;

    }

}
////// src/ProportionalLiquidity.sol
/* pragma solidity ^0.5.0; */

/* import "./Assimilators.sol"; */

/* import "./ShellStorage.sol"; */

/* import "./UnsafeMath64x64.sol"; */

/* import "./ShellMath.sol"; */


library ProportionalLiquidity {

    using ABDKMath64x64 for uint;
    using ABDKMath64x64 for int128;
    using UnsafeMath64x64 for int128;

    event Transfer(address indexed from, address indexed to, uint256 value);

    int128 constant ONE = 0x10000000000000000;
    int128 constant ONE_WEI = 0x12;

    function proportionalDeposit (
        ShellStorage.Shell storage shell,
        uint256 _deposit
    ) external returns (
        uint256 shells_,
        uint[] memory
    ) {

        int128 __deposit = _deposit.divu(1e18);

        uint _length = shell.assets.length;

        uint[] memory deposits_ = new uint[](_length);
        
        ( int128 _oGLiq, int128[] memory _oBals ) = getGrossLiquidityAndBalances(shell);

        if (_oGLiq == 0) {

            for (uint i = 0; i < _length; i++) {

                deposits_[i] = Assimilators.intakeNumeraire(shell.assets[i].addr, __deposit.mul(shell.weights[i]));

            }

        } else {

            int128 _multiplier = __deposit.div(_oGLiq);

            for (uint i = 0; i < _length; i++) {

                deposits_[i] = Assimilators.intakeNumeraire(shell.assets[i].addr, _oBals[i].mul(_multiplier));

            }

        }
        
        int128 _totalShells = shell.totalSupply.divu(1e18);
        
        int128 _newShells = _totalShells > 0
            ? __deposit.div(_oGLiq).mul(_totalShells)
            : __deposit;

        requireLiquidityInvariant(
            shell, 
            _totalShells,
            _newShells, 
            _oGLiq, 
            _oBals
        );        

        mint(shell, msg.sender, shells_ = _newShells.mulu(1e18));

        return (shells_, deposits_);

    }
    
    
    function viewProportionalDeposit (
        ShellStorage.Shell storage shell,
        uint256 _deposit
    ) external view returns (
        uint shells_,
        uint[] memory
    ) {

        int128 __deposit = _deposit.divu(1e18);

        uint _length = shell.assets.length;

        ( int128 _oGLiq, int128[] memory _oBals ) = getGrossLiquidityAndBalances(shell);

        uint[] memory deposits_ = new uint[](_length);

        if (_oGLiq == 0) {

            for (uint i = 0; i < _length; i++) {

                deposits_[i] = Assimilators.viewRawAmount(
                    shell.assets[i].addr,
                    __deposit.mul(shell.weights[i])
                );

            }

        } else {

            int128 _multiplier = __deposit.div(_oGLiq);

            for (uint i = 0; i < _length; i++) {

                deposits_[i] = Assimilators.viewRawAmount(
                    shell.assets[i].addr,
                    _oBals[i].mul(_multiplier)
                );

            }

        }
        
        int128 _totalShells = shell.totalSupply.divu(1e18);
        
        int128 _newShells = _totalShells > 0
            ? __deposit.div(_oGLiq).mul(_totalShells)
            : __deposit;
        
        shells_ = _newShells.mulu(1e18);

        return ( shells_, deposits_ );

    }

    function proportionalWithdraw (
        ShellStorage.Shell storage shell,
        uint256 _withdrawal
    ) external returns (
        uint[] memory
    ) {

        uint _length = shell.assets.length;

        ( int128 _oGLiq, int128[] memory _oBals ) = getGrossLiquidityAndBalances(shell);

        uint[] memory withdrawals_ = new uint[](_length);
        
        int128 _totalShells = shell.totalSupply.divu(1e18);
        int128 __withdrawal = _withdrawal.divu(1e18);

        int128 _multiplier = __withdrawal
            .mul(ONE - shell.epsilon)
            .div(_totalShells);

        for (uint i = 0; i < _length; i++) {

            withdrawals_[i] = Assimilators.outputNumeraire(
                shell.assets[i].addr,
                msg.sender,
                _oBals[i].mul(_multiplier)
            );

        }

        requireLiquidityInvariant(
            shell, 
            _totalShells, 
            __withdrawal.neg(), 
            _oGLiq, 
            _oBals
        );
        
        burn(shell, msg.sender, _withdrawal);

        return withdrawals_;

    }
    
    function viewProportionalWithdraw (
        ShellStorage.Shell storage shell,
        uint256 _withdrawal
    ) external view returns (
        uint[] memory
    ) {

        uint _length = shell.assets.length;

        ( int128 _oGLiq, int128[] memory _oBals ) = getGrossLiquidityAndBalances(shell);

        uint[] memory withdrawals_ = new uint[](_length);

        int128 _multiplier = _withdrawal.divu(1e18)
            .mul(ONE - shell.epsilon)
            .div(shell.totalSupply.divu(1e18));

        for (uint i = 0; i < _length; i++) {

            withdrawals_[i] = Assimilators.viewRawAmount(shell.assets[i].addr, _oBals[i].mul(_multiplier));

        }

        return withdrawals_;

    }

    function getGrossLiquidityAndBalances (
        ShellStorage.Shell storage shell
    ) internal view returns (
        int128 grossLiquidity_,
        int128[] memory
    ) {
        
        uint _length = shell.assets.length;

        int128[] memory balances_ = new int128[](_length);
        
        for (uint i = 0; i < _length; i++) {

            int128 _bal = Assimilators.viewNumeraireBalance(shell.assets[i].addr);
            
            balances_[i] = _bal;
            grossLiquidity_ += _bal;
            
        }
        
        return (grossLiquidity_, balances_);

    }
    
    function requireLiquidityInvariant (
        ShellStorage.Shell storage shell,
        int128 _shells,
        int128 _newShells,
        int128 _oGLiq,
        int128[] memory _oBals
    ) private {
    
        ( int128 _nGLiq, int128[] memory _nBals ) = getGrossLiquidityAndBalances(shell);
        
        int128 _beta = shell.beta;
        int128 _delta = shell.delta;
        int128[] memory _weights = shell.weights;
        
        int128 _omega = ShellMath.calculateFee(_oGLiq, _oBals, _beta, _delta, _weights);

        int128 _psi = ShellMath.calculateFee(_nGLiq, _nBals, _beta, _delta, _weights);

        ShellMath.enforceLiquidityInvariant(_shells, _newShells, _oGLiq, _nGLiq, _omega, _psi);
        
    }

    function burn (ShellStorage.Shell storage shell, address account, uint256 amount) private {

        shell.balances[account] = burn_sub(shell.balances[account], amount);

        shell.totalSupply = burn_sub(shell.totalSupply, amount);

        emit Transfer(msg.sender, address(0), amount);

    }

    function mint (ShellStorage.Shell storage shell, address account, uint256 amount) private {

        shell.totalSupply = mint_add(shell.totalSupply, amount);

        shell.balances[account] = mint_add(shell.balances[account], amount);

        emit Transfer(address(0), msg.sender, amount);

    }

    function mint_add(uint x, uint y) private pure returns (uint z) {

        require((z = x + y) >= x, "Shell/mint-overflow");

    }

    function burn_sub(uint x, uint y) private pure returns (uint z) {

        require((z = x - y) <= x, "Shell/burn-underflow");

    }


}
////// src/SelectiveLiquidity.sol
/* pragma solidity ^0.5.0; */

/* import "./Assimilators.sol"; */

/* import "./ShellStorage.sol"; */

/* import "./ShellMath.sol"; */

/* import "./UnsafeMath64x64.sol"; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */


library SelectiveLiquidity {

    using ABDKMath64x64 for int128;
    using UnsafeMath64x64 for int128;

    event Transfer(address indexed from, address indexed to, uint256 value);

    int128 constant ONE = 0x10000000000000000;

    function selectiveDeposit (
        ShellStorage.Shell storage shell,
        address[] calldata _derivatives,
        uint[] calldata _amounts,
        uint _minShells
    ) external returns (
        uint shells_
    ) {

        (   int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _oBals,
            int128[] memory _nBals ) = getLiquidityDepositData(shell, _derivatives, _amounts);

        int128 _shells = ShellMath.calculateLiquidityMembrane(shell, _oGLiq, _nGLiq, _oBals, _nBals);

        shells_ = _shells.mulu(1e18);

        require(_minShells < shells_, "Shell/under-minimum-shells");

        mint(shell, msg.sender, shells_);

    }

    function viewSelectiveDeposit (
        ShellStorage.Shell storage shell,
        address[] calldata _derivatives,
        uint[] calldata _amounts
    ) external view returns (
        uint shells_
    ) {

        (   int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _oBals,
            int128[] memory _nBals ) = viewLiquidityDepositData(shell, _derivatives, _amounts);

        int128 _shells = ShellMath.calculateLiquidityMembrane(shell, _oGLiq, _nGLiq, _oBals, _nBals);

        shells_ = _shells.mulu(1e18);

    }

    function selectiveWithdraw (
        ShellStorage.Shell storage shell,
        address[] calldata _derivatives,
        uint[] calldata _amounts,
        uint _maxShells
    ) external returns (
        uint256 shells_
    ) {

        (   int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _oBals,
            int128[] memory _nBals ) = getLiquidityWithdrawData(shell, _derivatives, msg.sender, _amounts);

        int128 _shells = ShellMath.calculateLiquidityMembrane(shell, _oGLiq, _nGLiq, _oBals, _nBals);

        _shells = _shells.neg().us_mul(ONE + shell.epsilon);

        shells_ = _shells.mulu(1e18);

        require(shells_ < _maxShells, "Shell/above-maximum-shells");

        burn(shell, msg.sender, shells_);

    }

    function viewSelectiveWithdraw (
        ShellStorage.Shell storage shell,
        address[] calldata _derivatives,
        uint[] calldata _amounts
    ) external view returns (
        uint shells_
    ) {

        (   int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _oBals,
            int128[] memory _nBals ) = viewLiquidityWithdrawData(shell, _derivatives, _amounts);

        int128 _shells = ShellMath.calculateLiquidityMembrane(shell, _oGLiq, _nGLiq, _oBals, _nBals);

        _shells = _shells.neg().us_mul(ONE + shell.epsilon);

        shells_ = _shells.mulu(1e18);

    }

    function getLiquidityDepositData (
        ShellStorage.Shell storage shell,
        address[] memory _derivatives,
        uint[] memory _amounts
    ) private returns (
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.weights.length;
        int128[] memory oBals_ = new int128[](_length);
        int128[] memory nBals_ = new int128[](_length);

        for (uint i = 0; i < _derivatives.length; i++) {

            ShellStorage.Assimilator memory _assim = shell.assimilators[_derivatives[i]];

            require(_assim.addr != address(0), "Shell/unsupported-derivative");

            if ( nBals_[_assim.ix] == 0 && 0 == oBals_[_assim.ix]) {

                ( int128 _amount, int128 _balance ) = Assimilators.intakeRawAndGetBalance(_assim.addr, _amounts[i]);

                nBals_[_assim.ix] = _balance;

                oBals_[_assim.ix] = _balance.sub(_amount);

            } else {

                int128 _amount = Assimilators.intakeRaw(_assim.addr, _amounts[i]);

                nBals_[_assim.ix] = nBals_[_assim.ix].add(_amount);

            }

        }

        return completeLiquidityData(shell, oBals_, nBals_);

    }

    function getLiquidityWithdrawData (
        ShellStorage.Shell storage shell,
        address[] memory _derivatives,
        address _rcpnt,
        uint[] memory _amounts
    ) private returns (
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.weights.length;
        int128[] memory oBals_ = new int128[](_length);
        int128[] memory nBals_ = new int128[](_length);

        for (uint i = 0; i < _derivatives.length; i++) {

            ShellStorage.Assimilator memory _assim = shell.assimilators[_derivatives[i]];

            require(_assim.addr != address(0), "Shell/unsupported-derivative");

            if ( nBals_[_assim.ix] == 0 && 0 == oBals_[_assim.ix]) {

                ( int128 _amount, int128 _balance ) = Assimilators.outputRawAndGetBalance(_assim.addr, _rcpnt, _amounts[i]);

                nBals_[_assim.ix] = _balance;
                oBals_[_assim.ix] = _balance.sub(_amount);

            } else {

                int128 _amount = Assimilators.outputRaw(_assim.addr, _rcpnt, _amounts[i]);

                nBals_[_assim.ix] = nBals_[_assim.ix].add(_amount);

            }

        }

        return completeLiquidityData(shell, oBals_, nBals_);

    }

    function viewLiquidityDepositData (
        ShellStorage.Shell storage shell,
        address[] memory _derivatives,
        uint[] memory _amounts
    ) private view returns (
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.assets.length;
        int128[] memory oBals_ = new int128[](_length);
        int128[] memory nBals_ = new int128[](_length);

        for (uint i = 0; i < _derivatives.length; i++) {

            ShellStorage.Assimilator memory _assim = shell.assimilators[_derivatives[i]];

            require(_assim.addr != address(0), "Shell/unsupported-derivative");

            if ( nBals_[_assim.ix] == 0 && 0 == oBals_[_assim.ix]) {

                ( int128 _amount, int128 _balance ) = Assimilators.viewNumeraireAmountAndBalance(_assim.addr, _amounts[i]);

                nBals_[_assim.ix] = _balance.add(_amount);

                oBals_[_assim.ix] = _balance;

            } else {

                int128 _amount = Assimilators.viewNumeraireAmount(_assim.addr, _amounts[i]);

                nBals_[_assim.ix] = nBals_[_assim.ix].add(_amount);

            }

        }

        return completeLiquidityData(shell, oBals_, nBals_);

    }

    function viewLiquidityWithdrawData (
        ShellStorage.Shell storage shell,
        address[] memory _derivatives,
        uint[] memory _amounts
    ) private view returns (
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.assets.length;
        int128[] memory oBals_ = new int128[](_length);
        int128[] memory nBals_ = new int128[](_length);

        for (uint i = 0; i < _derivatives.length; i++) {

            ShellStorage.Assimilator memory _assim = shell.assimilators[_derivatives[i]];

            require(_assim.addr != address(0), "Shell/unsupported-derivative");

            if ( nBals_[_assim.ix] == 0 && 0 == oBals_[_assim.ix]) {

                ( int128 _amount, int128 _balance ) = Assimilators.viewNumeraireAmountAndBalance(_assim.addr, _amounts[i]);

                nBals_[_assim.ix] = _balance.sub(_amount);

                oBals_[_assim.ix] = _balance;

            } else {

                int128 _amount = Assimilators.viewNumeraireAmount(_assim.addr, _amounts[i]);

                nBals_[_assim.ix] = nBals_[_assim.ix].sub(_amount);

            }

        }

        return completeLiquidityData(shell, oBals_, nBals_);

    }

    function completeLiquidityData (
        ShellStorage.Shell storage shell,
        int128[] memory oBals_,
        int128[] memory nBals_
    ) private view returns (
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = oBals_.length;

        for (uint i = 0; i < _length; i++) {

            if (oBals_[i] == 0 && 0 == nBals_[i]) {

                nBals_[i] = oBals_[i] = Assimilators.viewNumeraireBalance(shell.assets[i].addr);
                
            }

            oGLiq_ += oBals_[i];
            nGLiq_ += nBals_[i];

        }

        return ( oGLiq_, nGLiq_, oBals_, nBals_ );

    }

    function burn (ShellStorage.Shell storage shell, address account, uint256 amount) private {

        shell.balances[account] = burn_sub(shell.balances[account], amount);

        shell.totalSupply = burn_sub(shell.totalSupply, amount);

        emit Transfer(msg.sender, address(0), amount);

    }

    function mint (ShellStorage.Shell storage shell, address account, uint256 amount) private {

        shell.totalSupply = mint_add(shell.totalSupply, amount);

        shell.balances[account] = mint_add(shell.balances[account], amount);

        emit Transfer(address(0), msg.sender, amount);

    }

    function mint_add(uint x, uint y) private pure returns (uint z) {
        require((z = x + y) >= x, "Shell/mint-overflow");
    }

    function burn_sub(uint x, uint y) private pure returns (uint z) {
        require((z = x - y) <= x, "Shell/burn-underflow");
    }

}
////// src/Shells.sol
// 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.5.0; */

/* import "./ShellStorage.sol"; */

/* import "./Assimilators.sol"; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

library Shells {

    using ABDKMath64x64 for int128;

    event Approval(address indexed _owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);

    function add(uint x, uint y, string memory errorMessage) private pure returns (uint z) {
        require((z = x + y) >= x, errorMessage);
    }

    function sub(uint x, uint y, string memory errorMessage) private pure returns (uint z) {
        require((z = x - y) <= x, errorMessage);
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(ShellStorage.Shell storage shell, address recipient, uint256 amount) external returns (bool) {
        _transfer(shell, msg.sender, recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(ShellStorage.Shell storage shell, address spender, uint256 amount) external returns (bool) {
        _approve(shell, msg.sender, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for `sender`'s tokens of at least
     * `amount`
     */
    function transferFrom(ShellStorage.Shell storage shell, address sender, address recipient, uint256 amount) external returns (bool) {
        _transfer(shell, msg.sender, recipient, amount);
        _approve(shell, sender, msg.sender, sub(shell.allowances[sender][msg.sender], amount, "Shell/insufficient-allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(ShellStorage.Shell storage shell, address spender, uint256 addedValue) external returns (bool) {
        _approve(shell, msg.sender, spender, add(shell.allowances[msg.sender][spender], addedValue, "Shell/approval-overflow"));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(ShellStorage.Shell storage shell, address spender, uint256 subtractedValue) external returns (bool) {
        _approve(shell, msg.sender, spender, sub(shell.allowances[msg.sender][spender], subtractedValue, "Shell/allowance-decrease-underflow"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is public function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(ShellStorage.Shell storage shell, address sender, address recipient, uint256 amount) private {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        shell.balances[sender] = sub(shell.balances[sender], amount, "Shell/insufficient-balance");
        shell.balances[recipient] = add(shell.balances[recipient], amount, "Shell/transfer-overflow");
        emit Transfer(sender, recipient, amount);
    }


    /**
     * @dev Sets `amount` as the allowance of `spender` over the `_owner`s tokens.
     *
     * This is public function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `_owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(ShellStorage.Shell storage shell, address _owner, address spender, uint256 amount) private {
        require(_owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        shell.allowances[_owner][spender] = amount;
        emit Approval(_owner, spender, amount);
    }

}
////// src/Swaps.sol
/* pragma solidity ^0.5.0; */

/* import "./Assimilators.sol"; */

/* import "./ShellStorage.sol"; */

/* import "./ShellMath.sol"; */

/* import "./UnsafeMath64x64.sol"; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

library Swaps {

    using ABDKMath64x64 for int128;
    using UnsafeMath64x64 for int128;

    event Trade(address indexed trader, address indexed origin, address indexed target, uint256 originAmount, uint256 targetAmount);

    int128 constant ONE = 0x10000000000000000;

    function getOriginAndTarget (
        ShellStorage.Shell storage shell,
        address _o,
        address _t
    ) private view returns (
        ShellStorage.Assimilator memory,
        ShellStorage.Assimilator memory
    ) {

        ShellStorage.Assimilator memory o_ = shell.assimilators[_o];
        ShellStorage.Assimilator memory t_ = shell.assimilators[_t];

        require(o_.addr != address(0), "Shell/origin-not-supported");
        require(t_.addr != address(0), "Shell/target-not-supported");

        return ( o_, t_ );

    }


    function originSwap (
        ShellStorage.Shell storage shell,
        address _origin,
        address _target,
        uint256 _originAmount,
        address _recipient
    ) external returns (
        uint256 tAmt_
    ) {

        (   ShellStorage.Assimilator memory _o,
            ShellStorage.Assimilator memory _t  ) = getOriginAndTarget(shell, _origin, _target);

        if (_o.ix == _t.ix) return Assimilators.outputNumeraire(_t.addr, _recipient, Assimilators.intakeRaw(_o.addr, _originAmount));

        (   int128 _amt,
            int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _oBals,
            int128[] memory _nBals ) = getOriginSwapData(shell, _o.ix, _t.ix, _o.addr, _originAmount);

        _amt = ShellMath.calculateTrade(shell, _oGLiq, _nGLiq, _oBals, _nBals, _amt, _t.ix);

        _amt = _amt.us_mul(ONE - shell.epsilon);

        tAmt_ = Assimilators.outputNumeraire(_t.addr, _recipient, _amt);

        emit Trade(msg.sender, _origin, _target, _originAmount, tAmt_);

    }

    function viewOriginSwap (
        ShellStorage.Shell storage shell,
        address _origin,
        address _target,
        uint256 _originAmount
    ) external view returns (
        uint256 tAmt_
    ) {

        (   ShellStorage.Assimilator memory _o,
            ShellStorage.Assimilator memory _t  ) = getOriginAndTarget(shell, _origin, _target);

        if (_o.ix == _t.ix) return Assimilators.viewRawAmount(_t.addr, Assimilators.viewNumeraireAmount(_o.addr, _originAmount));

        (   int128 _amt,
            int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _nBals,
            int128[] memory _oBals ) = viewOriginSwapData(shell, _o.ix, _t.ix, _originAmount, _o.addr);

        _amt = ShellMath.calculateTrade(shell, _oGLiq, _nGLiq, _oBals, _nBals, _amt, _t.ix);

        _amt = _amt.us_mul(ONE - shell.epsilon);

        tAmt_ = Assimilators.viewRawAmount(_t.addr, _amt.abs());

    }

    function targetSwap (
        ShellStorage.Shell storage shell,
        address _origin,
        address _target,
        uint256 _targetAmount,
        address _recipient
    ) external returns (
        uint256 oAmt_
    ) {

        (   ShellStorage.Assimilator memory _o,
            ShellStorage.Assimilator memory _t  ) = getOriginAndTarget(shell, _origin, _target);

        if (_o.ix == _t.ix) return Assimilators.intakeNumeraire(_o.addr, Assimilators.outputRaw(_t.addr, _recipient, _targetAmount));

        (   int128 _amt,
            int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _oBals,
            int128[] memory _nBals) = getTargetSwapData(shell, _t.ix, _o.ix, _t.addr, _recipient, _targetAmount);

        _amt = ShellMath.calculateTrade(shell, _oGLiq, _nGLiq, _oBals, _nBals, _amt, _o.ix);

        _amt = _amt.us_mul(ONE + shell.epsilon);

        oAmt_ = Assimilators.intakeNumeraire(_o.addr, _amt);

        emit Trade(msg.sender, _origin, _target, oAmt_, _targetAmount);

    }

    function viewTargetSwap (
        ShellStorage.Shell storage shell,
        address _origin,
        address _target,
        uint256 _targetAmount
    ) external view returns (
        uint256 oAmt_
    ) {

        (   ShellStorage.Assimilator memory _o,
            ShellStorage.Assimilator memory _t  ) = getOriginAndTarget(shell, _origin, _target);

        if (_o.ix == _t.ix) return Assimilators.viewRawAmount(_o.addr, Assimilators.viewNumeraireAmount(_t.addr, _targetAmount));

        (   int128 _amt,
            int128 _oGLiq,
            int128 _nGLiq,
            int128[] memory _nBals,
            int128[] memory _oBals ) = viewTargetSwapData(shell, _t.ix, _o.ix, _targetAmount, _t.addr);

        _amt = ShellMath.calculateTrade(shell, _oGLiq, _nGLiq, _oBals, _nBals, _amt, _o.ix);

        _amt = _amt.us_mul(ONE + shell.epsilon);

        oAmt_ = Assimilators.viewRawAmount(_o.addr, _amt);

    }

    function getOriginSwapData (
        ShellStorage.Shell storage shell,
        uint _inputIx,
        uint _outputIx,
        address _assim,
        uint _amt
    ) private returns (
        int128 amt_,
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.assets.length;

        int128[] memory oBals_ = new int128[](_length);
        int128[] memory nBals_ = new int128[](_length);
        ShellStorage.Assimilator[] memory _reserves = shell.assets;

        for (uint i = 0; i < _length; i++) {

            if (i != _inputIx) nBals_[i] = oBals_[i] = Assimilators.viewNumeraireBalance(_reserves[i].addr);
            else {

                int128 _bal;
                ( amt_, _bal ) = Assimilators.intakeRawAndGetBalance(_assim, _amt);

                oBals_[i] = _bal.sub(amt_);
                nBals_[i] = _bal;

            }

            oGLiq_ += oBals_[i];
            nGLiq_ += nBals_[i];

        }

        nGLiq_ = nGLiq_.sub(amt_);
        nBals_[_outputIx] = ABDKMath64x64.sub(nBals_[_outputIx], amt_);

        return ( amt_, oGLiq_, nGLiq_, oBals_, nBals_ );

    }

    function getTargetSwapData (
        ShellStorage.Shell storage shell,
        uint _inputIx,
        uint _outputIx,
        address _assim,
        address _recipient,
        uint _amt
    ) private returns (
        int128 amt_,
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.assets.length;

        int128[] memory oBals_ = new int128[](_length);
        int128[] memory nBals_ = new int128[](_length);
        ShellStorage.Assimilator[] memory _reserves = shell.assets;

        for (uint i = 0; i < _length; i++) {

            if (i != _inputIx) nBals_[i] = oBals_[i] = Assimilators.viewNumeraireBalance(_reserves[i].addr);
            else {

                int128 _bal;
                ( amt_, _bal ) = Assimilators.outputRawAndGetBalance(_assim, _recipient, _amt);

                oBals_[i] = _bal.sub(amt_);
                nBals_[i] = _bal;

            }

            oGLiq_ += oBals_[i];
            nGLiq_ += nBals_[i];

        }

        nGLiq_ = nGLiq_.sub(amt_);
        nBals_[_outputIx] = ABDKMath64x64.sub(nBals_[_outputIx], amt_);

        return ( amt_, oGLiq_, nGLiq_, oBals_, nBals_ );

    }

    function viewOriginSwapData (
        ShellStorage.Shell storage shell,
        uint _inputIx,
        uint _outputIx,
        uint _amt,
        address _assim
    ) private view returns (
        int128 amt_,
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.assets.length;
        int128[] memory nBals_ = new int128[](_length);
        int128[] memory oBals_ = new int128[](_length);

        for (uint i = 0; i < _length; i++) {

            if (i != _inputIx) nBals_[i] = oBals_[i] = Assimilators.viewNumeraireBalance(shell.assets[i].addr);
            else {

                int128 _bal;
                ( amt_, _bal ) = Assimilators.viewNumeraireAmountAndBalance(_assim, _amt);

                oBals_[i] = _bal;
                nBals_[i] = _bal.add(amt_);

            }

            oGLiq_ += oBals_[i];
            nGLiq_ += nBals_[i];

        }

        nGLiq_ = nGLiq_.sub(amt_);
        nBals_[_outputIx] = ABDKMath64x64.sub(nBals_[_outputIx], amt_);

        return ( amt_, oGLiq_, nGLiq_, nBals_, oBals_ );

    }

    function viewTargetSwapData (
        ShellStorage.Shell storage shell,
        uint _inputIx,
        uint _outputIx,
        uint _amt,
        address _assim
    ) private view returns (
        int128 amt_,
        int128 oGLiq_,
        int128 nGLiq_,
        int128[] memory,
        int128[] memory
    ) {

        uint _length = shell.assets.length;
        int128[] memory nBals_ = new int128[](_length);
        int128[] memory oBals_ = new int128[](_length);

        for (uint i = 0; i < _length; i++) {

            if (i != _inputIx) nBals_[i] = oBals_[i] = Assimilators.viewNumeraireBalance(shell.assets[i].addr);
            else {

                int128 _bal;
                ( amt_, _bal ) = Assimilators.viewNumeraireAmountAndBalance(_assim, _amt);
                amt_ = amt_.neg();

                oBals_[i] = _bal;
                nBals_[i] = _bal.add(amt_);

            }

            oGLiq_ += oBals_[i];
            nGLiq_ += nBals_[i];

        }

        nGLiq_ = nGLiq_.sub(amt_);
        nBals_[_outputIx] = ABDKMath64x64.sub(nBals_[_outputIx], amt_);


        return ( amt_, oGLiq_, nGLiq_, nBals_, oBals_ );

    }

}
////// src/ViewLiquidity.sol
// 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.5.0; */

/* import "./ShellStorage.sol"; */

/* import "./Assimilators.sol"; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

library ViewLiquidity {

    using ABDKMath64x64 for int128;

    function viewLiquidity (
        ShellStorage.Shell storage shell
    ) external view returns (
        uint total_,
        uint[] memory individual_
    ) {

        uint _length = shell.assets.length;

        uint[] memory individual_ = new uint[](_length);
        uint total_;

        for (uint i = 0; i < _length; i++) {

            uint _liquidity = Assimilators.viewNumeraireBalance(shell.assets[i].addr).mulu(1e18);

            total_ += _liquidity;
            individual_[i] = _liquidity;

        }

        return (total_, individual_);

    }

}
////// src/ShellStorage.sol
// 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.5.0; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

/* import "./Orchestrator.sol"; */

/* import "./PartitionedLiquidity.sol"; */

/* import "./ProportionalLiquidity.sol"; */

/* import "./SelectiveLiquidity.sol"; */

/* import "./Shells.sol"; */

/* import "./Swaps.sol"; */

/* import "./ViewLiquidity.sol"; */

contract ShellStorage {

    address public owner;

    string  public constant name = "Shells";
    string  public constant symbol = "SHL";
    uint8   public constant decimals = 18;

    Shell public shell;

    struct Shell {
        int128 alpha;
        int128 beta;
        int128 delta;
        int128 epsilon;
        int128 lambda;
        int128[] weights;
        uint totalSupply;
        Assimilator[] assets;
        mapping (address => Assimilator) assimilators;
        mapping (address => uint) balances;
        mapping (address => mapping (address => uint)) allowances;
    }

    struct Assimilator {
        address addr;
        uint8 ix;
    }

    mapping (address => PartitionTicket) public partitionTickets;

    struct PartitionTicket {
        uint[] claims;
        bool initialized;
    }

    address[] public derivatives;
    address[] public numeraires;
    address[] public reserves;

    bool public partitioned = false;

    bool public frozen = false;

    bool internal notEntered = true;

}
////// src/ShellMath.sol
// 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.5.0; */

/* import "./Assimilators.sol"; */

/* import "./UnsafeMath64x64.sol"; */

/* import "./ShellStorage.sol"; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

library ShellMath {

    int128 constant ONE = 0x10000000000000000;
    int128 constant MAX = 0x4000000000000000; // .25 in layman's terms
    int128 constant MAX_DIFF = -0x10C6F7A0B5EE;
    int128 constant ONE_WEI = 0x12;

    using ABDKMath64x64 for int128;
    using UnsafeMath64x64 for int128;
    using ABDKMath64x64 for uint256;

    function calculateFee (
        int128 _gLiq,
        int128[] memory _bals,
        int128 _beta,
        int128 _delta,
        int128[] memory _weights
    ) internal pure returns (int128 psi_) {

        uint _length = _bals.length;

        for (uint i = 0; i < _length; i++) {

            int128 _ideal = _gLiq.us_mul(_weights[i]);

            psi_ += calculateMicroFee(_bals[i], _ideal, _beta, _delta);

        }

    }

    function calculateMicroFee (
        int128 _bal,
        int128 _ideal,
        int128 _beta,
        int128 _delta
    ) private pure returns (int128 fee_) {

        if (_bal < _ideal) {

            int128 _threshold = _ideal.us_mul(ONE - _beta);

            if (_bal < _threshold) {

                int128 _feeMargin = _threshold - _bal;

                fee_ = _feeMargin.us_div(_ideal);
                fee_ = fee_.us_mul(_delta);

                if (fee_ > MAX) fee_ = MAX;

                fee_ = fee_.us_mul(_feeMargin);

            } else fee_ = 0;

        } else {

            int128 _threshold = _ideal.us_mul(ONE + _beta);

            if (_bal > _threshold) {

                int128 _feeMargin = _bal - _threshold;

                fee_ = _feeMargin.us_div(_ideal);
                fee_ = fee_.us_mul(_delta);

                if (fee_ > MAX) fee_ = MAX;

                fee_ = fee_.us_mul(_feeMargin);

            } else fee_ = 0;

        }

    }

    function calculateTrade (
        ShellStorage.Shell storage shell,
        int128 _oGLiq,
        int128 _nGLiq,
        int128[] memory _oBals,
        int128[] memory _nBals,
        int128 _inputAmt,
        uint _outputIndex
    ) internal view returns (int128 outputAmt_) {

        outputAmt_ = - _inputAmt;

        int128 _lambda = shell.lambda;
        int128 _beta = shell.beta;
        int128 _delta = shell.delta;
        int128[] memory _weights = shell.weights;

        int128 _omega = calculateFee(_oGLiq, _oBals, _beta, _delta, _weights);
        int128 _psi;

        for (uint i = 0; i < 32; i++) {

            _psi = calculateFee(_nGLiq, _nBals, _beta, _delta, _weights);

            if (( outputAmt_ = _omega < _psi
                    ? - ( _inputAmt + _omega - _psi )
                    : - ( _inputAmt + _lambda.us_mul(_omega - _psi) )
                ) / 1e13 == outputAmt_ / 1e13 ) {

                _nGLiq = _oGLiq + _inputAmt + outputAmt_;

                _nBals[_outputIndex] = _oBals[_outputIndex] + outputAmt_;

                enforceHalts(shell, _oGLiq, _nGLiq, _oBals, _nBals, _weights);
                
                enforceSwapInvariant(_oGLiq, _omega, _nGLiq, _psi);

                return outputAmt_;

            } else {

                _nGLiq = _oGLiq + _inputAmt + outputAmt_;

                _nBals[_outputIndex] = _oBals[_outputIndex].add(outputAmt_);

            }

        }

        revert("Shell/swap-convergence-failed");

    }
    
    function enforceSwapInvariant (
        int128 _oGLiq,
        int128 _omega,
        int128 _nGLiq,
        int128 _psi
    ) private pure {

        int128 _nextUtil = _nGLiq - _psi;

        int128 _prevUtil = _oGLiq - _omega;

        int128 _diff = _nextUtil - _prevUtil;

        require(0 < _diff || _diff >= MAX_DIFF, "Shell/swap-invariant-violation");
        
    }

    function calculateLiquidityMembrane (
        ShellStorage.Shell storage shell,
        int128 _oGLiq,
        int128 _nGLiq,
        int128[] memory _oBals,
        int128[] memory _nBals
    ) internal view returns (int128 shells_) {

        enforceHalts(shell, _oGLiq, _nGLiq, _oBals, _nBals, shell.weights);
        
        int128 _omega;
        int128 _psi;
        
        {
            
            int128 _beta = shell.beta;
            int128 _delta = shell.delta;
            int128[] memory _weights = shell.weights;

            _omega = calculateFee(_oGLiq, _oBals, _beta, _delta, _weights);
            _psi = calculateFee(_nGLiq, _nBals, _beta, _delta, _weights);

        }

        int128 _feeDiff = _psi.sub(_omega);
        int128 _liqDiff = _nGLiq.sub(_oGLiq);
        int128 _oUtil = _oGLiq.sub(_omega);
        int128 _totalShells = shell.totalSupply.divu(1e18);
        int128 _shellMultiplier;

        if (_totalShells == 0) {

            shells_ = _nGLiq.sub(_psi);

        } else if (_feeDiff >= 0) {

            _shellMultiplier = _liqDiff.sub(_feeDiff).div(_oUtil);

        } else {
            
            _shellMultiplier = _liqDiff.sub(shell.lambda.mul(_feeDiff));
            
            _shellMultiplier = _shellMultiplier.div(_oUtil);

        }

        if (_totalShells != 0) {

            shells_ = _totalShells.us_mul(_shellMultiplier);
            
            enforceLiquidityInvariant(_totalShells, shells_, _oGLiq, _nGLiq, _omega, _psi);

        }

    }
    
    function enforceLiquidityInvariant (
        int128 _totalShells,
        int128 _newShells,
        int128 _oGLiq,
        int128 _nGLiq,
        int128 _omega,
        int128 _psi
    ) internal view {
        
        if (_totalShells == 0 || 0 == _totalShells + _newShells) return;
        
        int128 _prevUtilPerShell = _oGLiq
            .sub(_omega)
            .div(_totalShells);
            
        int128 _nextUtilPerShell = _nGLiq
            .sub(_psi)
            .div(_totalShells.add(_newShells));

        int128 _diff = _nextUtilPerShell - _prevUtilPerShell;

        require(0 < _diff || _diff >= MAX_DIFF, "Shell/liquidity-invariant-violation");
        
    }

    function enforceHalts (
        ShellStorage.Shell storage shell,
        int128 _oGLiq,
        int128 _nGLiq,
        int128[] memory _oBals,
        int128[] memory _nBals,
        int128[] memory _weights
    ) private view {

        uint256 _length = _nBals.length;
        int128 _alpha = shell.alpha;

        for (uint i = 0; i < _length; i++) {

            int128 _nIdeal = _nGLiq.us_mul(_weights[i]);

            if (_nBals[i] > _nIdeal) {

                int128 _upperAlpha = ONE + _alpha;

                int128 _nHalt = _nIdeal.us_mul(_upperAlpha);

                if (_nBals[i] > _nHalt){

                    int128 _oHalt = _oGLiq.us_mul(_weights[i]).us_mul(_upperAlpha);

                    if (_oBals[i] < _oHalt) revert("Shell/upper-halt");
                    if (_nBals[i] - _nHalt > _oBals[i] - _oHalt) revert("Shell/upper-halt");

                }

            } else {

                int128 _lowerAlpha = ONE - _alpha;

                int128 _nHalt = _nIdeal.us_mul(_lowerAlpha);

                if (_nBals[i] < _nHalt){

                    int128 _oHalt = _oGLiq.us_mul(_weights[i]).us_mul(_lowerAlpha);

                    if (_oBals[i] > _oHalt) revert("Shell/lower-halt");
                    if (_nHalt - _nBals[i] > _oHalt - _oBals[i]) revert("Shell/lower-halt");

                }
            }
        }
    }
}
////// src/Orchestrator.sol
// 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.5.0; */

/* import "./Assimilators.sol"; */

/* import "./ShellMath.sol"; */

/* import "./ShellStorage.sol"; */

/* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */

library Orchestrator {

    using ABDKMath64x64 for int128;
    using ABDKMath64x64 for uint256;

    int128 constant ONE_WEI = 0x12;

    event ParametersSet(uint256 alpha, uint256 beta, uint256 delta, uint256 epsilon, uint256 lambda);

    event AssetIncluded(address indexed numeraire, address indexed reserve, uint weight);

    event AssimilatorIncluded(address indexed derivative, address indexed numeraire, address indexed reserve, address assimilator);

    function setParams (
        ShellStorage.Shell storage shell,
        uint256 _alpha,
        uint256 _beta,
        uint256 _feeAtHalt,
        uint256 _epsilon,
        uint256 _lambda
    ) external {

        require(0 < _alpha && _alpha < 1e18, "Shell/parameter-invalid-alpha");

        require(0 <= _beta && _beta < _alpha, "Shell/parameter-invalid-beta");

        require(_feeAtHalt <= .5e18, "Shell/parameter-invalid-max");

        require(0 <= _epsilon && _epsilon <= .01e18, "Shell/parameter-invalid-epsilon");

        require(0 <= _lambda && _lambda <= 1e18, "Shell/parameter-invalid-lambda");

        int128 _omega = getFee(shell);

        shell.alpha = (_alpha + 1).divu(1e18);

        shell.beta = (_beta + 1).divu(1e18);

        shell.delta = ( _feeAtHalt ).divu(1e18).div(uint(2).fromUInt().mul(shell.alpha.sub(shell.beta))) + ONE_WEI;

        shell.epsilon = (_epsilon + 1).divu(1e18);

        shell.lambda = (_lambda + 1).divu(1e18);
        
        int128 _psi = getFee(shell);
        
        require(_omega >= _psi, "Shell/parameters-increase-fee");

        emit ParametersSet(_alpha, _beta, shell.delta.mulu(1e18), _epsilon, _lambda);

    }

    function getFee (
        ShellStorage.Shell storage shell
    ) private view returns (
        int128 fee_
    ) {

        int128 _gLiq;

        int128[] memory _bals = new int128[](shell.assets.length);

        for (uint i = 0; i < _bals.length; i++) {

            int128 _bal = Assimilators.viewNumeraireBalance(shell.assets[i].addr);

            _bals[i] = _bal;

            _gLiq += _bal;

        }

        fee_ = ShellMath.calculateFee(_gLiq, _bals, shell.beta, shell.delta, shell.weights);

    }
    
 
    function initialize (
        ShellStorage.Shell storage shell,
        address[] storage numeraires,
        address[] storage reserves,
        address[] storage derivatives,
        address[] calldata _assets,
        uint[] calldata _assetWeights,
        address[] calldata _derivativeAssimilators
    ) external {
        
        for (uint i = 0; i < _assetWeights.length; i++) {

            uint ix = i*5;
        
            numeraires.push(_assets[ix]);
            derivatives.push(_assets[ix]);

            reserves.push(_assets[2+ix]);
            if (_assets[ix] != _assets[2+ix]) derivatives.push(_assets[2+ix]);
            
            includeAsset(
                shell,
                _assets[ix],   // numeraire
                _assets[1+ix], // numeraire assimilator
                _assets[2+ix], // reserve
                _assets[3+ix], // reserve assimilator
                _assets[4+ix], // reserve approve to
                _assetWeights[i]
            );
            
        }
        
        for (uint i = 0; i < _derivativeAssimilators.length / 5; i++) {
            
            uint ix = i * 5;

            derivatives.push(_derivativeAssimilators[ix]);

            includeAssimilator(
                shell,
                _derivativeAssimilators[ix],   // derivative
                _derivativeAssimilators[1+ix], // numeraire
                _derivativeAssimilators[2+ix], // reserve
                _derivativeAssimilators[3+ix], // assimilator
                _derivativeAssimilators[4+ix]  // derivative approve to
            );

        }

    }

    function includeAsset (
        ShellStorage.Shell storage shell,
        address _numeraire,
        address _numeraireAssim,
        address _reserve,
        address _reserveAssim,
        address _reserveApproveTo,
        uint256 _weight
    ) private {

        require(_numeraire != address(0), "Shell/numeraire-cannot-be-zeroth-adress");

        require(_numeraireAssim != address(0), "Shell/numeraire-assimilator-cannot-be-zeroth-adress");

        require(_reserve != address(0), "Shell/reserve-cannot-be-zeroth-adress");

        require(_reserveAssim != address(0), "Shell/reserve-assimilator-cannot-be-zeroth-adress");

        require(_weight < 1e18, "Shell/weight-must-be-less-than-one");

        if (_numeraire != _reserve) safeApprove(_numeraire, _reserveApproveTo, uint(-1));

        ShellStorage.Assimilator storage _numeraireAssimilator = shell.assimilators[_numeraire];

        _numeraireAssimilator.addr = _numeraireAssim;

        _numeraireAssimilator.ix = uint8(shell.assets.length);

        ShellStorage.Assimilator storage _reserveAssimilator = shell.assimilators[_reserve];

        _reserveAssimilator.addr = _reserveAssim;

        _reserveAssimilator.ix = uint8(shell.assets.length);

        int128 __weight = _weight.divu(1e18).add(uint256(1).divu(1e18));

        shell.weights.push(__weight);

        shell.assets.push(_numeraireAssimilator);

        emit AssetIncluded(_numeraire, _reserve, _weight);

        emit AssimilatorIncluded(_numeraire, _numeraire, _reserve, _numeraireAssim);

        if (_numeraireAssim != _reserveAssim) {

            emit AssimilatorIncluded(_reserve, _numeraire, _reserve, _reserveAssim);

        }

    }
    
    function includeAssimilator (
        ShellStorage.Shell storage shell,
        address _derivative,
        address _numeraire,
        address _reserve,
        address _assimilator,
        address _derivativeApproveTo
    ) private {

        require(_derivative != address(0), "Shell/derivative-cannot-be-zeroth-address");

        require(_numeraire != address(0), "Shell/numeraire-cannot-be-zeroth-address");

        require(_reserve != address(0), "Shell/numeraire-cannot-be-zeroth-address");

        require(_assimilator != address(0), "Shell/assimilator-cannot-be-zeroth-address");
        
        safeApprove(_numeraire, _derivativeApproveTo, uint(-1));

        ShellStorage.Assimilator storage _numeraireAssim = shell.assimilators[_numeraire];

        shell.assimilators[_derivative] = ShellStorage.Assimilator(_assimilator, _numeraireAssim.ix);

        emit AssimilatorIncluded(_derivative, _numeraire, _reserve, _assimilator);

    }

    function safeApprove (
        address _token,
        address _spender,
        uint256 _value
    ) private {

        ( bool success, bytes memory returndata ) = _token.call(abi.encodeWithSignature("approve(address,uint256)", _spender, _value));

        require(success, "SafeERC20: low-level call failed");

    }

    function viewShell (
        ShellStorage.Shell storage shell
    ) external view returns (
        uint alpha_,
        uint beta_,
        uint delta_,
        uint epsilon_,
        uint lambda_
    ) {

        alpha_ = shell.alpha.mulu(1e18);

        beta_ = shell.beta.mulu(1e18);

        delta_ = shell.delta.mulu(1e18);

        epsilon_ = shell.epsilon.mulu(1e18);

        lambda_ = shell.lambda.mulu(1e18);

    }

}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"numeraire","type":"address"},{"indexed":true,"internalType":"address","name":"reserve","type":"address"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"AssetIncluded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"derivative","type":"address"},{"indexed":true,"internalType":"address","name":"numeraire","type":"address"},{"indexed":true,"internalType":"address","name":"reserve","type":"address"},{"indexed":false,"internalType":"address","name":"assimilator","type":"address"}],"name":"AssimilatorIncluded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"alpha","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"beta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"epsilon","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lambda","type":"uint256"}],"name":"ParametersSet","type":"event"}]

612773610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c8063572297df1461005057806364542e7d146101a857806375eccc3614610215575b600080fd5b81801561005c57600080fd5b506101a6600480360360e081101561007357600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b90919293919293908035906020019064010000000081111561010d57600080fd5b82018360208201111561011f57600080fd5b8035906020019184602083028401116401000000008311171561014157600080fd5b90919293919293908035906020019064010000000081111561016257600080fd5b82018360208201111561017457600080fd5b8035906020019184602083028401116401000000008311171561019657600080fd5b9091929391929390505050610273565b005b8180156101b457600080fd5b50610213600480360360c08110156101cb57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506107fe565b005b6102416004803603602081101561022b57600080fd5b8101908080359060200190929190505050610df2565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b60008090505b848490508110156106505760006005820290508a88888381811061029957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508888888381811061032657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050898888836002018181106103b657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505087878260020181811061044557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1688888381811061048457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461054d57888888836002018181106104cc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6106428c89898481811061055d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a8560010181811061058957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b866002018181106105b557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168c8c876003018181106105e157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168d8d8860040181811061060d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168c8c8a81811061063657fe5b90506020020135610ef8565b508080600101915050610279565b5060008090505b6005838390508161066457fe5b048110156107f15760006005820290508884848381811061068157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506107e38c85858481811061071157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1686868560010181811061073d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1687878660020181811061076957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1688888760030181811061079557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168989886004018181106107c157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1661169d565b508080600101915050610657565b5050505050505050505050565b8460001080156108155750670de0b6b3a764000085105b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d616c70686100000081525060200191505060405180910390fd5b8360001115801561089757508484105b610909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d626574610000000081525060200191505060405180910390fd5b6706f05b59d3b20000831115610987576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d6d6178000000000081525060200191505060405180910390fd5b8160001115801561099f5750662386f26fc100008211155b610a11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d657073696c6f6e0081525060200191505060405180910390fd5b80600011158015610a2a5750670de0b6b3a76400008111155b610a9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d6c616d626461000081525060200191505060405180910390fd5b6000610aa787611ac1565b9050610ac7670de0b6b3a764000060018801611c3c90919063ffffffff16565b8760000160006101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff160217905550610b22670de0b6b3a764000060018701611c3c90919063ffffffff16565b8760000160106101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055506012610be6610bba610b9f8a60000160109054906101000a9004600f0b8b60000160009054906101000a9004600f0b600f0b611ca490919063ffffffff16565b610ba96002611d0b565b600f0b611d2e90919063ffffffff16565b610bd5670de0b6b3a764000088611c3c90919063ffffffff16565b600f0b611d9990919063ffffffff16565b018760010160006101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff160217905550610c42670de0b6b3a764000060018501611c3c90919063ffffffff16565b8760010160106101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff160217905550610c9d670de0b6b3a764000060018401611c3c90919063ffffffff16565b8760020160006101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055506000610ce588611ac1565b905080600f0b82600f0b1215610d63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5368656c6c2f706172616d65746572732d696e6372656173652d66656500000081525060200191505060405180910390fd5b7fb399767364127d5a414f09f214fa5606358052b764894b1084ce5ef067c05a978787610db5670de0b6b3a76400008c60010160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b8787604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a15050505050505050565b6000806000806000610e29670de0b6b3a76400008760000160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9450610e5a670de0b6b3a76400008760000160109054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9350610e8b670de0b6b3a76400008760010160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9250610ebc670de0b6b3a76400008760010160109054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9150610eed670de0b6b3a76400008760020160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b905091939590929450565b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610f7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806126ef6027913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611004576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806126bc6033913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561108a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061261a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611110576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806126616031913960400191505060405180910390fd5b670de0b6b3a76400008110611170576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061263f6022913960400191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146111cf576111ce86837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611ed7565b5b60008760060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050858160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600501805490508160000160146101000a81548160ff021916908360ff16021790555060008860060160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050848160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555088600501805490508160000160146101000a81548160ff021916908360ff1602179055506000611374611348670de0b6b3a76400006001611c3c90919063ffffffff16565b611363670de0b6b3a764000087611c3c90919063ffffffff16565b600f0b6120cd90919063ffffffff16565b90508960030181908060018154018082558091505090600182039060005260206000209060029182820401919006601002909192909190916101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055505089600501839080600181540180825580915050906001820390600052602060002001600090919290919091506000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000820160149054906101000a900460ff168160000160146101000a81548160ff021916908360ff1602179055505050508673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f69745294f8c4916d2a4ca68ea4e3be1d5990927ba68481e69368deb3c4395d02866040518082815260200191505060405180910390a38673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f4b18271a7872ab0f9e58e9ca39180e3c710490f802d663f20ae751a8e6b29bc18b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a48573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614611691578673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f4b18271a7872ab0f9e58e9ca39180e3c710490f802d663f20ae751a8e6b29bc189604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a45b50505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611723576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806127166029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156117a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806125f26028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806125f26028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612692602a913960400191505060405180910390fd5b6118e084827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611ed7565b60008660060160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060405180604001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018260000160149054906101000a900460ff1660ff168152508760060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548160ff021916908360ff1602179055509050508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f4b18271a7872ab0f9e58e9ca39180e3c710490f802d663f20ae751a8e6b29bc186604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a450505050505050565b60008060608360050180549050604051908082528060200260200182016040528015611afc5781602001602082028038833980820191505090505b50905060008090505b8151811015611b8b576000611b55866005018381548110611b2257fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612134565b905080838381518110611b6457fe5b6020026020010190600f0b9081600f0b815250508084019350508080600101915050611b05565b50611c3382828660000160109054906101000a9004600f0b8760010160009054906101000a9004600f0b88600301805480602002602001604051908101604052809291908181526020018280548015611c2957602002820191906000526020600020906000905b82829054906101000a9004600f0b600f0b81526020019060100190602082600f01049283019260010382029150808411611bf25790505b50505050506121f5565b92505050919050565b600080821415611c4b57600080fd5b6000611c578484612273565b90506f7fffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff161115611c9a57600080fd5b8091505092915050565b60008082600f0b84600f0b0390507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b8112158015611cf857506f7fffffffffffffffffffffffffffffff600f0b8113155b611d0157600080fd5b8091505092915050565b6000677fffffffffffffff821115611d2257600080fd5b604082901b9050919050565b600080604083600f0b85600f0b02901d90507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b8112158015611d8657506f7fffffffffffffffffffffffffffffff600f0b8113155b611d8f57600080fd5b8091505092915050565b60008082600f0b1415611dab57600080fd5b600082600f0b604085600f0b901b81611dc057fe5b0590507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b8112158015611e0957506f7fffffffffffffffffffffffffffffff600f0b8113155b611e1257600080fd5b8091505092915050565b600080821415611e2f5760009050611ed1565b600083600f0b1215611e4057600080fd5b600060406fffffffffffffffffffffffffffffffff841685600f0b02901c90506000608084901c85600f0b02905077ffffffffffffffffffffffffffffffffffffffffffffffff811115611e9357600080fd5b604081901b9050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03811115611ec957600080fd5b818101925050505b92915050565b600060608473ffffffffffffffffffffffffffffffffffffffff168484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527f095ea7b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611fe75780518252602082019150602081019050602083039250611fc4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612049576040519150601f19603f3d011682016040523d82523d6000602084013e61204e565b606091505b5091509150816120c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b5050505050565b60008082600f0b84600f0b0190507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b811215801561212157506f7fffffffffffffffffffffffffffffff600f0b8113155b61212a57600080fd5b8091505092915050565b60008173ffffffffffffffffffffffffffffffffffffffff1663ac969a73306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156121b357600080fd5b505afa1580156121c7573d6000803e3d6000fd5b505050506040513d60208110156121dd57600080fd5b81019080805190602001909291905050509050919050565b6000808551905060008090505b8181101561226857600061223585838151811061221b57fe5b60200260200101518a600f0b61243490919063ffffffff16565b905061225688838151811061224657fe5b6020026020010151828989612450565b84019350508080600101915050612202565b505095945050505050565b60008082141561228257600080fd5b600077ffffffffffffffffffffffffffffffffffffffffffffffff84116122b85782604085901b816122b057fe5b04905061240d565b600060c09050600060c086901c905064010000000081106122e157602081901c90506020820191505b6201000081106122f957601081901c90506010820191505b610100811061231057600881901c90506008820191505b6010811061232657600481901c90506004820191505b6004811061233c57600281901c90506002820191505b6002811061234b576001820191505b600160bf830360018703901c018260ff0387901b8161236657fe5b0492506fffffffffffffffffffffffffffffffff83111561238657600080fd5b6000608086901c8402905060006fffffffffffffffffffffffffffffffff871685029050600060c089901c9050600060408a901b9050828110156123cb576001820391505b8281039050608084901b9250828110156123e6576001820391505b8281039050608084901c82146123f857fe5b88818161240157fe5b04870196505050505050505b6fffffffffffffffffffffffffffffffff81111561242a57600080fd5b8091505092915050565b600080604083600f0b85600f0b02901d90508091505092915050565b600083600f0b85600f0b121561251557600061248384680100000000000000000386600f0b61243490919063ffffffff16565b905080600f0b86600f0b121561250a57600086820390506124b08682600f0b6125ce90919063ffffffff16565b92506124c88484600f0b61243490919063ffffffff16565b9250674000000000000000600f0b83600f0b13156124ec5767400000000000000092505b6125028184600f0b61243490919063ffffffff16565b92505061250f565b600091505b506125c6565b600061253884680100000000000000000186600f0b61243490919063ffffffff16565b905080600f0b86600f0b13156125bf57600081870390506125658682600f0b6125ce90919063ffffffff16565b925061257d8484600f0b61243490919063ffffffff16565b9250674000000000000000600f0b83600f0b13156125a15767400000000000000092505b6125b78184600f0b61243490919063ffffffff16565b9250506125c4565b600091505b505b949350505050565b60008082600f0b604085600f0b901b816125e457fe5b059050809150509291505056fe5368656c6c2f6e756d6572616972652d63616e6e6f742d62652d7a65726f74682d616464726573735368656c6c2f726573657276652d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f7765696768742d6d7573742d62652d6c6573732d7468616e2d6f6e655368656c6c2f726573657276652d617373696d696c61746f722d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f617373696d696c61746f722d63616e6e6f742d62652d7a65726f74682d616464726573735368656c6c2f6e756d6572616972652d617373696d696c61746f722d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f6e756d6572616972652d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f646572697661746976652d63616e6e6f742d62652d7a65726f74682d61646472657373a265627a7a72315820705ba03f52a3f7aec13d8c74ef8ac1aab69f50818fbea4d1c1317cbd8ff124f764736f6c634300050f0032

Deployed Bytecode

0x73be1e6ef049b15bc77bb796babecbeea2707770d7301460806040526004361061004b5760003560e01c8063572297df1461005057806364542e7d146101a857806375eccc3614610215575b600080fd5b81801561005c57600080fd5b506101a6600480360360e081101561007357600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b90919293919293908035906020019064010000000081111561010d57600080fd5b82018360208201111561011f57600080fd5b8035906020019184602083028401116401000000008311171561014157600080fd5b90919293919293908035906020019064010000000081111561016257600080fd5b82018360208201111561017457600080fd5b8035906020019184602083028401116401000000008311171561019657600080fd5b9091929391929390505050610273565b005b8180156101b457600080fd5b50610213600480360360c08110156101cb57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506107fe565b005b6102416004803603602081101561022b57600080fd5b8101908080359060200190929190505050610df2565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b60008090505b848490508110156106505760006005820290508a88888381811061029957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508888888381811061032657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050898888836002018181106103b657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505087878260020181811061044557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1688888381811061048457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461054d57888888836002018181106104cc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6106428c89898481811061055d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a8560010181811061058957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b866002018181106105b557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168c8c876003018181106105e157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168d8d8860040181811061060d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168c8c8a81811061063657fe5b90506020020135610ef8565b508080600101915050610279565b5060008090505b6005838390508161066457fe5b048110156107f15760006005820290508884848381811061068157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506107e38c85858481811061071157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1686868560010181811061073d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1687878660020181811061076957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1688888760030181811061079557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168989886004018181106107c157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1661169d565b508080600101915050610657565b5050505050505050505050565b8460001080156108155750670de0b6b3a764000085105b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d616c70686100000081525060200191505060405180910390fd5b8360001115801561089757508484105b610909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d626574610000000081525060200191505060405180910390fd5b6706f05b59d3b20000831115610987576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d6d6178000000000081525060200191505060405180910390fd5b8160001115801561099f5750662386f26fc100008211155b610a11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d657073696c6f6e0081525060200191505060405180910390fd5b80600011158015610a2a5750670de0b6b3a76400008111155b610a9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5368656c6c2f706172616d657465722d696e76616c69642d6c616d626461000081525060200191505060405180910390fd5b6000610aa787611ac1565b9050610ac7670de0b6b3a764000060018801611c3c90919063ffffffff16565b8760000160006101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff160217905550610b22670de0b6b3a764000060018701611c3c90919063ffffffff16565b8760000160106101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055506012610be6610bba610b9f8a60000160109054906101000a9004600f0b8b60000160009054906101000a9004600f0b600f0b611ca490919063ffffffff16565b610ba96002611d0b565b600f0b611d2e90919063ffffffff16565b610bd5670de0b6b3a764000088611c3c90919063ffffffff16565b600f0b611d9990919063ffffffff16565b018760010160006101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff160217905550610c42670de0b6b3a764000060018501611c3c90919063ffffffff16565b8760010160106101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff160217905550610c9d670de0b6b3a764000060018401611c3c90919063ffffffff16565b8760020160006101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055506000610ce588611ac1565b905080600f0b82600f0b1215610d63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5368656c6c2f706172616d65746572732d696e6372656173652d66656500000081525060200191505060405180910390fd5b7fb399767364127d5a414f09f214fa5606358052b764894b1084ce5ef067c05a978787610db5670de0b6b3a76400008c60010160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b8787604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a15050505050505050565b6000806000806000610e29670de0b6b3a76400008760000160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9450610e5a670de0b6b3a76400008760000160109054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9350610e8b670de0b6b3a76400008760010160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9250610ebc670de0b6b3a76400008760010160109054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b9150610eed670de0b6b3a76400008760020160009054906101000a9004600f0b600f0b611e1c90919063ffffffff16565b905091939590929450565b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610f7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806126ef6027913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611004576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806126bc6033913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561108a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061261a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611110576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806126616031913960400191505060405180910390fd5b670de0b6b3a76400008110611170576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061263f6022913960400191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146111cf576111ce86837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611ed7565b5b60008760060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050858160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600501805490508160000160146101000a81548160ff021916908360ff16021790555060008860060160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050848160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555088600501805490508160000160146101000a81548160ff021916908360ff1602179055506000611374611348670de0b6b3a76400006001611c3c90919063ffffffff16565b611363670de0b6b3a764000087611c3c90919063ffffffff16565b600f0b6120cd90919063ffffffff16565b90508960030181908060018154018082558091505090600182039060005260206000209060029182820401919006601002909192909190916101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055505089600501839080600181540180825580915050906001820390600052602060002001600090919290919091506000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000820160149054906101000a900460ff168160000160146101000a81548160ff021916908360ff1602179055505050508673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f69745294f8c4916d2a4ca68ea4e3be1d5990927ba68481e69368deb3c4395d02866040518082815260200191505060405180910390a38673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f4b18271a7872ab0f9e58e9ca39180e3c710490f802d663f20ae751a8e6b29bc18b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a48573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614611691578673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f4b18271a7872ab0f9e58e9ca39180e3c710490f802d663f20ae751a8e6b29bc189604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a45b50505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611723576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806127166029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156117a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806125f26028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561182f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806125f26028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612692602a913960400191505060405180910390fd5b6118e084827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611ed7565b60008660060160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060405180604001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018260000160149054906101000a900460ff1660ff168152508760060160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548160ff021916908360ff1602179055509050508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f4b18271a7872ab0f9e58e9ca39180e3c710490f802d663f20ae751a8e6b29bc186604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a450505050505050565b60008060608360050180549050604051908082528060200260200182016040528015611afc5781602001602082028038833980820191505090505b50905060008090505b8151811015611b8b576000611b55866005018381548110611b2257fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612134565b905080838381518110611b6457fe5b6020026020010190600f0b9081600f0b815250508084019350508080600101915050611b05565b50611c3382828660000160109054906101000a9004600f0b8760010160009054906101000a9004600f0b88600301805480602002602001604051908101604052809291908181526020018280548015611c2957602002820191906000526020600020906000905b82829054906101000a9004600f0b600f0b81526020019060100190602082600f01049283019260010382029150808411611bf25790505b50505050506121f5565b92505050919050565b600080821415611c4b57600080fd5b6000611c578484612273565b90506f7fffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff161115611c9a57600080fd5b8091505092915050565b60008082600f0b84600f0b0390507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b8112158015611cf857506f7fffffffffffffffffffffffffffffff600f0b8113155b611d0157600080fd5b8091505092915050565b6000677fffffffffffffff821115611d2257600080fd5b604082901b9050919050565b600080604083600f0b85600f0b02901d90507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b8112158015611d8657506f7fffffffffffffffffffffffffffffff600f0b8113155b611d8f57600080fd5b8091505092915050565b60008082600f0b1415611dab57600080fd5b600082600f0b604085600f0b901b81611dc057fe5b0590507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b8112158015611e0957506f7fffffffffffffffffffffffffffffff600f0b8113155b611e1257600080fd5b8091505092915050565b600080821415611e2f5760009050611ed1565b600083600f0b1215611e4057600080fd5b600060406fffffffffffffffffffffffffffffffff841685600f0b02901c90506000608084901c85600f0b02905077ffffffffffffffffffffffffffffffffffffffffffffffff811115611e9357600080fd5b604081901b9050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03811115611ec957600080fd5b818101925050505b92915050565b600060608473ffffffffffffffffffffffffffffffffffffffff168484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040527f095ea7b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310611fe75780518252602082019150602081019050602083039250611fc4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612049576040519150601f19603f3d011682016040523d82523d6000602084013e61204e565b606091505b5091509150816120c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b5050505050565b60008082600f0b84600f0b0190507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b811215801561212157506f7fffffffffffffffffffffffffffffff600f0b8113155b61212a57600080fd5b8091505092915050565b60008173ffffffffffffffffffffffffffffffffffffffff1663ac969a73306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156121b357600080fd5b505afa1580156121c7573d6000803e3d6000fd5b505050506040513d60208110156121dd57600080fd5b81019080805190602001909291905050509050919050565b6000808551905060008090505b8181101561226857600061223585838151811061221b57fe5b60200260200101518a600f0b61243490919063ffffffff16565b905061225688838151811061224657fe5b6020026020010151828989612450565b84019350508080600101915050612202565b505095945050505050565b60008082141561228257600080fd5b600077ffffffffffffffffffffffffffffffffffffffffffffffff84116122b85782604085901b816122b057fe5b04905061240d565b600060c09050600060c086901c905064010000000081106122e157602081901c90506020820191505b6201000081106122f957601081901c90506010820191505b610100811061231057600881901c90506008820191505b6010811061232657600481901c90506004820191505b6004811061233c57600281901c90506002820191505b6002811061234b576001820191505b600160bf830360018703901c018260ff0387901b8161236657fe5b0492506fffffffffffffffffffffffffffffffff83111561238657600080fd5b6000608086901c8402905060006fffffffffffffffffffffffffffffffff871685029050600060c089901c9050600060408a901b9050828110156123cb576001820391505b8281039050608084901b9250828110156123e6576001820391505b8281039050608084901c82146123f857fe5b88818161240157fe5b04870196505050505050505b6fffffffffffffffffffffffffffffffff81111561242a57600080fd5b8091505092915050565b600080604083600f0b85600f0b02901d90508091505092915050565b600083600f0b85600f0b121561251557600061248384680100000000000000000386600f0b61243490919063ffffffff16565b905080600f0b86600f0b121561250a57600086820390506124b08682600f0b6125ce90919063ffffffff16565b92506124c88484600f0b61243490919063ffffffff16565b9250674000000000000000600f0b83600f0b13156124ec5767400000000000000092505b6125028184600f0b61243490919063ffffffff16565b92505061250f565b600091505b506125c6565b600061253884680100000000000000000186600f0b61243490919063ffffffff16565b905080600f0b86600f0b13156125bf57600081870390506125658682600f0b6125ce90919063ffffffff16565b925061257d8484600f0b61243490919063ffffffff16565b9250674000000000000000600f0b83600f0b13156125a15767400000000000000092505b6125b78184600f0b61243490919063ffffffff16565b9250506125c4565b600091505b505b949350505050565b60008082600f0b604085600f0b901b816125e457fe5b059050809150509291505056fe5368656c6c2f6e756d6572616972652d63616e6e6f742d62652d7a65726f74682d616464726573735368656c6c2f726573657276652d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f7765696768742d6d7573742d62652d6c6573732d7468616e2d6f6e655368656c6c2f726573657276652d617373696d696c61746f722d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f617373696d696c61746f722d63616e6e6f742d62652d7a65726f74682d616464726573735368656c6c2f6e756d6572616972652d617373696d696c61746f722d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f6e756d6572616972652d63616e6e6f742d62652d7a65726f74682d6164726573735368656c6c2f646572697661746976652d63616e6e6f742d62652d7a65726f74682d61646472657373a265627a7a72315820705ba03f52a3f7aec13d8c74ef8ac1aab69f50818fbea4d1c1317cbd8ff124f764736f6c634300050f0032

Deployed Bytecode Sourcemap

81873:7420:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84122:1646;;8:9:-1;5:2;;;30:1;27;20:12;5:2;84122:1646:0;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;84122:1646:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;84122:1646:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;84122:1646:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;84122:1646:0;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;84122:1646:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;84122:1646:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;84122:1646:0;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;84122:1646:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;84122:1646:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;84122:1646:0;;;;;;;;;;;;:::i;:::-;;82352:1214;;8:9:-1;5:2;;;30:1;27;20:12;5:2;82352:1214:0;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;82352:1214:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;88842:446;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;88842:446:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84122:1646;84474:6;84483:1;84474:10;;84469:695;84490:13;;:20;;84486:1;:24;84469:695;;;84534:7;84546:1;84544;:3;84534:13;;84572:10;84588:7;;84596:2;84588:11;;;;;;;;;;;;;;;84572:28;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;84572:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84615:11;84632:7;;84640:2;84632:11;;;;;;;;;;;;;;;84615:29;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;84615:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84661:8;84675:7;;84685:2;84683:1;:4;84675:13;;;;;;;;;;;;;;;84661:28;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;84661:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84723:7;;84733:2;84731:1;:4;84723:13;;;;;;;;;;;;;;;84708:28;;:7;;84716:2;84708:11;;;;;;;;;;;;;;;:28;;;84704:65;;84738:11;84755:7;;84765:2;84763:1;:4;84755:13;;;;;;;;;;;;;;;84738:31;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;84738:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84704:65;84798:340;84829:5;84853:7;;84861:2;84853:11;;;;;;;;;;;;;;;84898:7;;84908:2;84906:1;:4;84898:13;;;;;;;;;;;;;;;84955:7;;84965:2;84963:1;:4;84955:13;;;;;;;;;;;;;;;84998:7;;85008:2;85006:1;:4;84998:13;;;;;;;;;;;;;;;85053:7;;85063:2;85061:1;:4;85053:13;;;;;;;;;;;;;;;85107;;85121:1;85107:16;;;;;;;;;;;;;84798:12;:340::i;:::-;84469:695;84512:3;;;;;;;84469:695;;;;85189:6;85198:1;85189:10;;85184:575;85238:1;85205:23;;:30;;:34;;;;;;85201:1;:38;85184:575;;;85275:7;85289:1;85285;:5;85275:15;;85307:11;85324:23;;85348:2;85324:27;;;;;;;;;;;;;;;85307:45;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;85307:45:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;85369:376;85406:5;85430:23;;85454:2;85430:27;;;;;;;;;;;;;;;85492:23;;85518:2;85516:1;:4;85492:29;;;;;;;;;;;;;;;85553:23;;85579:2;85577:1;:4;85553:29;;;;;;;;;;;;;;;85612:23;;85638:2;85636:1;:4;85612:29;;;;;;;;;;;;;;;85675:23;;85701:2;85699:1;:4;85675:29;;;;;;;;;;;;;;;85369:18;:376::i;:::-;85184:575;85241:3;;;;;;;85184:575;;;;84122:1646;;;;;;;;;;:::o;82352:1214::-;82587:6;82583:1;:10;:27;;;;;82606:4;82597:6;:13;82583:27;82575:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82670:5;82665:1;:10;;:28;;;;;82687:6;82679:5;:14;82665:28;82657:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82761:5;82747:10;:19;;82739:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82824:8;82819:1;:13;;:35;;;;;82848:6;82836:8;:18;;82819:35;82811:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82916:7;82911:1;:12;;:31;;;;;82938:4;82927:7;:15;;82911:31;82903:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82990:13;83006;83013:5;83006:6;:13::i;:::-;82990:29;;83046:23;83064:4;83056:1;83047:6;:10;83046:17;;:23;;;;:::i;:::-;83032:5;:11;;;:37;;;;;;;;;;;;;;;;;;;;83095:22;83112:4;83104:1;83096:5;:9;83095:16;;:22;;;;:::i;:::-;83082:5;:10;;;:35;;;;;;;;;;;;;;;;;;;;82006:4;83144:82;83174:51;83197:27;83213:5;:10;;;;;;;;;;;;83197:5;:11;;;;;;;;;;;;:15;;;;:27;;;;:::i;:::-;83174:18;83179:1;83174:16;:18::i;:::-;:22;;;;:51;;;;:::i;:::-;83144:25;83164:4;83146:10;83144:19;;:25;;;;:::i;:::-;:29;;;;:82;;;;:::i;:::-;:92;83130:5;:11;;;:106;;;;;;;;;;;;;;;;;;;;83265:25;83285:4;83277:1;83266:8;:12;83265:19;;:25;;;;:::i;:::-;83249:5;:13;;;:41;;;;;;;;;;;;;;;;;;;;83318:24;83337:4;83329:1;83319:7;:11;83318:18;;:24;;;;:::i;:::-;83303:5;:12;;;:39;;;;;;;;;;;;;;;;;;;;83363:11;83377:13;83384:5;83377:6;:13::i;:::-;83363:27;;83429:4;83419:14;;:6;:14;;;;83411:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83485:71;83499:6;83507:5;83514:22;83531:4;83514:5;:11;;;;;;;;;;;;:16;;;;:22;;;;:::i;:::-;83538:8;83548:7;83485:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82352:1214;;;;;;;;:::o;88842:446::-;88945:11;88967:10;88988:11;89010:13;89034:12;89076:22;89093:4;89076:5;:11;;;;;;;;;;;;:16;;;;:22;;;;:::i;:::-;89067:31;;89119:21;89135:4;89119:5;:10;;;;;;;;;;;;:15;;;;:21;;;;:::i;:::-;89111:29;;89162:22;89179:4;89162:5;:11;;;;;;;;;;;;:16;;;;:22;;;;:::i;:::-;89153:31;;89208:24;89227:4;89208:5;:13;;;;;;;;;;;;:18;;;;:24;;;;:::i;:::-;89197:35;;89255:23;89273:4;89255:5;:12;;;;;;;;;;;;:17;;;;:23;;;;:::i;:::-;89245:33;;88842:446;;;;;;;:::o;85776:1732::-;86084:1;86062:24;;:10;:24;;;;86054:76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86178:1;86151:29;;:15;:29;;;;86143:93;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86277:1;86257:22;;:8;:22;;;;86249:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86367:1;86342:27;;:13;:27;;;;86334:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86454:4;86444:7;:14;86436:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86528:8;86514:22;;:10;:22;;;86510:80;;86538:52;86550:10;86562:17;86586:2;86538:11;:52::i;:::-;86510:80;86603:54;86660:5;:18;;:30;86679:10;86660:30;;;;;;;;;;;;;;;86603:87;;86732:15;86703:21;:26;;;:44;;;;;;;;;;;;;;;;;;86793:5;:12;;:19;;;;86760:21;:24;;;:53;;;;;;;;;;;;;;;;;;86826:52;86881:5;:18;;:28;86900:8;86881:28;;;;;;;;;;;;;;;86826:83;;86949:13;86922:19;:24;;;:40;;;;;;;;;;;;;;;;;;87006:5;:12;;:19;;;;86975;:22;;;:51;;;;;;;;;;;;;;;;;;87039:15;87057:45;87080:21;87096:4;87088:1;87080:15;;:21;;;;:::i;:::-;87057:18;87070:4;87057:7;:12;;:18;;;;:::i;:::-;:22;;;;:45;;;;:::i;:::-;87039:63;;87115:5;:13;;87134:8;87115:28;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;87115:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;87156:5;:12;;87174:21;87156:40;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;87156:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;87240:8;87214:44;;87228:10;87214:44;;;87250:7;87214:44;;;;;;;;;;;;;;;;;;87320:8;87276:70;;87308:10;87276:70;;87296:10;87276:70;;;87330:15;87276:70;;;;;;;;;;;;;;;;;;;;;;87382:13;87363:32;;:15;:32;;;87359:140;;87461:8;87419:66;;87449:10;87419:66;;87439:8;87419:66;;;87471:13;87419:66;;;;;;;;;;;;;;;;;;;;;;87359:140;85776:1732;;;;;;;;;;:::o;87520:978::-;87807:1;87784:25;;:11;:25;;;;87776:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;87898:1;87876:24;;:10;:24;;;;87868:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;87986:1;87966:22;;:8;:22;;;;87958:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;88078:1;88054:26;;:12;:26;;;;88046:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;88148:55;88160:10;88172:20;88199:2;88148:11;:55::i;:::-;88216:48;88267:5;:18;;:30;88286:10;88267:30;;;;;;;;;;;;;;;88216:81;;88344:58;;;;;;;;88369:12;88344:58;;;;;;88383:15;:18;;;;;;;;;;;;88344:58;;;;;88310:5;:18;;:31;88329:11;88310:31;;;;;;;;;;;;;;;:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;88465:8;88420:68;;88453:10;88420:68;;88440:11;88420:68;;;88475:12;88420:68;;;;;;;;;;;;;;;;;;;;;;87520:978;;;;;;;:::o;83574:533::-;83673:11;83705:12;83730:21;83767:5;:12;;:19;;;;83754:33;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;83754:33:0;;;;83730:57;;83805:6;83814:1;83805:10;;83800:202;83821:5;:12;83817:1;:16;83800:202;;;83857:11;83871:55;83905:5;:12;;83918:1;83905:15;;;;;;;;;;;;;;;:20;;;;;;;;;;;;83871:33;:55::i;:::-;83857:69;;83954:4;83943:5;83949:1;83943:8;;;;;;;;;;;;;:15;;;;;;;;;;;83984:4;83975:13;;;;83800:202;83835:3;;;;;;;83800:202;;;;84021:76;84044:5;84051;84058;:10;;;;;;;;;;;;84070:5;:11;;;;;;;;;;;;84083:5;:13;;84021:76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:22;:76::i;:::-;84014:83;;83574:533;;;;;:::o;8606:208::-;8666:6;8695:1;8690;:6;;8681:16;;;;;;8704:14;8721:12;8728:1;8731;8721:5;:12::i;:::-;8704:29;;1125:34;8749:29;;:6;:29;;;;8740:39;;;;;;8801:6;8786:22;;;8606:208;;;;:::o;4008:195::-;4065:6;4080:13;4108:1;4096:13;;4103:1;4096:9;;:13;4080:29;;966:35;4125:19;;:6;:19;;:42;;;;;1125:34;4148:19;;:6;:19;;4125:42;4116:52;;;;;;4190:6;4175:22;;;4008:195;;;;:::o;2107:137::-;2160:6;2189:18;2184:1;:23;;2175:33;;;;;;2235:2;2230:1;:7;;2215:23;;2107:137;;;:::o;4439:201::-;4496:6;4511:13;4544:2;4539:1;4527:13;;4534:1;4527:9;;:13;:19;;4511:35;;966;4562:19;;:6;:19;;:42;;;;;1125:34;4585:19;;:6;:19;;4562:42;4553:52;;;;;;4627:6;4612:22;;;4439:201;;;;:::o;6998:227::-;7055:6;7084:1;7079;:6;;;;7070:16;;;;;;7093:13;7130:1;7109:22;;7124:2;7118:1;7110:10;;:16;;7109:22;;;;;;7093:38;;966:35;7147:19;;:6;:19;;:42;;;;;1125:34;7170:19;;:6;:19;;7147:42;7138:52;;;;;;7212:6;7197:22;;;6998:227;;;;:::o;6261:469::-;6320:7;6345:1;6340;:6;6336:20;;;6355:1;6348:8;;;;6336:20;6379:1;6374;:6;;;;6365:16;;;;;;6390:10;6463:2;6423:34;6419:1;:38;6413:1;6404:11;;:54;6403:62;;6390:75;;6472:10;6505:3;6500:1;:8;;6494:1;6485:11;;:24;6472:37;;6533:50;6527:2;:56;;6518:66;;;;;;6598:2;6591:9;;;;;6700:2;6631:66;:71;6618:2;:84;;6609:94;;;;;;6722:2;6717;:7;6710:14;;;;6261:469;;;;;:::o;88506:328::-;88635:12;88649:23;88677:6;:11;;88741:8;88751:6;88689:69;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;88689:69:0;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;88689:69:0;88677:82;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;88677:82:0;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;88633:126:0;;;;88780:7;88772:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;88506:328;;;;;:::o;3591:195::-;3648:6;3663:13;3691:1;3679:13;;3686:1;3679:9;;:13;3663:29;;966:35;3708:19;;:6;:19;;:42;;;;;1125:34;3731:19;;:6;:19;;3708:42;3699:52;;;;;;3773:6;3758:22;;;3591:195;;;;:::o;28502:169::-;28572:11;28618:6;28605:41;;;28655:4;28605:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;28605:56:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;28605:56:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;28605:56:0;;;;;;;;;;;;;;;;28598:63;;28502:169;;;:::o;73853:447::-;74043:11;74069:12;74084:5;:12;74069:27;;74114:6;74123:1;74114:10;;74109:182;74130:7;74126:1;:11;74109:182;;;74161:13;74177:25;74190:8;74199:1;74190:11;;;;;;;;;;;;;;74177:5;:12;;;;:25;;;;:::i;:::-;74161:41;;74227:50;74245:5;74251:1;74245:8;;;;;;;;;;;;;;74255:6;74263:5;74270:6;74227:17;:50::i;:::-;74219:58;;;;74109:182;74139:3;;;;;;;74109:182;;;;73853:447;;;;;;;;:::o;21178:1257::-;21238:7;21268:1;21263;:6;;21254:16;;;;;;21279:14;21311:50;21306:1;:55;21302:1035;;21391:1;21385:2;21380:1;:7;;21379:13;;;;;;21370:22;;21302:1035;;;21413:11;21427:3;21413:17;;21439:10;21457:3;21452:1;:8;;21439:21;;21479:11;21473:2;:17;21469:48;;21501:2;21494:9;;;;;21512:2;21505:9;;;;21469:48;21535:7;21529:2;:13;21525:44;;21553:2;21546:9;;;;;21564:2;21557:9;;;;21525:44;21587:5;21581:2;:11;21577:40;;21603:1;21596:8;;;;;21613:1;21606:8;;;;21577:40;21635:4;21629:2;:10;21625:39;;21650:1;21643:8;;;;;21660:1;21653:8;;;;21625:39;21682:3;21676:2;:9;21672:38;;21696:1;21689:8;;;;;21706:1;21699:8;;;;21672:38;21728:3;21722:2;:9;21718:23;;21740:1;21733:8;;;;21718:23;21836:1;21829:3;21823;:9;21818:1;21814;:5;:18;;21813:24;21805:3;21799;:9;21794:1;:14;;21793:45;;;;;;21784:54;;21866:34;21856:6;:44;;21847:54;;;;;;21912:10;21940:3;21935:1;:8;;21925:6;:19;21912:32;;21953:10;21980:34;21976:1;:38;21966:6;:49;21953:62;;22026:10;22044:3;22039:1;:8;;22026:21;;22056:10;22074:2;22069:1;:7;;22056:20;;22096:2;22091;:7;22087:20;;;22106:1;22100:7;;;;22087:20;22122:2;22116:8;;;;22181:3;22175:2;:9;;22170:14;;22202:2;22197;:7;22193:20;;;22212:1;22206:7;;;;22193:20;22228:2;22222:8;;;;22298:3;22292:2;:9;;22286:2;:15;22278:24;;;;22328:1;22323:2;:6;;;;;;22313:16;;;;21302:1035;;;;;;;22364:34;22354:6;:44;;22345:54;;;;;;22422:6;22406:23;;;21178:1257;;;;:::o;30762:145::-;30822:6;30837:13;30870:2;30865:1;30853:13;;30860:1;30853:9;;:13;:19;;30837:35;;30894:6;30879:22;;;30762:145;;;;:::o;74308:1016::-;74458:11;74495:6;74488:13;;:4;:13;;;74484:831;;;74520:17;74540:26;74560:5;73551:19;74554:11;74540:6;:13;;;;:26;;;;:::i;:::-;74520:46;;74594:10;74587:17;;:4;:17;;;74583:309;;;74627:17;74660:4;74647:10;:17;74627:37;;74692:25;74710:6;74692:10;:17;;;;:25;;;;:::i;:::-;74685:32;;74743:19;74755:6;74743:4;:11;;;;:19;;;;:::i;:::-;74736:26;;73599:18;74787:10;;:4;:10;;;74783:26;;;73599:18;74799:10;;74783:26;74837:23;74849:10;74837:4;:11;;;;:23;;;;:::i;:::-;74830:30;;74583:309;;;;74891:1;74884:8;;74583:309;74484:831;;;;74929:17;74949:26;74969:5;73551:19;74963:11;74949:6;:13;;;;:26;;;;:::i;:::-;74929:46;;75003:10;74996:17;;:4;:17;;;74992:309;;;75036:17;75063:10;75056:4;:17;75036:37;;75101:25;75119:6;75101:10;:17;;;;:25;;;;:::i;:::-;75094:32;;75152:19;75164:6;75152:4;:11;;;;:19;;;;:::i;:::-;75145:26;;73599:18;75196:10;;:4;:10;;;75192:26;;;73599:18;75208:10;;75192:26;75246:23;75258:10;75246:4;:11;;;;:23;;;;:::i;:::-;75239:30;;74992:309;;;;75300:1;75293:8;;74992:309;74484:831;;74308:1016;;;;;;:::o;31177:148::-;31237:6;31252:13;31289:1;31268:22;;31283:2;31277:1;31269:10;;:16;;31268:22;;;;;;31252:38;;31312:6;31297:22;;;31177:148;;;;:::o

Swarm Source

bzzr://705ba03f52a3f7aec13d8c74ef8ac1aab69f50818fbea4d1c1317cbd8ff124f7

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
[ 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.