PSA: Scheduled Server Maintenance & Upgrades [2nd-December-2021 6:00 AM UTC] - Estimated duration: 3 hours.

Contract 0xB08018D77D4ec4087AA0A807967eb19dDb649429

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x28088332133d3b2631f856b299ed70986751fa5b7badfc2f9f325b02995abfde0x60806040125358162021-11-10 17:30:0821 days 14 hrs ago0x5195ad65e40c79e11661486b39978ff268f3b342 IN  Contract Creation0 BNB0.0086295
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
APRWithPoolOracle

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at BscScan.com on 2021-11-10
*/

// SPDX-License-Identifier: MIT
// File: contracts/libraries/ABDKMath64x64.sol


/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <[email protected]>
 */
pragma solidity ^0.5.0 || ^0.6.0 || ^0.7.0;

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

  /**
   * 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) {
    bool negative = x < 0 && y & 1 == 1;

    uint256 absX = uint128 (x < 0 ? -x : x);
    uint256 absResult;
    absResult = 0x100000000000000000000000000000000;

    if (absX <= 0x10000000000000000) {
      absX <<= 63;
      while (y != 0) {
        if (y & 0x1 != 0) {
          absResult = absResult * absX >> 127;
        }
        absX = absX * absX >> 127;

        if (y & 0x2 != 0) {
          absResult = absResult * absX >> 127;
        }
        absX = absX * absX >> 127;

        if (y & 0x4 != 0) {
          absResult = absResult * absX >> 127;
        }
        absX = absX * absX >> 127;

        if (y & 0x8 != 0) {
          absResult = absResult * absX >> 127;
        }
        absX = absX * absX >> 127;

        y >>= 4;
      }

      absResult >>= 64;
    } else {
      uint256 absXShift = 63;
      if (absX < 0x1000000000000000000000000) { absX <<= 32; absXShift -= 32; }
      if (absX < 0x10000000000000000000000000000) { absX <<= 16; absXShift -= 16; }
      if (absX < 0x1000000000000000000000000000000) { absX <<= 8; absXShift -= 8; }
      if (absX < 0x10000000000000000000000000000000) { absX <<= 4; absXShift -= 4; }
      if (absX < 0x40000000000000000000000000000000) { absX <<= 2; absXShift -= 2; }
      if (absX < 0x80000000000000000000000000000000) { absX <<= 1; absXShift -= 1; }

      uint256 resultShift = 0;
      while (y != 0) {
        require (absXShift < 64);

        if (y & 0x1 != 0) {
          absResult = absResult * absX >> 127;
          resultShift += absXShift;
          if (absResult > 0x100000000000000000000000000000000) {
            absResult >>= 1;
            resultShift += 1;
          }
        }
        absX = absX * absX >> 127;
        absXShift <<= 1;
        if (absX >= 0x100000000000000000000000000000000) {
            absX >>= 1;
            absXShift += 1;
        }

        y >>= 1;
      }

      require (resultShift < 64);
      absResult >>= 64 - resultShift;
    }
    int256 result = negative ? -int256 (absResult) : int256 (absResult);
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

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

  /**
   * 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) << uint256 (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 >>= uint256 (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 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) private pure returns (uint128) {
    if (x == 0) return 0;
    else {
      uint256 xx = x;
      uint256 r = 1;
      if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
      if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
      if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
      if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
      if (xx >= 0x100) { xx >>= 8; r <<= 4; }
      if (xx >= 0x10) { xx >>= 4; r <<= 2; }
      if (xx >= 0x8) { r <<= 1; }
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1;
      r = (r + x / r) >> 1; // Seven iterations should be enough
      uint256 r1 = x / r;
      return uint128 (r < r1 ? r : r1);
    }
  }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/token/ERC20/IERC20.sol



pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/utils/Address.sol



pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/math/SafeMath.sol



pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/utils/Context.sol



pragma solidity >=0.6.0 <0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File: contracts/libraries/Ownable.sol



pragma solidity 0.6.12;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;
    address private _candidate;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _candidate = newOwner;
    }

    function acceptOwnership() external {
        require(msg.sender == _candidate, "Ownable: not cadidate");
        emit OwnershipTransferred(_owner, _candidate);
        _owner = _candidate;
    }
}
// File: contracts/APRWithPoolOracle.sol


pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;







// Fulcrum
interface IFulcrum {
  function supplyInterestRate() external view returns (uint256);
  function nextSupplyInterestRate(uint256 supplyAmount) external view returns (uint256);
}

interface IFortube {
    function APY() external view returns (uint256);
    function underlying() external view returns (address);
}

interface IVenus {
  function supplyRatePerBlock() external view returns (uint);
}

interface IAlpaca {
  function vaultDebtVal() external view returns (uint256);
  function vaultDebtShare() external view returns (uint256);
  function totalSupply() external view returns (uint256);
  function totalToken() external view returns (uint256);
  function config() external view returns (address);
  function balanceOf(address _token) external view returns (uint256);
  function debtShareToVal(uint256 _amount) external view returns (uint256);
  function fairLaunchPoolId() external view returns (uint256);
  function token() external view returns (address);
}

interface IAlpacaFairLaunch {
  function alpacaPerBlock() external view returns (uint256);
  function poolInfo(uint256 index) external view returns (
    address stakeToken,
    uint256 allocPoint,
    uint256 lastRewardBlock,
    uint256 accAlpacaPerShare,
    uint256 accAlpacaPerShareTilBonusEnd
  );
  function totalAllocPoint() external view returns (uint256);
  function alpaca() external view returns (address);
}

interface IAlpacaConfig {
  function getFairLaunchAddr() external view returns (address);
  function getInterestRate(uint256 debt, uint256 floating) external view returns (uint256);
}

interface IUniswapV2Router02{
  function getAmountsOut(uint256 _amount, address[] calldata path) external view returns (uint256[] memory);
}

contract APRWithPoolOracle is Ownable {
  using SafeMath for uint256;
  using Address for address;

  address private usdtTokenAddress;
  address private wbnb;
  address private uniswapRouter;
  mapping (address => uint256) public alpacaTokenIndex;

  constructor() public {
    usdtTokenAddress = address(0x55d398326f99059fF775485246999027B3197955);
    wbnb = address(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);
    uniswapRouter = address(0x10ED43C718714eb63d5aA57B78B54704E256024E);
    alpacaTokenIndex[address(0x7C9e73d4C71dae564d41F78d56439bB4ba87592f)] = 3;
    alpacaTokenIndex[address(0x158Da805682BdC8ee32d52833aD41E74bb951E59)] = 16;
    alpacaTokenIndex[address(0xd7D069493685A581d27824Fc46EdA46B7EfC0063)] = 1;
  }
  function getFulcrumAPRAdjusted(address token, uint256 _supply) external view returns(uint256) {
    if(token == address(0))
      return 0;
    else
      return IFulcrum(token).nextSupplyInterestRate(_supply);
  }

  function getFortubeAPRAdjusted(address token) external view returns (uint256) {
    if(token == address(0))
      return 0;
    else{
      IFortube fortube = IFortube(token);
      return fortube.APY().mul(1e2);
    }
  }

  function getVenusAPRAdjusted(address token) external view returns (uint256) {
    uint256 supplyRatePerBlock = IVenus(token).supplyRatePerBlock();
    int128 _temp = ABDKMath64x64.add(ABDKMath64x64.mul(ABDKMath64x64.divu(supplyRatePerBlock, 1e18),ABDKMath64x64.fromUInt(20*60*24)),ABDKMath64x64.fromUInt(1));
    return ABDKMath64x64.mulu(ABDKMath64x64.sub(ABDKMath64x64.pow(_temp, 365),ABDKMath64x64.fromUInt(1)), 1e18)*1e2;
  }

  function getAlpacaAPRAdjusted(address token) external view returns(uint256) {
    if(token == address(0))
      return 0;
    else{
      IAlpaca alpaca = IAlpaca(token);
      IAlpacaConfig config = IAlpacaConfig(alpaca.config());
      uint256 borrowInterest = config.getInterestRate(alpaca.vaultDebtVal(), alpaca.totalToken() - alpaca.vaultDebtVal()) * 365 * 24 * 3600;
      uint256 lendingApr = borrowInterest * alpaca.vaultDebtVal() / alpaca.totalToken() * (100 - 19) / 100;
      uint256 apr = lendingApr;
      return 
        ABDKMath64x64.mulu(
          ABDKMath64x64.sub(
            ABDKMath64x64.exp(ABDKMath64x64.div(ABDKMath64x64.fromUInt(apr), ABDKMath64x64.fromUInt(1e18))),
            ABDKMath64x64.fromUInt(1)
          ),
          1e18
        )*1e2;
    }
  }

  function setAlpacaTokenIndex(address _token, uint256 _index) public onlyOwner{
    alpacaTokenIndex[_token] = _index;
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"alpacaTokenIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getAlpacaAPRAdjusted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getFortubeAPRAdjusted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"getFulcrumAPRAdjusted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getVenusAPRAdjusted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"setAlpacaTokenIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600061001b610158565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600280546001600160a01b03199081167355d398326f99059ff775485246999027b31979551790915560038054821673bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c178155600480549092167310ed43c718714eb63d5aa57b78b54704e256024e1790915560056020527f853c741fd47e691ea205412fb14aa0bb38a116e57e4dcf54d12bde910131a9ff5560107fa12d3edab77f23e3b0d09943371897e2e046cfbd536e5767060a8c66f4746a6d5573d7d069493685a581d27824fc46eda46b7efc006360005260017f6da52722051bff75fcdf647c06347bcf73f559e2b7bf6d06f8f1ba24ef8252525561015c565b3390565b611ba68061016b6000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b146101045780639a159611146101195780639c11db491461012c578063caaf5e8d1461013f578063f2fde38b146101525761009e565b80631bdfe57a146100a35780634dce8216146100b85780634eff75d8146100e1578063715018a6146100f457806379ba5097146100fc575b600080fd5b6100b66100b13660046119ff565b610165565b005b6100cb6100c63660046119c7565b6101c9565b6040516100d89190611b41565b60405180910390f35b6100cb6100ef3660046119ff565b61026b565b6100b6610308565b6100b6610391565b61010c61041c565b6040516100d89190611a42565b6100cb6101273660046119c7565b61042b565b6100cb61013a3660046119c7565b610516565b6100cb61014d3660046119c7565b6108c4565b6100b66101603660046119c7565b6108d6565b61016d61095d565b6001600160a01b031661017e61041c565b6001600160a01b0316146101ad5760405162461bcd60e51b81526004016101a490611b0c565b60405180910390fd5b6001600160a01b03909116600090815260056020526040902055565b60006001600160a01b0382166101e157506000610266565b60008290506102626064826001600160a01b031663ef8bd3056040518163ffffffff1660e01b815260040160206040518083038186803b15801561022457600080fd5b505afa158015610238573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025c9190611a2a565b90610961565b9150505b919050565b60006001600160a01b03831661028357506000610302565b60405163d65a502160e01b81526001600160a01b0384169063d65a5021906102af908590600401611b41565b60206040518083038186803b1580156102c757600080fd5b505afa1580156102db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ff9190611a2a565b90505b92915050565b61031061095d565b6001600160a01b031661032161041c565b6001600160a01b0316146103475760405162461bcd60e51b81526004016101a490611b0c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001546001600160a01b031633146103bb5760405162461bcd60e51b81526004016101a490611a56565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031690565b600080826001600160a01b031663ae9d70b06040518163ffffffff1660e01b815260040160206040518083038186803b15801561046757600080fd5b505afa15801561047b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049f9190611a2a565b905060006104da6104cb6104bb84670de0b6b3a764000061099b565b6104c66170806109d2565b6109f0565b6104d560016109d2565b610a27565b905061050b6104fd6104ee8361016d610a5a565b6104f860016109d2565b610c82565b670de0b6b3a7640000610cb5565b606402949350505050565b60006001600160a01b03821661052e57506000610266565b60008290506000816001600160a01b03166379502c556040518163ffffffff1660e01b815260040160206040518083038186803b15801561056e57600080fd5b505afa158015610582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a691906119e3565b90506000816001600160a01b031663c6dfa13f846001600160a01b0316630a355d7d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105f257600080fd5b505afa158015610606573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062a9190611a2a565b856001600160a01b0316630a355d7d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561066357600080fd5b505afa158015610677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069b9190611a2a565b866001600160a01b031663626be5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106d457600080fd5b505afa1580156106e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070c9190611a2a565b036040518363ffffffff1660e01b815260040161072a929190611b4a565b60206040518083038186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190611a2a565b61016d02601802610e1002905060006064846001600160a01b031663626be5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107c457600080fd5b505afa1580156107d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fc9190611a2a565b856001600160a01b0316630a355d7d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561083557600080fd5b505afa158015610849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086d9190611a2a565b84028161087657fe5b046051028161088157fe5b049050806108b56104fd6104ee6108b061089a856109d2565b6108ab670de0b6b3a76400006109d2565b610d1d565b610d6f565b60640295505050505050610266565b60056020526000908152604090205481565b6108de61095d565b6001600160a01b03166108ef61041c565b6001600160a01b0316146109155760405162461bcd60e51b81526004016101a490611b0c565b6001600160a01b03811661093b5760405162461bcd60e51b81526004016101a490611a85565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60008261097057506000610302565b8282028284828161097d57fe5b04146102ff5760405162461bcd60e51b81526004016101a490611acb565b6000816109a757600080fd5b60006109b38484610dc4565b905060016001607f1b036001600160801b03821611156102ff57600080fd5b6000677fffffffffffffff8211156109e957600080fd5b5060401b90565b6000600f83810b9083900b0260401d60016001607f1b03198112801590610a1e575060016001607f1b038113155b6102ff57600080fd5b6000600f83810b9083900b0160016001607f1b03198112801590610a1e575060016001607f1b038113156102ff57600080fd5b600080600084600f0b128015610a735750826001166001145b905060008085600f0b12610a875784610a8c565b846000035b6001600160801b03169050600160801b680100000000000000008211610b2657603f82901b91505b8415610b1e576001851615610ac9578102607f1c5b908002607f1c906002851615610adf578102607f1c5b908002607f1c906004851615610af5578102607f1c5b908002607f1c906008851615610b0b578102607f1c5b60049490941c93908002607f1c90610ab4565b60401c610c3c565b603f600160601b831015610b405760209290921b91601f19015b600160701b831015610b585760109290921b91600f19015b600160781b831015610b705760089290921b91600719015b6001607c1b831015610b885760049290921b91600319015b6001607e1b831015610ba05760029290921b91600119015b6001607f1b831015610bb85760019290921b91600019015b60005b8615610c255760408210610bce57600080fd5b6001871615610bf457918302607f1c918101600160801b831115610bf457600192831c92015b928002607f1c9260019190911b90600160801b8410610c1957600193841c9391909101905b600187901c9650610bbb565b60408110610c3257600080fd5b6040039190911c90505b600083610c495781610c4e565b816000035b905060016001607f1b03198112801590610c6f575060016001607f1b038113155b610c7857600080fd5b9695505050505050565b6000600f82810b9084900b0360016001607f1b03198112801590610a1e575060016001607f1b038113156102ff57600080fd5b600081610cc457506000610302565b600083600f0b1215610cd557600080fd5b600f83900b6001600160801b038316810260401c90608084901c026001600160c01b03811115610d0457600080fd5b60401b8119811115610d1557600080fd5b019392505050565b600081600f0b60001415610d3057600080fd5b600082600f0b604085600f0b901b81610d4557fe5b05905060016001607f1b03198112801590610a1e575060016001607f1b038113156102ff57600080fd5b6000600160461b82600f0b12610d8457600080fd5b683fffffffffffffffff1982600f0b1215610da157506000610266565b610302608083600f0b700171547652b82fe1777d0ffda0d23a7d1202901d610f0e565b600081610dd057600080fd5b60006001600160c01b038411610df55782604085901b81610ded57fe5b049050610efa565b60c084811c6401000000008110610e0e576020918201911c5b620100008110610e20576010918201911c5b6101008110610e31576008918201911c5b60108110610e41576004918201911c5b60048110610e51576002918201911c5b60028110610e60576001820191505b60bf820360018603901c6001018260ff0387901b81610e7b57fe5b0492506001600160801b03831115610e9257600080fd5b608085901c83026001600160801b038616840260c088901c604089901b82811015610ebe576001820391505b608084901b92900382811015610ed5576001820391505b829003608084901c8214610ee557fe5b888181610eee57fe5b04870196505050505050505b6001600160801b038111156102ff57600080fd5b6000600160461b82600f0b12610f2357600080fd5b683fffffffffffffffff1982600f0b1215610f4057506000610266565b6001607f1b60006780000000000000008416600f0b1315610f725770016a09e667f3bcc908b2fb1366ea957d3e0260801c5b60008367400000000000000016600f0b1315610f9f577001306fe0a31b7152de8d5a46305c85edec0260801c5b60008367200000000000000016600f0b1315610fcc577001172b83c7d517adcdf7c8c50eb14a791f0260801c5b60008367100000000000000016600f0b1315610ff95770010b5586cf9890f6298b92b71842a983630260801c5b60008367080000000000000016600f0b1315611026577001059b0d31585743ae7c548eb68ca417fd0260801c5b60008367040000000000000016600f0b131561105357700102c9a3e778060ee6f7caca4f7a29bde80260801c5b60008367020000000000000016600f0b13156110805770010163da9fb33356d84a66ae336dcdfa3f0260801c5b60008367010000000000000016600f0b13156110ad57700100b1afa5abcbed6129ab13ec11dc95430260801c5b600083668000000000000016600f0b13156110d95770010058c86da1c09ea1ff19d294cf2f679b0260801c5b600083664000000000000016600f0b1315611105577001002c605e2e8cec506d21bfc89a23a00f0260801c5b600083662000000000000016600f0b131561113157700100162f3904051fa128bca9c55c31e5df0260801c5b600083661000000000000016600f0b131561115d577001000b175effdc76ba38e31671ca9397250260801c5b600083660800000000000016600f0b131561118957700100058ba01fb9f96d6cacd4b180917c3d0260801c5b600083660400000000000016600f0b13156111b55770010002c5cc37da9491d0985c348c68e7b30260801c5b600083660200000000000016600f0b13156111e1577001000162e525ee054754457d59952920260260801c5b600083660100000000000016600f0b131561120d5770010000b17255775c040618bf4a4ade83fc0260801c5b6000836580000000000016600f0b1315611238577001000058b91b5bc9ae2eed81e9b7d4cfab0260801c5b6000836540000000000016600f0b131561126357700100002c5c89d5ec6ca4d7c8acc017b7c90260801c5b6000836520000000000016600f0b131561128e5770010000162e43f4f831060e02d839a9d16d0260801c5b6000836510000000000016600f0b13156112b957700100000b1721bcfc99d9f890ea069117630260801c5b6000836508000000000016600f0b13156112e45770010000058b90cf1e6d97f9ca14dbcc16280260801c5b6000836504000000000016600f0b131561130f577001000002c5c863b73f016468f6bac5ca2b0260801c5b6000836502000000000016600f0b131561133a57700100000162e430e5a18f6119e3c02282a50260801c5b6000836501000000000016600f0b1315611365577001000000b1721835514b86e6d96efd1bfe0260801c5b60008364800000000016600f0b131561138f57700100000058b90c0b48c6be5df846c5b2ef0260801c5b60008364400000000016600f0b13156113b95770010000002c5c8601cc6b9e94213c72737a0260801c5b60008364200000000016600f0b13156113e3577001000000162e42fff037df38aa2b219f060260801c5b60008364100000000016600f0b131561140d5770010000000b17217fba9c739aa5819f44f90260801c5b60008364080000000016600f0b1315611437577001000000058b90bfcdee5acd3c1cedc8230260801c5b60008364040000000016600f0b131561146157700100000002c5c85fe31f35a6a30da1be500260801c5b60008364020000000016600f0b131561148b5770010000000162e42ff0999ce3541b9fffcf0260801c5b60008364010000000016600f0b13156114b557700100000000b17217f80f4ef5aadda455540260801c5b600083638000000016600f0b13156114de5770010000000058b90bfbf8479bd5a81b51ad0260801c5b600083634000000016600f0b1315611507577001000000002c5c85fdf84bd62ae30a74cc0260801c5b600083632000000016600f0b131561153057700100000000162e42fefb2fed257559bdaa0260801c5b600083631000000016600f0b1315611559577001000000000b17217f7d5a7716bba4a9ae0260801c5b600083630800000016600f0b131561158257700100000000058b90bfbe9ddbac5e109cce0260801c5b600083630400000016600f0b13156115ab5770010000000002c5c85fdf4b15de6f17eb0d0260801c5b600083630200000016600f0b13156115d4577001000000000162e42fefa494f1478fde050260801c5b600083630100000016600f0b13156115fd5770010000000000b17217f7d20cf927c8e94c0260801c5b6000836280000016600f0b1315611625577001000000000058b90bfbe8f71cb4e4b33d0260801c5b6000836240000016600f0b131561164d57700100000000002c5c85fdf477b662b269450260801c5b6000836220000016600f0b13156116755770010000000000162e42fefa3ae53369388c0260801c5b6000836210000016600f0b131561169d57700100000000000b17217f7d1d351a389d400260801c5b6000836208000016600f0b13156116c55770010000000000058b90bfbe8e8b2d3d4ede0260801c5b6000836204000016600f0b13156116ed577001000000000002c5c85fdf4741bea6e77e0260801c5b6000836202000016600f0b131561171557700100000000000162e42fefa39fe95583c20260801c5b6000836201000016600f0b131561173d577001000000000000b17217f7d1cfb72b45e10260801c5b60008361800016600f0b131561176457700100000000000058b90bfbe8e7cc35c3f00260801c5b60008361400016600f0b131561178b5770010000000000002c5c85fdf473e242ea380260801c5b60008361200016600f0b13156117b2577001000000000000162e42fefa39f02b772c0260801c5b60008361100016600f0b13156117d95770010000000000000b17217f7d1cf7d83c1a0260801c5b60008361080016600f0b1315611800577001000000000000058b90bfbe8e7bdcbe2e0260801c5b60008361040016600f0b131561182757700100000000000002c5c85fdf473dea871f0260801c5b60008361020016600f0b131561184e5770010000000000000162e42fefa39ef44d910260801c5b60008361010016600f0b131561187557700100000000000000b17217f7d1cf79e9490260801c5b600083608016600f0b131561189b5770010000000000000058b90bfbe8e7bce5440260801c5b600083604016600f0b13156118c1577001000000000000002c5c85fdf473de6eca0260801c5b600083602016600f0b13156118e757700100000000000000162e42fefa39ef366f0260801c5b600083601016600f0b131561190d577001000000000000000b17217f7d1cf79afa0260801c5b600083600816600f0b131561193357700100000000000000058b90bfbe8e7bcd6d0260801c5b600083600416600f0b13156119595770010000000000000002c5c85fdf473de6b20260801c5b600083600216600f0b131561197f577001000000000000000162e42fefa39ef3580260801c5b600083600116600f0b13156119a55770010000000000000000b17217f7d1cf79ab0260801c5b600f83810b60401d603f03900b1c60016001607f1b0381111561030257600080fd5b6000602082840312156119d8578081fd5b81356102ff81611b58565b6000602082840312156119f4578081fd5b81516102ff81611b58565b60008060408385031215611a11578081fd5b8235611a1c81611b58565b946020939093013593505050565b600060208284031215611a3b578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6020808252601590820152744f776e61626c653a206e6f7420636164696461746560581b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b90815260200190565b918252602082015260400190565b6001600160a01b0381168114611b6d57600080fd5b5056fea2646970667358221220ceb1d35f73304a334fe989f9ce451bad5bf50815d658c5ecda2081dfac70383064736f6c634300060c0033

Deployed ByteCode Sourcemap

48809:2581:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;51264:123;;;;;;:::i;:::-;;:::i;:::-;;49783:229;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;49558:219;;;;;;:::i;:::-;;:::i;46202:148::-;;;:::i;46707:199::-;;;:::i;45551:87::-;;;:::i;:::-;;;;;;;:::i;50018:433::-;;;;;;:::i;:::-;;:::i;50457:801::-;;;;;;:::i;:::-;;:::i;49011:52::-;;;;;;:::i;:::-;;:::i;46505:194::-;;;;;;:::i;:::-;;:::i;51264:123::-;45782:12;:10;:12::i;:::-;-1:-1:-1;;;;;45771:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;45771:23:0;;45763:68;;;;-1:-1:-1;;;45763:68:0;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;51348:24:0;;::::1;;::::0;;;:16:::1;:24;::::0;;;;:33;51264:123::o;49783:229::-;49852:7;-1:-1:-1;;;;;49871:19:0;;49868:139;;-1:-1:-1;49906:1:0;49899:8;;49868:139;49927:16;49955:5;49927:34;;49977:22;49995:3;49977:7;-1:-1:-1;;;;;49977:11:0;;:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:17;;:22::i;:::-;49970:29;;;49868:139;49783:229;;;:::o;49558:219::-;49643:7;-1:-1:-1;;;;;49662:19:0;;49659:112;;-1:-1:-1;49697:1:0;49690:8;;49659:112;49724:47;;-1:-1:-1;;;49724:47:0;;-1:-1:-1;;;;;49724:38:0;;;;;:47;;49763:7;;49724:47;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;49717:54;;49659:112;49558:219;;;;:::o;46202:148::-;45782:12;:10;:12::i;:::-;-1:-1:-1;;;;;45771:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;45771:23:0;;45763:68;;;;-1:-1:-1;;;45763:68:0;;;;;;;:::i;:::-;46309:1:::1;46293:6:::0;;46272:40:::1;::::0;-1:-1:-1;;;;;46293:6:0;;::::1;::::0;46272:40:::1;::::0;46309:1;;46272:40:::1;46340:1;46323:19:::0;;-1:-1:-1;;;;;;46323:19:0::1;::::0;;46202:148::o;46707:199::-;46776:10;;-1:-1:-1;;;;;46776:10:0;46762;:24;46754:58;;;;-1:-1:-1;;;46754:58:0;;;;;;;:::i;:::-;46857:10;;;46849:6;;46828:40;;-1:-1:-1;;;;;46857:10:0;;;;46849:6;;;;46828:40;;;46888:10;;;46879:19;;-1:-1:-1;;;;;;46879:19:0;-1:-1:-1;;;;;46888:10:0;;;46879:19;;;;;;46707:199::o;45551:87::-;45597:7;45624:6;-1:-1:-1;;;;;45624:6:0;45551:87;:::o;50018:433::-;50085:7;50101:26;50137:5;-1:-1:-1;;;;;50130:32:0;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50101:63;;50171:12;50186:141;50204:96;50222:44;50241:18;50261:4;50222:18;:44::i;:::-;50267:32;50290:8;50267:22;:32::i;:::-;50204:17;:96::i;:::-;50301:25;50324:1;50301:22;:25::i;:::-;50186:17;:141::i;:::-;50171:156;;50341:100;50360:74;50378:29;50396:5;50403:3;50378:17;:29::i;:::-;50408:25;50431:1;50408:22;:25::i;:::-;50360:17;:74::i;:::-;50436:4;50341:18;:100::i;:::-;50442:3;50341:104;;50018:433;-1:-1:-1;;;;50018:433:0:o;50457:801::-;50524:7;-1:-1:-1;;;;;50543:19:0;;50540:713;;-1:-1:-1;50578:1:0;50571:8;;50540:713;50599:14;50624:5;50599:31;;50639:20;50676:6;-1:-1:-1;;;;;50676:13:0;;:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50639:53;;50701:22;50726:6;-1:-1:-1;;;;;50726:22:0;;50749:6;-1:-1:-1;;;;;50749:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50794:6;-1:-1:-1;;;;;50794:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50772:6;-1:-1:-1;;;;;50772:17:0;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:43;50726:90;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50819:3;50726:96;50825:2;50726:101;50830:4;50726:108;50701:133;;50843:18;50940:3;50905:6;-1:-1:-1;;;;;50905:17:0;;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50881:6;-1:-1:-1;;;;;50881:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;50864:14;:38;:60;;;;;;50928:8;50864:73;:79;;;;;;;-1:-1:-1;50864:79:0;51002:239;51033:180;51065:95;51083:76;51101:27;50864:79;51101:22;:27::i;:::-;51130:28;51153:4;51130:22;:28::i;:::-;51083:17;:76::i;:::-;51065:17;:95::i;51002:239::-;51242:3;51002:243;50985:260;;;;;;;;;49011:52;;;;;;;;;;;;;:::o;46505:194::-;45782:12;:10;:12::i;:::-;-1:-1:-1;;;;;45771:23:0;:7;:5;:7::i;:::-;-1:-1:-1;;;;;45771:23:0;;45763:68;;;;-1:-1:-1;;;45763:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;46594:22:0;::::1;46586:73;;;;-1:-1:-1::0;;;46586:73:0::1;;;;;;;:::i;:::-;46670:10;:21:::0;;-1:-1:-1;;;;;;46670:21:0::1;-1:-1:-1::0;;;;;46670:21:0;;;::::1;::::0;;;::::1;::::0;;46505:194::o;44070:106::-;44158:10;44070:106;:::o;39587:220::-;39645:7;39669:6;39665:20;;-1:-1:-1;39684:1:0;39677:8;;39665:20;39708:5;;;39712:1;39708;:5;:1;39732:5;;;;;:10;39724:56;;;;-1:-1:-1;;;39724:56:0;;;;;;;:::i;8526:208::-;8586:6;8610;8601:16;;;;;;8624:14;8641:12;8648:1;8651;8641:5;:12::i;:::-;8624:29;-1:-1:-1;;;;;;;;;;;8669:29:0;;;;8660:39;;;;;2027:137;2080:6;2109:18;2104:1;:23;;2095:33;;;;;;-1:-1:-1;2155:2:0;2150:7;;2027:137::o;4359:201::-;4416:6;4447:13;:9;;;:13;;;;;4464:2;4447:19;-1:-1:-1;;;;;;4482:19:0;;;;;:42;;-1:-1:-1;;;;;;4505:19:0;;;4482:42;4473:52;;;;;3511:195;3568:6;3599:13;:9;;;:13;;;;;-1:-1:-1;;;;;;3628:19:0;;;;;:42;;-1:-1:-1;;;;;;3651:19:0;;;3619:52;;;;;11034:2259;11092:6;11107:13;11127:1;11123;:5;;;:19;;;;;11132:1;11136;11132:5;11141:1;11132:10;11123:19;11107:35;;11151:12;11179:1;11175;:5;;;:14;;11188:1;11175:14;;;11184:1;11183:2;;11175:14;-1:-1:-1;;;;;11151:39:0;;-1:-1:-1;;;;11289:19:0;11281:27;;11277:1849;;11328:2;11319:11;;;;;11339:547;11346:6;;11339:547;;11373:3;11369:7;;:12;11365:78;;11408:16;;11428:3;11408:23;11365:78;11460:11;;;11475:3;11460:18;;11499:3;11495:7;;:12;11491:78;;11534:16;;11554:3;11534:23;11491:78;11586:11;;;11601:3;11586:18;;11625:3;11621:7;;:12;11617:78;;11660:16;;11680:3;11660:23;11617:78;11712:11;;;11727:3;11712:18;;11751:3;11747:7;;:12;11743:78;;11786:16;;11806:3;11786:23;11743:78;11875:1;11869:7;;;;;11838:11;;;11853:3;11838:18;;11339:547;;;11910:2;11896:16;11277:1849;;;11955:2;-1:-1:-1;;;11970:34:0;;11966:73;;;12017:2;12008:11;;;;;-1:-1:-1;;12021:15:0;11966:73;-1:-1:-1;;;12051:4:0;:38;12047:77;;;12102:2;12093:11;;;;;-1:-1:-1;;12106:15:0;12047:77;-1:-1:-1;;;12136:4:0;:40;12132:77;;;12189:1;12180:10;;;;;-1:-1:-1;;12192:14:0;12132:77;-1:-1:-1;;;12221:4:0;:41;12217:78;;;12275:1;12266:10;;;;;-1:-1:-1;;12278:14:0;12217:78;-1:-1:-1;;;12307:4:0;:41;12303:78;;;12361:1;12352:10;;;;;-1:-1:-1;;12364:14:0;12303:78;-1:-1:-1;;;12393:4:0;:41;12389:78;;;12447:1;12438:10;;;;;-1:-1:-1;;12450:14:0;12389:78;12477:19;12509:534;12516:6;;12509:534;;12556:2;12544:9;:14;12535:24;;;;;;12580:3;12576:7;;:12;12572:255;;12615:16;;;12635:3;12615:23;;12651:24;;-1:-1:-1;;;12692:47:0;;12688:128;;;12770:1;12756:15;;;;12786:16;12688:128;12844:11;;;12859:3;12844:18;;12887:1;12873:15;;;;;-1:-1:-1;;;12903:43:0;;12899:115;;12972:1;12963:10;;;;12988:14;;;;;12899:115;13032:1;13026:7;;;;;12509:534;;;13076:2;13062:11;:16;13053:26;;;;;;13102:2;:16;13088:30;;;;;-1:-1:-1;11277:1849:0;13132:13;13148:8;:51;;13189:9;13148:51;;;13168:9;13159:19;;13148:51;13132:67;-1:-1:-1;;;;;;;13215:19:0;;;;;:42;;-1:-1:-1;;;;;;13238:19:0;;;13215:42;13206:52;;;;;;13280:6;11034:2259;-1:-1:-1;;;;;;11034:2259:0:o;3928:195::-;3985:6;4016:13;;;;:9;;;;:13;-1:-1:-1;;;;;;4045:19:0;;;;;:42;;-1:-1:-1;;;;;;4068:19:0;;;4036:52;;;;;6181:469;6240:7;6260:6;6256:20;;-1:-1:-1;6275:1:0;6268:8;;6256:20;6299:1;6294;:6;;;;6285:16;;;;;;6324:11;;;;-1:-1:-1;;;;;6339:38:0;;6324:54;;6383:2;6323:62;;6425:3;6420:8;;;6405:24;-1:-1:-1;;;;;6447:56:0;;;6438:66;;;;;;6518:2;6511:9;6551:71;;6538:84;;;6529:94;;;;;;6637:7;;6181:469;-1:-1:-1;;;6181:469:0:o;6918:227::-;6975:6;6999:1;:6;;7004:1;6999:6;;6990:16;;;;;;7013:13;7050:1;7029:22;;7044:2;7038:1;7030:10;;:16;;7029:22;;;;;;;-1:-1:-1;;;;;;;7067:19:0;;;;;:42;;-1:-1:-1;;;;;;7090:19:0;;;7058:52;;;;;21991:273;22038:6;-1:-1:-1;;;22062:1:0;:24;;;22053:34;;;;;;-1:-1:-1;;22112:1:0;:25;;;22108:39;;;-1:-1:-1;22146:1:0;22139:8;;22108:39;22176:82;22253:3;22209:1;22201:10;;22214:35;22201:48;:55;;22176:5;:82::i;22578:1257::-;22638:7;22663:6;22654:16;;;;;;22679:14;-1:-1:-1;;;;;22706:1:0;:55;22702:1035;;22791:1;22785:2;22780:1;:7;;22779:13;;;;;;22770:22;;22702:1035;;;22827:3;22852:8;;;22879:11;22873:17;;22869:48;;22901:2;22905:9;;;;22894;22869:48;22935:7;22929:2;:13;22925:44;;22953:2;22957:9;;;;22946;22925:44;22987:5;22981:2;:11;22977:40;;23003:1;23006:8;;;;22996;22977:40;23035:4;23029:2;:10;23025:39;;23050:1;23053:8;;;;23043;23025:39;23082:3;23076:2;:9;23072:38;;23096:1;23099:8;;;;23089;23072:38;23128:3;23122:2;:9;23118:23;;23140:1;23133:8;;;;23118:23;23229:3;23223;:9;23218:1;23214;:5;:18;;23236:1;23213:24;23205:3;23199;:9;23194:1;:14;;23193:45;;;;;;23184:54;;-1:-1:-1;;;;;23256:6:0;:44;;23247:54;;;;;;23340:3;23335:8;;;23325:19;;-1:-1:-1;;;;;23376:38:0;;23366:49;;23444:3;23439:8;;;23474:2;23469:7;;;23491;;;23487:20;;;23506:1;23500:7;;;;23487:20;23581:3;23575:9;;;;23516:8;;23597:7;;;23593:20;;;23612:1;23606:7;;;;23593:20;23622:8;;;23698:3;23692:9;;;23686:15;;23678:24;;;;23728:1;23723:2;:6;;;;;;23713:16;;;;22702:1035;;;;;;;-1:-1:-1;;;;;23754:6:0;:44;;23745:54;;;;;15140:6664;15189:6;-1:-1:-1;;;15213:1:0;:24;;;15204:34;;;;;;-1:-1:-1;;15263:1:0;:25;;;15259:39;;;-1:-1:-1;15297:1:0;15290:8;;15259:39;-1:-1:-1;;;15320:14:0;15388:18;15384:22;;:26;;;15380:99;;;15437:35;15428:44;15476:3;15428:51;15380:99;15515:1;15490;15494:18;15490:22;:26;;;15486:99;;;15543:35;15534:44;15582:3;15534:51;15486:99;15621:1;15596;15600:18;15596:22;:26;;;15592:99;;;15649:35;15640:44;15688:3;15640:51;15592:99;15727:1;15702;15706:18;15702:22;:26;;;15698:99;;;15755:35;15746:44;15794:3;15746:51;15698:99;15832:1;15808;15812:17;15808:21;:25;;;15804:98;;;15860:35;15851:44;15899:3;15851:51;15804:98;15937:1;15913;15917:17;15913:21;:25;;;15909:98;;;15965:35;15956:44;16004:3;15956:51;15909:98;16042:1;16018;16022:17;16018:21;:25;;;16014:98;;;16070:35;16061:44;16109:3;16061:51;16014:98;16147:1;16123;16127:17;16123:21;:25;;;16119:98;;;16175:35;16166:44;16214:3;16166:51;16119:98;16251:1;16228;16232:16;16228:20;:24;;;16224:97;;;16279:35;16270:44;16318:3;16270:51;16224:97;16355:1;16332;16336:16;16332:20;:24;;;16328:97;;;16383:35;16374:44;16422:3;16374:51;16328:97;16459:1;16436;16440:16;16436:20;:24;;;16432:97;;;16487:35;16478:44;16526:3;16478:51;16432:97;16563:1;16540;16544:16;16540:20;:24;;;16536:97;;;16591:35;16582:44;16630:3;16582:51;16536:97;16666:1;16644;16648:15;16644:19;:23;;;16640:96;;;16694:35;16685:44;16733:3;16685:51;16640:96;16769:1;16747;16751:15;16747:19;:23;;;16743:96;;;16797:35;16788:44;16836:3;16788:51;16743:96;16872:1;16850;16854:15;16850:19;:23;;;16846:96;;;16900:35;16891:44;16939:3;16891:51;16846:96;16975:1;16953;16957:15;16953:19;:23;;;16949:96;;;17003:35;16994:44;17042:3;16994:51;16949:96;17077:1;17056;17060:14;17056:18;:22;;;17052:95;;;17105:35;17096:44;17144:3;17096:51;17052:95;17179:1;17158;17162:14;17158:18;:22;;;17154:95;;;17207:35;17198:44;17246:3;17198:51;17154:95;17281:1;17260;17264:14;17260:18;:22;;;17256:95;;;17309:35;17300:44;17348:3;17300:51;17256:95;17383:1;17362;17366:14;17362:18;:22;;;17358:95;;;17411:35;17402:44;17450:3;17402:51;17358:95;17484:1;17464;17468:13;17464:17;:21;;;17460:94;;;17512:35;17503:44;17551:3;17503:51;17460:94;17585:1;17565;17569:13;17565:17;:21;;;17561:94;;;17613:35;17604:44;17652:3;17604:51;17561:94;17686:1;17666;17670:13;17666:17;:21;;;17662:94;;;17714:35;17705:44;17753:3;17705:51;17662:94;17787:1;17767;17771:13;17767:17;:21;;;17763:94;;;17815:35;17806:44;17854:3;17806:51;17763:94;17887:1;17868;17872:12;17868:16;:20;;;17864:93;;;17915:35;17906:44;17954:3;17906:51;17864:93;17987:1;17968;17972:12;17968:16;:20;;;17964:93;;;18015:35;18006:44;18054:3;18006:51;17964:93;18087:1;18068;18072:12;18068:16;:20;;;18064:93;;;18115:35;18106:44;18154:3;18106:51;18064:93;18187:1;18168;18172:12;18168:16;:20;;;18164:93;;;18215:35;18206:44;18254:3;18206:51;18164:93;18286:1;18268;18272:11;18268:15;:19;;;18264:92;;;18314:35;18305:44;18353:3;18305:51;18264:92;18385:1;18367;18371:11;18367:15;:19;;;18363:92;;;18413:35;18404:44;18452:3;18404:51;18363:92;18484:1;18466;18470:11;18466:15;:19;;;18462:92;;;18512:35;18503:44;18551:3;18503:51;18462:92;18583:1;18565;18569:11;18565:15;:19;;;18561:92;;;18611:35;18602:44;18650:3;18602:51;18561:92;18681:1;18664;18668:10;18664:14;:18;;;18660:91;;;18709:35;18700:44;18748:3;18700:51;18660:91;18779:1;18762;18766:10;18762:14;:18;;;18758:91;;;18807:35;18798:44;18846:3;18798:51;18758:91;18877:1;18860;18864:10;18860:14;:18;;;18856:91;;;18905:35;18896:44;18944:3;18896:51;18856:91;18975:1;18958;18962:10;18958:14;:18;;;18954:91;;;19003:35;18994:44;19042:3;18994:51;18954:91;19072:1;19056;19060:9;19056:13;:17;;;19052:90;;;19100:35;19091:44;19139:3;19091:51;19052:90;19169:1;19153;19157:9;19153:13;:17;;;19149:90;;;19197:35;19188:44;19236:3;19188:51;19149:90;19266:1;19250;19254:9;19250:13;:17;;;19246:90;;;19294:35;19285:44;19333:3;19285:51;19246:90;19363:1;19347;19351:9;19347:13;:17;;;19343:90;;;19391:35;19382:44;19430:3;19382:51;19343:90;19459:1;19444;19448:8;19444:12;:16;;;19440:89;;;19487:35;19478:44;19526:3;19478:51;19440:89;19555:1;19540;19544:8;19540:12;:16;;;19536:89;;;19583:35;19574:44;19622:3;19574:51;19536:89;19651:1;19636;19640:8;19636:12;:16;;;19632:89;;;19679:35;19670:44;19718:3;19670:51;19632:89;19747:1;19732;19736:8;19732:12;:16;;;19728:89;;;19775:35;19766:44;19814:3;19766:51;19728:89;19842:1;19828;19832:7;19828:11;:15;;;19824:88;;;19870:35;19861:44;19909:3;19861:51;19824:88;19937:1;19923;19927:7;19923:11;:15;;;19919:88;;;19965:35;19956:44;20004:3;19956:51;19919:88;20032:1;20018;20022:7;20018:11;:15;;;20014:88;;;20060:35;20051:44;20099:3;20051:51;20014:88;20127:1;20113;20117:7;20113:11;:15;;;20109:88;;;20155:35;20146:44;20194:3;20146:51;20109:88;20221:1;20208;20212:6;20208:10;:14;;;20204:87;;;20249:35;20240:44;20288:3;20240:51;20204:87;20315:1;20302;20306:6;20302:10;:14;;;20298:87;;;20343:35;20334:44;20382:3;20334:51;20298:87;20409:1;20396;20400:6;20396:10;:14;;;20392:87;;;20437:35;20428:44;20476:3;20428:51;20392:87;20503:1;20490;20494:6;20490:10;:14;;;20486:87;;;20531:35;20522:44;20570:3;20522:51;20486:87;20596:1;20584;20588:5;20584:9;:13;;;20580:86;;;20624:35;20615:44;20663:3;20615:51;20580:86;20689:1;20677;20681:5;20677:9;:13;;;20673:86;;;20717:35;20708:44;20756:3;20708:51;20673:86;20782:1;20770;20774:5;20770:9;:13;;;20766:86;;;20810:35;20801:44;20849:3;20801:51;20766:86;20875:1;20863;20867:5;20863:9;:13;;;20859:86;;;20903:35;20894:44;20942:3;20894:51;20859:86;20967:1;20956;20960:4;20956:8;:12;;;20952:85;;;20995:35;20986:44;21034:3;20986:51;20952:85;21059:1;21048;21052:4;21048:8;:12;;;21044:85;;;21087:35;21078:44;21126:3;21078:51;21044:85;21151:1;21140;21144:4;21140:8;:12;;;21136:85;;;21179:35;21170:44;21218:3;21170:51;21136:85;21243:1;21232;21236:4;21232:8;:12;;;21228:85;;;21271:35;21262:44;21310:3;21262:51;21228:85;21334:1;21324;21328:3;21324:7;:11;;;21320:84;;;21362:35;21353:44;21401:3;21353:51;21320:84;21425:1;21415;21419:3;21415:7;:11;;;21411:84;;;21453:35;21444:44;21492:3;21444:51;21411:84;21516:1;21506;21510:3;21506:7;:11;;;21502:84;;;21544:35;21535:44;21583:3;21535:51;21502:84;21607:1;21597;21601:3;21597:7;:11;;;21593:84;;;21635:35;21626:44;21674:3;21626:51;21593:84;21712:7;;;;21717:2;21712:7;21706:2;:14;21697:24;;21686:35;-1:-1:-1;;;;;21737:29:0;;;21728:39;;;;;561:241:-1;;665:2;653:9;644:7;640:23;636:32;633:2;;;-1:-1;;671:12;633:2;85:6;72:20;97:33;124:5;97:33;:::i;809:263::-;;924:2;912:9;903:7;899:23;895:32;892:2;;;-1:-1;;930:12;892:2;226:6;220:13;238:33;265:5;238:33;:::i;1079:366::-;;;1200:2;1188:9;1179:7;1175:23;1171:32;1168:2;;;-1:-1;;1206:12;1168:2;85:6;72:20;97:33;124:5;97:33;:::i;:::-;1258:63;1358:2;1397:22;;;;350:20;;-1:-1;;;1162:283::o;1452:263::-;;1567:2;1555:9;1546:7;1542:23;1538:32;1535:2;;;-1:-1;;1573:12;1535:2;-1:-1;498:13;;1529:186;-1:-1;1529:186::o;3396:222::-;-1:-1;;;;;6218:54;;;;1793:37;;3523:2;3508:18;;3494:124::o;3625:416::-;3825:2;3839:47;;;2067:2;3810:18;;;5990:19;-1:-1;;;6030:14;;;2083:44;2146:12;;;3796:245::o;4048:416::-;4248:2;4262:47;;;2397:2;4233:18;;;5990:19;2433:34;6030:14;;;2413:55;-1:-1;;;2488:12;;;2481:30;2530:12;;;4219:245::o;4471:416::-;4671:2;4685:47;;;2781:2;4656:18;;;5990:19;2817:34;6030:14;;;2797:55;-1:-1;;;2872:12;;;2865:25;2909:12;;;4642:245::o;4894:416::-;5094:2;5108:47;;;5079:18;;;5990:19;3196:34;6030:14;;;3176:55;3250:12;;;5065:245::o;5317:222::-;3347:37;;;5444:2;5429:18;;5415:124::o;5546:333::-;3347:37;;;5865:2;5850:18;;3347:37;5701:2;5686:18;;5672:207::o;6363:117::-;-1:-1;;;;;6218:54;;6422:35;;6412:2;;6471:1;;6461:12;6412:2;6406:74;:::o

Swarm Source

ipfs://ceb1d35f73304a334fe989f9ce451bad5bf50815d658c5ecda2081dfac703830
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.