Address Details
contract

0x52737f41EA463226af071933c823c2D550Bd6610

Contract Name
GasPriceMinimum
Creator
0xf3eb91–a79239 at 0xeda587–de828c
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
24288434
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
GasPriceMinimum




Optimization enabled
false
Compiler version
v0.8.19+commit.7dd6d404




EVM Version
paris




Verified at
2024-03-29T14:40:38.475583Z

project:/contracts-0.8/common/GasPriceMinimum.sol

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.7 <0.8.20;

import "@openzeppelin/contracts8/access/Ownable.sol";

import "../../contracts/common/CalledByVm.sol";
import "../../contracts/common/Initializable.sol";
import "../../contracts/common/interfaces/ICeloVersionedContract.sol";
import "../../contracts/common/FixidityLib.sol";
import "./UsingRegistry.sol";
import "../../contracts/stability/interfaces/ISortedOracles.sol";
import "@openzeppelin/contracts8/utils/math/Math.sol";

/**
 * @title Stores and provides gas price minimum for various currencies.
 */
contract GasPriceMinimum is
  ICeloVersionedContract,
  Ownable,
  Initializable,
  UsingRegistry,
  CalledByVm
{
  using FixidityLib for FixidityLib.Fraction;

  event TargetDensitySet(uint256 targetDensity);
  event GasPriceMinimumFloorSet(uint256 gasPriceMinimumFloor);
  event AdjustmentSpeedSet(uint256 adjustmentSpeed);
  event GasPriceMinimumUpdated(uint256 gasPriceMinimum);
  event BaseFeeOpCodeActivationBlockSet(uint256 baseFeeOpCodeActivationBlock);

  uint256 public deprecated_gasPriceMinimum;
  uint256 public gasPriceMinimumFloor;

  // Block congestion level targeted by the gas price minimum calculation.
  FixidityLib.Fraction public targetDensity;

  // Speed of gas price minimum adjustment due to congestion.
  FixidityLib.Fraction public adjustmentSpeed;

  uint256 public baseFeeOpCodeActivationBlock;
  uint256 public constant ABSOLUTE_MINIMAL_GAS_PRICE = 1;

  /**
   * @notice Sets initialized == true on implementation contracts
   * @param test Set to true to skip implementation initialization
   */
  constructor(bool test) public Initializable(test) {}

  /**
   * @notice Returns the storage, major, minor, and patch version of the contract.
   * @return Storage version of the contract.
   * @return Major version of the contract.
   * @return Minor version of the contract.
   * @return Patch version of the contract.
   */
  function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
    return (1, 2, 0, 1);
  }

  /**
   * @notice Used in place of the constructor to allow the contract to be upgradable via proxy.
   * @param _registryAddress The address of the registry core smart contract.
   * @param _gasPriceMinimumFloor The lowest value the gas price minimum can be.
   * @param _targetDensity The target gas fullness of blocks, expressed as a fixidity fraction.
   * @param _adjustmentSpeed How quickly the minimum changes, expressed as a fixidity fraction.
   * @param _baseFeeOpCodeActivationBlock Block number where the baseFee opCode is activated
   */
  function initialize(
    address _registryAddress,
    uint256 _gasPriceMinimumFloor,
    uint256 _targetDensity,
    uint256 _adjustmentSpeed,
    uint256 _baseFeeOpCodeActivationBlock
  ) external initializer {
    _transferOwnership(msg.sender);
    setRegistry(_registryAddress);
    deprecated_gasPriceMinimum = _gasPriceMinimumFloor;
    setGasPriceMinimumFloor(_gasPriceMinimumFloor);
    setTargetDensity(_targetDensity);
    setAdjustmentSpeed(_adjustmentSpeed);
    _setBaseFeeOpCodeActivationBlock(_baseFeeOpCodeActivationBlock, true);
  }

  /**
   * @notice Set a multiplier that impacts how quickly gas price minimum is adjusted.
   * @param _adjustmentSpeed How quickly the minimum changes, expressed as a fixidity fraction.
   * @dev Value is expected to be < 1.
   */
  function setAdjustmentSpeed(uint256 _adjustmentSpeed) public onlyOwner {
    adjustmentSpeed = FixidityLib.wrap(_adjustmentSpeed);
    require(adjustmentSpeed.lt(FixidityLib.fixed1()), "adjustment speed must be smaller than 1");
    emit AdjustmentSpeedSet(_adjustmentSpeed);
  }

  /**
   * @notice Set the block density targeted by the gas price minimum algorithm.
   * @param _targetDensity The target gas fullness of blocks, expressed as a fixidity fraction.
   * @dev Value is expected to be < 1.
   */
  function setTargetDensity(uint256 _targetDensity) public onlyOwner {
    targetDensity = FixidityLib.wrap(_targetDensity);
    require(targetDensity.lt(FixidityLib.fixed1()), "target density must be smaller than 1");
    emit TargetDensitySet(_targetDensity);
  }

  /**
   * @notice Set the minimum gas price treshold.
   * @param _gasPriceMinimumFloor The lowest value the gas price minimum can be.
   * @dev Value is expected to be > 0.
   */
  function setGasPriceMinimumFloor(uint256 _gasPriceMinimumFloor) public onlyOwner {
    require(_gasPriceMinimumFloor > 0, "gas price minimum floor must be greater than zero");
    gasPriceMinimumFloor = _gasPriceMinimumFloor;
    emit GasPriceMinimumFloorSet(_gasPriceMinimumFloor);
  }

  /**
   * @notice Set the activation block of the baseFee opCode.
   * @param _baseFeeOpCodeActivationBlock Block number where the baseFee opCode is activated
   * @dev Value is expected to be > 0.
   */
  function setBaseFeeOpCodeActivationBlock(uint256 _baseFeeOpCodeActivationBlock)
    external
    onlyOwner
  {
    _setBaseFeeOpCodeActivationBlock(_baseFeeOpCodeActivationBlock, false);
  }

  /**
   * @notice Set the activation block of the baseFee opCode.
   * @param _baseFeeOpCodeActivationBlock Block number where the baseFee opCode is activated
   * @dev Value is expected to be > 0.
   */
  function _setBaseFeeOpCodeActivationBlock(uint256 _baseFeeOpCodeActivationBlock, bool allowZero)
    private
    onlyOwner
  {
    require(
      allowZero || _baseFeeOpCodeActivationBlock > 0,
      "baseFee opCode activation block must be greater than zero"
    );
    baseFeeOpCodeActivationBlock = _baseFeeOpCodeActivationBlock;
    emit BaseFeeOpCodeActivationBlockSet(_baseFeeOpCodeActivationBlock);
  }

  function gasPriceMinimum() public view returns (uint256) {
    if (baseFeeOpCodeActivationBlock > 0 && block.number >= baseFeeOpCodeActivationBlock) {
      return block.basefee;
    } else {
      return deprecated_gasPriceMinimum;
    }
  }

  function _getGasPriceMinimum(address tokenAddress) private view returns (uint256) {
    if (
      tokenAddress == address(0) ||
      tokenAddress == registry.getAddressForOrDie(GOLD_TOKEN_REGISTRY_ID)
    ) {
      return gasPriceMinimum();
    } else {
      ISortedOracles sortedOracles = ISortedOracles(
        registry.getAddressForOrDie(SORTED_ORACLES_REGISTRY_ID)
      );
      uint256 rateNumerator;
      uint256 rateDenominator;
      (rateNumerator, rateDenominator) = sortedOracles.medianRate(tokenAddress);
      return ((gasPriceMinimum() * rateNumerator) / rateDenominator);
    }
  }

  /**
   * @notice Retrieve the current gas price minimum for a currency.
   * When caled for 0x0 or Celo address, it returns gasPriceMinimum().
   * For other addresses it returns gasPriceMinimum() mutiplied by 
   * the SortedOracles median of the token. It does not check tokenAddress is a valid fee currency.
   * this function will never returns values less than ABSOLUTE_MINIMAL_GAS_PRICE.
   * If Oracle rate doesn't exist, it returns ABSOLUTE_MINIMAL_GAS_PRICE.
   * @dev This functions assumes one unit of token has 18 digits.
   * @param tokenAddress The currency the gas price should be in (defaults to Celo).
   * @return current gas price minimum in the requested currency
   */
  function getGasPriceMinimum(address tokenAddress) external view returns (uint256) {
    return Math.max(_getGasPriceMinimum(tokenAddress), ABSOLUTE_MINIMAL_GAS_PRICE);
  }

  /**
   * @notice Adjust the gas price minimum based on governable parameters
   * and block congestion.
   * @param blockGasTotal The amount of gas in the most recent block.
   * @param blockGasLimit The maxBlockGasLimit of the past block.
   * @return result of the calculation (new gas price minimum)
   */
  function updateGasPriceMinimum(uint256 blockGasTotal, uint256 blockGasLimit)
    external
    onlyVm
    returns (uint256)
  {
    deprecated_gasPriceMinimum = getUpdatedGasPriceMinimum(blockGasTotal, blockGasLimit);
    emit GasPriceMinimumUpdated(deprecated_gasPriceMinimum);
    return deprecated_gasPriceMinimum;
  }

  /**
   * @notice Calculates the gas price minimum based on governable parameters
   * and block congestion.
   * @param blockGasTotal The amount of gas in the most recent block.
   * @param blockGasLimit The maxBlockGasLimit of the past block.
   * @return result of the calculation (new gas price minimum)
   * @dev Calculate using the following formula:
   * oldGasPriceMinimum * (1 + (adjustmentSpeed * (blockDensity - targetDensity))) + 1.
   */
  function getUpdatedGasPriceMinimum(uint256 blockGasTotal, uint256 blockGasLimit)
    public
    view
    returns (uint256)
  {
    FixidityLib.Fraction memory blockDensity = FixidityLib.newFixedFraction(
      blockGasTotal,
      blockGasLimit
    );
    bool densityGreaterThanTarget = blockDensity.gt(targetDensity);
    FixidityLib.Fraction memory densityDelta = densityGreaterThanTarget
      ? blockDensity.subtract(targetDensity)
      : targetDensity.subtract(blockDensity);
    FixidityLib.Fraction memory adjustment = densityGreaterThanTarget
      ? FixidityLib.fixed1().add(adjustmentSpeed.multiply(densityDelta))
      : FixidityLib.fixed1().subtract(adjustmentSpeed.multiply(densityDelta));

    uint256 newGasPriceMinimum = adjustment
      .multiply(FixidityLib.newFixed(gasPriceMinimum()))
      .add(FixidityLib.fixed1())
      .fromFixed();

    return newGasPriceMinimum >= gasPriceMinimumFloor ? newGasPriceMinimum : gasPriceMinimumFloor;
  }
}
        

