{"constructor_args":null,"is_partially_verified":true,"is_changed_bytecode":false,"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"bucket","type":"bytes32"}],"name":"BucketLiquidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"mocAddress","type":"address"}],"name":"ContractLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[],"name":"BUCKET_C0","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BUCKET_X2","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DEPRECATED_mocBurnout","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"isAddition","type":"bool"},{"internalType":"uint256","name":"delta","type":"uint256"}],"name":"alterRedeemRequestAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"bproxBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"calculateBitProHoldersInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"contract IGovernor","name":"newIGovernor","type":"address"}],"name":"changeIGovernor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"connector","outputs":[{"internalType":"contract MoCConnector","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"redeemer","type":"address"}],"name":"docAmountToRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"}],"name":"evalBucketLiquidation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"evalLiquidation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getBitProInterestAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBitProRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getDayPrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMocPrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRedeemRequestAt","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReservePrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"governor","outputs":[{"internalType":"contract IGovernor","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_stopper","type":"address"},{"internalType":"contract IGovernor","name":"_governor","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"connectorAddress","type":"address"},{"internalType":"address","name":"governorAddress","type":"address"},{"internalType":"address","name":"stopperAddress","type":"address"},{"internalType":"bool","name":"startStoppable","type":"bool"},{"internalType":"uint256","name":"maxGasPrice_","type":"uint256"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract IGovernor","name":"_governor","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_stopper","type":"address"},{"internalType":"contract IGovernor","name":"_governor","type":"address"},{"internalType":"bool","name":"_stoppable","type":"bool"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isBitProInterestEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"}],"name":"isBucketLiquidationReached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isDailyEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"isSettlementEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"makeStoppable","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"makeUnstoppable","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxGasPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"btcToMint","type":"uint256"}],"name":"mintBPro","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"btcToMint","type":"uint256"},{"internalType":"address payable","name":"vendorAccount","type":"address"}],"name":"mintBProVendors","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"},{"internalType":"uint256","name":"btcToMint","type":"uint256"}],"name":"mintBProx","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address payable","name":"","type":"address"}],"name":"mintBProxVendors","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"btcToMint","type":"uint256"}],"name":"mintDoc","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"btcToMint","type":"uint256"},{"internalType":"address payable","name":"vendorAccount","type":"address"}],"name":"mintDocVendors","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"payBitProHoldersInterestPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"redeemAllDoc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"bproAmount","type":"uint256"}],"name":"redeemBPro","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"bproAmount","type":"uint256"},{"internalType":"address payable","name":"vendorAccount","type":"address"}],"name":"redeemBProVendors","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"},{"internalType":"uint256","name":"bproxAmount","type":"uint256"}],"name":"redeemBProx","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"bucket","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address payable","name":"","type":"address"}],"name":"redeemBProxVendors","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"docAmount","type":"uint256"}],"name":"redeemDocRequest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"docAmount","type":"uint256"}],"name":"redeemFreeDoc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"docAmount","type":"uint256"},{"internalType":"address payable","name":"vendorAccount","type":"address"}],"name":"redeemFreeDocVendors","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"redeemQueueSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"steps","type":"uint256"}],"name":"runSettlement","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint256","name":"btcAmount","type":"uint256"}],"name":"sendToAddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"maxGasPrice_","type":"uint256"}],"name":"setMaxGasPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newStopper","type":"address"}],"name":"setStopper","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stoppable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stopper","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}],"conflicting_implementations":null,"certified":false,"additional_sources":[{"file_path":"npm/moc-governance@0.1.0/contracts/Governance/ChangeContract.sol","source_code":"pragma solidity ^0.5.8;\n\n/**\n  @title ChangeContract\n  @notice This interface is the one used by the governance system.\n  @dev If you plan to do some changes to a system governed by this project you should write a contract\n  that does those changes, like a recipe. This contract MUST not have ANY kind of public or external function\n  that modifies the state of this ChangeContract, otherwise you could run into front-running issues when the governance\n  system is fully in place.\n */\ninterface ChangeContract {\n\n  /**\n    @notice Override this function with a recipe of the changes to be done when this ChangeContract\n    is executed\n   */\n  function execute() external;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/base/MoCConstants.sol","source_code":"pragma solidity ^0.5.8;\n\n/**\n * @dev Defines special constants to use along all the MoC System\n */\ncontract MoCConstants {\n  bytes32 constant public BUCKET_X2 = \"X2\";\n  bytes32 constant public BUCKET_C0 = \"C0\";\n}"},{"file_path":"npm/money-on-chain@3.0.7/contracts/interface/IMoCExchange.sol","source_code":"pragma solidity ^0.5.8;\n\ninterface IMoCExchange {\n    function getMoCTokenBalance(address owner, address spender) external view\n    returns (uint256 mocBalance, uint256 mocAllowance);\n\n    function mintBPro(address account, uint256 btcAmount, address vendorAccount) external\n    returns (uint256, uint256, uint256, uint256, uint256);\n\n    function redeemBPro(address account, uint256 bproAmount, address vendorAccount) external\n    returns (uint256, uint256, uint256, uint256, uint256);\n\n    function mintDoc(address account, uint256 btcToMint, address vendorAccount) external\n    returns (uint256, uint256, uint256, uint256, uint256);\n\n    function redeemFreeDoc(address account, uint256 docAmount, address vendorAccount) external\n    returns (uint256, uint256, uint256, uint256, uint256);\n\n    function redeemAllDoc(address origin, address payable destination) external\n    returns (uint256);\n}"},{"file_path":"npm/money-on-chain@3.0.7/contracts/base/MoCWhitelist.sol","source_code":"pragma solidity ^0.5.8;\n\n/**\n  @dev Provides access control between all MoC Contracts\n */\ncontract MoCWhitelist {\n  mapping(address => bool) whitelist;\n\n  /**\n   * @dev Check if an account is whitelisted\n   * @return Bool\n   */\n  function isWhitelisted(address account)\n    public\n    view\n    returns (bool)\n  {\n    require(account != address(0), \"Account must not be 0x0\");\n    return whitelist[account];\n  }\n\n  /**\n   * @dev Add account to whitelist\n   */\n  function add(address account) internal {\n    require(account != address(0), \"Account must not be 0x0\");\n    require(!isWhitelisted(account), \"Account not allowed to add accounts into white list\");\n    whitelist[account] = true;\n  }\n\n  /**\n   * @dev Remove account from whitelist\n   */\n  function remove(address account) internal {\n    require(account != address(0), \"Account must not be 0x0\");\n    require(isWhitelisted(account), \"Account is not allowed to remove address from the white list\");\n\n    whitelist[account] = false;\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/interface/IMoC.sol","source_code":"pragma solidity ^0.5.8;\n\ninterface IMoC {\n    function() external payable;\n\n    function sendToAddress(address payable receiver, uint256 btcAmount) external returns(bool);\n}"},{"file_path":"npm/moc-governance@0.1.0/contracts/Governance/Governed.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"./IGovernor.sol\";\nimport \"zos-lib/contracts/Initializable.sol\";\n\n/**\n  @title Governed\n  @notice Base contract to be inherited by governed contracts\n  @dev This contract is not usable on its own since it does not have any _productive useful_ behaviour\n  The only purpose of this contract is to define some useful modifiers and functions to be used on the\n  governance aspect of the child contract\n  */\ncontract Governed is Initializable {\n\n  /**\n    @notice The address of the contract which governs this one\n   */\n  IGovernor public governor;\n\n  string constant private NOT_AUTHORIZED_CHANGER = \"not_authorized_changer\";\n\n  /**\n    @notice Modifier that protects the function\n    @dev You should use this modifier in any function that should be called through\n    the governance system\n   */\n  modifier onlyAuthorizedChanger() {\n    require(governor.isAuthorizedChanger(msg.sender), NOT_AUTHORIZED_CHANGER);\n    _;\n  }\n\n  /**\n    @notice Initialize the contract with the basic settings\n    @dev This initialize replaces the constructor but it is not called automatically.\n    It is necessary because of the upgradeability of the contracts\n    @param _governor Governor address\n   */\n  function initialize(IGovernor _governor) public initializer {\n    governor = _governor;\n  }\n\n  /**\n    @notice Change the contract's governor. Should be called through the old governance system\n    @param newIGovernor New governor address\n   */\n  function changeIGovernor(IGovernor newIGovernor) public onlyAuthorizedChanger {\n    governor = newIGovernor;\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/moc-governance@0.1.0/contracts/Governance/IGovernor.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"./ChangeContract.sol\";\n\n/**\n  @title Governor\n  @notice Governor interface. This functions should be overwritten to\n  enable the comunnication with the rest of the system\n  */\ninterface IGovernor{\n\n  /**\n    @notice Function to be called to make the changes in changeContract\n    @dev This function should be protected somehow to only execute changes that\n    benefit the system. This decision process is independent of this architechture\n    therefore is independent of this interface too\n    @param changeContract Address of the contract that will execute the changes\n   */\n  function executeChange(ChangeContract changeContract) external;\n\n  /**\n    @notice Function to be called to make the changes in changeContract\n    @param _changer Address of the contract that will execute the changes\n   */\n  function isAuthorizedChanger(address _changer) external view returns (bool);\n}\n"},{"file_path":"npm/moc-governance@0.1.0/contracts/Stopper/Stoppable.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"../Governance/Governed.sol\";\n\n\n/**\n  @title Stoppable\n  @notice Allow a contract to be paused through the stopper subsystem. This contracts\n  is able to disable the stoppability feature through governance.\n  @dev This contract was heavily based on the _Pausable_ contract of openzeppelin-eth but\n  it was modified in order to being able to turn on and off its stopability\n */\ncontract Stoppable is Governed {\n\n  event Paused(address account);\n  event Unpaused(address account);\n\n  bool public stoppable;\n  bool private _paused;\n  address public stopper;\n  string private constant UNSTOPPABLE = \"unstoppable\";\n  string private constant CONTRACT_IS_ACTIVE = \"contract_is_active\";\n  string private constant CONTRACT_IS_PAUSED = \"contract_is_paused\";\n  string private constant NOT_STOPPER = \"not_stopper\";\n\n\n  /**\n    @notice Modifier to make a function callable only when the contract is enable\n    to be paused\n  */\n  modifier whenStoppable() {\n    require(stoppable, UNSTOPPABLE);\n    _;\n  }\n\n  /**\n    @notice Modifier to make a function callable only when the contract is not paused\n  */\n  modifier whenNotPaused() {\n    require(!_paused, CONTRACT_IS_PAUSED);\n    _;\n  }\n\n  /**\n    @notice Modifier to make a function callable only when the contract is paused\n    */\n  modifier whenPaused() {\n    require(_paused, CONTRACT_IS_ACTIVE);\n    _;\n  }\n\n  /**\n    @notice  Modifier to make a function callable only by the pauser\n   */\n  modifier onlyPauser() {\n    require(stopper == msg.sender, NOT_STOPPER);\n    _;\n  }\n\n  /**\n    @notice Initialize the contract with the basic settings\n    @dev This initialize replaces the constructor but it is not called automatically.\n    It is necessary because of the upgradeability of the contracts. Either this function or the next can be used\n    @param _stopper The address that is authorized to stop this contract\n    @param _governor The address that will define when a change contract is authorized to do this unstoppable/stoppable again\n   */\n  function initialize(address _stopper, IGovernor _governor) public initializer {\n    initialize(_stopper, _governor, true);\n  }\n\n  /**\n    @notice Initialize the contract with the basic settings\n    @dev This initialize replaces the constructor but it is not called automatically.\n    It is necessary because of the upgradeability of the contracts. Either this function or the previous can be used\n    @param _stopper The address that is authorized to stop this contract\n    @param _governor The address that will define when a change contract is authorized to do this unstoppable/stoppable again\n    @param _stoppable Define if the contract starts being unstoppable or not\n   */\n  function initialize(address _stopper, IGovernor _governor, bool _stoppable) public initializer {\n    stoppable = _stoppable;\n    stopper = _stopper;\n    Governed.initialize(_governor);\n  }\n\n  /**\n    @notice Returns true if paused\n   */\n  function paused() public view returns (bool) {\n    return _paused;\n  }\n  /**\n    @notice Called by the owner to pause, triggers stopped state\n    @dev Should only be called by the pauser and when it is stoppable\n   */\n  function pause() public whenStoppable onlyPauser whenNotPaused {\n    _paused = true;\n    emit Paused(msg.sender);\n  }\n\n  /**\n    @notice Called by the owner to unpause, returns to normal state\n   */\n  function unpause() public onlyPauser whenPaused {\n    _paused = false;\n    emit Unpaused(msg.sender);\n  }\n\n\n  /**\n    @notice Switches OFF the stoppability of the contract; if the contract was paused\n    it will no longer be so\n    @dev Should be called through governance\n   */\n  function makeUnstoppable() public onlyAuthorizedChanger {\n    stoppable = false;\n  }\n\n\n  /**\n    @notice Switches ON the stoppability of the contract; if the contract was paused\n    before making it unstoppable it will be paused again after calling this function\n    @dev Should be called through governance\n   */\n  function makeStoppable() public onlyAuthorizedChanger {\n    stoppable = true;\n  }\n\n  /**\n    @notice Changes the address which is enable to stop this contract\n    @param newStopper Address of the newStopper\n    @dev Should be called through governance\n   */\n  function setStopper(address newStopper) public onlyAuthorizedChanger {\n    stopper = newStopper;\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/MoCBProxManager.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"./base/MoCBase.sol\";\nimport \"./MoCBucketContainer.sol\";\n\ncontract MoCBProxManager is MoCBucketContainer {\n  using SafeMath for uint256;\n  uint256 constant MIN_ALLOWED_BALANCE = 0;\n\n  /**\n    @dev Initializes the contract\n    @param connectorAddress MoCConnector contract address\n    @param _governor Governor contract address\n    @param _c0Cobj Bucket C0 objective coverage\n    @param _x2Cobj Bucket X2 objective coverage\n  */\n  function initialize(\n    address connectorAddress,\n    address _governor,\n    uint256 _c0Cobj,\n    uint256 _x2Cobj\n  ) public initializer {\n    initializeBase(connectorAddress);\n    initializeValues(_governor);\n    createBucket(BUCKET_C0, _c0Cobj, true);\n    createBucket(BUCKET_X2, _x2Cobj, false);\n  }\n\n  /**\n    @dev returns user balance\n    @param bucket BProx corresponding bucket to get balance from\n    @param userAddress user address to get balance from\n    @return total balance for the userAddress\n  */\n  function bproxBalanceOf(bytes32 bucket, address userAddress) public view returns(uint256) {\n    BProxBalance memory userBalance = mocBuckets[bucket].bproxBalances[userAddress];\n    if (!hasValidBalance(bucket, userAddress, userBalance.index)) return 0;\n    return userBalance.value;\n  }\n\n  /**\n    @dev verifies that this user has assigned balance for the given bucket\n    @param bucket corresponding Leveraged bucket to get balance from\n    @param userAddress user address to verify balance for\n    @param index index, starting from 1, where the address of the user is being kept\n    @return true if the user has assigned balance\n  */\n  function hasValidBalance(bytes32 bucket, address userAddress, uint index) public view returns(bool) {\n    return (index != 0) &&\n      (index <= getActiveAddressesCount(bucket)) &&\n      (mocBuckets[bucket].activeBalances[index - 1] == userAddress);\n  }\n\n  /**\n    @dev  Assigns the amount of BProx\n    @param bucket bucket from which the BProx will be removed\n    @param account user address to redeem for\n    @param bproxAmount bprox amount to redeem [using mocPresicion]\n    @param totalCost btc value of bproxAmount [using reservePrecision]\n  */\n  function assignBProx(bytes32 bucket, address payable account, uint256 bproxAmount, uint256 totalCost)\n  public onlyWhitelisted(msg.sender) {\n    uint256 currentBalance = bproxBalanceOf(bucket, account);\n\n    setBProxBalanceOf(bucket, account, currentBalance.add(bproxAmount));\n    addValuesToBucket(bucket, totalCost, 0, bproxAmount);\n  }\n\n  /**\n    @dev Removes the amount of BProx and substract BTC cost from bucket\n    @param bucket bucket from which the BProx will be removed\n    @param userAddress user address to redeem for\n    @param bproxAmount bprox amount to redeem [using mocPresicion]\n    @param totalCost btc value of bproxAmount [using reservePrecision]\n  */\n  function removeBProx(bytes32 bucket, address payable userAddress, uint256 bproxAmount, uint256 totalCost)\n  public onlyWhitelisted(msg.sender) {\n    uint256 currentBalance = bproxBalanceOf(bucket, userAddress);\n\n    setBProxBalanceOf(bucket, userAddress, currentBalance.sub(bproxAmount));\n    substractValuesFromBucket(bucket, totalCost, 0, bproxAmount);\n  }\n\n  /**\n    @dev Sets the amount of BProx\n    @param bucket bucket from which the BProx will be setted\n    @param userAddress user address to redeem for\n    @param value bprox amount to redeem [using mocPresicion]\n  */\n  function setBProxBalanceOf(bytes32 bucket, address payable userAddress, uint256 value) public onlyWhitelisted(msg.sender) {\n    mocBuckets[bucket].bproxBalances[userAddress].value = value;\n    uint256 index = mocBuckets[bucket].bproxBalances[userAddress].index;\n    if (!hasValidBalance(bucket, userAddress, index))\n      index = 0;\n\n    bool hasBalance = value > MIN_ALLOWED_BALANCE;\n    // The address is not in the array\n    if (index == 0) {\n      if (hasBalance) {\n        if (mocBuckets[bucket].activeBalances.length == mocBuckets[bucket].activeBalancesLength) {\n          mocBuckets[bucket].activeBalances.length += 1;\n        }\n        uint256 currentIndex = mocBuckets[bucket].activeBalancesLength++;\n        mocBuckets[bucket].activeBalances[currentIndex] = userAddress;\n        mocBuckets[bucket].bproxBalances[userAddress].index = mocBuckets[bucket].activeBalancesLength;\n      }\n    } else {\n      if (!hasBalance) {\n        // We need to delete this address from the tracker\n        uint256 lastActiveIndex = mocBuckets[bucket].activeBalancesLength;\n        address payable keyToMove = mocBuckets[bucket].activeBalances[lastActiveIndex - 1];\n        mocBuckets[bucket].activeBalances[index - 1] = keyToMove;\n        // Alternative index and array decreases lenght to prevent gas limit\n        mocBuckets[bucket].activeBalancesLength--;\n        // Update moved key index\n        mocBuckets[bucket].bproxBalances[keyToMove].index = index;\n        // Disable empty account index (0 == NULL)\n        mocBuckets[bucket].bproxBalances[userAddress].index = 0;\n      }\n    }\n  }\n\n  /**\n   @dev intializes values of the contract\n   @param _governor Governor contract address\n  */\n  function initializeValues(address _governor) internal {\n    governor = IGovernor(_governor);\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/MoCBucketContainer.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"openzeppelin-solidity/contracts/math/Math.sol\";\nimport \"./base/MoCBase.sol\";\nimport \"moc-governance/contracts/Governance/Governed.sol\";\n\ncontract MoCBucketContainer is MoCBase, Governed {\n  using SafeMath for uint256;\n  using Math for uint256;\n\n  struct BProxBalance {\n    uint256 value;\n    uint index; // Index start in 1, zero is reserved for NULL\n  }\n\n  struct MoCBucket {\n    bytes32 name;\n    bool isBase;\n    uint256 nDoc;\n    uint256 nBPro;\n    uint256 nBTC;\n    uint256 cobj;\n    // Should only be used in L buckets\n    mapping(address => BProxBalance) bproxBalances;\n    address payable[] activeBalances;\n    uint256 activeBalancesLength;\n    // Should only be used in Base buckets (C0)\n    uint256 inrateBag;\n    bool available;\n  }\n\n  event BucketMovement(\n    bytes32 from,\n    bytes32 to,\n    uint256 reserves,\n    uint256 stableTokens\n  );\n\n  event BucketCreation(\n    bytes32 name,\n    uint256 cobj\n  );\n\n  event BucketStateUpdate(\n    bytes32 name,\n    uint256 nReserve,\n    uint256 nStable,\n    uint256 nRiskProx,\n    uint256 inrateBag\n  );\n\n  mapping(bytes32 => MoCBucket) internal mocBuckets;\n\n   /**\n   GETTERS\n   */\n  function getBucketNBTC(bytes32 bucket) public view returns(uint256) {\n    return mocBuckets[bucket].nBTC;\n  }\n\n  function getBucketNBPro(bytes32 bucket) public view returns(uint256) {\n    return mocBuckets[bucket].nBPro;\n  }\n\n  function getBucketNDoc(bytes32 bucket) public view returns(uint256) {\n    return mocBuckets[bucket].nDoc;\n  }\n\n  function getBucketCobj(bytes32 bucket) public view returns(uint256) {\n    return mocBuckets[bucket].cobj;\n  }\n\n  function getInrateBag(bytes32 bucket) external pure returns(uint256) {\n    return 0;\n  }\n\n  /**\n   * @dev Sets the objective coverage (cobj) on an specficied bucket.\n   * @param  _bucket - name of the bucket\n   * @param  _cobj - new value of cobj\n   */\n  function setBucketCobj(bytes32 _bucket, uint256 _cobj) public onlyAuthorizedChanger(){\n    //TODO: It is necessary to analyze the impact in the model it has when changing X2. This\n    mocBuckets[_bucket].cobj = _cobj;\n  }\n\n  /**\n    @dev returns true if the bucket is a base bucket\n    @param bucket Name of the bucket\n  */\n  function isBucketBase(bytes32 bucket) public view returns(bool){\n    return mocBuckets[bucket].isBase;\n  }\n\n  /**\n    @dev returns true if the bucket have docs in it\n    @param bucket Name of the bucket\n  */\n  function isBucketEmpty(bytes32 bucket) public view returns(bool) {\n    return mocBuckets[bucket].nDoc == 0;\n  }\n\n  /**\n    @dev Returns all the address that currently have bprox position for this bucket\n    @param bucket bucket of the active address\n  */\n  function getActiveAddresses(bytes32 bucket) public view returns(address payable[] memory) {\n    return mocBuckets[bucket].activeBalances;\n  }\n\n  /**\n    @dev Returns all the address that currently have bprox position for this bucket\n    @param bucket bucket of the active address\n  */\n  function getActiveAddressesCount(bytes32 bucket) public view returns(uint256 count) {\n    return mocBuckets[bucket].activeBalancesLength;\n  }\n\n  /**\n    @dev Add values to all variables of the bucket\n    @param bucketName Name of the bucket\n    @param btc BTC amount [using reservePrecision]\n    @param doc Doc amount [using mocPrecision]\n    @param bprox BPro amount [using mocPrecision]\n  */\n  function addValuesToBucket(bytes32 bucketName, uint256 btc, uint256 doc, uint256 bprox)\n  public onlyWhitelisted(msg.sender) {\n    MoCBucket storage bucket = mocBuckets[bucketName];\n\n    bucket.nBTC = bucket.nBTC.add(btc);\n    bucket.nDoc = bucket.nDoc.add(doc);\n    bucket.nBPro = bucket.nBPro.add(bprox);\n  }\n\n  /**\n    @dev Substract values to all variables of the bucket\n    @param bucketName Name of the bucket\n    @param btc BTC amount [using reservePrecision]\n    @param doc Doc amount [using mocPrecision]\n    @param bprox BPro amount [using mocPrecision]\n  */\n  function substractValuesFromBucket(bytes32 bucketName, uint256 btc, uint256 doc, uint256 bprox)\n  public onlyWhitelisted(msg.sender)  {\n    MoCBucket storage bucket = mocBuckets[bucketName];\n\n    bucket.nBTC = bucket.nBTC.sub(btc);\n    bucket.nDoc = bucket.nDoc.sub(doc);\n    bucket.nBPro = bucket.nBPro.sub(bprox);\n  }\n\n  /**\n    @dev Move Btcs and Docs from one bucket to another\n    @param from Name of bucket from where the BTCs will be removed\n    @param to Name of bucket from where the BTCs will be added\n    @param btc BTCs amount [using reservePrecision]\n    @param docs Docs amount [using mocPrecision]\n  */\n  function moveBtcAndDocs(bytes32 from, bytes32 to, uint256 btc, uint256 docs) public\n  onlyWhitelisted(msg.sender) bucketStateUpdate(from) bucketStateUpdate(to) {\n    MoCBucket storage bucketFrom = mocBuckets[from];\n    MoCBucket storage bucketTo = mocBuckets[to];\n\n    bucketFrom.nBTC = bucketFrom.nBTC.sub(btc);\n    bucketTo.nBTC = bucketTo.nBTC.add(btc);\n\n    bucketFrom.nDoc = bucketFrom.nDoc.sub(docs);\n    bucketTo.nDoc = bucketTo.nDoc.add(docs);\n\n    emit BucketMovement(from, to, btc, docs);\n  }\n\n  /**\n    @dev Clears completely the origin bucket, removing all Docs, RBTCs and bproxs\n    @param toLiquidate Bucket to be cleared out\n    @param destination Bucket that will receive the Docs and RBTCs\n   */\n  function liquidateBucket(bytes32 toLiquidate, bytes32 destination) public onlyWhitelisted(msg.sender) {\n    require(!isBucketBase(toLiquidate), \"Cannot liquidate a base bucket\");\n\n    clearBucketBalances(toLiquidate);\n    emptyBucket(toLiquidate, destination);\n  }\n\n  /**\n    @dev Clears Docs and BTC from bucket origin and sends them to destination bucket\n    @param origin Bucket to clear out\n    @param destination Destination bucket\n  */\n  function emptyBucket(bytes32 origin, bytes32 destination) public onlyWhitelisted(msg.sender) {\n    moveBtcAndDocs(origin, destination, mocBuckets[origin].nBTC, mocBuckets[origin].nDoc);\n  }\n\n  /**\n   * @dev checks if a bucket exists\n   * @param bucket name of the bucket\n   */\n  function isAvailableBucket(bytes32 bucket) public view returns(bool) {\n    return mocBuckets[bucket].available;\n  }\n\n  /**\n    @dev Put all bucket BProx balances in zero\n    @param bucketName Bucket to clear out\n   */\n  function clearBucketBalances(bytes32 bucketName) public onlyWhitelisted(msg.sender) {\n    MoCBucket storage bucket = mocBuckets[bucketName];\n    bucket.nBPro = 0;\n    bucket.activeBalancesLength = 0;\n  }\n\n  /**\n    @dev Creates bucket\n    @param name Name of the bucket\n    @param cobj Target Coverage of the bucket\n    @param isBase Indicates if it is a base bucket (true) or not (false)\n  */\n  function createBucket(bytes32 name, uint256 cobj, bool isBase) internal {\n    mocBuckets[name].name = name;\n    mocBuckets[name].nDoc = 0;\n    mocBuckets[name].nBPro = 0;\n    mocBuckets[name].nBTC = 0;\n    mocBuckets[name].cobj = cobj;\n    mocBuckets[name].isBase = isBase;\n    mocBuckets[name].available = true;\n    emit BucketCreation(name, cobj);\n  }\n\n  modifier onlyBaseBucket(bytes32 bucket) {\n    require(isBucketBase(bucket), \"Bucket should be a base type bucket\");\n    _;\n  }\n\n  modifier bucketStateUpdate(bytes32 bucket) {\n    _;\n    emit BucketStateUpdate(\n      bucket,\n      mocBuckets[bucket].nBTC,\n      mocBuckets[bucket].nDoc,\n      mocBuckets[bucket].nBPro,\n      mocBuckets[bucket].inrateBag\n      );\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/MoCHelperLib.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\nlibrary MoCHelperLib {\n\n  struct MocLibConfig {\n    uint256 reservePrecision;\n    uint256 dayPrecision;\n    uint256 mocPrecision;\n  }\n\n  using SafeMath for uint256;\n\n  uint256 constant UINT256_MAX = ~uint256(0);\n\n  /**\n    @dev Returns max uint256 value constant.\n    @return max uint256 value constant\n  */\n  function getMaxInt(MocLibConfig storage /*config*/) public pure returns(uint256) {\n    return UINT256_MAX;\n  }\n\n  /**\n    @dev Calculates average interest using integral function: T =  Rate = a * (x ** b) + c\n    @param tMax maxInterestRate [using mocPrecision]\n    @param power factor [using noPrecision]\n    @param tMin minInterestRate C0 doc amount [using mocPrecision]\n    @param abRat1 initial abundance ratio [using mocPrecision]\n    @param abRat2 final abundance ratio [using mocPrecision]\n    @return average interest rate [using mocPrecision]\n  */\n  function inrateAvg(MocLibConfig storage config, uint256 tMax, uint256 power, uint256 tMin, uint256 abRat1, uint256 abRat2)\n  public view returns(uint256) {\n    require(tMax > tMin, \"Max inrate should be bigger than Min inrate\");\n    uint256 abRat1Comp = config.mocPrecision.sub(abRat1);\n    uint256 abRat2Comp = config.mocPrecision.sub(abRat2);\n\n    if (abRat1 == abRat2) {\n      return potential(config, tMax, power, tMin, abRat1Comp);\n    }\n    else if (abRat2 < abRat1) {\n      return avgInt(config, tMax, power, tMin, abRat1Comp, abRat2Comp);\n    }\n    else {\n      return avgInt(config, tMax, power, tMin, abRat2Comp, abRat1Comp);\n    }\n  }\n\n  /**\n    @dev Calculates spot interest rate that BProx owners should pay to BPro owners: Rate = tMax * (abRatio ** power) + tMin\n    @param tMin min interest rate [using mocPrecision]\n    @param power power to use in the formula [using NoPrecision]\n    @param tMax max interest rate [using mocPrecision]\n    @param abRatio bucket C0  abundance Ratio [using mocPrecision]\n   */\n  function spotInrate(\n    MocLibConfig storage config, uint256 tMax, uint256 power, uint256 tMin, uint256 abRatio\n  ) public view returns(uint256) {\n    uint256 abRatioComp = config.mocPrecision.sub(abRatio);\n\n    return potential(config, tMax, power, tMin, abRatioComp);\n  }\n\n  /**\n    @dev Calculates potential interests function with given parameters: Rate = a * (x ** b) + c\n    @param a maxInterestRate [using mocPrecision]\n    @param b factor [using NoPrecision]\n    @param c minInterestRate C0 doc amount [using mocPrecision]\n    @param value global doc amount [using mocPrecision]\n  */\n  function potential(MocLibConfig storage config, uint256 a, uint256 b, uint256 c, uint256 value)\n  public view returns(uint256) {\n    // value ** b\n    // [MOC] ** [] = [MOC]\n    uint256 aux1 = pow(value, b, config.mocPrecision);\n    // (a * aux1) + c\n    // [MOC] [MOC] / [MOC] + [MOC] = [MOC]\n    return a.mul(aux1).div(config.mocPrecision).add(c);\n  }\n\n  /**\n    @dev Calculates average of the integral function:\n     T = (\n              (c * xf + ((a * (xf ** (b + 1))) / (b + 1))) -\n              (c * xi + ((a * (xi ** (b + 1))) / (b + 1)))\n             ) / (xf - xi)\n    @param a maxInterestRate [using mocPrecision]\n    @param b factor [using NoPrecision]\n    @param c minInterestRate C0 doc amount [using mocPrecision]\n    @param value1 value to put in the function [using mocPrecision]\n    @param value2 value to put in the function [using mocPrecision]\n    @return average interest rate [using mocPrecision]\n  */\n  function avgInt(MocLibConfig storage config, uint256 a, uint256 b, uint256 c, uint256 value1, uint256 value2)\n  public view returns(uint256) {\n    // value2 - value1\n    // [MOC]\n    uint256 diff = value2.sub(value1);\n    // ((c * (1 - value1) + ((a * ((1 - value1) ** (b + 1))) / (b + 1)))\n    uint256 intV1 = integral(config, a, b, c, value1);\n    // ((c * (1 - value2) + ((a * ((1 - value2) ** (b + 1))) / (b + 1)))\n    uint256 intV2 = integral(config,  a, b, c, value2);\n    // (secOp - first) / diff\n    // ([MOC][MOC] - [MOC][MOC]) / [MOC] = [MOC]\n    return intV2.sub(intV1).div(diff);\n  }\n\n  /**\n    @dev Calculates integral of the exponential function: T = c * (value) + (a * value ** (b + 1)) / (b + 1))\n    @param a maxInterestRate [using mocPrecision]\n    @param b factor [using NoPrecision]\n    @param c minInterestRate C0 doc amount [using mocPrecision]\n    @param value value to put in the function [using mocPrecision]\n    @return integration result [using mocPrecision]\n  */\n  function integral(MocLibConfig storage config, uint256 a, uint256 b, uint256 c, uint256 value)\n  public view returns(uint256) {\n    // b + 1\n    // [NONE]\n    uint256 b2 = b.add(1);\n    // c * value\n    // [MOC][MOC]\n    uint256 firstOp = c.mul(value);\n    // [MOC]\n    uint256 pow = pow(value, b2, config.mocPrecision);\n    // (a * value ** b2) / b2)\n    // [MOC][MOC]\n    uint256 secOp = a.mul(pow).div(b2);\n    // (firstOp + secOp)\n    // [MOC][MOC] + [MOC][MOC] = [MOC][MOC]\n    return firstOp.add(secOp);\n  }\n\n  /**\n  * @dev Relation between docs in bucket 0 and Doc total supply\n  * @param doc0 doc count in bucket 0 [using mocPrecision]\n  * @param doct total doc supply [using mocPrecision]\n  * @return abundance ratio [using mocPrecision]\n  */\n  function abundanceRatio(MocLibConfig storage config, uint256 doc0, uint256 doct)\n  public view returns(uint256) {\n    if (doct == 0) {\n      return config.mocPrecision;\n    }\n    // [DOC] [MOC] / [DOC] = [MOC]\n    return doc0.mul(config.mocPrecision).div(doct);\n  }\n\n  /**\n    @dev Returns the Ratio to apply to BPro Price in discount situations: SpotDiscountRate = TPD * (utpdu - cob) / (uptdu -liq)\n    @param bproLiqDiscountRate Discount rate applied at Liquidation level coverage [using mocPrecision]\n    @param liq Liquidation coverage threshold [using mocPrecision]\n    @param utpdu Discount coverage threshold [using mocPrecision]\n    @param cov Actual global Coverage threshold [using mocPrecision]\n    @return Spot discount rate [using mocPrecision]\n  */\n  function bproSpotDiscountRate(\n    MocLibConfig storage libConfig, uint256 bproLiqDiscountRate,\n    uint256 liq, uint256 utpdu, uint256 cov\n  ) public view returns(uint256) {\n    require(bproLiqDiscountRate < libConfig.mocPrecision, \"Discount rate should be lower than 1\");\n\n    if (cov >= utpdu) {\n      return 0;\n    }\n\n    // utpdu - liq\n    // [MOC] - [MOC] = [MOC]\n    uint256 utpduLiqDiff = utpdu.sub(liq);\n\n    // utpdu - cov\n    // [MOC] - [MOC] = [MOC]\n    uint256 utpduCovDiff = utpdu.sub(cov);\n\n    // TPD * utpduCovDiff / utpduLiqDiff\n    // [MOC] * [MOC] / [MOC] = [MOC]\n    return bproLiqDiscountRate.mul(utpduCovDiff).div(utpduLiqDiff);\n  }\n\n  /**\n    @dev Max amount of BPro to available with discount: MaxBProWithDiscount = (uTPDU * nDOC * PEG - (nBTC * B)) / (TPusd * TPD)\n    @param nB Total BTC amount [using reservePrecision]\n    @param nDoc DOC amount [using mocPrecision]\n    @param utpdu Discount coverage threshold [using mocPrecision]\n    @param peg peg value\n    @param btcPrice BTC price [using mocPrecision]\n    @param bproUsdPrice bproUsdPrice [using mocPrecision]\n    @param spotDiscount spot discount [using mocPrecision]\n    @return Total BPro amount [using mocPrecision]\n  */\n  function maxBProWithDiscount(\n    MocLibConfig storage libConfig, uint256 nB, uint256 nDoc, uint256 utpdu,\n    uint256 peg, uint256 btcPrice, uint256 bproUsdPrice, uint256 spotDiscount\n  ) public view returns(uint256)  {\n    require(spotDiscount < libConfig.mocPrecision, \"Discount Rate should be lower than 1\");\n\n    if (spotDiscount == 0) {\n      return 0;\n    }\n\n    // nBTC * B\n    // [RES] * [MOC] / [RES] = [MOC]\n    uint256 nbUsdValue = nB.mul(btcPrice).div(libConfig.reservePrecision);\n\n    // (TPusd * (1 - TPD))\n    // [MOC] * [MOC] / [MOC] = [MOC]\n    uint256 bproDiscountPrice = bproUsdPrice.mul(libConfig.mocPrecision.sub(spotDiscount))\n      .div(libConfig.mocPrecision);\n\n    return maxBProWithDiscountAux(libConfig, nbUsdValue, nDoc, utpdu, peg, bproDiscountPrice);\n  }\n\n  /**\n    @dev Max amount of BPro to available with discount: MaxBProWithDiscount = (uTPDU * nDOC * PEG - (nBTC * B)) / (TPusd * TPD)\n    @param nbUsdValue Total amount of BTC in USD [using mocPrecision]\n    @param nDoc DOC amount [using mocPrecision]\n    @param utpdu Discount coverage threshold [using mocPrecision]\n    @param bproDiscountPrice bproUsdPrice with discount applied [using mocPrecision]\n    @param peg peg value\n    @return Total BPro amount [using mocPrecision]\n  */\n  function maxBProWithDiscountAux(\n    MocLibConfig storage libConfig, uint256 nbUsdValue, uint256 nDoc,\n    uint256 utpdu, uint256 peg, uint256 bproDiscountPrice\n  ) internal view returns(uint256) {\n\n    // uTPDU * nDOC * PEG\n    // [MOC] * [MOC] / [MOC] = [MOC]\n    uint256 coverageUSDAmount = utpdu.mul(nDoc).mul(peg).div(libConfig.mocPrecision);\n\n    // This case only occurs with Coverage below 1\n    if (coverageUSDAmount <= nbUsdValue) {\n      return 0;\n    }\n\n    // ([MOC] - [MOC]) * [RES] / [MOC] = [RES]\n    return coverageUSDAmount.sub(nbUsdValue).mul(libConfig.reservePrecision).div(bproDiscountPrice);\n  }\n\n  /**\n    @dev Calculates Locked bitcoin\n    @param btcPrice BTC price [using mocPrecision]\n    @param nDoc Docs amount [using mocPrecision]\n    @param peg peg value\n    @return Locked bitcoin [using reservePrecision]\n  */\n  function lockedBitcoin(\n    MocLibConfig storage libConfig, uint256 btcPrice, uint256 nDoc, uint256 peg\n  ) public view returns(uint256) {\n    return nDoc.mul(peg).mul(libConfig.reservePrecision).div(btcPrice);\n  }\n\n  /**\n    @dev Calculates price at liquidation event as a relation between the doc total supply\n    and the amount of RBTC available to distribute\n    @param rbtcAmount RBTC to distribute [using reservePrecision]\n    @param nDoc Docs amount [using mocPrecision]\n    @return Price at liquidation event [using mocPrecision]\n  */\n  function liquidationPrice(MocLibConfig storage libConfig, uint256 rbtcAmount, uint256 nDoc)\n  public view returns(uint256) {\n    // [MOC] * [RES] / [RES]\n    return nDoc.mul(libConfig.reservePrecision).div(rbtcAmount);\n  }\n\n  /**\n    @dev Calculates BPro BTC price: TPbtc = (nB-LB) / nTP\n    @param nB Total BTC amount [using reservePrecision]\n    @param lb Locked bitcoins amount [using reservePrecision]\n    @param nTP BPro amount [using mocPrecision]\n    @return BPro BTC price [using reservePrecision]\n  */\n  function bproTecPrice(MocLibConfig storage libConfig, uint256 nB, uint256 lb, uint256 nTP)\n    public view returns(uint256) {\n    // Liquidation happens before this condition turns true\n    if (nB < lb) {\n      return 0;\n    }\n\n    if (nTP == 0) {\n      return libConfig.mocPrecision;\n    }\n    // ([RES] - [RES]) * [MOC] / [MOC]\n    return nB.sub(lb).mul(libConfig.mocPrecision).div(nTP);\n  }\n\n  /**\n    @dev Calculates BPro BTC price: BProxInBPro = bproxTecPrice / bproPrice\n    @param bproxTecPrice BProx BTC price [using reservePrecision]\n    @param bproPrice Trog BTC price [using reservePrecision]\n    @return BProx price in BPro [using mocPrecision]\n  */\n  function bproxBProPrice(\n    MocLibConfig storage libConfig, uint256 bproxTecPrice, uint256 bproPrice\n  ) public view returns(uint256) {\n    // [RES] * [MOC] / [RES] = [MOC]\n    return bproxTecPrice.mul(libConfig.mocPrecision).div(bproPrice);\n  }\n\n  /**\n    @dev Returns a new value with the discountRate applied: TPbtc = (price)* (1 - discountRate)\n    @param price Price [using SomePrecision]\n    @param discountRate Discount rate to apply [using mocPrecision]\n    @return Price with discount applied [using SomePrecision]\n  */\n  function applyDiscountRate(MocLibConfig storage libConfig, uint256 price, uint256 discountRate)\n    public view returns(uint256) {\n\n    uint256 discountCoeff = libConfig.mocPrecision.sub(discountRate);\n\n    return price.mul(discountCoeff).div(libConfig.mocPrecision);\n  }\n\n  /**\n    @dev Returns the amount of interest to pay: TPbtc = price * interestRate\n    @param value Cost to apply interest [using SomePrecision]\n    @param interestRate Interest rate to apply [using mocPrecision]\n    @return Interest cost based on the value and interestRate [using SomePrecision]\n  */\n  function getInterestCost(MocLibConfig storage libConfig, uint256 value, uint256 interestRate)\n    public view returns(uint256) {\n    // [ORIGIN] * [MOC] / [MOC] = [ORIGIN]\n    return value.mul(interestRate).div(libConfig.mocPrecision);\n  }\n\n  /**\n    @dev Calculates Coverage: Coverage = nB / LB\n    @param nB Total BTC amount [using reservePrecision]\n    @param lB Locked bitcoins amount [using reservePrecision]\n    @return Coverage [using mocPrecision]\n  */\n  function coverage(MocLibConfig storage libConfig, uint256 nB, uint256 lB) public view\n    returns(uint256) {\n    if (lB == 0) {\n      return UINT256_MAX;\n    }\n\n    return nB.mul(libConfig.mocPrecision).div(lB);\n  }\n\n /**\n    @dev Calculates Leverage from Coverage: Leverage = C / (C - 1)\n    @param cov Coverage [using mocPrecision]\n    @return Leverage [using mocPrecision]\n  */\n  function leverageFromCoverage(MocLibConfig storage libConfig, uint256 cov)\n  public view returns(uint256) {\n    if (cov == UINT256_MAX) {\n      return libConfig.mocPrecision;\n    }\n\n    if (cov <= libConfig.mocPrecision) {\n      return UINT256_MAX;\n    }\n\n    return cov.mul(libConfig.mocPrecision).div(cov.sub(libConfig.mocPrecision));\n  }\n\n /**\n    @dev Calculates Leverage: Leverage = nB / (nB - lB)\n    @param nB Total BTC amount [using reservePrecision]\n    @param lB Locked bitcoins amount [using reservePrecision]\n    @return Leverage [using mocPrecision]\n  */\n  function leverage(MocLibConfig storage libConfig, uint256 nB,uint256 lB)\n  public view returns(uint256) {\n    if (lB == 0) {\n      return libConfig.mocPrecision;\n    }\n\n    if (nB <= lB) {\n      return UINT256_MAX;\n    }\n\n    return nB.mul(libConfig.mocPrecision).div(nB.sub(lB));\n  }\n\n  /**\n    @dev Price in BTC of the amount of Docs\n    @param amount Total BTC amount [using reservePrecision]\n    @param btcPrice BTC price [using mocPrecision]\n    @return Total value [using reservePrecision]\n  */\n  function docsBtcValue(\n    MocLibConfig storage libConfig, uint256 amount,uint256 peg, uint256 btcPrice\n  ) public view returns(uint256) {\n    require(btcPrice > 0,\"Bitcoin price should be more than zero\");\n    require(libConfig.reservePrecision > 0, \"Precision should be more than zero\");\n    //Total = amount / satoshi price\n    //Total = amount / (btcPrice / precision)\n    // [RES] * [MOC] / [MOC]\n    uint256 docBtcTotal = amount.mul(libConfig.mocPrecision).mul(peg).div(btcPrice);\n\n    return docBtcTotal;\n  }\n\n /**\n    @dev Price in RBTC of the amount of BPros\n    @param bproAmount amount of BPro [using mocPrecision]\n    @param bproBtcPrice BPro price in RBTC [using reservePrecision]\n    @return Total value [using reservePrecision]\n  */\n  function bproBtcValue(MocLibConfig storage libConfig, uint256 bproAmount, uint256 bproBtcPrice)\n    public view returns(uint256) {\n    require(libConfig.reservePrecision > 0, \"Precision should be more than zero\");\n\n    // [MOC] * [RES] / [MOC] =  [RES]\n    uint256 bproBtcTotal = bproAmount.mul(bproBtcPrice).div(libConfig.mocPrecision);\n\n    return bproBtcTotal;\n  }\n\n  /**\n    @dev Max amount of Docs to issue: MaxDoc = ((nB*B)-(Cobj*B/Bcons*nDoc*PEG))/(PEG*(Cobj*B/BCons-1))\n    @param nB Total BTC amount [using reservePrecision]\n    @param cobj Target Coverage [using mocPrecision]\n    @param nDoc DOC amount [using mocPrecision]\n    @param peg peg value\n    @param btcPrice BTC price [using mocPrecision]\n    @param bCons BTC conservative price [using mocPrecision]\n    @return Total Docs amount [using mocPrecision]\n  */\n  function maxDoc(\n    MocLibConfig storage libConfig, uint256 nB,\n    uint256 cobj, uint256 nDoc, uint256 peg, uint256 btcPrice, uint256 bCons\n  ) public view returns(uint256) {\n    require(libConfig.reservePrecision > 0, \"Invalid Precision\");\n    require(libConfig.mocPrecision > 0, \"Invalid Precision\");\n\n    // If cobj is less than 1, just return zero\n    if (cobj < libConfig.mocPrecision)\n      return 0;\n\n    // Cobj * B / BCons\n    // [MOC] * [MOC] / [MOC] = [MOC]\n    uint256 adjCobj = cobj.mul(btcPrice).div(bCons);\n\n    return maxDocAux(libConfig, nB, adjCobj, nDoc, peg, btcPrice);\n  }\n\n  function maxDocAux(MocLibConfig storage libConfig, uint256 nB, uint256 adjCobj, uint256 nDoc, uint256 peg, uint256 btcPrice)\n  internal view returns(uint256) {\n    // (nB*B)\n    // [RES] [MOC] [MOC] / [RES] = [MOC] [MOC]\n    uint256 firstOperand = nB.mul(btcPrice).mul(libConfig.mocPrecision).div(libConfig.reservePrecision);\n    // (adjCobj*nDoc*PEG)\n    // [MOC] [MOC]\n    uint256 secOperand = adjCobj.mul(nDoc).mul(peg);\n    // (PEG*(adjCobj-1)\n    // [MOC]\n    uint256 denom = adjCobj.sub(libConfig.mocPrecision).mul(peg);\n\n    if (firstOperand <= secOperand)\n      return 0;\n\n    // ([MOC][MOC] - [MOC][MOC]) / [MOC] = [MOC]\n    return (firstOperand.sub(secOperand)).div(denom);\n  }\n\n  /**\n    @dev Max amount of BPro to redeem: MaxBPro = ((nB*B)-(Cobj*nDoc*PEG))/TPusd\n    @param nB Total BTC amount [using reservePrecision]\n    @param cobj Target Coverage [using mocPrecision]\n    @param nDoc Target Coverage [using mocPrecision]\n    @param peg peg value\n    @param btcPrice BTC price [using mocPrecision]\n    @param bCons BTC conservative price [using mocPrecision]\n    @param bproUsdPrice bproUsdPrice [using mocPrecision]\n    @return Total BPro amount [using mocPrecision]\n  */\n  function maxBPro(\n    MocLibConfig storage libConfig, uint256 nB, uint256 cobj,\n    uint256 nDoc, uint256 peg, uint256 btcPrice, uint256 bCons, uint256 bproUsdPrice\n  ) public view returns(uint256) {\n    require(libConfig.reservePrecision > 0, \"Invalid Precision\");\n    require(libConfig.mocPrecision > 0, \"Invalid Precision\");\n\n    // Cobj * btcPrice / BCons\n    // [MOC] * [MOC] / [MOC] = [MOC]\n    uint256 adjCobj = cobj.mul(btcPrice).div(bCons);\n    // (nB * btcPrice)\n    // [RES] * [MOC] * [MOC] / [RES] = [MOC] [MOC]\n    uint256 firstOperand = nB.mul(btcPrice)\n      .mul(libConfig.mocPrecision)\n      .div(libConfig.reservePrecision);\n    // (adjCobj * nDoc * PEG)\n    // [MOC] * [MOC]\n    uint256 secOperand = adjCobj.mul(nDoc).mul(peg);\n\n    if (firstOperand <= secOperand)\n      return 0;\n\n    // ([MOC][MOC] - [MOC][MOC]) / [MOC] = [MOC]\n    return (firstOperand.sub(secOperand)).div(bproUsdPrice);\n  }\n\n  /**\n    @dev Calculates the total BTC price of the amount of BPros\n    @param amount Amount of BPro [using mocPrecision]\n    @param bproPrice BPro BTC Price [using reservePrecision]\n    @return BPro total value in BTC [using reservePrecision]\n  */\n  function totalBProInBtc(\n    MocLibConfig storage libConfig, uint256 amount, uint256 bproPrice\n  ) public view returns(uint256) {\n    // [RES] * [MOC] / [MOC] = [RES]\n    return bproPrice.mul(amount).div(libConfig.mocPrecision);\n  }\n\n  /**\n    @dev Calculates the equivalent in Docs of the btcAmount\n    @param btcAmount BTC  amount [using reservePrecision]\n    @param btcPrice BTC price [using mocPrecision]\n    @return Equivalent Doc amount [using mocPrecision]\n  */\n  function maxDocsWithBtc(\n    MocLibConfig storage libConfig, uint256 btcAmount, uint256 btcPrice\n  ) public view returns(uint256) {\n    // [RES] * [MOC] / [RES] = [MOC]\n    return btcAmount.mul(btcPrice).div(libConfig.reservePrecision);\n  }\n\n  /**\n    @dev Calculates the equivalent in BPro of the btcAmount\n    @param btcAmount BTC amount [using reservePrecision]\n    @param bproPrice BPro BTC price [using reservePrecision]\n    @return Equivalent Bpro amount [using mocPrecision]\n  */\n  function maxBProWithBtc(\n    MocLibConfig storage libConfig, uint256 btcAmount, uint256 bproPrice\n  ) public view returns(uint256) {\n    if (bproPrice == 0) {\n      return 0;\n    }\n\n    // [RES] * [MOC] / [RES]\n    return btcAmount.mul(libConfig.mocPrecision).div(bproPrice);\n  }\n\n  /**\n    @dev Calculates the Btc amount to move from C0 bucket to: toMove = btcAmount * (lev - 1)\n    an L bucket when a BProx minting occurs\n    @param btcAmount Total BTC amount [using reservePrecision]\n    @param lev L bucket leverage [using mocPrecision]\n    @return btc to move [using reservePrecision]\n  */\n  function bucketTransferAmount(\n    MocLibConfig storage libConfig, uint256 btcAmount, uint256 lev\n  ) public view returns(uint256) {\n    require(lev > libConfig.mocPrecision, \"Leverage should be more than 1\");\n\n    if (lev == UINT256_MAX || btcAmount == 0) {\n      return 0;\n    }\n\n    // (lev-1)\n    uint256 levSubOne = lev.sub(libConfig.mocPrecision);\n\n    // Intentionally avaoid SafeMath\n    // [RES] * [MOC]\n    uint256 transferAmount = btcAmount * levSubOne;\n    if (transferAmount / btcAmount != levSubOne)\n      return 0;\n\n    // [RES] * [MOC] / [MOC] = [RES]\n    return transferAmount.div(libConfig.mocPrecision);\n  }\n\n  /**\n    @dev Max amount of BTC allowed to be used to mint bprox: Maxbprox = nDOC/ (PEG*B*(lev-1))\n    @param nDoc number of DOC [using mocPrecision]\n    @param peg peg value\n    @param btcPrice BTC price [using mocPrecision]\n    @param lev leverage [using mocPrecision]\n    @return Max bprox BTC value [using reservePrecision]\n  */\n  function maxBProxBtcValue(\n    MocLibConfig storage libConfig, uint256 nDoc, uint256 peg, uint256 btcPrice, uint256 lev\n  ) public view returns(uint256)  {\n    require(libConfig.reservePrecision > 0, \"Invalid Precision\");\n    require(libConfig.mocPrecision > 0, \"Invalid Precision\");\n\n    if (lev <= libConfig.mocPrecision) {\n      return 0;\n    }\n    // (lev-1)\n    // [MOC]\n    uint256 levSubOne = lev.sub(libConfig.mocPrecision);\n\n    // PEG * BtcPrice\n    // [MOC]\n    uint256 pegTimesPrice = peg.mul(btcPrice);\n\n    // This intentionally avoid using safeMath to handle overflow case\n    // PEG * BtcPrice * (lev - 1)\n    // [MOC] * [MOC]\n    uint256 dividend = pegTimesPrice * levSubOne;\n\n    if (dividend / pegTimesPrice != levSubOne)\n      return 0; // INFINIT dividend means 0\n\n    // nDoc adjusted with precisions\n    // [MOC] [RES]\n    uint256 divider = nDoc.mul(libConfig.reservePrecision);\n\n    // [MOC] [RES] [MOC] / [MOC] [MOC]\n    return divider.mul(libConfig.mocPrecision).div(dividend);\n  }\n\n  /**\n    @dev Calculates the equivalent in MoC of the btcAmount\n    @param btcAmount BTC  amount\n    @param btcPrice BTC price\n    @param mocPrice MoC price\n    @return Equivalent MoC amount\n  */\n  function maxMoCWithBtc(\n    MocLibConfig storage /*libConfig*/, uint256 btcAmount, uint256 btcPrice, uint256 mocPrice\n  ) public pure returns(uint256) {\n    return btcPrice.mul(btcAmount).div(mocPrice);\n  }\n\n  /**\n    @dev Calculates the equivalent in BTC of the MoC amount\n    @param amount BTC  amount\n    @param btcPrice BTC price\n    @param mocPrice MoC price\n    @return Equivalent MoC amount\n  */\n  function mocBtcValue(\n    MocLibConfig storage /*libConfig*/, uint256 amount, uint256 btcPrice, uint256 mocPrice\n  ) public pure returns(uint256) {\n    require(btcPrice > 0,\"Bitcoin price should be more than zero\");\n    require(mocPrice > 0,\"MoC price should be more than zero\");\n\n    uint256 mocBtcTotal = amount.mul(mocPrice).div(btcPrice);\n\n    return mocBtcTotal;\n  }\n\n  /**\n    @dev Transform an address to payable address\n    @param account Address to transform to payable\n    @return Payable address for account\n  */\n  function getPayableAddress(\n    MocLibConfig storage /*libConfig*/, address account\n  ) public pure\n  returns (address payable) {\n    return address(uint160(account));\n  }\n\n  /**\n    @dev Rounding product adapted from DSMath but with custom precision\n    @param x Multiplicand\n    @param y Multiplier\n    @return Product\n  */\n  function mulr(uint x, uint y, uint256 precision) internal pure returns (uint z) {\n    return x.mul(y).add(precision.div(2)).div(precision);\n  }\n\n  /**\n    @dev Potentiation by squaring adapted from DSMath but with custom precision\n    @param x Base\n    @param n Exponent\n    @return power\n  */\n  function pow(uint256 x, uint256 n, uint256 precision) internal pure returns (uint z) {\n    uint256 x2 = x;\n    z = n % 2 != 0 ? x : precision;\n\n    for (n /= 2; n != 0; n /= 2) {\n      x2 = mulr(x2, x2, precision);\n\n      if (n % 2 != 0) {\n        z = mulr(z, x2, precision);\n      }\n    }\n  }\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/MoCLibConnection.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"./MoCHelperLib.sol\";\n\n/**\n  @dev Interface with MocHelperLib\n */\ncontract MoCLibConnection {\n  using MoCHelperLib for MoCHelperLib.MocLibConfig;\n  MoCHelperLib.MocLibConfig internal mocLibConfig;\n\n  /*\n  * Precision getters\n  */\n  function getMocPrecision() public view returns(uint256) {\n    return mocLibConfig.mocPrecision;\n  }\n\n  function getReservePrecision() public view returns(uint256) {\n    return mocLibConfig.reservePrecision;\n  }\n\n  function getDayPrecision() public view returns(uint256) {\n    return mocLibConfig.dayPrecision;\n  }\n\n  function initializePrecisions() internal {\n    mocLibConfig = MoCHelperLib.MocLibConfig({\n      reservePrecision: 10 ** 18,\n      mocPrecision: 10 ** 18,\n      dayPrecision: 1\n    });\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/base/MoCBase.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"zos-lib/contracts/Initializable.sol\";\n\nimport \"./MoCConnector.sol\";\nimport \"./MoCConstants.sol\";\n\n/**\n  @dev General usefull modifiers and functions\n */\ncontract MoCBase is MoCConstants, Initializable {\n  // Contracts\n  MoCConnector public connector;\n\n  bool internal initialized;\n\n  function initializeBase(address connectorAddress) internal initializer {\n    connector = MoCConnector(connectorAddress);\n  }\n\n  modifier onlyWhitelisted(address account) {\n    require(connector.isWhitelisted(account), \"Address is not whitelisted\");\n    _;\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}\n"},{"file_path":"npm/money-on-chain@3.0.7/contracts/base/MoCConnector.sol","source_code":"pragma solidity ^0.5.8;\n\nimport \"zos-lib/contracts/Initializable.sol\";\n\nimport \"./MoCWhitelist.sol\";\n\n/**\n  @dev Provides access control between all MoC Contracts\n */\ncontract MoCConnector is MoCWhitelist, Initializable {\n  // References\n  address payable public moc;\n  address public docToken;\n  address public bproToken;\n  address public bproxManager;\n  address public mocState;\n  /** DEPRECATED **/\n  // solium-disable-next-line mixedcase\n  address public DEPRECATED_mocConverter;\n  address public mocSettlement;\n  address public mocExchange;\n  address public mocInrate;\n  /** DEPRECATED mocBurnout **/\n  address public mocBurnout;\n\n  bool internal initialized;\n\n  /**\n    @dev Initializes the contract\n    @param mocAddress MoC contract address\n    @param docAddress DoCToken contract address\n    @param bproAddress BProToken contract address\n    @param bproxAddress BProxManager contract address\n    @param stateAddress MoCState contract address\n    @param settlementAddress MoCSettlement contract address\n    @param exchangeAddress MoCExchange contract address\n    @param inrateAddress MoCInrate contract address\n    @param burnoutBookAddress (DEPRECATED) MoCBurnout contract address. DO NOT USE.\n  */\n  function initialize(\n    address payable mocAddress,\n    address docAddress,\n    address bproAddress,\n    address bproxAddress,\n    address stateAddress,\n    address settlementAddress,\n    address exchangeAddress,\n    address inrateAddress,\n    address burnoutBookAddress\n  ) public initializer {\n    moc = mocAddress;\n    docToken = docAddress;\n    bproToken = bproAddress;\n    bproxManager = bproxAddress;\n    mocState = stateAddress;\n    mocSettlement = settlementAddress;\n    mocExchange = exchangeAddress;\n    mocInrate = inrateAddress;\n    mocBurnout = burnoutBookAddress;\n\n    // Add to Whitelist\n    add(mocAddress);\n    add(docAddress);\n    add(bproAddress);\n    add(bproxAddress);\n    add(stateAddress);\n    add(settlementAddress);\n    add(exchangeAddress);\n    add(inrateAddress);\n    add(burnoutBookAddress);\n  }\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[50] private upgradeGap;\n}"},{"file_path":"npm/money-on-chain@3.0.7/contracts/interface/IMoCInrate.sol","source_code":"pragma solidity ^0.5.8;\n\ninterface IMoCInrate {\n    // Transaction types\n    function MINT_BPRO_FEES_RBTC() external view returns(uint8);\n    function REDEEM_BPRO_FEES_RBTC() external view returns(uint8);\n    function MINT_DOC_FEES_RBTC() external view returns(uint8);\n    function REDEEM_DOC_FEES_RBTC() external view returns(uint8);\n    function MINT_BTCX_FEES_RBTC() external view returns(uint8);\n    function REDEEM_BTCX_FEES_RBTC() external view returns(uint8);\n    function MINT_BPRO_FEES_MOC() external view returns(uint8);\n    function REDEEM_BPRO_FEES_MOC() external view returns(uint8);\n    function MINT_DOC_FEES_MOC() external view returns(uint8);\n    function REDEEM_DOC_FEES_MOC() external view returns(uint8);\n    function MINT_BTCX_FEES_MOC() external view returns(uint8);\n    function REDEEM_BTCX_FEES_MOC() external view returns(uint8);\n\n    function payBitProHoldersInterestPayment() external returns(uint256);\n\n    function calculateBitProHoldersInterest() external view returns(uint256, uint256);\n\n    function getBitProInterestAddress() external view returns(address payable);\n\n    function getBitProRate() external view returns(uint256);\n\n    function isDailyEnabled() external view returns(bool);\n\n    function isBitProInterestEnabled() external view returns(bool);\n\n    function commissionsAddress() external view returns(address payable);\n\n    function calcCommissionValue(uint256 rbtcAmount, uint8 txType) external view returns(uint256);\n\n    function calculateVendorMarkup(address vendorAccount, uint256 amount) external view returns (uint256 markup);\n\n}"},{"file_path":"npm/money-on-chain@3.0.7/contracts/interface/IMoCSettlement.sol","source_code":"pragma solidity ^0.5.8;\n\ninterface IMoCSettlement {\n    function getRedeemRequestAt(uint256 _index) external pure returns (address payable, uint256);\n\n    function redeemQueueSize() external pure returns (uint256);\n\n    function docAmountToRedeem(address _who) external pure returns (uint256);\n\n    function isSettlementEnabled() external view returns (bool);\n\n    function runSettlement(uint256 steps) external returns (uint256);\n\n    function nextSettlementBlock() external view returns (uint256);\n}"},{"file_path":"npm/money-on-chain@3.0.7/contracts/interface/IMoCState.sol","source_code":"pragma solidity ^0.5.8;\n\ninterface IMoCState {\n\n     /******STATE MACHINE*********/\n    enum States {\n        // State 0\n        Liquidated,\n        // State 1\n        BProDiscount,\n        // State 2\n        BelowCobj,\n        // State 3\n        AboveCobj\n    }\n\n\n    function addToRbtcInSystem(uint256 btcAmount) external;\n\n    function subtractRbtcFromSystem(uint256 btcAmount) external;\n\n    function coverage(bytes32 bucket) external view returns(uint256);\n\n    function getRbtcRemainder() external view returns(uint256);\n\n    function liq() external view returns(uint256);\n\n    function state() external view returns(States);\n\n    function peg() external view returns(uint256);\n\n    function dayBlockSpan() external view returns(uint256);\n\n    function getBitcoinPrice() external view returns(uint256);\n\n    function getMoCPrice() external view returns(uint256);\n\n    function getProtected() external view returns(uint256);\n\n    function globalCoverage() external view returns(uint256);\n\n    function getMoCVendors() external view returns(address);\n\n    function getMoCToken() external view returns(address);\n\n    function nextState() external;\n\n    function maxBProWithDiscount() external view returns(uint256);\n\n    function absoluteMaxBPro() external view returns(uint256);\n\n    function absoluteMaxDoc() external view returns(uint256);\n\n    function freeDoc() external view returns(uint256);\n\n    function bproTecPrice() external view returns(uint256);\n\n    function bproSpotDiscountRate() external view returns(uint256);\n\n    function bproDiscountPrice() external view returns(uint256);\n\n    function bucketBProTecPrice(bytes32 bucket) external view returns(uint256);\n\n    function currentAbundanceRatio() external view returns(uint256);\n\n    function abundanceRatio(uint256 doc0) external view returns(uint256);\n\n    function daysToSettlement() external view returns(uint256);\n\n    function leverage(bytes32 bucket) external view returns(uint256);\n\n    function getBucketNBTC(bytes32 bucket) external view returns(uint256);\n\n    function getLiquidationPrice() external view returns(uint256);\n\n    function maxBProxBtcValue(bytes32 bucket) external view returns(uint256);\n\n    function bucketBProTecPriceHelper(bytes32 bucket) external view returns(uint256);\n\n    // Ex Mocconverter\n    function docsToBtc(uint256 docAmount) external view returns(uint256);\n    function btcToDoc(uint256 btcAmount) external view returns(uint256);\n    function bproxToBtc(uint256 bproxAmount, bytes32 bucket) external view returns(uint256);\n    function btcToBProx(uint256 btcAmount, bytes32 bucket) external view returns(uint256);\n\n\n}"},{"file_path":"npm/money-on-chain@3.0.7/contracts/interface/IMoCVendors.sol","source_code":"pragma solidity ^0.5.8;\n\ninterface IMoCVendors {\n    function resetTotalPaidInMoC() external;\n\n    function getIsActive(address account) external view\n    returns (bool);\n\n    function getTotalPaidInMoC(address account) external view\n    returns (uint256);\n\n    function getStaking(address account) external view\n    returns (uint256);\n\n    function getMarkup(address account) external view\n    returns (uint256);\n\n    function updatePaidMarkup(address account, uint256 mocAmount, uint256 rbtcAmount) external\n    returns(bool);\n}"},{"file_path":"npm/openzeppelin-solidity@2.3.0/contracts/access/Roles.sol","source_code":"pragma solidity ^0.5.0;\n\n/**\n * @title Roles\n * @dev Library for managing addresses assigned to a Role.\n */\nlibrary Roles {\n    struct Role {\n        mapping (address => bool) bearer;\n    }\n\n    /**\n     * @dev Give an account access to this role.\n     */\n    function add(Role storage role, address account) internal {\n        require(!has(role, account), \"Roles: account already has role\");\n        role.bearer[account] = true;\n    }\n\n    /**\n     * @dev Remove an account's access to this role.\n     */\n    function remove(Role storage role, address account) internal {\n        require(has(role, account), \"Roles: account does not have role\");\n        role.bearer[account] = false;\n    }\n\n    /**\n     * @dev Check if an account has this role.\n     * @return bool\n     */\n    function has(Role storage role, address account) internal view returns (bool) {\n        require(account != address(0), \"Roles: account is the zero address\");\n        return role.bearer[account];\n    }\n}\n"},{"file_path":"npm/openzeppelin-solidity@2.3.0/contracts/access/roles/PauserRole.sol","source_code":"pragma solidity ^0.5.0;\n\nimport \"../Roles.sol\";\n\ncontract PauserRole {\n    using Roles for Roles.Role;\n\n    event PauserAdded(address indexed account);\n    event PauserRemoved(address indexed account);\n\n    Roles.Role private _pausers;\n\n    constructor () internal {\n        _addPauser(msg.sender);\n    }\n\n    modifier onlyPauser() {\n        require(isPauser(msg.sender), \"PauserRole: caller does not have the Pauser role\");\n        _;\n    }\n\n    function isPauser(address account) public view returns (bool) {\n        return _pausers.has(account);\n    }\n\n    function addPauser(address account) public onlyPauser {\n        _addPauser(account);\n    }\n\n    function renouncePauser() public {\n        _removePauser(msg.sender);\n    }\n\n    function _addPauser(address account) internal {\n        _pausers.add(account);\n        emit PauserAdded(account);\n    }\n\n    function _removePauser(address account) internal {\n        _pausers.remove(account);\n        emit PauserRemoved(account);\n    }\n}\n"},{"file_path":"npm/openzeppelin-solidity@2.3.0/contracts/lifecycle/Pausable.sol","source_code":"pragma solidity ^0.5.0;\n\nimport \"../access/roles/PauserRole.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\ncontract Pausable is PauserRole {\n    /**\n     * @dev Emitted when the pause is triggered by a pauser (`account`).\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by a pauser (`account`).\n     */\n    event Unpaused(address account);\n\n    bool private _paused;\n\n    /**\n     * @dev Initializes the contract in unpaused state. Assigns the Pauser role\n     * to the deployer.\n     */\n    constructor () internal {\n        _paused = false;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view returns (bool) {\n        return _paused;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     */\n    modifier whenNotPaused() {\n        require(!_paused, \"Pausable: paused\");\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     */\n    modifier whenPaused() {\n        require(_paused, \"Pausable: not paused\");\n        _;\n    }\n\n    /**\n     * @dev Called by a pauser to pause, triggers stopped state.\n     */\n    function pause() public onlyPauser whenNotPaused {\n        _paused = true;\n        emit Paused(msg.sender);\n    }\n\n    /**\n     * @dev Called by a pauser to unpause, returns to normal state.\n     */\n    function unpause() public onlyPauser whenPaused {\n        _paused = false;\n        emit Unpaused(msg.sender);\n    }\n}\n"},{"file_path":"npm/openzeppelin-solidity@2.3.0/contracts/math/Math.sol","source_code":"pragma solidity ^0.5.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a >= b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow, so we distribute\n        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);\n    }\n}\n"},{"file_path":"npm/openzeppelin-solidity@2.3.0/contracts/math/SafeMath.sol","source_code":"pragma solidity ^0.5.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b <= a, \"SafeMath: subtraction overflow\");\n        uint256 c = a - b;\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n        // benefit is lost if 'b' is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n        if (a == 0) {\n            return 0;\n        }\n\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        // Solidity only automatically asserts when dividing by 0\n        require(b > 0, \"SafeMath: division by zero\");\n        uint256 c = a / b;\n        // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b != 0, \"SafeMath: modulo by zero\");\n        return a % b;\n    }\n}\n"},{"file_path":"npm/openzeppelin-solidity@2.3.0/contracts/token/ERC20/IERC20.sol","source_code":"pragma solidity ^0.5.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see `ERC20Detailed`.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a `Transfer` event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through `transferFrom`. This is\n     * zero by default.\n     *\n     * This value changes when `approve` or `transferFrom` are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * > Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an `Approval` event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a `Transfer` event.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to `approve`. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},{"file_path":"npm/zos-lib@2.3.1/contracts/Initializable.sol","source_code":"pragma solidity >=0.4.24 <0.6.0;\n\n\n/**\n * @title Initializable\n *\n * @dev Helper contract to support initializer functions. To use it, replace\n * the constructor with a function that has the `initializer` modifier.\n * WARNING: Unlike constructors, initializer functions must be manually\n * invoked. This applies both to deploying an Initializable contract, as well\n * as extending an Initializable contract via inheritance.\n * WARNING: When used with inheritance, manual care must be taken to not invoke\n * a parent initializer twice, or ensure that all initializers are idempotent,\n * because this is not dealt with automatically as with constructors.\n */\ncontract Initializable {\n\n  /**\n   * @dev Indicates that the contract has been initialized.\n   */\n  bool private initialized;\n\n  /**\n   * @dev Indicates that the contract is in the process of being initialized.\n   */\n  bool private initializing;\n\n  /**\n   * @dev Modifier to use in the initializer function of a contract.\n   */\n  modifier initializer() {\n    require(initializing || isConstructor() || !initialized, \"Contract instance has already been initialized\");\n\n    bool isTopLevelCall = !initializing;\n    if (isTopLevelCall) {\n      initializing = true;\n      initialized = true;\n    }\n\n    _;\n\n    if (isTopLevelCall) {\n      initializing = false;\n    }\n  }\n\n  /// @dev Returns true if and only if the function is running in the constructor\n  function isConstructor() private view returns (bool) {\n    // extcodesize checks the size of the code stored in an address, and\n    // address returns the current address. Since the code is still not\n    // deployed when running a constructor, any checks on its code size will\n    // yield zero, making it an effective way to detect if a contract is\n    // under construction or not.\n    uint256 cs;\n    assembly { cs := extcodesize(address) }\n    return cs == 0;\n  }\n\n  // Reserved storage space to allow for layout changes in the future.\n  uint256[50] private ______gap;\n}\n"}],"is_verified_via_sourcify":false,"can_be_visualized_via_sol2uml":true,"evm_version":"byzantium","language":"solidity","is_verified_via_eth_bytecode_db":false,"is_fully_verified":false,"license_type":"none","is_blueprint":false,"name":"MoC","creation_bytecode":"0x608060405234801561001057600080fd5b506158d980620000216000396000f3fe6080604052600436106103395760003560e060020a9004806368274357116101af578063bb5dcd95116100fb578063dd7c6c7f11610099578063e4bbb5a811610073578063e4bbb5a814610d32578063eef13ca114610d77578063f15a222614610dc4578063f715e29314610e0357610339565b8063dd7c6c7f14610cda578063e22155f614610d08578063e2414a7314610d1d57610339565b8063d1a76714116100d5578063d1a7671414610c30578063d219519214610c45578063d2fa635e14610c7e578063dae2844e14610ca857610339565b8063bb5dcd9514610bb6578063c273f9ee14610be0578063c4d66de814610bfd57610339565b806397f773e6116101685780639e95db2c116101425780639e95db2c14610b20578063b6e0833014610b35578063b7aa53e714610b68578063bb4872de14610ba157610339565b806397f773e614610a9f578063995cc17214610ad85780639d5a3ba814610b0b57610339565b80636827435714610a195780637caca79c14610a2e5780637d28f1e514610a4357806383f3084f14610a605780638456cb5914610a755780638953902d14610a8a57610339565b806340883740116102895780635210570c116102275780635b0217c8116102015780635b0217c8146109595780635c975abb146109835780635cefe4b41461099857806363b89274146109c857610339565b80635210570c1461091a57806357a13a161461092f5780635afccf721461094457610339565b806343514d5d1161026357806343514d5d14610857578063485cc955146108835780634cce0646146108be57806350771849146108f057610339565b8063408837401461080357806341c056061461081857806342af302c1461082d57610339565b80632768ef09116102f65780633b3032d2116102d05780633b3032d2146107745780633de39c11146107a05780633debd2d8146107b55780633f4ba83a146107ee57610339565b80632768ef091461070c5780632816d6811461073557806333421c381461075f57610339565b806305903cee1461061f57806306bdce8c146106495780630a58f47a146106705780630c340a24146106a35780631d28b199146106d4578063219edd9e146106e9575b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156103f35760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156103b85781810151838201526020016103a0565b50505050905090810190601f1680156103e55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561044857600080fd5b505af115801561045c573d6000803e3d6000fd5b5060009250610469915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156104bb57600080fd5b505afa1580156104cf573d6000803e3d6000fd5b505050506040513d60208110156104e557600080fd5b505160038111156104f257fe5b141561050557610500610e18565b61061d565b61010354604080517fab9757c000000000000000000000000000000000000000000000000000000000815260f460020a610433026004820152346024820152600060448201819052606482018190529151600160a060020a039093169263ab9757c09260848084019391929182900301818387803b15801561058657600080fd5b505af115801561059a573d6000803e3d6000fd5b505061010454604080517feb4edb850000000000000000000000000000000000000000000000000000000081523460048201529051600160a060020a03909216935063eb4edb85925060248082019260009290919082900301818387803b15801561060457600080fd5b505af1158015610618573d6000803e3d6000fd5b505050505b005b34801561062b57600080fd5b5061061d6004803603602081101561064257600080fd5b503561112d565b34801561065557600080fd5b5061065e611130565b60408051918252519081900360200190f35b34801561067c57600080fd5b5061061d6004803603602081101561069357600080fd5b5035600160a060020a0316611136565b3480156106af57600080fd5b506106b8611259565b60408051600160a060020a039092168252519081900360200190f35b3480156106e057600080fd5b5061065e611268565b61061d600480360360408110156106ff57600080fd5b50803590602001356112f8565b34801561071857600080fd5b50610721611308565b604080519115158252519081900360200190f35b34801561074157600080fd5b5061061d6004803603602081101561075857600080fd5b5035611367565b34801561076b57600080fd5b5061061d6115f1565b61061d6004803603604081101561078a57600080fd5b5080359060200135600160a060020a0316611702565b3480156107ac57600080fd5b5061065e611b00565b3480156107c157600080fd5b50610721600480360360408110156107d857600080fd5b50600160a060020a038135169060200135611b07565b3480156107fa57600080fd5b5061061d611c75565b34801561080f57600080fd5b506106b8611ddc565b34801561082457600080fd5b506106b8611e3b565b34801561083957600080fd5b506107216004803603602081101561085057600080fd5b5035611e4b565b61061d6004803603604081101561086d57600080fd5b5080359060200135600160a060020a0316611f7e565b34801561088f57600080fd5b5061061d600480360360408110156108a657600080fd5b50600160a060020a03813581169160200135166123e1565b61061d600480360360608110156108d457600080fd5b5080359060208101359060400135600160a060020a0316612493565b3480156108fc57600080fd5b5061061d6004803603602081101561091357600080fd5b5035612822565b34801561092657600080fd5b5061061d61282d565b34801561093b57600080fd5b5061065e612925565b34801561095057600080fd5b50610721612949565b34801561096557600080fd5b5061061d6004803603602081101561097c57600080fd5b50356129a8565b34801561098f57600080fd5b50610721612bc9565b3480156109a457600080fd5b5061061d600480360360408110156109bb57600080fd5b5080359060200135612bd7565b3480156109d457600080fd5b5061061d600480360360a08110156109eb57600080fd5b50600160a060020a038135811691602081013582169160408201351690606081013515159060800135612be3565b348015610a2557600080fd5b5061061d613106565b348015610a3a57600080fd5b50610721613201565b61061d60048036036020811015610a5957600080fd5b5035613206565b348015610a6c57600080fd5b506106b8613211565b348015610a8157600080fd5b5061061d613220565b348015610a9657600080fd5b5061061d613404565b348015610aab57600080fd5b5061065e60048036036040811015610ac257600080fd5b5080359060200135600160a060020a031661353d565b348015610ae457600080fd5b5061065e60048036036020811015610afb57600080fd5b5035600160a060020a03166135e2565b348015610b1757600080fd5b5061065e61367f565b348015610b2c57600080fd5b5061061d6136de565b348015610b4157600080fd5b5061061d60048036036020811015610b5857600080fd5b5035600160a060020a0316613986565b348015610b7457600080fd5b5061061d60048036036040811015610b8b57600080fd5b5080359060200135600160a060020a0316613a94565b348015610bad57600080fd5b50610721613ee2565b348015610bc257600080fd5b5061061d60048036036020811015610bd957600080fd5b5035613eeb565b61061d60048036036020811015610bf657600080fd5b5035613ef6565b348015610c0957600080fd5b5061061d60048036036020811015610c2057600080fd5b5035600160a060020a0316613f01565b348015610c3c57600080fd5b506106b8613fc1565b348015610c5157600080fd5b5061061d60048036036040811015610c6857600080fd5b5080359060200135600160a060020a0316613fd6565b348015610c8a57600080fd5b5061061d60048036036020811015610ca157600080fd5b50356143a8565b348015610cb457600080fd5b5061061d60048036036040811015610ccb57600080fd5b50803515159060200135611304565b348015610ce657600080fd5b50610cef614481565b6040805192835260208301919091528051918290030190f35b348015610d1457600080fd5b5061065e61451c565b348015610d2957600080fd5b5061065e614528565b348015610d3e57600080fd5b5061061d60048036036060811015610d5557600080fd5b50600160a060020a03813581169160208101359091169060400135151561452e565b348015610d8357600080fd5b50610da160048036036020811015610d9a57600080fd5b5035614616565b60408051600160a060020a03909316835260208301919091528051918290030190f35b348015610dd057600080fd5b5061061d60048036036060811015610de757600080fd5b5080359060208101359060400135600160a060020a03166146b9565b348015610e0f57600080fd5b5061065e614a3c565b6101095474010000000000000000000000000000000000000000900460ff1661112b5761010260009054906101000a9004600160a060020a0316600160a060020a0316635c975abb6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015610e8d57600080fd5b505afa158015610ea1573d6000803e3d6000fd5b505050506040513d6020811015610eb757600080fd5b5051610f2a5761010260009054906101000a9004600160a060020a0316600160a060020a0316638456cb596040518163ffffffff1660e060020a028152600401600060405180830381600087803b158015610f1157600080fd5b505af1158015610f25573d6000803e3d6000fd5b505050505b610108546040805160e260020a6330a5e173028152905161103092600160a060020a03169163c29785cc916004808301926020929190829003018186803b158015610f7457600080fd5b505afa158015610f88573d6000803e3d6000fd5b505050506040513d6020811015610f9e57600080fd5b505161010454604080517fc94750a80000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163c94750a891600480820192602092909190829003018186803b158015610fff57600080fd5b505afa158015611013573d6000803e3d6000fd5b505050506040513d602081101561102957600080fd5b5051614a42565b610109805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055606854604080517f5342825300000000000000000000000000000000000000000000000000000000815290517faf905e9cf428f582ba291af107597e8a811842567b96a9cd61ca5b0239ddb78892600160a060020a0316916353428253916004808301926020929190829003018186803b1580156110e357600080fd5b505afa1580156110f7573d6000803e3d6000fd5b505050506040513d602081101561110d57600080fd5b505160408051600160a060020a039092168252519081900360200190a15b565b50565b60005490565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d60208110156111ae57600080fd5b505160408051808201909152601681526000805160206158858339815191526020820152906112215760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce8054600160a060020a03909216620100000275ffffffffffffffffffffffffffffffffffffffff000019909216919091179055565b609b54600160a060020a031681565b61010854604080517f1d28b1990000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691631d28b199916004808301926020929190829003018186803b1580156112c757600080fd5b505afa1580156112db573d6000803e3d6000fd5b505050506040513d60208110156112f157600080fd5b5051905090565b61130482826000612493565b5050565b61010654604080517f2768ef090000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691632768ef09916004808301926020929190829003018186803b1580156112c757600080fd5b61010354604080517fed7dfd320000000000000000000000000000000000000000000000000000000081526004810184905290518392600160a060020a03169163ed7dfd32916024808301926020929190829003018186803b1580156113cc57600080fd5b505afa1580156113e0573d6000803e3d6000fd5b505050506040513d60208110156113f657600080fd5b505161144c576040805160e560020a62461bcd02815260206004820152601760248201527f4275636b6574206973206e6f7420617661696c61626c65000000000000000000604482015290519081900360640190fd5b61010354604080517f633ba2880000000000000000000000000000000000000000000000000000000081526004810185905290518492600160a060020a03169163633ba288916024808301926020929190829003018186803b1580156114b157600080fd5b505afa1580156114c5573d6000803e3d6000fd5b505050506040513d60208110156114db57600080fd5b50511561151c5760405160e560020a62461bcd0281526004018080602001828103825260278152602001806157256027913960400191505060405180910390fd5b61152583611e4b565b156115ec5761010354604080517f15d1b0d60000000000000000000000000000000000000000000000000000000081526004810186905260f460020a6104330260248201529051600160a060020a03909216916315d1b0d69160448082019260009290919082900301818387803b15801561159f57600080fd5b505af11580156115b3573d6000803e3d6000fd5b50506040805186815290517f03b09556eaf1538697123fabf059066271cafa36dc147deec0ec8c90ea14c89b9350908190036020019150a15b505050565b61010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561164557600080fd5b505af1158015611659573d6000803e3d6000fd5b5060009250611666915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156116b857600080fd5b505afa1580156116cc573d6000803e3d6000fd5b505050506040513d60208110156116e257600080fd5b505160038111156116ef57fe5b141561112b576116fd610e18565b61112b565b61010b5460ff161561174c576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156117d75760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561182c57600080fd5b505af1158015611840573d6000803e3d6000fd5b506000925061184d915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561189f57600080fd5b505afa1580156118b3573d6000803e3d6000fd5b505050506040513d60208110156118c957600080fd5b505160038111156118d657fe5b14156118f9576118e4610e18565b34156118f4576118f43334614ac7565b611af1565b60038061010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561194e57600080fd5b505afa158015611962573d6000803e3d6000fd5b505050506040513d602081101561197857600080fd5b5051600381111561198557fe5b10156119c55760405160e560020a62461bcd02815260040180806020018281038252602881526020018061583d6028913960400191505060405180910390fd5b61010a543a1115611a0a5760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517f7e7cafda00000000000000000000000000000000000000000000000000000000815233600482015260248101869052600160a060020a038581166044830152915160009384938493849384939290921691637e7cafda9160648082019260a09290919082900301818787803b158015611a8b57600080fd5b505af1158015611a9f573d6000803e3d6000fd5b505050506040513d60a0811015611ab557600080fd5b50805160208201516040830151606084015160809094015192985090965094509092509050611aea33348787878c8888614b70565b5050505050505b505061010b805460ff19169055565b61010a5481565b61010b5460009060ff1615611b54576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff19166001179055606854604080517f3af32abf000000000000000000000000000000000000000000000000000000008152336004820181905291519192600160a060020a031691633af32abf91602480820192602092909190829003018186803b158015611bc857600080fd5b505afa158015611bdc573d6000803e3d6000fd5b505050506040513d6020811015611bf257600080fd5b5051611c48576040805160e560020a62461bcd02815260206004820152601a60248201527f41646472657373206973206e6f742077686974656c6973746564000000000000604482015290519081900360640190fd5b82611c565760019150611c63565b611c608484614cba565b91505b5061010b805460ff1916905592915050565b60ce5460408051808201909152600b81527f6e6f745f73746f70706572000000000000000000000000000000000000000000602082015290620100009004600160a060020a03163314611d0c5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce5460408051808201909152601281527f636f6e74726163745f69735f6163746976650000000000000000000000000000602082015290610100900460ff16611d9b5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805461ff00191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b61010854604080517f408837400000000000000000000000000000000000000000000000000000000081529051600092600160a060020a0316916340883740916004808301926020929190829003018186803b1580156112c757600080fd5b61010954600160a060020a031681565b61010454604080517ffaba8c3b0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a03169163faba8c3b916004808301926020929190829003018186803b158015611eaa57600080fd5b505afa158015611ebe573d6000803e3d6000fd5b505050506040513d6020811015611ed457600080fd5b505161010454604080517f8c3e0502000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a0390921691638c3e050291602480820192602092909190829003018186803b158015611f3c57600080fd5b505afa158015611f50573d6000803e3d6000fd5b505050506040513d6020811015611f6657600080fd5b505111611f7557506001611f79565b5060005b919050565b61010b5460ff1615611fc8576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156120535760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1580156120a857600080fd5b505af11580156120bc573d6000803e3d6000fd5b50600092506120c9915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561211b57600080fd5b505afa15801561212f573d6000803e3d6000fd5b505050506040513d602081101561214557600080fd5b5051600381111561215257fe5b1415612160576118e4610e18565b61010460009054906101000a9004600160a060020a0316600160a060020a031663e480e5b96040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156121b257600080fd5b505afa1580156121c6573d6000803e3d6000fd5b505050506040513d60208110156121dc57600080fd5b505161010454604080517fc4ee19ea0000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163c4ee19ea91600480820192602092909190829003018186803b15801561223d57600080fd5b505afa158015612251573d6000803e3d6000fd5b505050506040513d602081101561226757600080fd5b5051116122a85760405160e560020a62461bcd02815260040180806020018281038252602d8152602001806156d8602d913960400191505060405180910390fd5b61010a543a11156122ed5760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517f1a5e898600000000000000000000000000000000000000000000000000000000815233600482015260248101859052600160a060020a038481166044830152915160009384938493849384939290921691631a5e89869160648082019260a09290919082900301818787803b15801561236e57600080fd5b505af1158015612382573d6000803e3d6000fd5b505050506040513d60a081101561239857600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506123cd33348787878b8888614b70565b5050505050505061010b805460ff19169055565b603554610100900460ff16806123fa57506123fa614d9d565b80612408575060355460ff16155b6124465760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015612471576035805460ff1961ff0019909116610100171660011790555b61247d8383600161452e565b80156115ec576035805461ff0019169055505050565b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156125105760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010354604080517fed7dfd320000000000000000000000000000000000000000000000000000000081526004810186905290518592600160a060020a03169163ed7dfd32916024808301926020929190829003018186803b15801561257657600080fd5b505afa15801561258a573d6000803e3d6000fd5b505050506040513d60208110156125a057600080fd5b50516125f6576040805160e560020a62461bcd02815260206004820152601760248201527f4275636b6574206973206e6f7420617661696c61626c65000000000000000000604482015290519081900360640190fd5b61010354604080517f633ba2880000000000000000000000000000000000000000000000000000000081526004810187905290518692600160a060020a03169163633ba288916024808301926020929190829003018186803b15801561265b57600080fd5b505afa15801561266f573d6000803e3d6000fd5b505050506040513d602081101561268557600080fd5b5051156126c65760405160e560020a62461bcd0281526004018080602001828103825260278152602001806157256027913960400191505060405180910390fd5b61010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561271a57600080fd5b505af115801561272e573d6000803e3d6000fd5b506000925061273b915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561278d57600080fd5b505afa1580156127a1573d6000803e3d6000fd5b505050506040513d60208110156127b757600080fd5b505160038111156127c457fe5b14156127d7576127d2610e18565b61281b565b846127e181611367565b60405160e560020a62461bcd02815260040180806020018281038252603f8152602001806157bd603f913960400191505060405180910390fd5b5050505050565b61112d816000613a94565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561287b57600080fd5b505afa15801561288f573d6000803e3d6000fd5b505050506040513d60208110156128a557600080fd5b505160408051808201909152601681526000805160206158858339815191526020820152906129185760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805460ff19169055565b7f583200000000000000000000000000000000000000000000000000000000000081565b61010854604080517f5afccf720000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635afccf72916004808301926020929190829003018186803b1580156112c757600080fd5b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff1615612a255760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b158015612a7a57600080fd5b505af1158015612a8e573d6000803e3d6000fd5b5060009250612a9b915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015612aed57600080fd5b505afa158015612b01573d6000803e3d6000fd5b505050506040513d6020811015612b1757600080fd5b50516003811115612b2457fe5b1415612b3757612b32610e18565b61112d565b61010654604080517f5b0217c8000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a0390921691635b0217c8916024808201926020929091908290030181600087803b158015612b9f57600080fd5b505af1158015612bb3573d6000803e3d6000fd5b505050506040513d60208110156115ec57600080fd5b60ce54610100900460ff1690565b611304828260006146b9565b603554610100900460ff1680612bfc5750612bfc614d9d565b80612c0a575060355460ff16155b612c485760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015612c73576035805460ff1961ff0019909116610100171660011790555b612c7b614da3565b612c8486614dd5565b606860009054906101000a9004600160a060020a0316600160a060020a03166399c6fe736040518163ffffffff1660e060020a02815260040160206040518083038186803b158015612cd557600080fd5b505afa158015612ce9573d6000803e3d6000fd5b505050506040513d6020811015612cff57600080fd5b50516101018054600160a060020a031916600160a060020a03928316179055606854604080517fd31cc8310000000000000000000000000000000000000000000000000000000081529051919092169163d31cc831916004808301926020929190829003018186803b158015612d7457600080fd5b505afa158015612d88573d6000803e3d6000fd5b505050506040513d6020811015612d9e57600080fd5b50516101028054600160a060020a031916600160a060020a03928316179055606854604080517f955b570a0000000000000000000000000000000000000000000000000000000081529051919092169163955b570a916004808301926020929190829003018186803b158015612e1357600080fd5b505afa158015612e27573d6000803e3d6000fd5b505050506040513d6020811015612e3d57600080fd5b50516101038054600160a060020a031916600160a060020a03928316179055606854604080517f12529f1f000000000000000000000000000000000000000000000000000000008152905191909216916312529f1f916004808301926020929190829003018186803b158015612eb257600080fd5b505afa158015612ec6573d6000803e3d6000fd5b505050506040513d6020811015612edc57600080fd5b50516101048054600160a060020a031916600160a060020a03928316179055606854604080517fb29ead6c0000000000000000000000000000000000000000000000000000000081529051919092169163b29ead6c916004808301926020929190829003018186803b158015612f5157600080fd5b505afa158015612f65573d6000803e3d6000fd5b505050506040513d6020811015612f7b57600080fd5b50516101068054600160a060020a031916600160a060020a03928316179055606854604080517f8557af6f00000000000000000000000000000000000000000000000000000000815290519190921691638557af6f916004808301926020929190829003018186803b158015612ff057600080fd5b505afa158015613004573d6000803e3d6000fd5b505050506040513d602081101561301a57600080fd5b50516101078054600160a060020a031916600160a060020a03928316179055606854604080517fffb691300000000000000000000000000000000000000000000000000000000081529051919092169163ffb69130916004808301926020929190829003018186803b15801561308f57600080fd5b505afa1580156130a3573d6000803e3d6000fd5b505050506040513d60208110156130b957600080fd5b50516101088054600160a060020a031916600160a060020a039092169190911790556130e684868561452e565b61010a82905580156130fe576035805461ff00191690555b505050505050565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561315457600080fd5b505afa158015613168573d6000803e3d6000fd5b505050506040513d602081101561317e57600080fd5b505160408051808201909152601681526000805160206158858339815191526020820152906131f15760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805460ff19166001179055565b600090565b61112d816000611702565b606854600160a060020a031681565b60ce5460408051808201909152600b81527f756e73746f707061626c6500000000000000000000000000000000000000000060208201529060ff166132a95760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce5460408051808201909152600b81527f6e6f745f73746f70706572000000000000000000000000000000000000000000602082015290620100009004600160a060020a031633146133415760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156133bf5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805461ff0019166101001790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b60008061010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561345957600080fd5b505afa15801561346d573d6000803e3d6000fd5b505050506040513d602081101561348357600080fd5b5051600381111561349057fe5b146134cf5760405160e560020a62461bcd02815260040180806020018281038252602881526020018061583d6028913960400191505060405180910390fd5b61010754604080517f45e2c5a6000000000000000000000000000000000000000000000000000000008152336004820181905260248201529051600160a060020a03909216916345e2c5a6916044808201926020929091908290030181600087803b158015612b9f57600080fd5b61010354604080517f97f773e600000000000000000000000000000000000000000000000000000000815260048101859052600160a060020a038481166024830152915160009392909216916397f773e691604480820192602092909190829003018186803b1580156135af57600080fd5b505afa1580156135c3573d6000803e3d6000fd5b505050506040513d60208110156135d957600080fd5b50519392505050565b61010654604080517f995cc172000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151600093929092169163995cc17291602480820192602092909190829003018186803b15801561364d57600080fd5b505afa158015613661573d6000803e3d6000fd5b505050506040513d602081101561367757600080fd5b505192915050565b61010654604080517f9d5a3ba80000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691639d5a3ba8916004808301926020929190829003018186803b1580156112c757600080fd5b61010b5460ff1615613728576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156137b35760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010854604080517f9e95db2c0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691639e95db2c91600480830192602092919082900301818787803b15801561381457600080fd5b505af1158015613828573d6000803e3d6000fd5b505050506040513d602081101561383e57600080fd5b505161010854604080517f4088374000000000000000000000000000000000000000000000000000000000815290519293506138d892600160a060020a0390921691634088374091600480820192602092909190829003018186803b1580156138a657600080fd5b505afa1580156138ba573d6000803e3d6000fd5b505050506040513d60208110156138d057600080fd5b505182614cba565b156139785761010354604080517f119e2ad600000000000000000000000000000000000000000000000000000000815260f460020a61043302600482015260248101849052600060448201819052606482018190529151600160a060020a039093169263119e2ad69260848084019391929182900301818387803b15801561395f57600080fd5b505af1158015613973573d6000803e3d6000fd5b505050505b5061010b805460ff19169055565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b1580156139d457600080fd5b505afa1580156139e8573d6000803e3d6000fd5b505050506040513d60208110156139fe57600080fd5b50516040805180820190915260168152600080516020615885833981519152602082015290613a715760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b50609b8054600160a060020a031916600160a060020a0392909216919091179055565b61010b5460ff1615613ade576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff1615613b695760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b158015613bbe57600080fd5b505af1158015613bd2573d6000803e3d6000fd5b5060009250613bdf915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015613c3157600080fd5b505afa158015613c45573d6000803e3d6000fd5b505050506040513d6020811015613c5b57600080fd5b50516003811115613c6857fe5b1415613c76576118f4610e18565b61010460009054906101000a9004600160a060020a0316600160a060020a031663e480e5b96040518163ffffffff1660e060020a02815260040160206040518083038186803b158015613cc857600080fd5b505afa158015613cdc573d6000803e3d6000fd5b505050506040513d6020811015613cf257600080fd5b505161010454604080517fc4ee19ea0000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163c4ee19ea91600480820192602092909190829003018186803b158015613d5357600080fd5b505afa158015613d67573d6000803e3d6000fd5b505050506040513d6020811015613d7d57600080fd5b505111613dbe5760405160e560020a62461bcd02815260040180806020018281038252602d8152602001806156d8602d913960400191505060405180910390fd5b61010a543a1115613e035760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517fa62c25c700000000000000000000000000000000000000000000000000000000815233600482015260248101859052600160a060020a03848116604483015291516000938493849384938493929092169163a62c25c79160648082019260a09290919082900301818787803b158015613e8457600080fd5b505af1158015613e98573d6000803e3d6000fd5b505050506040513d60a0811015613eae57600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506123cd338686868a8787614e95565b60ce5460ff1681565b61112d816000613fd6565b61112d816000611f7e565b603554610100900460ff1680613f1a5750613f1a614d9d565b80613f28575060355460ff16155b613f665760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015613f91576035805460ff1961ff0019909116610100171660011790555b609b8054600160a060020a031916600160a060020a0384161790558015611304576035805461ff00191690555050565b60ce54620100009004600160a060020a031681565b61010b5460ff1615614020576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156140ab5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561410057600080fd5b505af1158015614114573d6000803e3d6000fd5b5060009250614121915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561417357600080fd5b505afa158015614187573d6000803e3d6000fd5b505050506040513d602081101561419d57600080fd5b505160038111156141aa57fe5b14156141b8576118f4610e18565b60038061010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561420d57600080fd5b505afa158015614221573d6000803e3d6000fd5b505050506040513d602081101561423757600080fd5b5051600381111561424457fe5b10156142845760405160e560020a62461bcd02815260040180806020018281038252602881526020018061583d6028913960400191505060405180910390fd5b61010a543a11156142c95760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517fd524a16800000000000000000000000000000000000000000000000000000000815233600482015260248101869052600160a060020a03858116604483015291516000938493849384938493929092169163d524a1689160648082019260a09290919082900301818787803b15801561434a57600080fd5b505af115801561435e573d6000803e3d6000fd5b505050506040513d60a081101561437457600080fd5b50805160208201516040830151606084015160809094015192985090965094509092509050611aea338686868b8787614e95565b60ce54620100009004600160a060020a031633148061443d5750609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561441057600080fd5b505afa158015614424573d6000803e3d6000fd5b505050506040513d602081101561443a57600080fd5b50515b61447b5760405160e560020a62461bcd02815260040180806020018281038252602181526020018061576e6021913960400191505060405180910390fd5b61010a55565b61010854604080517fdd7c6c7f00000000000000000000000000000000000000000000000000000000815281516000938493600160a060020a039091169263dd7c6c7f9260048083019392829003018186803b1580156144e057600080fd5b505afa1580156144f4573d6000803e3d6000fd5b505050506040513d604081101561450a57600080fd5b50805160209091015190925090509091565b60f460020a6104330281565b60015490565b603554610100900460ff16806145475750614547614d9d565b80614555575060355460ff16155b6145935760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff161580156145be576035805460ff1961ff0019909116610100171660011790555b60ce805460ff19168315151775ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a038716021790556145fe83613f01565b8015614610576035805461ff00191690555b50505050565b61010654604080517feef13ca10000000000000000000000000000000000000000000000000000000081526004810184905281516000938493600160a060020a039091169263eef13ca19260248083019392829003018186803b15801561467c57600080fd5b505afa158015614690573d6000803e3d6000fd5b505050506040513d60408110156146a657600080fd5b5080516020909101519092509050915091565b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156147365760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010354604080517fed7dfd320000000000000000000000000000000000000000000000000000000081526004810186905290518592600160a060020a03169163ed7dfd32916024808301926020929190829003018186803b15801561479c57600080fd5b505afa1580156147b0573d6000803e3d6000fd5b505050506040513d60208110156147c657600080fd5b505161481c576040805160e560020a62461bcd02815260206004820152601760248201527f4275636b6574206973206e6f7420617661696c61626c65000000000000000000604482015290519081900360640190fd5b61010354604080517f633ba2880000000000000000000000000000000000000000000000000000000081526004810187905290518692600160a060020a03169163633ba288916024808301926020929190829003018186803b15801561488157600080fd5b505afa158015614895573d6000803e3d6000fd5b505050506040513d60208110156148ab57600080fd5b5051156148ec5760405160e560020a62461bcd0281526004018080602001828103825260278152602001806157256027913960400191505060405180910390fd5b61010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561494057600080fd5b505af1158015614954573d6000803e3d6000fd5b5060009250614961915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156149b357600080fd5b505afa1580156149c7573d6000803e3d6000fd5b505050506040513d60208110156149dd57600080fd5b505160038111156149ea57fe5b14156149f8576127d2610e18565b84614a0281611367565b60405160e560020a62461bcd0281526004018080602001828103825260418152602001806157fc6041913960600191505060405180910390fd5b60025490565b61010454604080517fc9c95036000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163c9c950369160248082019260009290919082900301818387803b158015614aa957600080fd5b505af1158015614abd573d6000803e3d6000fd5b5050505061130482825b604051600090600160a060020a0384169083908381818185875af1925050503d8060008114614b12576040519150601f19603f3d011682016040523d82523d6000602084013e614b17565b606091505b50509050806115ec576040805160e560020a62461bcd02815260206004820152601460248201527f52425443207472616e73666572206661696c6564000000000000000000000000604482015290519081900360640190fd5b85614b81858363ffffffff614f3616565b614ba857614ba583614b99898963ffffffff614f3616565b9063ffffffff614f3616565b90505b87811115614c00576040805160e560020a62461bcd02815260206004820152601460248201527f616d6f756e74206973206e6f7420656e6f756768000000000000000000000000604482015290519081900360640190fd5b61010454604080517feb4edb85000000000000000000000000000000000000000000000000000000008152600481018a90529051600160a060020a039092169163eb4edb859160248082019260009290919082900301818387803b158015614c6757600080fd5b505af1158015614c7b573d6000803e3d6000fd5b50505050614c8b89868685614f93565b614c96848785615427565b614caf89614caa8a8463ffffffff61567716565b614ac7565b505050505050505050565b6040516000908190600160a060020a0385169084908381818185875af1925050503d8060008114614d07576040519150601f19603f3d011682016040523d82523d6000602084013e614d0c565b606091505b505090508015614d965761010454604080517fc9c95036000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a039092169163c9c950369160248082019260009290919082900301818387803b158015614d7d57600080fd5b505af1158015614d91573d6000803e3d6000fd5b505050505b9392505050565b303b1590565b60408051606081018252670de0b6b3a76400008082526001602083018190529190920182905260008290558055600255565b603554610100900460ff1680614dee5750614dee614d9d565b80614dfc575060355460ff16155b614e3a5760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015614e65576035805460ff1961ff0019909116610100171660011790555b60688054600160a060020a031916600160a060020a0384161790558015611304576035805461ff00191690555050565b61010454600160a060020a031663c9c95036614ebb87614b998a8763ffffffff614f3616565b6040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b158015614ef457600080fd5b505af1158015614f08573d6000803e3d6000fd5b50505050614f1887858584614f93565b614f23838684615427565b614f2d8787614ac7565b50505050505050565b600082820183811015614d96576040805160e560020a62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000614fa5848363ffffffff614f3616565b9050801561281b5761010454604080517f5e10ad790000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635e10ad79916004808301926020929190829003018186803b15801561500c57600080fd5b505afa158015615020573d6000803e3d6000fd5b505050506040513d602081101561503657600080fd5b505161010454604080517f7f13cb060000000000000000000000000000000000000000000000000000000081529051929350600092600160a060020a0390921691637f13cb0691600480820192602092909190829003018186803b15801561509d57600080fd5b505afa1580156150b1573d6000803e3d6000fd5b505050506040513d60208110156150c757600080fd5b5051604080517f88114db3000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820188905260006044830181905292519394508516926388114db392606480840193602093929083900390910190829087803b15801561514157600080fd5b505af1158015615155573d6000803e3d6000fd5b505050506040513d602081101561516b57600080fd5b50511561531a57604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0389811660048301528781166024830152604482018790529151918316916323b872dd916064808201926020929091908290030181600087803b1580156151e657600080fd5b505af11580156151fa573d6000803e3d6000fd5b505050506040513d602081101561521057600080fd5b5050610108546040805160e260020a6330a5e1730281529051600160a060020a03808516936323b872dd938c93919092169163c29785cc916004808301926020929190829003018186803b15801561526757600080fd5b505afa15801561527b573d6000803e3d6000fd5b505050506040513d602081101561529157600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a039384166004820152929091166024830152604482018a90525160648083019260209291908290030181600087803b1580156152e857600080fd5b505af11580156152fc573d6000803e3d6000fd5b505050506040513d602081101561531257600080fd5b50614f2d9050565b80600160a060020a03166323b872dd8861010860009054906101000a9004600160a060020a0316600160a060020a031663c29785cc6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561537c57600080fd5b505afa158015615390573d6000803e3d6000fd5b505050506040513d60208110156153a657600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a039384166004820152929091166024830152604482018790525160648083019260209291908290030181600087803b1580156153fd57600080fd5b505af1158015615411573d6000803e3d6000fd5b505050506040513d6020811015614caf57600080fd5b6000615439838363ffffffff614f3616565b905080156146105761010454604080517f5e10ad790000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635e10ad79916004808301926020929190829003018186803b1580156154a057600080fd5b505afa1580156154b4573d6000803e3d6000fd5b505050506040513d60208110156154ca57600080fd5b5051604080517f88114db3000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526000602483018190526044830188905292519394508416926388114db392606480840193602093929083900390910190829087803b15801561554457600080fd5b505af1158015615558573d6000803e3d6000fd5b505050506040513d602081101561556e57600080fd5b5051156155fb5761557f8584614ac7565b610108546040805160e260020a6330a5e17302815290516127d292600160a060020a03169163c29785cc916004808301926020929190829003018186803b1580156155c957600080fd5b505afa1580156155dd573d6000803e3d6000fd5b505050506040513d60208110156155f357600080fd5b505185614ac7565b610108546040805160e260020a6330a5e173028152905161281b92600160a060020a03169163c29785cc916004808301926020929190829003018186803b15801561564557600080fd5b505afa158015615659573d6000803e3d6000fd5b505050506040513d602081101561566f57600080fd5b505183614ac7565b6000828211156156d1576040805160e560020a62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b5090039056fe46756e6374696f6e2063616e6e6f742062652063616c6c65642061742070726f74656374696f6e206d6f64652e636f6e74726163745f69735f70617573656400000000000000000000000000004275636b65742073686f756c64206e6f74206265206120626173652074797065206275636b65746761732070726963652069732061626f766520746865206d617820616c6c6f7765646e6f7420617574686f72697a6564206368616e676572206f722073746f70706572436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65644d696e74204c657665726167656420706f736974696f6e2069732064697361626c65642e205365653a20687474703a2f2f6269742e6c792f335850694b554152656465656d204c657665726167656420706f736974696f6e2069732064697361626c65642e205365653a20687474703a2f2f6269742e6c792f335850694b554146756e6374696f6e2063616e6e6f742062652063616c6c656420617420746869732073746174652e7265656e7472616e6379206e6f7420616c6c6f776564000000000000000000006e6f745f617574686f72697a65645f6368616e67657200000000000000000000a265627a7a72315820b284450c2d9b41b40bc1e734fa5004f32473fcd7b05b67baf23226c7e3b66e8364736f6c63430005110032","external_libraries":[],"proxy_type":null,"implementations":[],"verified_at":"2026-09-17T13:06:10.901910Z","is_verified_via_verifier_alliance":false,"compiler_version":"v0.5.17+commit.d19bba13","decoded_constructor_args":null,"sourcify_repo_url":null,"optimization_runs":200,"compiler_settings":{"evmVersion":"byzantium","libraries":{},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["npm/moc-governance@0.1.0/:zos-lib/=npm/zos-lib@2.3.1/","npm/money-on-chain@3.0.7/:moc-governance/=npm/moc-governance@0.1.0/","npm/money-on-chain@3.0.7/:openzeppelin-solidity/=npm/openzeppelin-solidity@2.3.0/","npm/money-on-chain@3.0.7/:zos-lib/=npm/zos-lib@2.3.1/"]},"is_verified":true,"verified_twin_address_hash":null,"optimization_enabled":true,"deployed_bytecode":"0x6080604052600436106103395760003560e060020a9004806368274357116101af578063bb5dcd95116100fb578063dd7c6c7f11610099578063e4bbb5a811610073578063e4bbb5a814610d32578063eef13ca114610d77578063f15a222614610dc4578063f715e29314610e0357610339565b8063dd7c6c7f14610cda578063e22155f614610d08578063e2414a7314610d1d57610339565b8063d1a76714116100d5578063d1a7671414610c30578063d219519214610c45578063d2fa635e14610c7e578063dae2844e14610ca857610339565b8063bb5dcd9514610bb6578063c273f9ee14610be0578063c4d66de814610bfd57610339565b806397f773e6116101685780639e95db2c116101425780639e95db2c14610b20578063b6e0833014610b35578063b7aa53e714610b68578063bb4872de14610ba157610339565b806397f773e614610a9f578063995cc17214610ad85780639d5a3ba814610b0b57610339565b80636827435714610a195780637caca79c14610a2e5780637d28f1e514610a4357806383f3084f14610a605780638456cb5914610a755780638953902d14610a8a57610339565b806340883740116102895780635210570c116102275780635b0217c8116102015780635b0217c8146109595780635c975abb146109835780635cefe4b41461099857806363b89274146109c857610339565b80635210570c1461091a57806357a13a161461092f5780635afccf721461094457610339565b806343514d5d1161026357806343514d5d14610857578063485cc955146108835780634cce0646146108be57806350771849146108f057610339565b8063408837401461080357806341c056061461081857806342af302c1461082d57610339565b80632768ef09116102f65780633b3032d2116102d05780633b3032d2146107745780633de39c11146107a05780633debd2d8146107b55780633f4ba83a146107ee57610339565b80632768ef091461070c5780632816d6811461073557806333421c381461075f57610339565b806305903cee1461061f57806306bdce8c146106495780630a58f47a146106705780630c340a24146106a35780631d28b199146106d4578063219edd9e146106e9575b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156103f35760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156103b85781810151838201526020016103a0565b50505050905090810190601f1680156103e55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561044857600080fd5b505af115801561045c573d6000803e3d6000fd5b5060009250610469915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156104bb57600080fd5b505afa1580156104cf573d6000803e3d6000fd5b505050506040513d60208110156104e557600080fd5b505160038111156104f257fe5b141561050557610500610e18565b61061d565b61010354604080517fab9757c000000000000000000000000000000000000000000000000000000000815260f460020a610433026004820152346024820152600060448201819052606482018190529151600160a060020a039093169263ab9757c09260848084019391929182900301818387803b15801561058657600080fd5b505af115801561059a573d6000803e3d6000fd5b505061010454604080517feb4edb850000000000000000000000000000000000000000000000000000000081523460048201529051600160a060020a03909216935063eb4edb85925060248082019260009290919082900301818387803b15801561060457600080fd5b505af1158015610618573d6000803e3d6000fd5b505050505b005b34801561062b57600080fd5b5061061d6004803603602081101561064257600080fd5b503561112d565b34801561065557600080fd5b5061065e611130565b60408051918252519081900360200190f35b34801561067c57600080fd5b5061061d6004803603602081101561069357600080fd5b5035600160a060020a0316611136565b3480156106af57600080fd5b506106b8611259565b60408051600160a060020a039092168252519081900360200190f35b3480156106e057600080fd5b5061065e611268565b61061d600480360360408110156106ff57600080fd5b50803590602001356112f8565b34801561071857600080fd5b50610721611308565b604080519115158252519081900360200190f35b34801561074157600080fd5b5061061d6004803603602081101561075857600080fd5b5035611367565b34801561076b57600080fd5b5061061d6115f1565b61061d6004803603604081101561078a57600080fd5b5080359060200135600160a060020a0316611702565b3480156107ac57600080fd5b5061065e611b00565b3480156107c157600080fd5b50610721600480360360408110156107d857600080fd5b50600160a060020a038135169060200135611b07565b3480156107fa57600080fd5b5061061d611c75565b34801561080f57600080fd5b506106b8611ddc565b34801561082457600080fd5b506106b8611e3b565b34801561083957600080fd5b506107216004803603602081101561085057600080fd5b5035611e4b565b61061d6004803603604081101561086d57600080fd5b5080359060200135600160a060020a0316611f7e565b34801561088f57600080fd5b5061061d600480360360408110156108a657600080fd5b50600160a060020a03813581169160200135166123e1565b61061d600480360360608110156108d457600080fd5b5080359060208101359060400135600160a060020a0316612493565b3480156108fc57600080fd5b5061061d6004803603602081101561091357600080fd5b5035612822565b34801561092657600080fd5b5061061d61282d565b34801561093b57600080fd5b5061065e612925565b34801561095057600080fd5b50610721612949565b34801561096557600080fd5b5061061d6004803603602081101561097c57600080fd5b50356129a8565b34801561098f57600080fd5b50610721612bc9565b3480156109a457600080fd5b5061061d600480360360408110156109bb57600080fd5b5080359060200135612bd7565b3480156109d457600080fd5b5061061d600480360360a08110156109eb57600080fd5b50600160a060020a038135811691602081013582169160408201351690606081013515159060800135612be3565b348015610a2557600080fd5b5061061d613106565b348015610a3a57600080fd5b50610721613201565b61061d60048036036020811015610a5957600080fd5b5035613206565b348015610a6c57600080fd5b506106b8613211565b348015610a8157600080fd5b5061061d613220565b348015610a9657600080fd5b5061061d613404565b348015610aab57600080fd5b5061065e60048036036040811015610ac257600080fd5b5080359060200135600160a060020a031661353d565b348015610ae457600080fd5b5061065e60048036036020811015610afb57600080fd5b5035600160a060020a03166135e2565b348015610b1757600080fd5b5061065e61367f565b348015610b2c57600080fd5b5061061d6136de565b348015610b4157600080fd5b5061061d60048036036020811015610b5857600080fd5b5035600160a060020a0316613986565b348015610b7457600080fd5b5061061d60048036036040811015610b8b57600080fd5b5080359060200135600160a060020a0316613a94565b348015610bad57600080fd5b50610721613ee2565b348015610bc257600080fd5b5061061d60048036036020811015610bd957600080fd5b5035613eeb565b61061d60048036036020811015610bf657600080fd5b5035613ef6565b348015610c0957600080fd5b5061061d60048036036020811015610c2057600080fd5b5035600160a060020a0316613f01565b348015610c3c57600080fd5b506106b8613fc1565b348015610c5157600080fd5b5061061d60048036036040811015610c6857600080fd5b5080359060200135600160a060020a0316613fd6565b348015610c8a57600080fd5b5061061d60048036036020811015610ca157600080fd5b50356143a8565b348015610cb457600080fd5b5061061d60048036036040811015610ccb57600080fd5b50803515159060200135611304565b348015610ce657600080fd5b50610cef614481565b6040805192835260208301919091528051918290030190f35b348015610d1457600080fd5b5061065e61451c565b348015610d2957600080fd5b5061065e614528565b348015610d3e57600080fd5b5061061d60048036036060811015610d5557600080fd5b50600160a060020a03813581169160208101359091169060400135151561452e565b348015610d8357600080fd5b50610da160048036036020811015610d9a57600080fd5b5035614616565b60408051600160a060020a03909316835260208301919091528051918290030190f35b348015610dd057600080fd5b5061061d60048036036060811015610de757600080fd5b5080359060208101359060400135600160a060020a03166146b9565b348015610e0f57600080fd5b5061065e614a3c565b6101095474010000000000000000000000000000000000000000900460ff1661112b5761010260009054906101000a9004600160a060020a0316600160a060020a0316635c975abb6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015610e8d57600080fd5b505afa158015610ea1573d6000803e3d6000fd5b505050506040513d6020811015610eb757600080fd5b5051610f2a5761010260009054906101000a9004600160a060020a0316600160a060020a0316638456cb596040518163ffffffff1660e060020a028152600401600060405180830381600087803b158015610f1157600080fd5b505af1158015610f25573d6000803e3d6000fd5b505050505b610108546040805160e260020a6330a5e173028152905161103092600160a060020a03169163c29785cc916004808301926020929190829003018186803b158015610f7457600080fd5b505afa158015610f88573d6000803e3d6000fd5b505050506040513d6020811015610f9e57600080fd5b505161010454604080517fc94750a80000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163c94750a891600480820192602092909190829003018186803b158015610fff57600080fd5b505afa158015611013573d6000803e3d6000fd5b505050506040513d602081101561102957600080fd5b5051614a42565b610109805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055606854604080517f5342825300000000000000000000000000000000000000000000000000000000815290517faf905e9cf428f582ba291af107597e8a811842567b96a9cd61ca5b0239ddb78892600160a060020a0316916353428253916004808301926020929190829003018186803b1580156110e357600080fd5b505afa1580156110f7573d6000803e3d6000fd5b505050506040513d602081101561110d57600080fd5b505160408051600160a060020a039092168252519081900360200190a15b565b50565b60005490565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d60208110156111ae57600080fd5b505160408051808201909152601681526000805160206158858339815191526020820152906112215760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce8054600160a060020a03909216620100000275ffffffffffffffffffffffffffffffffffffffff000019909216919091179055565b609b54600160a060020a031681565b61010854604080517f1d28b1990000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691631d28b199916004808301926020929190829003018186803b1580156112c757600080fd5b505afa1580156112db573d6000803e3d6000fd5b505050506040513d60208110156112f157600080fd5b5051905090565b61130482826000612493565b5050565b61010654604080517f2768ef090000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691632768ef09916004808301926020929190829003018186803b1580156112c757600080fd5b61010354604080517fed7dfd320000000000000000000000000000000000000000000000000000000081526004810184905290518392600160a060020a03169163ed7dfd32916024808301926020929190829003018186803b1580156113cc57600080fd5b505afa1580156113e0573d6000803e3d6000fd5b505050506040513d60208110156113f657600080fd5b505161144c576040805160e560020a62461bcd02815260206004820152601760248201527f4275636b6574206973206e6f7420617661696c61626c65000000000000000000604482015290519081900360640190fd5b61010354604080517f633ba2880000000000000000000000000000000000000000000000000000000081526004810185905290518492600160a060020a03169163633ba288916024808301926020929190829003018186803b1580156114b157600080fd5b505afa1580156114c5573d6000803e3d6000fd5b505050506040513d60208110156114db57600080fd5b50511561151c5760405160e560020a62461bcd0281526004018080602001828103825260278152602001806157256027913960400191505060405180910390fd5b61152583611e4b565b156115ec5761010354604080517f15d1b0d60000000000000000000000000000000000000000000000000000000081526004810186905260f460020a6104330260248201529051600160a060020a03909216916315d1b0d69160448082019260009290919082900301818387803b15801561159f57600080fd5b505af11580156115b3573d6000803e3d6000fd5b50506040805186815290517f03b09556eaf1538697123fabf059066271cafa36dc147deec0ec8c90ea14c89b9350908190036020019150a15b505050565b61010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561164557600080fd5b505af1158015611659573d6000803e3d6000fd5b5060009250611666915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156116b857600080fd5b505afa1580156116cc573d6000803e3d6000fd5b505050506040513d60208110156116e257600080fd5b505160038111156116ef57fe5b141561112b576116fd610e18565b61112b565b61010b5460ff161561174c576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156117d75760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561182c57600080fd5b505af1158015611840573d6000803e3d6000fd5b506000925061184d915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561189f57600080fd5b505afa1580156118b3573d6000803e3d6000fd5b505050506040513d60208110156118c957600080fd5b505160038111156118d657fe5b14156118f9576118e4610e18565b34156118f4576118f43334614ac7565b611af1565b60038061010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561194e57600080fd5b505afa158015611962573d6000803e3d6000fd5b505050506040513d602081101561197857600080fd5b5051600381111561198557fe5b10156119c55760405160e560020a62461bcd02815260040180806020018281038252602881526020018061583d6028913960400191505060405180910390fd5b61010a543a1115611a0a5760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517f7e7cafda00000000000000000000000000000000000000000000000000000000815233600482015260248101869052600160a060020a038581166044830152915160009384938493849384939290921691637e7cafda9160648082019260a09290919082900301818787803b158015611a8b57600080fd5b505af1158015611a9f573d6000803e3d6000fd5b505050506040513d60a0811015611ab557600080fd5b50805160208201516040830151606084015160809094015192985090965094509092509050611aea33348787878c8888614b70565b5050505050505b505061010b805460ff19169055565b61010a5481565b61010b5460009060ff1615611b54576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff19166001179055606854604080517f3af32abf000000000000000000000000000000000000000000000000000000008152336004820181905291519192600160a060020a031691633af32abf91602480820192602092909190829003018186803b158015611bc857600080fd5b505afa158015611bdc573d6000803e3d6000fd5b505050506040513d6020811015611bf257600080fd5b5051611c48576040805160e560020a62461bcd02815260206004820152601a60248201527f41646472657373206973206e6f742077686974656c6973746564000000000000604482015290519081900360640190fd5b82611c565760019150611c63565b611c608484614cba565b91505b5061010b805460ff1916905592915050565b60ce5460408051808201909152600b81527f6e6f745f73746f70706572000000000000000000000000000000000000000000602082015290620100009004600160a060020a03163314611d0c5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce5460408051808201909152601281527f636f6e74726163745f69735f6163746976650000000000000000000000000000602082015290610100900460ff16611d9b5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805461ff00191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b61010854604080517f408837400000000000000000000000000000000000000000000000000000000081529051600092600160a060020a0316916340883740916004808301926020929190829003018186803b1580156112c757600080fd5b61010954600160a060020a031681565b61010454604080517ffaba8c3b0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a03169163faba8c3b916004808301926020929190829003018186803b158015611eaa57600080fd5b505afa158015611ebe573d6000803e3d6000fd5b505050506040513d6020811015611ed457600080fd5b505161010454604080517f8c3e0502000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a0390921691638c3e050291602480820192602092909190829003018186803b158015611f3c57600080fd5b505afa158015611f50573d6000803e3d6000fd5b505050506040513d6020811015611f6657600080fd5b505111611f7557506001611f79565b5060005b919050565b61010b5460ff1615611fc8576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156120535760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b1580156120a857600080fd5b505af11580156120bc573d6000803e3d6000fd5b50600092506120c9915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561211b57600080fd5b505afa15801561212f573d6000803e3d6000fd5b505050506040513d602081101561214557600080fd5b5051600381111561215257fe5b1415612160576118e4610e18565b61010460009054906101000a9004600160a060020a0316600160a060020a031663e480e5b96040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156121b257600080fd5b505afa1580156121c6573d6000803e3d6000fd5b505050506040513d60208110156121dc57600080fd5b505161010454604080517fc4ee19ea0000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163c4ee19ea91600480820192602092909190829003018186803b15801561223d57600080fd5b505afa158015612251573d6000803e3d6000fd5b505050506040513d602081101561226757600080fd5b5051116122a85760405160e560020a62461bcd02815260040180806020018281038252602d8152602001806156d8602d913960400191505060405180910390fd5b61010a543a11156122ed5760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517f1a5e898600000000000000000000000000000000000000000000000000000000815233600482015260248101859052600160a060020a038481166044830152915160009384938493849384939290921691631a5e89869160648082019260a09290919082900301818787803b15801561236e57600080fd5b505af1158015612382573d6000803e3d6000fd5b505050506040513d60a081101561239857600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506123cd33348787878b8888614b70565b5050505050505061010b805460ff19169055565b603554610100900460ff16806123fa57506123fa614d9d565b80612408575060355460ff16155b6124465760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015612471576035805460ff1961ff0019909116610100171660011790555b61247d8383600161452e565b80156115ec576035805461ff0019169055505050565b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156125105760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010354604080517fed7dfd320000000000000000000000000000000000000000000000000000000081526004810186905290518592600160a060020a03169163ed7dfd32916024808301926020929190829003018186803b15801561257657600080fd5b505afa15801561258a573d6000803e3d6000fd5b505050506040513d60208110156125a057600080fd5b50516125f6576040805160e560020a62461bcd02815260206004820152601760248201527f4275636b6574206973206e6f7420617661696c61626c65000000000000000000604482015290519081900360640190fd5b61010354604080517f633ba2880000000000000000000000000000000000000000000000000000000081526004810187905290518692600160a060020a03169163633ba288916024808301926020929190829003018186803b15801561265b57600080fd5b505afa15801561266f573d6000803e3d6000fd5b505050506040513d602081101561268557600080fd5b5051156126c65760405160e560020a62461bcd0281526004018080602001828103825260278152602001806157256027913960400191505060405180910390fd5b61010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561271a57600080fd5b505af115801561272e573d6000803e3d6000fd5b506000925061273b915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561278d57600080fd5b505afa1580156127a1573d6000803e3d6000fd5b505050506040513d60208110156127b757600080fd5b505160038111156127c457fe5b14156127d7576127d2610e18565b61281b565b846127e181611367565b60405160e560020a62461bcd02815260040180806020018281038252603f8152602001806157bd603f913960400191505060405180910390fd5b5050505050565b61112d816000613a94565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561287b57600080fd5b505afa15801561288f573d6000803e3d6000fd5b505050506040513d60208110156128a557600080fd5b505160408051808201909152601681526000805160206158858339815191526020820152906129185760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805460ff19169055565b7f583200000000000000000000000000000000000000000000000000000000000081565b61010854604080517f5afccf720000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635afccf72916004808301926020929190829003018186803b1580156112c757600080fd5b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff1615612a255760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b158015612a7a57600080fd5b505af1158015612a8e573d6000803e3d6000fd5b5060009250612a9b915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015612aed57600080fd5b505afa158015612b01573d6000803e3d6000fd5b505050506040513d6020811015612b1757600080fd5b50516003811115612b2457fe5b1415612b3757612b32610e18565b61112d565b61010654604080517f5b0217c8000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a0390921691635b0217c8916024808201926020929091908290030181600087803b158015612b9f57600080fd5b505af1158015612bb3573d6000803e3d6000fd5b505050506040513d60208110156115ec57600080fd5b60ce54610100900460ff1690565b611304828260006146b9565b603554610100900460ff1680612bfc5750612bfc614d9d565b80612c0a575060355460ff16155b612c485760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015612c73576035805460ff1961ff0019909116610100171660011790555b612c7b614da3565b612c8486614dd5565b606860009054906101000a9004600160a060020a0316600160a060020a03166399c6fe736040518163ffffffff1660e060020a02815260040160206040518083038186803b158015612cd557600080fd5b505afa158015612ce9573d6000803e3d6000fd5b505050506040513d6020811015612cff57600080fd5b50516101018054600160a060020a031916600160a060020a03928316179055606854604080517fd31cc8310000000000000000000000000000000000000000000000000000000081529051919092169163d31cc831916004808301926020929190829003018186803b158015612d7457600080fd5b505afa158015612d88573d6000803e3d6000fd5b505050506040513d6020811015612d9e57600080fd5b50516101028054600160a060020a031916600160a060020a03928316179055606854604080517f955b570a0000000000000000000000000000000000000000000000000000000081529051919092169163955b570a916004808301926020929190829003018186803b158015612e1357600080fd5b505afa158015612e27573d6000803e3d6000fd5b505050506040513d6020811015612e3d57600080fd5b50516101038054600160a060020a031916600160a060020a03928316179055606854604080517f12529f1f000000000000000000000000000000000000000000000000000000008152905191909216916312529f1f916004808301926020929190829003018186803b158015612eb257600080fd5b505afa158015612ec6573d6000803e3d6000fd5b505050506040513d6020811015612edc57600080fd5b50516101048054600160a060020a031916600160a060020a03928316179055606854604080517fb29ead6c0000000000000000000000000000000000000000000000000000000081529051919092169163b29ead6c916004808301926020929190829003018186803b158015612f5157600080fd5b505afa158015612f65573d6000803e3d6000fd5b505050506040513d6020811015612f7b57600080fd5b50516101068054600160a060020a031916600160a060020a03928316179055606854604080517f8557af6f00000000000000000000000000000000000000000000000000000000815290519190921691638557af6f916004808301926020929190829003018186803b158015612ff057600080fd5b505afa158015613004573d6000803e3d6000fd5b505050506040513d602081101561301a57600080fd5b50516101078054600160a060020a031916600160a060020a03928316179055606854604080517fffb691300000000000000000000000000000000000000000000000000000000081529051919092169163ffb69130916004808301926020929190829003018186803b15801561308f57600080fd5b505afa1580156130a3573d6000803e3d6000fd5b505050506040513d60208110156130b957600080fd5b50516101088054600160a060020a031916600160a060020a039092169190911790556130e684868561452e565b61010a82905580156130fe576035805461ff00191690555b505050505050565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561315457600080fd5b505afa158015613168573d6000803e3d6000fd5b505050506040513d602081101561317e57600080fd5b505160408051808201909152601681526000805160206158858339815191526020820152906131f15760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805460ff19166001179055565b600090565b61112d816000611702565b606854600160a060020a031681565b60ce5460408051808201909152600b81527f756e73746f707061626c6500000000000000000000000000000000000000000060208201529060ff166132a95760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce5460408051808201909152600b81527f6e6f745f73746f70706572000000000000000000000000000000000000000000602082015290620100009004600160a060020a031633146133415760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156133bf5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5060ce805461ff0019166101001790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b60008061010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561345957600080fd5b505afa15801561346d573d6000803e3d6000fd5b505050506040513d602081101561348357600080fd5b5051600381111561349057fe5b146134cf5760405160e560020a62461bcd02815260040180806020018281038252602881526020018061583d6028913960400191505060405180910390fd5b61010754604080517f45e2c5a6000000000000000000000000000000000000000000000000000000008152336004820181905260248201529051600160a060020a03909216916345e2c5a6916044808201926020929091908290030181600087803b158015612b9f57600080fd5b61010354604080517f97f773e600000000000000000000000000000000000000000000000000000000815260048101859052600160a060020a038481166024830152915160009392909216916397f773e691604480820192602092909190829003018186803b1580156135af57600080fd5b505afa1580156135c3573d6000803e3d6000fd5b505050506040513d60208110156135d957600080fd5b50519392505050565b61010654604080517f995cc172000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151600093929092169163995cc17291602480820192602092909190829003018186803b15801561364d57600080fd5b505afa158015613661573d6000803e3d6000fd5b505050506040513d602081101561367757600080fd5b505192915050565b61010654604080517f9d5a3ba80000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691639d5a3ba8916004808301926020929190829003018186803b1580156112c757600080fd5b61010b5460ff1615613728576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156137b35760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010854604080517f9e95db2c0000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691639e95db2c91600480830192602092919082900301818787803b15801561381457600080fd5b505af1158015613828573d6000803e3d6000fd5b505050506040513d602081101561383e57600080fd5b505161010854604080517f4088374000000000000000000000000000000000000000000000000000000000815290519293506138d892600160a060020a0390921691634088374091600480820192602092909190829003018186803b1580156138a657600080fd5b505afa1580156138ba573d6000803e3d6000fd5b505050506040513d60208110156138d057600080fd5b505182614cba565b156139785761010354604080517f119e2ad600000000000000000000000000000000000000000000000000000000815260f460020a61043302600482015260248101849052600060448201819052606482018190529151600160a060020a039093169263119e2ad69260848084019391929182900301818387803b15801561395f57600080fd5b505af1158015613973573d6000803e3d6000fd5b505050505b5061010b805460ff19169055565b609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b1580156139d457600080fd5b505afa1580156139e8573d6000803e3d6000fd5b505050506040513d60208110156139fe57600080fd5b50516040805180820190915260168152600080516020615885833981519152602082015290613a715760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b50609b8054600160a060020a031916600160a060020a0392909216919091179055565b61010b5460ff1615613ade576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff1615613b695760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b158015613bbe57600080fd5b505af1158015613bd2573d6000803e3d6000fd5b5060009250613bdf915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015613c3157600080fd5b505afa158015613c45573d6000803e3d6000fd5b505050506040513d6020811015613c5b57600080fd5b50516003811115613c6857fe5b1415613c76576118f4610e18565b61010460009054906101000a9004600160a060020a0316600160a060020a031663e480e5b96040518163ffffffff1660e060020a02815260040160206040518083038186803b158015613cc857600080fd5b505afa158015613cdc573d6000803e3d6000fd5b505050506040513d6020811015613cf257600080fd5b505161010454604080517fc4ee19ea0000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163c4ee19ea91600480820192602092909190829003018186803b158015613d5357600080fd5b505afa158015613d67573d6000803e3d6000fd5b505050506040513d6020811015613d7d57600080fd5b505111613dbe5760405160e560020a62461bcd02815260040180806020018281038252602d8152602001806156d8602d913960400191505060405180910390fd5b61010a543a1115613e035760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517fa62c25c700000000000000000000000000000000000000000000000000000000815233600482015260248101859052600160a060020a03848116604483015291516000938493849384938493929092169163a62c25c79160648082019260a09290919082900301818787803b158015613e8457600080fd5b505af1158015613e98573d6000803e3d6000fd5b505050506040513d60a0811015613eae57600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506123cd338686868a8787614e95565b60ce5460ff1681565b61112d816000613fd6565b61112d816000611f7e565b603554610100900460ff1680613f1a5750613f1a614d9d565b80613f28575060355460ff16155b613f665760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015613f91576035805460ff1961ff0019909116610100171660011790555b609b8054600160a060020a031916600160a060020a0384161790558015611304576035805461ff00191690555050565b60ce54620100009004600160a060020a031681565b61010b5460ff1615614020576040805160e560020a62461bcd0281526020600482015260166024820152600080516020615865833981519152604482015290519081900360640190fd5b61010b805460ff1916600117905560ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156140ab5760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561410057600080fd5b505af1158015614114573d6000803e3d6000fd5b5060009250614121915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561417357600080fd5b505afa158015614187573d6000803e3d6000fd5b505050506040513d602081101561419d57600080fd5b505160038111156141aa57fe5b14156141b8576118f4610e18565b60038061010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561420d57600080fd5b505afa158015614221573d6000803e3d6000fd5b505050506040513d602081101561423757600080fd5b5051600381111561424457fe5b10156142845760405160e560020a62461bcd02815260040180806020018281038252602881526020018061583d6028913960400191505060405180910390fd5b61010a543a11156142c95760405160e560020a62461bcd02815260040180806020018281038252602281526020018061574c6022913960400191505060405180910390fd5b61010754604080517fd524a16800000000000000000000000000000000000000000000000000000000815233600482015260248101869052600160a060020a03858116604483015291516000938493849384938493929092169163d524a1689160648082019260a09290919082900301818787803b15801561434a57600080fd5b505af115801561435e573d6000803e3d6000fd5b505050506040513d60a081101561437457600080fd5b50805160208201516040830151606084015160809094015192985090965094509092509050611aea338686868b8787614e95565b60ce54620100009004600160a060020a031633148061443d5750609b546040805160e060020a63d994d6d50281523360048201529051600160a060020a039092169163d994d6d591602480820192602092909190829003018186803b15801561441057600080fd5b505afa158015614424573d6000803e3d6000fd5b505050506040513d602081101561443a57600080fd5b50515b61447b5760405160e560020a62461bcd02815260040180806020018281038252602181526020018061576e6021913960400191505060405180910390fd5b61010a55565b61010854604080517fdd7c6c7f00000000000000000000000000000000000000000000000000000000815281516000938493600160a060020a039091169263dd7c6c7f9260048083019392829003018186803b1580156144e057600080fd5b505afa1580156144f4573d6000803e3d6000fd5b505050506040513d604081101561450a57600080fd5b50805160209091015190925090509091565b60f460020a6104330281565b60015490565b603554610100900460ff16806145475750614547614d9d565b80614555575060355460ff16155b6145935760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff161580156145be576035805460ff1961ff0019909116610100171660011790555b60ce805460ff19168315151775ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a038716021790556145fe83613f01565b8015614610576035805461ff00191690555b50505050565b61010654604080517feef13ca10000000000000000000000000000000000000000000000000000000081526004810184905281516000938493600160a060020a039091169263eef13ca19260248083019392829003018186803b15801561467c57600080fd5b505afa158015614690573d6000803e3d6000fd5b505050506040513d60408110156146a657600080fd5b5080516020909101519092509050915091565b60ce546040805180820190915260128152600080516020615705833981519152602082015290610100900460ff16156147365760405160e560020a62461bcd0281526020600482018181528351602484015283519092839260449091019190850190808383600083156103b85781810151838201526020016103a0565b5061010354604080517fed7dfd320000000000000000000000000000000000000000000000000000000081526004810186905290518592600160a060020a03169163ed7dfd32916024808301926020929190829003018186803b15801561479c57600080fd5b505afa1580156147b0573d6000803e3d6000fd5b505050506040513d60208110156147c657600080fd5b505161481c576040805160e560020a62461bcd02815260206004820152601760248201527f4275636b6574206973206e6f7420617661696c61626c65000000000000000000604482015290519081900360640190fd5b61010354604080517f633ba2880000000000000000000000000000000000000000000000000000000081526004810187905290518692600160a060020a03169163633ba288916024808301926020929190829003018186803b15801561488157600080fd5b505afa158015614895573d6000803e3d6000fd5b505050506040513d60208110156148ab57600080fd5b5051156148ec5760405160e560020a62461bcd0281526004018080602001828103825260278152602001806157256027913960400191505060405180910390fd5b61010460009054906101000a9004600160a060020a0316600160a060020a03166314007c6d6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561494057600080fd5b505af1158015614954573d6000803e3d6000fd5b5060009250614961915050565b61010460009054906101000a9004600160a060020a0316600160a060020a031663c19d93fb6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156149b357600080fd5b505afa1580156149c7573d6000803e3d6000fd5b505050506040513d60208110156149dd57600080fd5b505160038111156149ea57fe5b14156149f8576127d2610e18565b84614a0281611367565b60405160e560020a62461bcd0281526004018080602001828103825260418152602001806157fc6041913960600191505060405180910390fd5b60025490565b61010454604080517fc9c95036000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163c9c950369160248082019260009290919082900301818387803b158015614aa957600080fd5b505af1158015614abd573d6000803e3d6000fd5b5050505061130482825b604051600090600160a060020a0384169083908381818185875af1925050503d8060008114614b12576040519150601f19603f3d011682016040523d82523d6000602084013e614b17565b606091505b50509050806115ec576040805160e560020a62461bcd02815260206004820152601460248201527f52425443207472616e73666572206661696c6564000000000000000000000000604482015290519081900360640190fd5b85614b81858363ffffffff614f3616565b614ba857614ba583614b99898963ffffffff614f3616565b9063ffffffff614f3616565b90505b87811115614c00576040805160e560020a62461bcd02815260206004820152601460248201527f616d6f756e74206973206e6f7420656e6f756768000000000000000000000000604482015290519081900360640190fd5b61010454604080517feb4edb85000000000000000000000000000000000000000000000000000000008152600481018a90529051600160a060020a039092169163eb4edb859160248082019260009290919082900301818387803b158015614c6757600080fd5b505af1158015614c7b573d6000803e3d6000fd5b50505050614c8b89868685614f93565b614c96848785615427565b614caf89614caa8a8463ffffffff61567716565b614ac7565b505050505050505050565b6040516000908190600160a060020a0385169084908381818185875af1925050503d8060008114614d07576040519150601f19603f3d011682016040523d82523d6000602084013e614d0c565b606091505b505090508015614d965761010454604080517fc9c95036000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a039092169163c9c950369160248082019260009290919082900301818387803b158015614d7d57600080fd5b505af1158015614d91573d6000803e3d6000fd5b505050505b9392505050565b303b1590565b60408051606081018252670de0b6b3a76400008082526001602083018190529190920182905260008290558055600255565b603554610100900460ff1680614dee5750614dee614d9d565b80614dfc575060355460ff16155b614e3a5760405160e560020a62461bcd02815260040180806020018281038252602e81526020018061578f602e913960400191505060405180910390fd5b603554610100900460ff16158015614e65576035805460ff1961ff0019909116610100171660011790555b60688054600160a060020a031916600160a060020a0384161790558015611304576035805461ff00191690555050565b61010454600160a060020a031663c9c95036614ebb87614b998a8763ffffffff614f3616565b6040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b158015614ef457600080fd5b505af1158015614f08573d6000803e3d6000fd5b50505050614f1887858584614f93565b614f23838684615427565b614f2d8787614ac7565b50505050505050565b600082820183811015614d96576040805160e560020a62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000614fa5848363ffffffff614f3616565b9050801561281b5761010454604080517f5e10ad790000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635e10ad79916004808301926020929190829003018186803b15801561500c57600080fd5b505afa158015615020573d6000803e3d6000fd5b505050506040513d602081101561503657600080fd5b505161010454604080517f7f13cb060000000000000000000000000000000000000000000000000000000081529051929350600092600160a060020a0390921691637f13cb0691600480820192602092909190829003018186803b15801561509d57600080fd5b505afa1580156150b1573d6000803e3d6000fd5b505050506040513d60208110156150c757600080fd5b5051604080517f88114db3000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820188905260006044830181905292519394508516926388114db392606480840193602093929083900390910190829087803b15801561514157600080fd5b505af1158015615155573d6000803e3d6000fd5b505050506040513d602081101561516b57600080fd5b50511561531a57604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0389811660048301528781166024830152604482018790529151918316916323b872dd916064808201926020929091908290030181600087803b1580156151e657600080fd5b505af11580156151fa573d6000803e3d6000fd5b505050506040513d602081101561521057600080fd5b5050610108546040805160e260020a6330a5e1730281529051600160a060020a03808516936323b872dd938c93919092169163c29785cc916004808301926020929190829003018186803b15801561526757600080fd5b505afa15801561527b573d6000803e3d6000fd5b505050506040513d602081101561529157600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a039384166004820152929091166024830152604482018a90525160648083019260209291908290030181600087803b1580156152e857600080fd5b505af11580156152fc573d6000803e3d6000fd5b505050506040513d602081101561531257600080fd5b50614f2d9050565b80600160a060020a03166323b872dd8861010860009054906101000a9004600160a060020a0316600160a060020a031663c29785cc6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561537c57600080fd5b505afa158015615390573d6000803e3d6000fd5b505050506040513d60208110156153a657600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a039384166004820152929091166024830152604482018790525160648083019260209291908290030181600087803b1580156153fd57600080fd5b505af1158015615411573d6000803e3d6000fd5b505050506040513d6020811015614caf57600080fd5b6000615439838363ffffffff614f3616565b905080156146105761010454604080517f5e10ad790000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635e10ad79916004808301926020929190829003018186803b1580156154a057600080fd5b505afa1580156154b4573d6000803e3d6000fd5b505050506040513d60208110156154ca57600080fd5b5051604080517f88114db3000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526000602483018190526044830188905292519394508416926388114db392606480840193602093929083900390910190829087803b15801561554457600080fd5b505af1158015615558573d6000803e3d6000fd5b505050506040513d602081101561556e57600080fd5b5051156155fb5761557f8584614ac7565b610108546040805160e260020a6330a5e17302815290516127d292600160a060020a03169163c29785cc916004808301926020929190829003018186803b1580156155c957600080fd5b505afa1580156155dd573d6000803e3d6000fd5b505050506040513d60208110156155f357600080fd5b505185614ac7565b610108546040805160e260020a6330a5e173028152905161281b92600160a060020a03169163c29785cc916004808301926020929190829003018186803b15801561564557600080fd5b505afa158015615659573d6000803e3d6000fd5b505050506040513d602081101561566f57600080fd5b505183614ac7565b6000828211156156d1576040805160e560020a62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b5090039056fe46756e6374696f6e2063616e6e6f742062652063616c6c65642061742070726f74656374696f6e206d6f64652e636f6e74726163745f69735f70617573656400000000000000000000000000004275636b65742073686f756c64206e6f74206265206120626173652074797065206275636b65746761732070726963652069732061626f766520746865206d617820616c6c6f7765646e6f7420617574686f72697a6564206368616e676572206f722073746f70706572436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65644d696e74204c657665726167656420706f736974696f6e2069732064697361626c65642e205365653a20687474703a2f2f6269742e6c792f335850694b554152656465656d204c657665726167656420706f736974696f6e2069732064697361626c65642e205365653a20687474703a2f2f6269742e6c792f335850694b554146756e6374696f6e2063616e6e6f742062652063616c6c656420617420746869732073746174652e7265656e7472616e6379206e6f7420616c6c6f776564000000000000000000006e6f745f617574686f72697a65645f6368616e67657200000000000000000000a265627a7a72315820b284450c2d9b41b40bc1e734fa5004f32473fcd7b05b67baf23226c7e3b66e8364736f6c63430005110032","source_code":"pragma solidity ^0.5.8;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"openzeppelin-solidity/contracts/lifecycle/Pausable.sol\";\nimport \"./MoCBProxManager.sol\";\nimport \"./interface/IMoCState.sol\";\nimport \"./MoCLibConnection.sol\";\nimport \"./interface/IMoCSettlement.sol\";\nimport \"./interface/IMoCExchange.sol\";\nimport \"./base/MoCBase.sol\";\nimport \"moc-governance/contracts/Stopper/Stoppable.sol\";\nimport \"moc-governance/contracts/Governance/IGovernor.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\nimport \"./interface/IMoCVendors.sol\";\nimport \"./interface/IMoCInrate.sol\";\nimport \"./interface/IMoC.sol\";\n\ncontract MoCEvents {\n  event BucketLiquidation(bytes32 bucket);\n  event ContractLiquidated(address mocAddress);\n}\n\ncontract MoC is MoCEvents, MoCLibConnection, MoCBase, Stoppable, IMoC {\n  using SafeMath for uint256;\n\n  /// @dev Contracts.\n  address internal docToken;\n  address internal bproToken;\n  MoCBProxManager internal bproxManager;\n  IMoCState internal mocState;\n  /** DEPRECATED **/\n  // solium-disable-next-line mixedcase\n  address internal DEPRECATED_mocConverter;\n  IMoCSettlement internal settlement;\n  IMoCExchange internal mocExchange;\n  IMoCInrate internal mocInrate;\n  /// @dev 'MoCBurnout' is deprecated. DO NOT use this variable.\n  /** DEPRECATED **/\n  // solium-disable-next-line mixedcase\n  address public DEPRECATED_mocBurnout;\n\n  /// @dev Indicates if Rbtc remainder was sent and BProToken was paused\n  bool internal liquidationExecuted;\n\n  //TODO: We must research if fallback function is really needed.\n  /**\n    @dev Fallback function\n  */\n  function() external payable whenNotPaused() transitionState() {\n    bproxManager.addValuesToBucket(BUCKET_C0, msg.value, 0, 0);\n    mocState.addToRbtcInSystem(msg.value);\n  }\n\n  /**\n    @dev Initializes the contract\n    @param connectorAddress MoCConnector contract address\n    @param governorAddress Governor contract address\n    @param stopperAddress Stopper contract address\n    @param startStoppable Indicates if the contract starts being unstoppable or not\n    @param maxGasPrice_ gas price limit to mint and redeem operations\n  */\n  function initialize(\n    address connectorAddress,\n    address governorAddress,\n    address stopperAddress,\n    bool startStoppable,\n    uint256 maxGasPrice_\n  ) public initializer {\n    initializePrecisions();\n    initializeBase(connectorAddress);\n    //initializeContracts\n    docToken = connector.docToken();\n    bproToken = connector.bproToken();\n    bproxManager = MoCBProxManager(connector.bproxManager());\n    mocState = IMoCState(connector.mocState());\n    settlement = IMoCSettlement(connector.mocSettlement());\n    mocExchange = IMoCExchange(connector.mocExchange());\n    mocInrate = IMoCInrate(connector.mocInrate());\n    //initializeGovernanceContracts\n    Stoppable.initialize(stopperAddress, IGovernor(governorAddress), startStoppable);\n    maxGasPrice = maxGasPrice_;\n  }\n\n  /****************************INTERFACE*******************************************/\n\n  /**\n    @dev Gets the BProx balance of an address\n    @param bucket Name of the bucket\n    @param account Address\n    @return BProx balance of the address\n  */\n  function bproxBalanceOf(bytes32 bucket, address account) public view returns(uint256) {\n    return bproxManager.bproxBalanceOf(bucket, account);\n  }\n\n  /**\n    @dev Gets the RedeemRequest at the queue index position\n    @param index queue position to get\n    @return redeemer's address and amount he submitted\n  */\n  function getRedeemRequestAt(uint256 index) public view returns(address, uint256) {\n    return settlement.getRedeemRequestAt(index);\n  }\n\n  /**\n    @dev Returns current redeem queue size\n    @return redeem queue size\n   */\n  function redeemQueueSize() public view returns(uint256) {\n    return settlement.redeemQueueSize();\n  }\n\n  /**\n    @dev Returns the total amount of Docs in the redeem queue for redeemer\n    @param redeemer address for which ^ is computed\n    @return total amount of Docs in the redeem queue for redeemer\n   */\n  function docAmountToRedeem(address redeemer) public view returns(uint256) {\n    return settlement.docAmountToRedeem(redeemer);\n  }\n\n\n  /**\n  * @dev Creates or updates the amount of a Doc redeem Request from the msg.sender\n  * @param docAmount Amount of Docs to redeem on settlement [using mocPrecision]\n  */\n  function redeemDocRequest(uint256 docAmount) public {\n    // Do nothing. Feature removed\n  }\n\n  /**\n    @dev Alters the redeem amount position for the redeemer\n    @param isAddition true if adding amount to redeem, false to substract.\n    @param delta the amount to add/substract to current position\n  */\n  function alterRedeemRequestAmount(bool isAddition, uint256 delta) public {\n    // Do nothing. Feature removed\n  }\n\n  /**\n    @dev Mints BPRO and pays the comissions of the operation (retrocompatible function).\n    @dev Retrocompatible function.\n    @param btcToMint Amount in BTC to mint\n   */\n  function mintBPro(uint256 btcToMint)\n  public payable {\n    mintBProVendors(btcToMint, address(0));\n  }\n\n  /**\n    @dev Mints BPRO and pays the comissions of the operation.\n    @param btcToMint Amount in BTC to mint\n    @param vendorAccount Vendor address\n   */\n  function mintBProVendors(uint256 btcToMint, address payable vendorAccount)\n  public payable\n  nonReentrant whenNotPaused() transitionStateWithRefund() notInProtectionMode() isValidGasPrice() {\n    /** UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n    (uint256 totalBtcSpent,\n    uint256 btcCommission,\n    uint256 mocCommission,\n    uint256 btcMarkup,\n    uint256 mocMarkup) = mocExchange.mintBPro(msg.sender, btcToMint, vendorAccount);\n\n    transferCommissions(\n      msg.sender,\n      msg.value,\n      totalBtcSpent,\n      btcCommission,\n      mocCommission,\n      vendorAccount,\n      btcMarkup,\n      mocMarkup\n    );\n    /** END UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n  }\n\n  /**\n    @dev Redeems Bpro Tokens and pays the comissions of the operation (retrocompatible function).\n    @param bproAmount Amount in Bpro\n  */\n  function redeemBPro(uint256 bproAmount)\n  public {\n    redeemBProVendors(bproAmount, address(0));\n  }\n\n  /**\n    @dev Redeems Bpro Tokens and pays the comissions of the operation\n    @param bproAmount Amount in Bpro\n    @param vendorAccount Vendor address\n  */\n  function redeemBProVendors(uint256 bproAmount, address payable vendorAccount)\n  public\n  nonReentrant whenNotPaused() transitionState() atLeastState(IMoCState.States.AboveCobj) isValidGasPrice() {\n    /** UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n    (uint256 btcAmount,\n    uint256 btcCommission,\n    uint256 mocCommission,\n    uint256 btcMarkup,\n    uint256 mocMarkup) = mocExchange.redeemBPro(msg.sender, bproAmount, vendorAccount);\n\n    redeemWithCommission(\n      msg.sender,\n      btcAmount,\n      btcCommission,\n      mocCommission,\n      vendorAccount,\n      btcMarkup,\n      mocMarkup\n    );\n    /** END UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n  }\n\n  /**\n    @dev Mint Doc tokens and pays the commisions of the operation (retrocompatible function).\n    @dev Retrocompatible function.\n    @param btcToMint Amount in RBTC to mint\n  */\n  function mintDoc(uint256 btcToMint)\n  public payable {\n    mintDocVendors(btcToMint, address(0));\n  }\n\n  /**\n   * @dev Mint Doc tokens and pays the commisions of the operation\n   * @param btcToMint Amount in RBTC to mint\n   * @param vendorAccount Vendor address\n   */\n  function mintDocVendors(uint256 btcToMint, address payable vendorAccount)\n  public payable\n  nonReentrant whenNotPaused() transitionStateWithRefund() atLeastState(IMoCState.States.AboveCobj) isValidGasPrice() {\n    /** UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n    (uint256 totalBtcSpent,\n    uint256 btcCommission,\n    uint256 mocCommission,\n    uint256 btcMarkup,\n    uint256 mocMarkup) = mocExchange.mintDoc(msg.sender, btcToMint, vendorAccount);\n\n    transferCommissions(\n      msg.sender,\n      msg.value,\n      totalBtcSpent,\n      btcCommission,\n      mocCommission,\n      vendorAccount,\n      btcMarkup,\n      mocMarkup\n    );\n    /** END UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n  }\n\n  /**\n    @dev Redeems Bprox Tokens and pays the comissions of the operation in RBTC (retrocompatible function).\n    @dev Retrocompatible function.\n    @param bucket Bucket to reedem, for example X2\n    @param bproxAmount Amount in Bprox\n  */\n  function redeemBProx(bytes32 bucket, uint256 bproxAmount) public {\n    redeemBProxVendors(bucket, bproxAmount, address(0));\n  }\n\n  /**\n    @dev Redeems Bprox Tokens and pays the comissions of the operation in RBTC\n    @param bucket Bucket to reedem, for example X2\n  */\n  function redeemBProxVendors(bytes32 bucket, uint256 /*bproxAmount*/, address payable /*vendorAccount*/) public\n  whenNotPaused() availableBucket(bucket) notBaseBucket(bucket)\n  transitionState() bucketStateTransition(bucket) {\n    /** UPDATE V0114: 31/01/2023 - Removal of leveraged positions. Please take a look at http://bit.ly/3XPiKUA **/\n    revert(\"Redeem Leveraged position is disabled. See: http://bit.ly/3XPiKUA\");\n  }\n\n  /**\n    @dev BUCKET bprox minting (retrocompatible function).\n    @dev Retrocompatible function.\n    @param bucket Name of the bucket used\n    @param btcToMint amount to mint on RBTC\n  */\n  function mintBProx(bytes32 bucket, uint256 btcToMint) public payable {\n    mintBProxVendors(bucket, btcToMint, address(0));\n  }\n\n  /**\n    @dev BUCKET bprox minting\n    @param bucket Name of the bucket used\n  */\n  function mintBProxVendors(bytes32 bucket, uint256 /*btcToMint*/, address payable /*vendorAccount*/) public payable\n  whenNotPaused() availableBucket(bucket) notBaseBucket(bucket)\n  transitionState() bucketStateTransition(bucket) {\n    /** UPDATE V0114: 31/01/2023 - Removal of leveraged positions. Please take a look at http://bit.ly/3XPiKUA **/\n    revert(\"Mint Leveraged position is disabled. See: http://bit.ly/3XPiKUA\");\n  }\n\n  /**\n    @dev Redeems the requested amount for the msg.sender, or the max amount of free docs possible (retrocompatible function).\n    @dev Retrocompatible function.\n    @param docAmount Amount of Docs to redeem.\n  */\n  function redeemFreeDoc(uint256 docAmount)\n  public {\n    redeemFreeDocVendors(docAmount, address(0));\n  }\n\n  /**\n    @dev Redeems the requested amount for the msg.sender, or the max amount of free docs possible.\n    @param docAmount Amount of Docs to redeem.\n    @param vendorAccount Vendor address\n  */\n  function redeemFreeDocVendors(uint256 docAmount, address payable vendorAccount)\n  public\n  nonReentrant whenNotPaused() transitionState() notInProtectionMode() isValidGasPrice() {\n    /** UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n    (uint256 btcAmount,\n    uint256 btcCommission,\n    uint256 mocCommission,\n    uint256 btcMarkup,\n    uint256 mocMarkup) = mocExchange.redeemFreeDoc(msg.sender, docAmount, vendorAccount);\n\n    redeemWithCommission(\n      msg.sender,\n      btcAmount,\n      btcCommission,\n      mocCommission,\n      vendorAccount,\n      btcMarkup,\n      mocMarkup\n    );\n    /** END UPDATE V0112: 24/09/2020 - Upgrade to support multiple commission rates **/\n  }\n\n  /**\n    @dev Allow redeem on liquidation state, user DoCs get burned and he receives\n    the equivalent BTCs if can be covered, or the maximum available\n  */\n  function redeemAllDoc() public atState(IMoCState.States.Liquidated) {\n    mocExchange.redeemAllDoc(msg.sender, msg.sender);\n  }\n\n  /**\n    @dev Pays the BitPro interest and transfers it to the address mocInrate.bitProInterestAddress\n    BitPro interests = Nb (bucket 0) * bitProRate.\n  */\n  function payBitProHoldersInterestPayment() public nonReentrant whenNotPaused() {\n    uint256 toPay = mocInrate.payBitProHoldersInterestPayment();\n    if (doSend(mocInrate.getBitProInterestAddress(), toPay)) {\n      bproxManager.substractValuesFromBucket(BUCKET_C0, toPay, 0, 0);\n    }\n  }\n\n  /**\n    @dev Calculates BitPro holders holder interest by taking the total amount of RBTCs available on Bucket 0.\n    BitPro interests = Nb (bucket 0) * bitProRate.\n  */\n  function calculateBitProHoldersInterest() public view returns(uint256, uint256) {\n    return mocInrate.calculateBitProHoldersInterest();\n  }\n\n  /**\n    @dev Gets the target address to transfer BitPro Holders rate\n    @return Target address to transfer BitPro Holders interest\n  */\n  function getBitProInterestAddress() public view returns(address payable) {\n    return mocInrate.getBitProInterestAddress();\n  }\n\n  /**\n    @dev Gets the rate for BitPro Holders\n    @return BitPro Rate\n  */\n  function getBitProRate() public view returns(uint256) {\n    return mocInrate.getBitProRate();\n  }\n\n\n  function isDailyEnabled() external pure returns(bool) {\n    return false;\n  }\n\n  function isBitProInterestEnabled() public view returns(bool) {\n    return mocInrate.isBitProInterestEnabled();\n  }\n\n  /**\n    @dev Indicates if settlement is enabled\n    @return Returns true if blockSpan number of blocks has passed since last execution; otherwise false\n  */\n  function isSettlementEnabled() public view returns(bool) {\n    return settlement.isSettlementEnabled();\n  }\n\n  /**\n    @dev Checks if bucket liquidation is reached.\n    @param bucket Name of bucket.\n    @return true if bucket liquidation is reached, false otherwise\n  */\n  function isBucketLiquidationReached(bytes32 bucket) public view returns(bool) {\n    if (mocState.coverage(bucket) <= mocState.liq()) {\n      return true;\n    }\n    return false;\n  }\n\n  function evalBucketLiquidation(bytes32 bucket) public availableBucket(bucket) notBaseBucket(bucket) {\n    if (isBucketLiquidationReached(bucket)) {\n      bproxManager.liquidateBucket(bucket, BUCKET_C0);\n\n      emit BucketLiquidation(bucket);\n    }\n  }\n\n  /**\n    @dev Evaluates if liquidation state has been reached and runs liq if that's the case\n  */\n  function evalLiquidation() public transitionState() {\n    // DO NOTHING. Everything is handled in transitionState() modifier.\n  }\n\n  /**\n    @dev Runs all settlement process\n    @param steps Number of steps\n  */\n  function runSettlement(uint256 steps) public whenNotPaused() transitionState() {\n    settlement.runSettlement(steps);\n  }\n\n  /**\n    @dev Send RBTC to a user and update RbtcInSystem in MoCState\n    @param receiver address of receiver\n    @param btcAmount amount to transfer\n    @return result of the transaction\n  */\n  function sendToAddress(address payable receiver, uint256 btcAmount) public nonReentrant onlyWhitelisted(msg.sender) returns(bool) {\n    if (btcAmount == 0) {\n      return true;\n    }\n    return doSend(receiver, btcAmount);\n  }\n\n  function liquidate() internal {\n    if (!liquidationExecuted) {\n      //pauseBProToken\n      if (!Pausable(bproToken).paused()) {\n        Pausable(bproToken).pause();\n      }\n      //sendRbtcRemainder\n      doTransfer(mocInrate.commissionsAddress(), mocState.getRbtcRemainder());\n      liquidationExecuted = true;\n\n      emit ContractLiquidated(connector.moc());\n    }\n  }\n\n  /************************************/\n  /***** UPGRADE v0110      ***********/\n  /************************************/\n\n  /** START UPDATE V0112: 24/09/2020  **/\n  /** Upgrade to support multiple commission rates **/\n  /** Internal functions **/\n\n  /**\n    @dev Transfer mint operation fees (commissions + vendor markup)\n    @param sender address of msg.sender\n    @param value amount of msg.value\n    @param totalBtcSpent amount in RBTC spent\n    @param btcCommission commission amount in RBTC\n    @param mocCommission commission amount in MoC\n    @param vendorAccount address of vendor\n    @param btcMarkup vendor markup in RBTC\n    @param mocMarkup vendor markup in MoC\n  */\n  // solium-disable-next-line security/no-assign-params\n  function transferCommissions(\n    address payable sender,\n    uint256 value,\n    uint256 totalBtcSpent,\n    uint256 btcCommission,\n    uint256 mocCommission,\n    address payable vendorAccount,\n    uint256 btcMarkup,\n    uint256 mocMarkup\n  )\n  internal {\n    uint256 totalBtcWithFees = totalBtcSpent;\n    if (mocCommission.add(mocMarkup) == 0) {\n      totalBtcWithFees = totalBtcSpent.add(btcCommission).add(btcMarkup);\n    }\n    require(totalBtcWithFees <= value, \"amount is not enough\");\n\n    // Need to update general State\n    mocState.addToRbtcInSystem(totalBtcSpent);\n\n    transferMocCommission(sender, mocCommission, vendorAccount, mocMarkup);\n\n    transferBtcCommission(vendorAccount, btcCommission, btcMarkup);\n\n    // Calculate change\n    safeTransferRbtc(sender, value.sub(totalBtcWithFees));\n  }\n\n  /**\n    @dev Transfer operation fees in MoC (commissions + vendor markup)\n    @param sender address of msg.sender\n    @param mocCommission commission amount in MoC\n    @param vendorAccount address of vendor\n    @param mocMarkup vendor markup in MoC\n  */\n  // solium-disable-next-line security/no-assign-params\n  function transferMocCommission(\n    address sender,\n    uint256 mocCommission,\n    address vendorAccount,\n    uint256 mocMarkup\n  ) internal {\n    // If commission and markup are paid in MoC\n    uint256 totalMoCFee = mocCommission.add(mocMarkup);\n    if (totalMoCFee > 0) {\n      IMoCVendors mocVendors = IMoCVendors(mocState.getMoCVendors());\n      // Transfer MoC from sender to this contract\n      IERC20 mocToken = IERC20(mocState.getMoCToken());\n\n      // Transfer vendor markup in MoC\n      if (mocVendors.updatePaidMarkup(vendorAccount, mocMarkup, 0)) {\n        // Transfer MoC to vendor address\n        mocToken.transferFrom(sender, vendorAccount, mocMarkup);\n        // Transfer MoC to commissions address\n        mocToken.transferFrom(sender, mocInrate.commissionsAddress(), mocCommission);\n      } else {\n        // Transfer MoC to commissions address\n        mocToken.transferFrom(sender, mocInrate.commissionsAddress(), totalMoCFee);\n      }\n    }\n  }\n\n  /**\n    @dev Transfer redeem operation fees (commissions + vendor markup)\n    @param sender address of msg.sender\n    @param btcCommission commission amount in RBTC\n    @param mocCommission commission amount in MoC\n    @param vendorAccount address of vendor\n    @param btcMarkup vendor markup in RBTC\n    @param mocMarkup vendor markup in MoC\n  */\n  function redeemWithCommission(\n    address payable sender,\n    uint256 btcAmount,\n    uint256 btcCommission,\n    uint256 mocCommission,\n    address payable vendorAccount,\n    uint256 btcMarkup,\n    uint256 mocMarkup\n  )\n   internal {\n    mocState.subtractRbtcFromSystem(btcAmount.add(btcMarkup).add(btcCommission));\n\n    transferMocCommission(sender, mocCommission, vendorAccount, mocMarkup);\n\n    transferBtcCommission(vendorAccount, btcCommission, btcMarkup);\n\n    safeTransferRbtc(sender, btcAmount);\n  }\n\n  /**\n    @dev Transfer operation fees in RBTC (commissions + vendor markup)\n    @param vendorAccount address of vendor\n    @param btcCommission commission amount in RBTC\n    @param btcMarkup vendor markup in RBTC\n  */\n  function transferBtcCommission(address payable vendorAccount, uint256 btcCommission, uint256 btcMarkup) internal {\n\n    uint256 totalBtcFee = btcCommission.add(btcMarkup);\n\n    if (totalBtcFee > 0) {\n      IMoCVendors mocVendors = IMoCVendors(mocState.getMoCVendors());\n      // Transfer vendor markup in MoC\n      if (mocVendors.updatePaidMarkup(vendorAccount, 0, btcMarkup)) {\n        // Transfer RBTC to vendor address\n        safeTransferRbtc(vendorAccount, btcMarkup);\n        // Transfer RBTC to commissions address\n        safeTransferRbtc(mocInrate.commissionsAddress(), btcCommission);\n      } else {\n        // Transfer MoC to commissions address\n        safeTransferRbtc(mocInrate.commissionsAddress(), totalBtcFee);\n      }\n    }\n  }\n\n  /** END UPDATE V0112: 24/09/2020 **/\n\n  /**\n    @dev Transfer using transfer function and updates global RBTC register in MoCState\n    @param receiver address of receiver\n    @param btcAmount amount in RBTC\n  */\n  function doTransfer(address payable receiver, uint256 btcAmount) private {\n    mocState.subtractRbtcFromSystem(btcAmount);\n    safeTransferRbtc(receiver, btcAmount);\n  }\n\n  /**\n    @dev Safe RBTC transfer that is compatible with EIP-1884 gas cost changes\n    @param receiver address of receiver\n    @param amount amount in RBTC\n  */\n  function safeTransferRbtc(address payable receiver, uint256 amount) private {\n    // solium-disable-next-line security/no-call-value\n    (bool success, ) = receiver.call.value(amount)(\"\");\n    require(success, \"RBTC transfer failed\");\n  }\n\n  /**\n    @dev Transfer using call and updates global RBTC register in MoCState only on success\n    @param receiver address of receiver\n    @param btcAmount amount in RBTC\n    @return Execution result\n  */\n  function doSend(address payable receiver, uint256 btcAmount) private returns(bool) {\n    // solium-disable-next-line security/no-call-value\n    (bool result, ) = receiver.call.value(btcAmount)(\"\");\n\n    if (result) {\n      mocState.subtractRbtcFromSystem(btcAmount);\n    }\n\n    return result;\n  }\n\n  /***** STATE MODIFIERS *****/\n\n  modifier nonReentrant() {\n    require(!_reentrancyLock, \"reentrancy not allowed\");\n    _reentrancyLock = true;\n    _;\n    _reentrancyLock = false;\n  }\n\n  modifier atState(IMoCState.States _state) {\n    require(mocState.state() == _state, \"Function cannot be called at this state.\");\n    _;\n  }\n\n  modifier atLeastState(IMoCState.States _state) {\n    require(mocState.state() >= _state, \"Function cannot be called at this state.\");\n    _;\n  }\n\n  modifier atMostState(IMoCState.States _state) {\n    require(mocState.state() <= _state, \"Function cannot be called at this state.\");\n    _;\n  }\n\n  modifier notInProtectionMode() {\n    require(mocState.globalCoverage() > mocState.getProtected(), \"Function cannot be called at protection mode.\");\n    _;\n  }\n\n  modifier bucketStateTransition(bytes32 bucket) {\n    evalBucketLiquidation(bucket);\n    _;\n  }\n\n  modifier availableBucket(bytes32 bucket) {\n    require (bproxManager.isAvailableBucket(bucket), \"Bucket is not available\");\n    _;\n  }\n\n  modifier notBaseBucket(bytes32 bucket) {\n    require(!bproxManager.isBucketBase(bucket), \"Bucket should not be a base type bucket\");\n    _;\n  }\n\n  modifier transitionState()\n  {\n    mocState.nextState();\n    if (mocState.state() == IMoCState.States.Liquidated) {\n      liquidate();\n    }\n    else\n      _;\n  }\n\n  modifier transitionStateWithRefund()\n  {\n    mocState.nextState();\n    if (mocState.state() == IMoCState.States.Liquidated) {\n      liquidate();\n      if (msg.value > 0) {\n        safeTransferRbtc(msg.sender, msg.value);\n      }\n    }\n    else\n      _;\n  }\n\n  /**\n   * @notice validate that the given gas price is less or equal to the gas price limit\n   */\n  modifier isValidGasPrice() {\n    require(tx.gasprice <= maxGasPrice, \"gas price is above the max allowed\");\n    _;\n  }\n\n  /**\n   * @notice allows the pauser or an authorized changer to update the gas price limit\n   *  The pauser is a multisig that could be used in this case to speed up the max gas price\n   *  change if it is necessary\n   * @param maxGasPrice_ new gas price limit\n   */\n  function setMaxGasPrice(uint256 maxGasPrice_) external {\n    require(stopper == msg.sender || governor.isAuthorizedChanger(msg.sender), \"not authorized changer or stopper\");\n    maxGasPrice = maxGasPrice_;\n  }\n\n  uint256 public maxGasPrice;\n  bool private _reentrancyLock;\n\n  // Leave a gap betweeen inherited contracts variables in order to be\n  // able to add more variables in them later\n  uint256[48] private upgradeGap;\n}\n","creation_status":"success","file_path":"npm/money-on-chain@3.0.7/contracts/MoC.sol"}