/@openzeppelin/contracts8/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

/@openzeppelin/contracts8/token/ERC20/IERC20.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

/@openzeppelin/contracts8/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^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 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
          

/@openzeppelin/contracts8/utils/math/Math.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/project:/contracts/common/CalledByVm.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.5.13 <0.9.0;

contract CalledByVm {
  modifier onlyVm() {
    require(msg.sender == address(0), "Only VM can call");
    _;
  }
}
          

/project:/contracts/common/FixidityLib.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.5.13 <0.9.0;

/**
 * @title FixidityLib
 * @author Gadi Guy, Alberto Cuesta Canada
 * @notice This library provides fixed point arithmetic with protection against
 * overflow.
 * All operations are done with uint256 and the operands must have been created
 * with any of the newFrom* functions, which shift the comma digits() to the
 * right and check for limits, or with wrap() which expects a number already
 * in the internal representation of a fraction.
 * When using this library be sure to use maxNewFixed() as the upper limit for
 * creation of fixed point numbers.
 * @dev All contained functions are pure and thus marked internal to be inlined
 * on consuming contracts at compile time for gas efficiency.
 */
library FixidityLib {
  struct Fraction {
    uint256 value;
  }

  /**
   * @notice Number of positions that the comma is shifted to the right.
   */
  function digits() internal pure returns (uint8) {
    return 24;
  }

  uint256 private constant FIXED1_UINT = 1000000000000000000000000;

  /**
   * @notice This is 1 in the fixed point units used in this library.
   * @dev Test fixed1() equals 10^digits()
   * Hardcoded to 24 digits.
   */
  function fixed1() internal pure returns (Fraction memory) {
    return Fraction(FIXED1_UINT);
  }

  /**
   * @notice Wrap a uint256 that represents a 24-decimal fraction in a Fraction
   * struct.
   * @param x Number that already represents a 24-decimal fraction.
   * @return A Fraction struct with contents x.
   */
  function wrap(uint256 x) internal pure returns (Fraction memory) {
    return Fraction(x);
  }

  /**
   * @notice Unwraps the uint256 inside of a Fraction struct.
   */
  function unwrap(Fraction memory x) internal pure returns (uint256) {
    return x.value;
  }

  /**
   * @notice The amount of decimals lost on each multiplication operand.
   * @dev Test mulPrecision() equals sqrt(fixed1)
   */
  function mulPrecision() internal pure returns (uint256) {
    return 1000000000000;
  }

  /**
   * @notice Maximum value that can be converted to fixed point. Optimize for deployment.
   * @dev
   * Test maxNewFixed() equals maxUint256() / fixed1()
   */
  function maxNewFixed() internal pure returns (uint256) {
    return 115792089237316195423570985008687907853269984665640564;
  }

  /**
   * @notice Converts a uint256 to fixed point Fraction
   * @dev Test newFixed(0) returns 0
   * Test newFixed(1) returns fixed1()
   * Test newFixed(maxNewFixed()) returns maxNewFixed() * fixed1()
   * Test newFixed(maxNewFixed()+1) fails
   */
  function newFixed(uint256 x) internal pure returns (Fraction memory) {
    require(x <= maxNewFixed(), "can't create fixidity number larger than maxNewFixed()");
    return Fraction(x * FIXED1_UINT);
  }

  /**
   * @notice Converts a uint256 in the fixed point representation of this
   * library to a non decimal. All decimal digits will be truncated.
   */
  function fromFixed(Fraction memory x) internal pure returns (uint256) {
    return x.value / FIXED1_UINT;
  }

  /**
   * @notice Converts two uint256 representing a fraction to fixed point units,
   * equivalent to multiplying dividend and divisor by 10^digits().
   * @param numerator numerator must be <= maxNewFixed()
   * @param denominator denominator must be <= maxNewFixed() and denominator can't be 0
   * @dev
   * Test newFixedFraction(1,0) fails
   * Test newFixedFraction(0,1) returns 0
   * Test newFixedFraction(1,1) returns fixed1()
   * Test newFixedFraction(1,fixed1()) returns 1
   */
  function newFixedFraction(uint256 numerator, uint256 denominator)
    internal
    pure
    returns (Fraction memory)
  {
    Fraction memory convertedNumerator = newFixed(numerator);
    Fraction memory convertedDenominator = newFixed(denominator);
    return divide(convertedNumerator, convertedDenominator);
  }

  /**
   * @notice Returns the integer part of a fixed point number.
   * @dev
   * Test integer(0) returns 0
   * Test integer(fixed1()) returns fixed1()
   * Test integer(newFixed(maxNewFixed())) returns maxNewFixed()*fixed1()
   */
  function integer(Fraction memory x) internal pure returns (Fraction memory) {
    return Fraction((x.value / FIXED1_UINT) * FIXED1_UINT); // Can't overflow
  }

  /**
   * @notice Returns the fractional part of a fixed point number.
   * In the case of a negative number the fractional is also negative.
   * @dev
   * Test fractional(0) returns 0
   * Test fractional(fixed1()) returns 0
   * Test fractional(fixed1()-1) returns 10^24-1
   */
  function fractional(Fraction memory x) internal pure returns (Fraction memory) {
    return Fraction(x.value - (x.value / FIXED1_UINT) * FIXED1_UINT); // Can't overflow
  }

  /**
   * @notice x+y.
   * @dev The maximum value that can be safely used as an addition operator is defined as
   * maxFixedAdd = maxUint256()-1 / 2, or
   * 57896044618658097711785492504343953926634992332820282019728792003956564819967.
   * Test add(maxFixedAdd,maxFixedAdd) equals maxFixedAdd + maxFixedAdd
   * Test add(maxFixedAdd+1,maxFixedAdd+1) throws
   */
  function add(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) {
    uint256 z = x.value + y.value;
    require(z >= x.value, "add overflow detected");
    return Fraction(z);
  }

  /**
   * @notice x-y.
   * @dev
   * Test subtract(6, 10) fails
   */
  function subtract(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) {
    require(x.value >= y.value, "substraction underflow detected");
    return Fraction(x.value - y.value);
  }

  /**
   * @notice x*y. If any of the operators is higher than the max multiplier value it
   * might overflow.
   * @dev The maximum value that can be safely used as a multiplication operator
   * (maxFixedMul) is calculated as sqrt(maxUint256()*fixed1()),
   * or 340282366920938463463374607431768211455999999999999
   * Test multiply(0,0) returns 0
   * Test multiply(maxFixedMul,0) returns 0
   * Test multiply(0,maxFixedMul) returns 0
   * Test multiply(fixed1()/mulPrecision(),fixed1()*mulPrecision()) returns fixed1()
   * Test multiply(maxFixedMul,maxFixedMul) is around maxUint256()
   * Test multiply(maxFixedMul+1,maxFixedMul+1) fails
   */
  function multiply(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) {
    if (x.value == 0 || y.value == 0) return Fraction(0);
    if (y.value == FIXED1_UINT) return x;
    if (x.value == FIXED1_UINT) return y;

    // Separate into integer and fractional parts
    // x = x1 + x2, y = y1 + y2
    uint256 x1 = integer(x).value / FIXED1_UINT;
    uint256 x2 = fractional(x).value;
    uint256 y1 = integer(y).value / FIXED1_UINT;
    uint256 y2 = fractional(y).value;

    // (x1 + x2) * (y1 + y2) = (x1 * y1) + (x1 * y2) + (x2 * y1) + (x2 * y2)
    uint256 x1y1 = x1 * y1;
    if (x1 != 0) require(x1y1 / x1 == y1, "overflow x1y1 detected");

    // x1y1 needs to be multiplied back by fixed1
    // solium-disable-next-line mixedcase
    uint256 fixed_x1y1 = x1y1 * FIXED1_UINT;
    if (x1y1 != 0) require(fixed_x1y1 / x1y1 == FIXED1_UINT, "overflow x1y1 * fixed1 detected");
    x1y1 = fixed_x1y1;

    uint256 x2y1 = x2 * y1;
    if (x2 != 0) require(x2y1 / x2 == y1, "overflow x2y1 detected");

    uint256 x1y2 = x1 * y2;
    if (x1 != 0) require(x1y2 / x1 == y2, "overflow x1y2 detected");

    x2 = x2 / mulPrecision();
    y2 = y2 / mulPrecision();
    uint256 x2y2 = x2 * y2;
    if (x2 != 0) require(x2y2 / x2 == y2, "overflow x2y2 detected");

    // result = fixed1() * x1 * y1 + x1 * y2 + x2 * y1 + x2 * y2 / fixed1();
    Fraction memory result = Fraction(x1y1);
    result = add(result, Fraction(x2y1)); // Add checks for overflow
    result = add(result, Fraction(x1y2)); // Add checks for overflow
    result = add(result, Fraction(x2y2)); // Add checks for overflow
    return result;
  }

  /**
   * @notice 1/x
   * @dev
   * Test reciprocal(0) fails
   * Test reciprocal(fixed1()) returns fixed1()
   * Test reciprocal(fixed1()*fixed1()) returns 1 // Testing how the fractional is truncated
   * Test reciprocal(1+fixed1()*fixed1()) returns 0 // Testing how the fractional is truncated
   * Test reciprocal(newFixedFraction(1, 1e24)) returns newFixed(1e24)
   */
  function reciprocal(Fraction memory x) internal pure returns (Fraction memory) {
    require(x.value != 0, "can't call reciprocal(0)");
    return Fraction((FIXED1_UINT * FIXED1_UINT) / x.value); // Can't overflow
  }

  /**
   * @notice x/y. If the dividend is higher than the max dividend value, it
   * might overflow. You can use multiply(x,reciprocal(y)) instead.
   * @dev The maximum value that can be safely used as a dividend (maxNewFixed) is defined as
   * divide(maxNewFixed,newFixedFraction(1,fixed1())) is around maxUint256().
   * This yields the value 115792089237316195423570985008687907853269984665640564.
   * Test maxNewFixed equals maxUint256()/fixed1()
   * Test divide(maxNewFixed,1) equals maxNewFixed*(fixed1)
   * Test divide(maxNewFixed+1,multiply(mulPrecision(),mulPrecision())) throws
   * Test divide(fixed1(),0) fails
   * Test divide(maxNewFixed,1) = maxNewFixed*(10^digits())
   * Test divide(maxNewFixed+1,1) throws
   */
  function divide(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) {
    require(y.value != 0, "can't divide by 0");
    uint256 X = x.value * FIXED1_UINT;
    require(X / FIXED1_UINT == x.value, "overflow at divide");
    return Fraction(X / y.value);
  }

  /**
   * @notice x > y
   */
  function gt(Fraction memory x, Fraction memory y) internal pure returns (bool) {
    return x.value > y.value;
  }

  /**
   * @notice x >= y
   */
  function gte(Fraction memory x, Fraction memory y) internal pure returns (bool) {
    return x.value >= y.value;
  }

  /**
   * @notice x < y
   */
  function lt(Fraction memory x, Fraction memory y) internal pure returns (bool) {
    return x.value < y.value;
  }

  /**
   * @notice x <= y
   */
  function lte(Fraction memory x, Fraction memory y) internal pure returns (bool) {
    return x.value <= y.value;
  }

  /**
   * @notice x == y
   */
  function equals(Fraction memory x, Fraction memory y) internal pure returns (bool) {
    return x.value == y.value;
  }

  /**
   * @notice x <= 1
   */
  function isProperFraction(Fraction memory x) internal pure returns (bool) {
    return lte(x, fixed1());
  }
}
          

/project:/contracts/common/Initializable.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.5.13 <0.9.0;

contract Initializable {
  bool public initialized;

  constructor(bool testingDeployment) public {
    if (!testingDeployment) {
      initialized = true;
    }
  }

  modifier initializer() {
    require(!initialized, "contract already initialized");
    initialized = true;
    _;
  }
}
          

/project:/contracts/common/interfaces/ICeloVersionedContract.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.5.13 <0.9.0;

interface ICeloVersionedContract {
  /**
   * @notice Returns the storage, major, minor, and patch version of the contract.
    * @return Storage version of the contract.
    * @return Major version of the contract.
    * @return Minor version of the contract.
    * @return Patch version of the contract.
   */
  function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256);
}
          

/project:/contracts/common/interfaces/IRegistry.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.5.13 <0.9.0;

interface IRegistry {
  function setAddressFor(string calldata, address) external;
  function getAddressForOrDie(bytes32) external view returns (address);
  function getAddressFor(bytes32) external view returns (address);
  function getAddressForStringOrDie(string calldata identifier) external view returns (address);
  function getAddressForString(string calldata identifier) external view returns (address);
  function isOneOf(bytes32[] calldata, address) external view returns (bool);
}
          

/project:/contracts/stability/interfaces/ISortedOracles.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.5.13 <0.9.0;

interface ISortedOracles {
  function addOracle(address, address) external;
  function removeOracle(address, address, uint256) external;
  function report(address, uint256, address, address) external;
  function removeExpiredReports(address, uint256) external;
  function isOldestReportExpired(address token) external view returns (bool, address);
  function numRates(address) external view returns (uint256);
  function medianRate(address) external view returns (uint256, uint256);
  function numTimestamps(address) external view returns (uint256);
  function medianTimestamp(address) external view returns (uint256);
}
          

/project:/contracts-0.8/common/UsingRegistry.sol

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0 <0.8.20;

// Note: This is not an exact copy of UsingRegistry or UsingRegistryV2 in the contract's folder
// because Mento's interfaces still don't support Solidity 0.8

import "@openzeppelin/contracts8/access/Ownable.sol";
import "@openzeppelin/contracts8/token/ERC20/IERC20.sol";

import "../../contracts/common/interfaces/IRegistry.sol";

contract UsingRegistry is Ownable {
  event RegistrySet(address indexed registryAddress);

  // solhint-disable state-visibility
  bytes32 constant ACCOUNTS_REGISTRY_ID = keccak256(abi.encodePacked("Accounts"));
  bytes32 constant ATTESTATIONS_REGISTRY_ID = keccak256(abi.encodePacked("Attestations"));
  bytes32 constant DOWNTIME_SLASHER_REGISTRY_ID = keccak256(abi.encodePacked("DowntimeSlasher"));
  bytes32 constant DOUBLE_SIGNING_SLASHER_REGISTRY_ID = keccak256(
    abi.encodePacked("DoubleSigningSlasher")
  );
  bytes32 constant ELECTION_REGISTRY_ID = keccak256(abi.encodePacked("Election"));
  bytes32 constant EXCHANGE_REGISTRY_ID = keccak256(abi.encodePacked("Exchange"));
  bytes32 constant FEE_CURRENCY_WHITELIST_REGISTRY_ID = keccak256(
    abi.encodePacked("FeeCurrencyWhitelist")
  );
  bytes32 constant FREEZER_REGISTRY_ID = keccak256(abi.encodePacked("Freezer"));
  bytes32 constant GOLD_TOKEN_REGISTRY_ID = keccak256(abi.encodePacked("GoldToken"));
  bytes32 constant GOVERNANCE_REGISTRY_ID = keccak256(abi.encodePacked("Governance"));
  bytes32 constant GOVERNANCE_SLASHER_REGISTRY_ID = keccak256(
    abi.encodePacked("GovernanceSlasher")
  );
  bytes32 constant LOCKED_GOLD_REGISTRY_ID = keccak256(abi.encodePacked("LockedGold"));
  bytes32 constant RESERVE_REGISTRY_ID = keccak256(abi.encodePacked("Reserve"));
  bytes32 constant RANDOM_REGISTRY_ID = keccak256(abi.encodePacked("Random"));
  bytes32 constant SORTED_ORACLES_REGISTRY_ID = keccak256(abi.encodePacked("SortedOracles"));
  bytes32 constant STABLE_TOKEN_REGISTRY_ID = keccak256(abi.encodePacked("StableToken"));
  bytes32 constant VALIDATORS_REGISTRY_ID = keccak256(abi.encodePacked("Validators"));
  // solhint-enable state-visibility

  IRegistry public registry;

  modifier onlyRegisteredContract(bytes32 identifierHash) {
    require(registry.getAddressForOrDie(identifierHash) == msg.sender, "only registered contract");
    _;
  }

  modifier onlyRegisteredContracts(bytes32[] memory identifierHashes) {
    require(registry.isOneOf(identifierHashes, msg.sender), "only registered contracts");
    _;
  }

  /**
   * @notice Updates the address pointing to a Registry contract.
   * @param registryAddress The address of a registry contract for routing to other contracts.
   */
  function setRegistry(address registryAddress) public onlyOwner {
    require(registryAddress != address(0), "Cannot register the null address");
    registry = IRegistry(registryAddress);
    emit RegistrySet(registryAddress);
  }

  function getGoldToken() internal view returns (IERC20) {
    return IERC20(registry.getAddressForOrDie(GOLD_TOKEN_REGISTRY_ID));
  }
}
          

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":false},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"paris","compilationTarget":{"project:/contracts-0.8/common/GasPriceMinimum.sol":"GasPriceMinimum"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"bool","name":"test","internalType":"bool"}]},{"type":"event","name":"AdjustmentSpeedSet","inputs":[{"type":"uint256","name":"adjustmentSpeed","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"BaseFeeOpCodeActivationBlockSet","inputs":[{"type":"uint256","name":"baseFeeOpCodeActivationBlock","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"GasPriceMinimumFloorSet","inputs":[{"type":"uint256","name":"gasPriceMinimumFloor","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"GasPriceMinimumUpdated","inputs":[{"type":"uint256","name":"gasPriceMinimum","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RegistrySet","inputs":[{"type":"address","name":"registryAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TargetDensitySet","inputs":[{"type":"uint256","name":"targetDensity","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ABSOLUTE_MINIMAL_GAS_PRICE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"value","internalType":"uint256"}],"name":"adjustmentSpeed","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"baseFeeOpCodeActivationBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"deprecated_gasPriceMinimum","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"gasPriceMinimum","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"gasPriceMinimumFloor","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getGasPriceMinimum","inputs":[{"type":"address","name":"tokenAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUpdatedGasPriceMinimum","inputs":[{"type":"uint256","name":"blockGasTotal","internalType":"uint256"},{"type":"uint256","name":"blockGasLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVersionNumber","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_registryAddress","internalType":"address"},{"type":"uint256","name":"_gasPriceMinimumFloor","internalType":"uint256"},{"type":"uint256","name":"_targetDensity","internalType":"uint256"},{"type":"uint256","name":"_adjustmentSpeed","internalType":"uint256"},{"type":"uint256","name":"_baseFeeOpCodeActivationBlock","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IRegistry"}],"name":"registry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAdjustmentSpeed","inputs":[{"type":"uint256","name":"_adjustmentSpeed","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBaseFeeOpCodeActivationBlock","inputs":[{"type":"uint256","name":"_baseFeeOpCodeActivationBlock","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setGasPriceMinimumFloor","inputs":[{"type":"uint256","name":"_gasPriceMinimumFloor","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRegistry","inputs":[{"type":"address","name":"registryAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTargetDensity","inputs":[{"type":"uint256","name":"_targetDensity","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"value","internalType":"uint256"}],"name":"targetDensity","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"updateGasPriceMinimum","inputs":[{"type":"uint256","name":"blockGasTotal","internalType":"uint256"},{"type":"uint256","name":"blockGasLimit","internalType":"uint256"}]}]
              

Contract Creation Code

0x60806040523480156200001157600080fd5b50604051620028c0380380620028c0833981810160405281019062000037919062000190565b80620000586200004c6200008260201b60201c565b6200008a60201b60201c565b806200007a576001600060146101000a81548160ff0219169083151502179055505b5050620001c2565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b60008115159050919050565b6200016a8162000153565b81146200017657600080fd5b50565b6000815190506200018a816200015f565b92915050565b600060208284031215620001a957620001a86200014e565b5b6000620001b98482850162000179565b91505092915050565b6126ee80620001d26000396000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c806393ca6fc4116100b8578063c12398b41161007c578063c12398b41461031e578063ceff0bd61461034e578063ef712c5b1461036c578063f2fde38b1461039c578063f8e2b062146103b8578063f92ad219146103d657610142565b806393ca6fc41461027c578063a54b7fc014610298578063a68f548e146102c8578063a91ee0dc146102e6578063b830f4a41461030257610142565b8063541170fd1161010a578063541170fd146101d957806354255be0146101f7578063715018a6146102185780637b103999146102225780638da5cb5b146102405780638efd92ca1461025e57610142565b8063158ef93e1461014757806330f726b91461016557806336945c2d146101815780634a3d5fe21461019f5780634b930e5a146101bd575b600080fd5b61014f6103f2565b60405161015c9190611812565b60405180910390f35b61017f600480360381019061017a9190611868565b610405565b005b6101896104ce565b60405161019691906118a4565b60405180910390f35b6101a76104f9565b6040516101b491906118a4565b60405180910390f35b6101d760048036038101906101d29190611868565b610505565b005b6101e161051b565b6040516101ee91906118a4565b60405180910390f35b6101ff610520565b60405161020f94939291906118bf565b60405180910390f35b61022061053c565b005b61022a610550565b6040516102379190611983565b60405180910390f35b610248610576565b60405161025591906119bf565b60405180910390f35b61026661059f565b60405161027391906118a4565b60405180910390f35b61029660048036038101906102919190611868565b6105a5565b005b6102b260048036038101906102ad9190611a06565b61066e565b6040516102bf91906118a4565b60405180910390f35b6102d061068a565b6040516102dd91906118a4565b60405180910390f35b61030060048036038101906102fb9190611a06565b610696565b005b61031c60048036038101906103179190611868565b610794565b005b61033860048036038101906103339190611a33565b610820565b60405161034591906118a4565b60405180910390f35b6103566108e4565b60405161036391906118a4565b60405180910390f35b61038660048036038101906103819190611a33565b6108ea565b60405161039391906118a4565b60405180910390f35b6103b660048036038101906103b19190611a06565b610a82565b005b6103c0610b05565b6040516103cd91906118a4565b60405180910390f35b6103f060048036038101906103eb9190611a73565b610b0b565b005b600060149054906101000a900460ff1681565b61040d610bbc565b61041681610c3a565b600560008201518160000155905050610455610430610c58565b6005604051806020016040529081600082015481525050610c7e90919063ffffffff16565b610494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048b90611b71565b60405180910390fd5b7fd2e71cd7012df1df07d4908ff75ae4b2bfbb6c49d39144404661f1fd47253283816040516104c391906118a4565b60405180910390a150565b6000806006541180156104e357506006544310155b156104f0574890506104f6565b60025490505b90565b60048060000154905081565b61050d610bbc565b610518816000610c93565b50565b600181565b6000806000806001600260006001935093509350935090919293565b610544610bbc565b61054e6000610d28565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60065481565b6105ad610bbc565b6105b681610c3a565b6004600082015181600001559050506105f56105d0610c58565b6004604051806020016040529081600082015481525050610c7e90919063ffffffff16565b610634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062b90611c03565b60405180910390fd5b7f2a109bad06121312708ed2a3e9b3556ea85ef8eadd4d10d8181f50d114eb4fab8160405161066391906118a4565b60405180910390a150565b600061068361067c83610dec565b6001611097565b9050919050565b60058060000154905081565b61069e610bbc565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070490611c6f565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f27fe5f0c1c3b1ed427cc63d0f05759ffdecf9aec9e18d31ef366fc8a6cb5dc3b60405160405180910390a250565b61079c610bbc565b600081116107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d690611d01565b60405180910390fd5b806003819055507f5548a13ccc1d9e4e2860461edda5ad49ba8a4fda485f67d954f9d7da8d2aff278160405161081591906118a4565b60405180910390a150565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610890576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088790611d6d565b60405180910390fd5b61089a83836108ea565b6002819055507f6e53b2f8b69496c2a175588ad1326dbabe2f66df4d82f817aeca52e3474807fb6002546040516108d191906118a4565b60405180910390a1600254905092915050565b60035481565b6000806108f784846110b0565b905060006109246004604051806020016040529081600082015481525050836110e690919063ffffffff16565b905060008161095b576109568360046040518060200160405290816000820154815250506110fb90919063ffffffff16565b610985565b6109846004604051806020016040529081600082015481525050846110fb90919063ffffffff16565b5b90506000826109d5576109d06109ba83600560405180602001604052908160008201548152505061117890919063ffffffff16565b6109c2610c58565b6110fb90919063ffffffff16565b610a18565b610a17610a0183600560405180602001604052908160008201548152505061117890919063ffffffff16565b610a09610c58565b61150f90919063ffffffff16565b5b90506000610a5f610a5a610a2a610c58565b610a4c610a3d610a386104ce565b61158e565b8661117890919063ffffffff16565b61150f90919063ffffffff16565b61160b565b9050600354811015610a7357600354610a75565b805b9550505050505092915050565b610a8a610bbc565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610af9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af090611dff565b60405180910390fd5b610b0281610d28565b50565b60025481565b600060149054906101000a900460ff1615610b5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5290611e6b565b60405180910390fd5b6001600060146101000a81548160ff021916908315150217905550610b7f33610d28565b610b8885610696565b83600281905550610b9884610794565b610ba1836105a5565b610baa82610405565b610bb5816001610c93565b5050505050565b610bc461162e565b73ffffffffffffffffffffffffffffffffffffffff16610be2610576565b73ffffffffffffffffffffffffffffffffffffffff1614610c38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2f90611ed7565b60405180910390fd5b565b610c426117e4565b6040518060200160405280838152509050919050565b610c606117e4565b604051806020016040528069d3c21bcecceda1000000815250905090565b60008160000151836000015110905092915050565b610c9b610bbc565b8080610ca75750600082115b610ce6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdd90611f69565b60405180910390fd5b816006819055507fc74fe30765574b78669fcec5cea6b0dcaacd907890a49fc756a40235d01b09fc82604051610d1c91906118a4565b60405180910390a15050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480610f125750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001610e7090611fe0565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401610ea2919061200e565b602060405180830381865afa158015610ebf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee3919061203e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15610f2657610f1f6104ce565b9050611092565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001610f75906120b7565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401610fa7919061200e565b602060405180830381865afa158015610fc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe8919061203e565b90506000808273ffffffffffffffffffffffffffffffffffffffff1663ef90e1b0866040518263ffffffff1660e01b815260040161102691906119bf565b6040805180830381865afa158015611042573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106691906120e1565b809250819350505080826110786104ce565b6110829190612150565b61108c91906121c1565b93505050505b919050565b60008183116110a657816110a8565b825b905092915050565b6110b86117e4565b60006110c38461158e565b905060006110d08461158e565b90506110dc8282611636565b9250505092915050565b60008160000151836000015111905092915050565b6111036117e4565b81600001518360000151101561114e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111459061223e565b60405180910390fd5b60405180602001604052808360000151856000015161116d919061225e565b815250905092915050565b6111806117e4565b600083600001511480611197575060008260000151145b156111b357604051806020016040528060008152509050611509565b69d3c21bcecceda10000008260000151036111d057829050611509565b69d3c21bcecceda10000008360000151036111ed57819050611509565b600069d3c21bcecceda100000061120385611725565b6000015161121191906121c1565b9050600061121e85611767565b600001519050600069d3c21bcecceda100000061123a86611725565b6000015161124891906121c1565b9050600061125586611767565b600001519050600082856112699190612150565b9050600085146112c15782858261128091906121c1565b146112c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b7906122de565b60405180910390fd5b5b600069d3c21bcecceda1000000826112d99190612150565b90506000821461133b5769d3c21bcecceda100000082826112fa91906121c1565b1461133a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113319061234a565b60405180910390fd5b5b8091506000848661134c9190612150565b9050600086146113a45784868261136391906121c1565b146113a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139a906123b6565b60405180910390fd5b5b600084886113b29190612150565b90506000881461140a578488826113c991906121c1565b14611409576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140090612422565b60405180910390fd5b5b6114126117b8565b8761141d91906121c1565b96506114276117b8565b8561143291906121c1565b9450600085886114429190612150565b90506000881461149a5785888261145991906121c1565b14611499576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114909061248e565b60405180910390fd5b5b600060405180602001604052808781525090506114c58160405180602001604052808781525061150f565b90506114df8160405180602001604052808681525061150f565b90506114f98160405180602001604052808581525061150f565b9050809a50505050505050505050505b92915050565b6115176117e4565b60008260000151846000015161152d91906124ae565b90508360000151811015611576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156d9061252e565b60405180910390fd5b60405180602001604052808281525091505092915050565b6115966117e4565b61159e6117c5565b8211156115e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d7906125c0565b60405180910390fd5b604051806020016040528069d3c21bcecceda1000000846116019190612150565b8152509050919050565b600069d3c21bcecceda1000000826000015161162791906121c1565b9050919050565b600033905090565b61163e6117e4565b6000826000015103611685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167c9061262c565b60405180910390fd5b600069d3c21bcecceda100000084600001516116a19190612150565b9050836000015169d3c21bcecceda1000000826116be91906121c1565b146116fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f590612698565b60405180910390fd5b604051806020016040528084600001518361171991906121c1565b81525091505092915050565b61172d6117e4565b604051806020016040528069d3c21bcecceda100000080856000015161175391906121c1565b61175d9190612150565b8152509050919050565b61176f6117e4565b604051806020016040528069d3c21bcecceda100000080856000015161179591906121c1565b61179f9190612150565b84600001516117ae919061225e565b8152509050919050565b600064e8d4a51000905090565b60007601357c299a88ea76a58924d52ce4f26a85af186c2b9e74905090565b6040518060200160405280600081525090565b60008115159050919050565b61180c816117f7565b82525050565b60006020820190506118276000830184611803565b92915050565b600080fd5b6000819050919050565b61184581611832565b811461185057600080fd5b50565b6000813590506118628161183c565b92915050565b60006020828403121561187e5761187d61182d565b5b600061188c84828501611853565b91505092915050565b61189e81611832565b82525050565b60006020820190506118b96000830184611895565b92915050565b60006080820190506118d46000830187611895565b6118e16020830186611895565b6118ee6040830185611895565b6118fb6060830184611895565b95945050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061194961194461193f84611904565b611924565b611904565b9050919050565b600061195b8261192e565b9050919050565b600061196d82611950565b9050919050565b61197d81611962565b82525050565b60006020820190506119986000830184611974565b92915050565b60006119a982611904565b9050919050565b6119b98161199e565b82525050565b60006020820190506119d460008301846119b0565b92915050565b6119e38161199e565b81146119ee57600080fd5b50565b600081359050611a00816119da565b92915050565b600060208284031215611a1c57611a1b61182d565b5b6000611a2a848285016119f1565b91505092915050565b60008060408385031215611a4a57611a4961182d565b5b6000611a5885828601611853565b9250506020611a6985828601611853565b9150509250929050565b600080600080600060a08688031215611a8f57611a8e61182d565b5b6000611a9d888289016119f1565b9550506020611aae88828901611853565b9450506040611abf88828901611853565b9350506060611ad088828901611853565b9250506080611ae188828901611853565b9150509295509295909350565b600082825260208201905092915050565b7f61646a7573746d656e74207370656564206d75737420626520736d616c6c657260008201527f207468616e203100000000000000000000000000000000000000000000000000602082015250565b6000611b5b602783611aee565b9150611b6682611aff565b604082019050919050565b60006020820190508181036000830152611b8a81611b4e565b9050919050565b7f7461726765742064656e73697479206d75737420626520736d616c6c6572207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6000611bed602583611aee565b9150611bf882611b91565b604082019050919050565b60006020820190508181036000830152611c1c81611be0565b9050919050565b7f43616e6e6f7420726567697374657220746865206e756c6c2061646472657373600082015250565b6000611c59602083611aee565b9150611c6482611c23565b602082019050919050565b60006020820190508181036000830152611c8881611c4c565b9050919050565b7f676173207072696365206d696e696d756d20666c6f6f72206d7573742062652060008201527f67726561746572207468616e207a65726f000000000000000000000000000000602082015250565b6000611ceb603183611aee565b9150611cf682611c8f565b604082019050919050565b60006020820190508181036000830152611d1a81611cde565b9050919050565b7f4f6e6c7920564d2063616e2063616c6c00000000000000000000000000000000600082015250565b6000611d57601083611aee565b9150611d6282611d21565b602082019050919050565b60006020820190508181036000830152611d8681611d4a565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611de9602683611aee565b9150611df482611d8d565b604082019050919050565b60006020820190508181036000830152611e1881611ddc565b9050919050565b7f636f6e747261637420616c726561647920696e697469616c697a656400000000600082015250565b6000611e55601c83611aee565b9150611e6082611e1f565b602082019050919050565b60006020820190508181036000830152611e8481611e48565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611ec1602083611aee565b9150611ecc82611e8b565b602082019050919050565b60006020820190508181036000830152611ef081611eb4565b9050919050565b7f62617365466565206f70436f64652061637469766174696f6e20626c6f636b2060008201527f6d7573742062652067726561746572207468616e207a65726f00000000000000602082015250565b6000611f53603983611aee565b9150611f5e82611ef7565b604082019050919050565b60006020820190508181036000830152611f8281611f46565b9050919050565b600081905092915050565b7f476f6c64546f6b656e0000000000000000000000000000000000000000000000600082015250565b6000611fca600983611f89565b9150611fd582611f94565b600982019050919050565b6000611feb82611fbd565b9150819050919050565b6000819050919050565b61200881611ff5565b82525050565b60006020820190506120236000830184611fff565b92915050565b600081519050612038816119da565b92915050565b6000602082840312156120545761205361182d565b5b600061206284828501612029565b91505092915050565b7f536f727465644f7261636c657300000000000000000000000000000000000000600082015250565b60006120a1600d83611f89565b91506120ac8261206b565b600d82019050919050565b60006120c282612094565b9150819050919050565b6000815190506120db8161183c565b92915050565b600080604083850312156120f8576120f761182d565b5b6000612106858286016120cc565b9250506020612117858286016120cc565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061215b82611832565b915061216683611832565b925082820261217481611832565b9150828204841483151761218b5761218a612121565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006121cc82611832565b91506121d783611832565b9250826121e7576121e6612192565b5b828204905092915050565b7f737562737472616374696f6e20756e646572666c6f7720646574656374656400600082015250565b6000612228601f83611aee565b9150612233826121f2565b602082019050919050565b600060208201905081810360008301526122578161221b565b9050919050565b600061226982611832565b915061227483611832565b925082820390508181111561228c5761228b612121565b5b92915050565b7f6f766572666c6f77207831793120646574656374656400000000000000000000600082015250565b60006122c8601683611aee565b91506122d382612292565b602082019050919050565b600060208201905081810360008301526122f7816122bb565b9050919050565b7f6f766572666c6f772078317931202a2066697865643120646574656374656400600082015250565b6000612334601f83611aee565b915061233f826122fe565b602082019050919050565b6000602082019050818103600083015261236381612327565b9050919050565b7f6f766572666c6f77207832793120646574656374656400000000000000000000600082015250565b60006123a0601683611aee565b91506123ab8261236a565b602082019050919050565b600060208201905081810360008301526123cf81612393565b9050919050565b7f6f766572666c6f77207831793220646574656374656400000000000000000000600082015250565b600061240c601683611aee565b9150612417826123d6565b602082019050919050565b6000602082019050818103600083015261243b816123ff565b9050919050565b7f6f766572666c6f77207832793220646574656374656400000000000000000000600082015250565b6000612478601683611aee565b915061248382612442565b602082019050919050565b600060208201905081810360008301526124a78161246b565b9050919050565b60006124b982611832565b91506124c483611832565b92508282019050808211156124dc576124db612121565b5b92915050565b7f616464206f766572666c6f772064657465637465640000000000000000000000600082015250565b6000612518601583611aee565b9150612523826124e2565b602082019050919050565b600060208201905081810360008301526125478161250b565b9050919050565b7f63616e277420637265617465206669786964697479206e756d626572206c617260008201527f676572207468616e206d61784e65774669786564282900000000000000000000602082015250565b60006125aa603683611aee565b91506125b58261254e565b604082019050919050565b600060208201905081810360008301526125d98161259d565b9050919050565b7f63616e2774206469766964652062792030000000000000000000000000000000600082015250565b6000612616601183611aee565b9150612621826125e0565b602082019050919050565b6000602082019050818103600083015261264581612609565b9050919050565b7f6f766572666c6f77206174206469766964650000000000000000000000000000600082015250565b6000612682601283611aee565b915061268d8261264c565b602082019050919050565b600060208201905081810360008301526126b181612675565b905091905056fea26469706673582212208d6fe0b511ff627ac60524f5430d18bd51daf6bd26c2098de19f30dd0db38f6164736f6c634300081300330000000000000000000000000000000000000000000000000000000000000000

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101425760003560e01c806393ca6fc4116100b8578063c12398b41161007c578063c12398b41461031e578063ceff0bd61461034e578063ef712c5b1461036c578063f2fde38b1461039c578063f8e2b062146103b8578063f92ad219146103d657610142565b806393ca6fc41461027c578063a54b7fc014610298578063a68f548e146102c8578063a91ee0dc146102e6578063b830f4a41461030257610142565b8063541170fd1161010a578063541170fd146101d957806354255be0146101f7578063715018a6146102185780637b103999146102225780638da5cb5b146102405780638efd92ca1461025e57610142565b8063158ef93e1461014757806330f726b91461016557806336945c2d146101815780634a3d5fe21461019f5780634b930e5a146101bd575b600080fd5b61014f6103f2565b60405161015c9190611812565b60405180910390f35b61017f600480360381019061017a9190611868565b610405565b005b6101896104ce565b60405161019691906118a4565b60405180910390f35b6101a76104f9565b6040516101b491906118a4565b60405180910390f35b6101d760048036038101906101d29190611868565b610505565b005b6101e161051b565b6040516101ee91906118a4565b60405180910390f35b6101ff610520565b60405161020f94939291906118bf565b60405180910390f35b61022061053c565b005b61022a610550565b6040516102379190611983565b60405180910390f35b610248610576565b60405161025591906119bf565b60405180910390f35b61026661059f565b60405161027391906118a4565b60405180910390f35b61029660048036038101906102919190611868565b6105a5565b005b6102b260048036038101906102ad9190611a06565b61066e565b6040516102bf91906118a4565b60405180910390f35b6102d061068a565b6040516102dd91906118a4565b60405180910390f35b61030060048036038101906102fb9190611a06565b610696565b005b61031c60048036038101906103179190611868565b610794565b005b61033860048036038101906103339190611a33565b610820565b60405161034591906118a4565b60405180910390f35b6103566108e4565b60405161036391906118a4565b60405180910390f35b61038660048036038101906103819190611a33565b6108ea565b60405161039391906118a4565b60405180910390f35b6103b660048036038101906103b19190611a06565b610a82565b005b6103c0610b05565b6040516103cd91906118a4565b60405180910390f35b6103f060048036038101906103eb9190611a73565b610b0b565b005b600060149054906101000a900460ff1681565b61040d610bbc565b61041681610c3a565b600560008201518160000155905050610455610430610c58565b6005604051806020016040529081600082015481525050610c7e90919063ffffffff16565b610494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048b90611b71565b60405180910390fd5b7fd2e71cd7012df1df07d4908ff75ae4b2bfbb6c49d39144404661f1fd47253283816040516104c391906118a4565b60405180910390a150565b6000806006541180156104e357506006544310155b156104f0574890506104f6565b60025490505b90565b60048060000154905081565b61050d610bbc565b610518816000610c93565b50565b600181565b6000806000806001600260006001935093509350935090919293565b610544610bbc565b61054e6000610d28565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60065481565b6105ad610bbc565b6105b681610c3a565b6004600082015181600001559050506105f56105d0610c58565b6004604051806020016040529081600082015481525050610c7e90919063ffffffff16565b610634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062b90611c03565b60405180910390fd5b7f2a109bad06121312708ed2a3e9b3556ea85ef8eadd4d10d8181f50d114eb4fab8160405161066391906118a4565b60405180910390a150565b600061068361067c83610dec565b6001611097565b9050919050565b60058060000154905081565b61069e610bbc565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070490611c6f565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f27fe5f0c1c3b1ed427cc63d0f05759ffdecf9aec9e18d31ef366fc8a6cb5dc3b60405160405180910390a250565b61079c610bbc565b600081116107df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d690611d01565b60405180910390fd5b806003819055507f5548a13ccc1d9e4e2860461edda5ad49ba8a4fda485f67d954f9d7da8d2aff278160405161081591906118a4565b60405180910390a150565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610890576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088790611d6d565b60405180910390fd5b61089a83836108ea565b6002819055507f6e53b2f8b69496c2a175588ad1326dbabe2f66df4d82f817aeca52e3474807fb6002546040516108d191906118a4565b60405180910390a1600254905092915050565b60035481565b6000806108f784846110b0565b905060006109246004604051806020016040529081600082015481525050836110e690919063ffffffff16565b905060008161095b576109568360046040518060200160405290816000820154815250506110fb90919063ffffffff16565b610985565b6109846004604051806020016040529081600082015481525050846110fb90919063ffffffff16565b5b90506000826109d5576109d06109ba83600560405180602001604052908160008201548152505061117890919063ffffffff16565b6109c2610c58565b6110fb90919063ffffffff16565b610a18565b610a17610a0183600560405180602001604052908160008201548152505061117890919063ffffffff16565b610a09610c58565b61150f90919063ffffffff16565b5b90506000610a5f610a5a610a2a610c58565b610a4c610a3d610a386104ce565b61158e565b8661117890919063ffffffff16565b61150f90919063ffffffff16565b61160b565b9050600354811015610a7357600354610a75565b805b9550505050505092915050565b610a8a610bbc565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610af9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af090611dff565b60405180910390fd5b610b0281610d28565b50565b60025481565b600060149054906101000a900460ff1615610b5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5290611e6b565b60405180910390fd5b6001600060146101000a81548160ff021916908315150217905550610b7f33610d28565b610b8885610696565b83600281905550610b9884610794565b610ba1836105a5565b610baa82610405565b610bb5816001610c93565b5050505050565b610bc461162e565b73ffffffffffffffffffffffffffffffffffffffff16610be2610576565b73ffffffffffffffffffffffffffffffffffffffff1614610c38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2f90611ed7565b60405180910390fd5b565b610c426117e4565b6040518060200160405280838152509050919050565b610c606117e4565b604051806020016040528069d3c21bcecceda1000000815250905090565b60008160000151836000015110905092915050565b610c9b610bbc565b8080610ca75750600082115b610ce6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdd90611f69565b60405180910390fd5b816006819055507fc74fe30765574b78669fcec5cea6b0dcaacd907890a49fc756a40235d01b09fc82604051610d1c91906118a4565b60405180910390a15050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480610f125750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001610e7090611fe0565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401610ea2919061200e565b602060405180830381865afa158015610ebf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee3919061203e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15610f2657610f1f6104ce565b9050611092565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dcf0aaed604051602001610f75906120b7565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401610fa7919061200e565b602060405180830381865afa158015610fc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe8919061203e565b90506000808273ffffffffffffffffffffffffffffffffffffffff1663ef90e1b0866040518263ffffffff1660e01b815260040161102691906119bf565b6040805180830381865afa158015611042573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106691906120e1565b809250819350505080826110786104ce565b6110829190612150565b61108c91906121c1565b93505050505b919050565b60008183116110a657816110a8565b825b905092915050565b6110b86117e4565b60006110c38461158e565b905060006110d08461158e565b90506110dc8282611636565b9250505092915050565b60008160000151836000015111905092915050565b6111036117e4565b81600001518360000151101561114e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111459061223e565b60405180910390fd5b60405180602001604052808360000151856000015161116d919061225e565b815250905092915050565b6111806117e4565b600083600001511480611197575060008260000151145b156111b357604051806020016040528060008152509050611509565b69d3c21bcecceda10000008260000151036111d057829050611509565b69d3c21bcecceda10000008360000151036111ed57819050611509565b600069d3c21bcecceda100000061120385611725565b6000015161121191906121c1565b9050600061121e85611767565b600001519050600069d3c21bcecceda100000061123a86611725565b6000015161124891906121c1565b9050600061125586611767565b600001519050600082856112699190612150565b9050600085146112c15782858261128091906121c1565b146112c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b7906122de565b60405180910390fd5b5b600069d3c21bcecceda1000000826112d99190612150565b90506000821461133b5769d3c21bcecceda100000082826112fa91906121c1565b1461133a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113319061234a565b60405180910390fd5b5b8091506000848661134c9190612150565b9050600086146113a45784868261136391906121c1565b146113a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139a906123b6565b60405180910390fd5b5b600084886113b29190612150565b90506000881461140a578488826113c991906121c1565b14611409576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140090612422565b60405180910390fd5b5b6114126117b8565b8761141d91906121c1565b96506114276117b8565b8561143291906121c1565b9450600085886114429190612150565b90506000881461149a5785888261145991906121c1565b14611499576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114909061248e565b60405180910390fd5b5b600060405180602001604052808781525090506114c58160405180602001604052808781525061150f565b90506114df8160405180602001604052808681525061150f565b90506114f98160405180602001604052808581525061150f565b9050809a50505050505050505050505b92915050565b6115176117e4565b60008260000151846000015161152d91906124ae565b90508360000151811015611576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156d9061252e565b60405180910390fd5b60405180602001604052808281525091505092915050565b6115966117e4565b61159e6117c5565b8211156115e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d7906125c0565b60405180910390fd5b604051806020016040528069d3c21bcecceda1000000846116019190612150565b8152509050919050565b600069d3c21bcecceda1000000826000015161162791906121c1565b9050919050565b600033905090565b61163e6117e4565b6000826000015103611685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167c9061262c565b60405180910390fd5b600069d3c21bcecceda100000084600001516116a19190612150565b9050836000015169d3c21bcecceda1000000826116be91906121c1565b146116fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f590612698565b60405180910390fd5b604051806020016040528084600001518361171991906121c1565b81525091505092915050565b61172d6117e4565b604051806020016040528069d3c21bcecceda100000080856000015161175391906121c1565b61175d9190612150565b8152509050919050565b61176f6117e4565b604051806020016040528069d3c21bcecceda100000080856000015161179591906121c1565b61179f9190612150565b84600001516117ae919061225e565b8152509050919050565b600064e8d4a51000905090565b60007601357c299a88ea76a58924d52ce4f26a85af186c2b9e74905090565b6040518060200160405280600081525090565b60008115159050919050565b61180c816117f7565b82525050565b60006020820190506118276000830184611803565b92915050565b600080fd5b6000819050919050565b61184581611832565b811461185057600080fd5b50565b6000813590506118628161183c565b92915050565b60006020828403121561187e5761187d61182d565b5b600061188c84828501611853565b91505092915050565b61189e81611832565b82525050565b60006020820190506118b96000830184611895565b92915050565b60006080820190506118d46000830187611895565b6118e16020830186611895565b6118ee6040830185611895565b6118fb6060830184611895565b95945050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061194961194461193f84611904565b611924565b611904565b9050919050565b600061195b8261192e565b9050919050565b600061196d82611950565b9050919050565b61197d81611962565b82525050565b60006020820190506119986000830184611974565b92915050565b60006119a982611904565b9050919050565b6119b98161199e565b82525050565b60006020820190506119d460008301846119b0565b92915050565b6119e38161199e565b81146119ee57600080fd5b50565b600081359050611a00816119da565b92915050565b600060208284031215611a1c57611a1b61182d565b5b6000611a2a848285016119f1565b91505092915050565b60008060408385031215611a4a57611a4961182d565b5b6000611a5885828601611853565b9250506020611a6985828601611853565b9150509250929050565b600080600080600060a08688031215611a8f57611a8e61182d565b5b6000611a9d888289016119f1565b9550506020611aae88828901611853565b9450506040611abf88828901611853565b9350506060611ad088828901611853565b9250506080611ae188828901611853565b9150509295509295909350565b600082825260208201905092915050565b7f61646a7573746d656e74207370656564206d75737420626520736d616c6c657260008201527f207468616e203100000000000000000000000000000000000000000000000000602082015250565b6000611b5b602783611aee565b9150611b6682611aff565b604082019050919050565b60006020820190508181036000830152611b8a81611b4e565b9050919050565b7f7461726765742064656e73697479206d75737420626520736d616c6c6572207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6000611bed602583611aee565b9150611bf882611b91565b604082019050919050565b60006020820190508181036000830152611c1c81611be0565b9050919050565b7f43616e6e6f7420726567697374657220746865206e756c6c2061646472657373600082015250565b6000611c59602083611aee565b9150611c6482611c23565b602082019050919050565b60006020820190508181036000830152611c8881611c4c565b9050919050565b7f676173207072696365206d696e696d756d20666c6f6f72206d7573742062652060008201527f67726561746572207468616e207a65726f000000000000000000000000000000602082015250565b6000611ceb603183611aee565b9150611cf682611c8f565b604082019050919050565b60006020820190508181036000830152611d1a81611cde565b9050919050565b7f4f6e6c7920564d2063616e2063616c6c00000000000000000000000000000000600082015250565b6000611d57601083611aee565b9150611d6282611d21565b602082019050919050565b60006020820190508181036000830152611d8681611d4a565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611de9602683611aee565b9150611df482611d8d565b604082019050919050565b60006020820190508181036000830152611e1881611ddc565b9050919050565b7f636f6e747261637420616c726561647920696e697469616c697a656400000000600082015250565b6000611e55601c83611aee565b9150611e6082611e1f565b602082019050919050565b60006020820190508181036000830152611e8481611e48565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611ec1602083611aee565b9150611ecc82611e8b565b602082019050919050565b60006020820190508181036000830152611ef081611eb4565b9050919050565b7f62617365466565206f70436f64652061637469766174696f6e20626c6f636b2060008201527f6d7573742062652067726561746572207468616e207a65726f00000000000000602082015250565b6000611f53603983611aee565b9150611f5e82611ef7565b604082019050919050565b60006020820190508181036000830152611f8281611f46565b9050919050565b600081905092915050565b7f476f6c64546f6b656e0000000000000000000000000000000000000000000000600082015250565b6000611fca600983611f89565b9150611fd582611f94565b600982019050919050565b6000611feb82611fbd565b9150819050919050565b6000819050919050565b61200881611ff5565b82525050565b60006020820190506120236000830184611fff565b92915050565b600081519050612038816119da565b92915050565b6000602082840312156120545761205361182d565b5b600061206284828501612029565b91505092915050565b7f536f727465644f7261636c657300000000000000000000000000000000000000600082015250565b60006120a1600d83611f89565b91506120ac8261206b565b600d82019050919050565b60006120c282612094565b9150819050919050565b6000815190506120db8161183c565b92915050565b600080604083850312156120f8576120f761182d565b5b6000612106858286016120cc565b9250506020612117858286016120cc565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061215b82611832565b915061216683611832565b925082820261217481611832565b9150828204841483151761218b5761218a612121565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006121cc82611832565b91506121d783611832565b9250826121e7576121e6612192565b5b828204905092915050565b7f737562737472616374696f6e20756e646572666c6f7720646574656374656400600082015250565b6000612228601f83611aee565b9150612233826121f2565b602082019050919050565b600060208201905081810360008301526122578161221b565b9050919050565b600061226982611832565b915061227483611832565b925082820390508181111561228c5761228b612121565b5b92915050565b7f6f766572666c6f77207831793120646574656374656400000000000000000000600082015250565b60006122c8601683611aee565b91506122d382612292565b602082019050919050565b600060208201905081810360008301526122f7816122bb565b9050919050565b7f6f766572666c6f772078317931202a2066697865643120646574656374656400600082015250565b6000612334601f83611aee565b915061233f826122fe565b602082019050919050565b6000602082019050818103600083015261236381612327565b9050919050565b7f6f766572666c6f77207832793120646574656374656400000000000000000000600082015250565b60006123a0601683611aee565b91506123ab8261236a565b602082019050919050565b600060208201905081810360008301526123cf81612393565b9050919050565b7f6f766572666c6f77207831793220646574656374656400000000000000000000600082015250565b600061240c601683611aee565b9150612417826123d6565b602082019050919050565b6000602082019050818103600083015261243b816123ff565b9050919050565b7f6f766572666c6f77207832793220646574656374656400000000000000000000600082015250565b6000612478601683611aee565b915061248382612442565b602082019050919050565b600060208201905081810360008301526124a78161246b565b9050919050565b60006124b982611832565b91506124c483611832565b92508282019050808211156124dc576124db612121565b5b92915050565b7f616464206f766572666c6f772064657465637465640000000000000000000000600082015250565b6000612518601583611aee565b9150612523826124e2565b602082019050919050565b600060208201905081810360008301526125478161250b565b9050919050565b7f63616e277420637265617465206669786964697479206e756d626572206c617260008201527f676572207468616e206d61784e65774669786564282900000000000000000000602082015250565b60006125aa603683611aee565b91506125b58261254e565b604082019050919050565b600060208201905081810360008301526125d98161259d565b9050919050565b7f63616e2774206469766964652062792030000000000000000000000000000000600082015250565b6000612616601183611aee565b9150612621826125e0565b602082019050919050565b6000602082019050818103600083015261264581612609565b9050919050565b7f6f766572666c6f77206174206469766964650000000000000000000000000000600082015250565b6000612682601283611aee565b915061268d8261264c565b602082019050919050565b600060208201905081810360008301526126b181612675565b905091905056fea26469706673582212208d6fe0b511ff627ac60524f5430d18bd51daf6bd26c2098de19f30dd0db38f6164736f6c63430008130033