Address Details
contract
0x1B78f6acD05e7BcB00f74863bfd8a7C264143e37
- Contract Name
- Broker
- Creator
- 0x56fd3f–9b8d81 at 0xb348f2–cc2334
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 1 Transactions
- Transfers
- 0 Transfers
- Gas Used
- 28,941
- Last Balance Update
- 27807456
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- Broker
- Optimization enabled
- true
- Compiler version
- v0.5.17+commit.d19bba13
- Optimization runs
- 10000
- Verified at
- 2024-01-10T17:40:01.606328Z
lib/mento-core-2.2.0/contracts/swap/Broker.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; pragma experimental ABIEncoderV2; import { Ownable } from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import { SafeERC20 } from "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; import { SafeMath } from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import { IERC20 } from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import { IExchangeProvider } from "../interfaces/IExchangeProvider.sol"; import { IBroker } from "../interfaces/IBroker.sol"; import { IBrokerAdmin } from "../interfaces/IBrokerAdmin.sol"; import { IReserve } from "../interfaces/IReserve.sol"; import { IERC20Metadata } from "../common/interfaces/IERC20Metadata.sol"; import { IStableTokenV2 } from "../interfaces/IStableTokenV2.sol"; import { Initializable } from "../common/Initializable.sol"; import { TradingLimits } from "../libraries/TradingLimits.sol"; import { ReentrancyGuard } from "../common/ReentrancyGuard.sol"; /** * @title Broker * @notice The broker executes swaps and keeps track of spending limits per pair. */ contract Broker is IBroker, IBrokerAdmin, Initializable, Ownable, ReentrancyGuard { using TradingLimits for TradingLimits.State; using TradingLimits for TradingLimits.Config; using SafeERC20 for IERC20; using SafeMath for uint256; /* ==================== State Variables ==================== */ address[] public exchangeProviders; mapping(address => bool) public isExchangeProvider; mapping(bytes32 => TradingLimits.State) public tradingLimitsState; mapping(bytes32 => TradingLimits.Config) public tradingLimitsConfig; // Address of the reserve. IReserve public reserve; uint256 private constant MAX_INT256 = uint256(-1) / 2; /* ==================== Constructor ==================== */ /** * @notice Sets initialized == true on implementation contracts. * @param test Set to true to skip implementation initialization. */ constructor(bool test) public Initializable(test) {} /** * @notice Allows the contract to be upgradable via the proxy. * @param _exchangeProviders The addresses of the ExchangeProvider contracts. * @param _reserve The address of the Reserve contract. */ function initialize(address[] calldata _exchangeProviders, address _reserve) external initializer { _transferOwnership(msg.sender); for (uint256 i = 0; i < _exchangeProviders.length; i++) { addExchangeProvider(_exchangeProviders[i]); } setReserve(_reserve); } /* ==================== Mutative Functions ==================== */ /** * @notice Add an exchange provider to the list of providers. * @param exchangeProvider The address of the exchange provider to add. * @return index The index of the newly added specified exchange provider. */ function addExchangeProvider(address exchangeProvider) public onlyOwner returns (uint256 index) { require(!isExchangeProvider[exchangeProvider], "ExchangeProvider already exists in the list"); require(exchangeProvider != address(0), "ExchangeProvider address can't be 0"); exchangeProviders.push(exchangeProvider); isExchangeProvider[exchangeProvider] = true; emit ExchangeProviderAdded(exchangeProvider); index = exchangeProviders.length.sub(1); } /** * @notice Remove an exchange provider from the list of providers. * @param exchangeProvider The address of the exchange provider to remove. * @param index The index of the exchange provider being removed. */ function removeExchangeProvider(address exchangeProvider, uint256 index) public onlyOwner { require(exchangeProviders[index] == exchangeProvider, "index doesn't match provider"); exchangeProviders[index] = exchangeProviders[exchangeProviders.length.sub(1)]; exchangeProviders.pop(); delete isExchangeProvider[exchangeProvider]; emit ExchangeProviderRemoved(exchangeProvider); } /** * @notice Set the Mento reserve address. * @param _reserve The Mento reserve address. */ function setReserve(address _reserve) public onlyOwner { require(_reserve != address(0), "Reserve address must be set"); emit ReserveSet(_reserve, address(reserve)); reserve = IReserve(_reserve); } /** * @notice Calculate the amount of tokenIn to be sold for a given amountOut of tokenOut * @param exchangeProvider the address of the exchange manager for the pair * @param exchangeId The id of the exchange to use * @param tokenIn The token to be sold * @param tokenOut The token to be bought * @param amountOut The amount of tokenOut to be bought * @return amountIn The amount of tokenIn to be sold */ function getAmountIn( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountOut ) external view returns (uint256 amountIn) { require(isExchangeProvider[exchangeProvider], "ExchangeProvider does not exist"); amountIn = IExchangeProvider(exchangeProvider).getAmountIn(exchangeId, tokenIn, tokenOut, amountOut); } /** * @notice Calculate the amount of tokenOut to be bought for a given amount of tokenIn to be sold * @param exchangeProvider the address of the exchange manager for the pair * @param exchangeId The id of the exchange to use * @param tokenIn The token to be sold * @param tokenOut The token to be bought * @param amountIn The amount of tokenIn to be sold * @return amountOut The amount of tokenOut to be bought */ function getAmountOut( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountIn ) external view returns (uint256 amountOut) { require(isExchangeProvider[exchangeProvider], "ExchangeProvider does not exist"); amountOut = IExchangeProvider(exchangeProvider).getAmountOut(exchangeId, tokenIn, tokenOut, amountIn); } /** * @notice Execute a token swap with fixed amountIn. * @param exchangeProvider the address of the exchange provider for the pair. * @param exchangeId The id of the exchange to use. * @param tokenIn The token to be sold. * @param tokenOut The token to be bought. * @param amountIn The amount of tokenIn to be sold. * @param amountOutMin Minimum amountOut to be received - controls slippage. * @return amountOut The amount of tokenOut to be bought. */ function swapIn( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOutMin ) external nonReentrant returns (uint256 amountOut) { require(isExchangeProvider[exchangeProvider], "ExchangeProvider does not exist"); amountOut = IExchangeProvider(exchangeProvider).swapIn(exchangeId, tokenIn, tokenOut, amountIn); require(amountOut >= amountOutMin, "amountOutMin not met"); guardTradingLimits(exchangeId, tokenIn, amountIn, tokenOut, amountOut); transferIn(msg.sender, tokenIn, amountIn); transferOut(msg.sender, tokenOut, amountOut); emit Swap(exchangeProvider, exchangeId, msg.sender, tokenIn, tokenOut, amountIn, amountOut); } /** * @notice Execute a token swap with fixed amountOut. * @param exchangeProvider the address of the exchange provider for the pair. * @param exchangeId The id of the exchange to use. * @param tokenIn The token to be sold. * @param tokenOut The token to be bought. * @param amountOut The amount of tokenOut to be bought. * @param amountInMax Maximum amount of tokenIn that can be traded. * @return amountIn The amount of tokenIn to be sold. */ function swapOut( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountOut, uint256 amountInMax ) external nonReentrant returns (uint256 amountIn) { require(isExchangeProvider[exchangeProvider], "ExchangeProvider does not exist"); amountIn = IExchangeProvider(exchangeProvider).swapOut(exchangeId, tokenIn, tokenOut, amountOut); require(amountIn <= amountInMax, "amountInMax exceeded"); guardTradingLimits(exchangeId, tokenIn, amountIn, tokenOut, amountOut); transferIn(msg.sender, tokenIn, amountIn); transferOut(msg.sender, tokenOut, amountOut); emit Swap(exchangeProvider, exchangeId, msg.sender, tokenIn, tokenOut, amountIn, amountOut); } /** * @notice Permissionless way to burn stables from msg.sender directly. * @param token The token getting burned. * @param amount The amount of the token getting burned. * @return True if transaction succeeds. */ function burnStableTokens(address token, uint256 amount) public returns (bool) { require(reserve.isStableAsset(token), "Token must be a reserve stable asset"); IERC20(token).safeTransferFrom(msg.sender, address(this), amount); require(IStableTokenV2(token).burn(amount), "Burning of the stable asset failed"); return true; } /** * @notice Configure trading limits for an (exchangeId, token) touple. * @dev Will revert if the configuration is not valid according to the * TradingLimits library. * Resets existing state according to the TradingLimits library logic. * Can only be called by owner. * @param exchangeId the exchangeId to target. * @param token the token to target. * @param config the new trading limits config. */ function configureTradingLimit( bytes32 exchangeId, address token, TradingLimits.Config memory config ) public onlyOwner { config.validate(); bytes32 limitId = exchangeId ^ bytes32(uint256(uint160(token))); tradingLimitsConfig[limitId] = config; tradingLimitsState[limitId] = tradingLimitsState[limitId].reset(config); emit TradingLimitConfigured(exchangeId, token, config); } /* ==================== Private Functions ==================== */ /** * @notice Transfer a specified Mento asset to the given address. * If the specified asset is a stable asset it will be minted directly to the address. If * the asset is a collateral asset it will be transferred from the reserve to the given address. * @param to The address receiving the asset. * @param token The asset to transfer. * @param amount The amount of `token` to be transferred. */ function transferOut( address payable to, address token, uint256 amount ) internal { if (reserve.isStableAsset(token)) { require(IStableTokenV2(token).mint(to, amount), "Minting of the stable asset failed"); } else if (reserve.isCollateralAsset(token)) { require(reserve.transferExchangeCollateralAsset(token, to, amount), "Transfer of the collateral asset failed"); } else { revert("Token must be stable or collateral assert"); } } /** * @notice Transfer a specified Mento asset into the reserve or the broker. * If the specified asset is a stable asset it will be transfered to the broker * and burned. If the asset is a collateral asset it will be transferred to the reserve. * @param from The address to transfer the asset from. * @param token The asset to transfer. * @param amount The amount of `token` to be transferred. */ function transferIn( address payable from, address token, uint256 amount ) internal { if (reserve.isStableAsset(token)) { IERC20(token).safeTransferFrom(from, address(this), amount); require(IStableTokenV2(token).burn(amount), "Burning of the stable asset failed"); } else if (reserve.isCollateralAsset(token)) { IERC20(token).safeTransferFrom(from, address(reserve), amount); } else { revert("Token must be stable or collateral assert"); } } /** * @notice Verify trading limits for a trade in both directions. * @dev Reverts if the trading limits are met for outflow or inflow. * @param exchangeId the ID of the exchange being used. * @param _tokenIn the address of the token flowing in. * @param amountIn the amount of token flowing in. * @param _tokenOut the address of the token flowing out. * @param amountOut the amount of token flowing out. */ function guardTradingLimits( bytes32 exchangeId, address _tokenIn, uint256 amountIn, address _tokenOut, uint256 amountOut ) internal { bytes32 tokenIn = bytes32(uint256(uint160(_tokenIn))); bytes32 tokenOut = bytes32(uint256(uint160(_tokenOut))); require(amountIn <= uint256(MAX_INT256), "amountIn too large"); require(amountOut <= uint256(MAX_INT256), "amountOut too large"); guardTradingLimit(exchangeId ^ tokenIn, int256(amountIn), _tokenIn); guardTradingLimit(exchangeId ^ tokenOut, -1 * int256(amountOut), _tokenOut); } /** * @notice Updates and verifies a trading limit if it's configured. * @dev Will revert if the trading limit is exceeded by this trade. * @param tradingLimitId the ID of the trading limit associated with the token * @param deltaFlow the deltaflow of this token, negative for outflow, positive for inflow. * @param token the address of the token, used to lookup decimals. */ function guardTradingLimit( bytes32 tradingLimitId, int256 deltaFlow, address token ) internal { TradingLimits.Config memory tradingLimitConfig = tradingLimitsConfig[tradingLimitId]; if (tradingLimitConfig.flags > 0) { TradingLimits.State memory tradingLimitState = tradingLimitsState[tradingLimitId]; tradingLimitState = tradingLimitState.update(tradingLimitConfig, deltaFlow, IERC20Metadata(token).decimals()); tradingLimitState.verify(tradingLimitConfig); tradingLimitsState[tradingLimitId] = tradingLimitState; } } /* ==================== View Functions ==================== */ /** * @notice Get the list of registered exchange providers. * @dev This can be used by UI or clients to discover all pairs. * @return exchangeProviders the addresses of all exchange providers. */ function getExchangeProviders() external view returns (address[] memory) { return exchangeProviders; } }
/lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/GSN/Context.sol
pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
/lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/math/SafeMath.sol
pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
/lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/ownership/Ownable.sol
pragma solidity ^0.5.0; import "../GSN/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
/lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
/lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/token/ERC20/SafeERC20.sol
pragma solidity ^0.5.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
/lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/utils/Address.sol
pragma solidity ^0.5.5; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } }
/lib/mento-core-2.2.0/contracts/common/Initializable.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; contract Initializable { bool public initialized; constructor(bool testingDeployment) public { if (!testingDeployment) { initialized = true; } } modifier initializer() { require(!initialized, "contract already initialized"); initialized = true; _; } }
/lib/mento-core-2.2.0/contracts/common/ReentrancyGuard.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; /** * @title Helps contracts guard against reentrancy attacks. * @author Remco Bloemen <remco@2π.com>, Eenae <alexey@mixbytes.io> * @dev If you mark a function `nonReentrant`, you should also * mark it `external`. */ contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor() internal { // The counter starts at one to prevent changing it from zero to a non-zero // value, which is a more expensive operation. _guardCounter = 1; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter, "reentrant call"); } }
/lib/mento-core-2.2.0/contracts/common/interfaces/IERC20Metadata.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; interface IERC20Metadata { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
/lib/mento-core-2.2.0/contracts/interfaces/IBroker.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; pragma experimental ABIEncoderV2; import { TradingLimits } from "../libraries/TradingLimits.sol"; /* * @title Broker Interface for trader functions * @notice The broker is responsible for executing swaps and keeping track of trading limits. */ interface IBroker { /** * @notice Emitted when a swap occurs. * @param exchangeProvider The exchange provider used. * @param exchangeId The id of the exchange used. * @param trader The user that initiated the swap. * @param tokenIn The address of the token that was sold. * @param tokenOut The address of the token that was bought. * @param amountIn The amount of token sold. * @param amountOut The amount of token bought. */ event Swap( address exchangeProvider, bytes32 indexed exchangeId, address indexed trader, address indexed tokenIn, address tokenOut, uint256 amountIn, uint256 amountOut ); /** * @notice Emitted when a new trading limit is configured. * @param exchangeId the exchangeId to target. * @param token the token to target. * @param config the new trading limits config. */ event TradingLimitConfigured(bytes32 exchangeId, address token, TradingLimits.Config config); /** * @notice Execute a token swap with fixed amountIn. * @param exchangeProvider the address of the exchange provider for the pair. * @param exchangeId The id of the exchange to use. * @param tokenIn The token to be sold. * @param tokenOut The token to be bought. * @param amountIn The amount of tokenIn to be sold. * @param amountOutMin Minimum amountOut to be received - controls slippage. * @return amountOut The amount of tokenOut to be bought. */ function swapIn( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOutMin ) external returns (uint256 amountOut); /** * @notice Execute a token swap with fixed amountOut. * @param exchangeProvider the address of the exchange provider for the pair. * @param exchangeId The id of the exchange to use. * @param tokenIn The token to be sold. * @param tokenOut The token to be bought. * @param amountOut The amount of tokenOut to be bought. * @param amountInMax Maximum amount of tokenIn that can be traded. * @return amountIn The amount of tokenIn to be sold. */ function swapOut( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountOut, uint256 amountInMax ) external returns (uint256 amountIn); /** * @notice Calculate amountOut of tokenOut received for a given amountIn of tokenIn. * @param exchangeProvider the address of the exchange provider for the pair. * @param exchangeId The id of the exchange to use. * @param tokenIn The token to be sold. * @param tokenOut The token to be bought. * @param amountIn The amount of tokenIn to be sold. * @return amountOut The amount of tokenOut to be bought. */ function getAmountOut( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountIn ) external view returns (uint256 amountOut); /** * @notice Calculate amountIn of tokenIn needed for a given amountOut of tokenOut. * @param exchangeProvider the address of the exchange provider for the pair. * @param exchangeId The id of the exchange to use. * @param tokenIn The token to be sold. * @param tokenOut The token to be bought. * @param amountOut The amount of tokenOut to be bought. * @return amountIn The amount of tokenIn to be sold. */ function getAmountIn( address exchangeProvider, bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountOut ) external view returns (uint256 amountIn); /** * @notice Get the list of registered exchange providers. * @dev This can be used by UI or clients to discover all pairs. * @return exchangeProviders the addresses of all exchange providers. */ function getExchangeProviders() external view returns (address[] memory exchangeProviders); }
/lib/mento-core-2.2.0/contracts/interfaces/IBrokerAdmin.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; /* * @title Broker Admin Interface * @notice Contains admin functions to configure the broker that * should be only callable by the owner. */ interface IBrokerAdmin { /** * @notice Emitted when an ExchangeProvider is added. * @param exchangeProvider The address of the ExchangeProvider. */ event ExchangeProviderAdded(address indexed exchangeProvider); /** * @notice Emitted when an ExchangeProvider is removed. * @param exchangeProvider The address of the ExchangeProvider. */ event ExchangeProviderRemoved(address indexed exchangeProvider); /** * @notice Emitted when the reserve is updated. * @param newAddress The new address. * @param prevAddress The previous address. */ event ReserveSet(address indexed newAddress, address indexed prevAddress); /** * @notice Remove an ExchangeProvider at a specified index. * @param exchangeProvider The address of the ExchangeProvider to remove. * @param index The index in the exchange providers array. */ function removeExchangeProvider(address exchangeProvider, uint256 index) external; /** * @notice Add an ExchangeProvider. * @param exchangeProvider The address of the ExchangeProvider to add. * @return index The index where the ExchangeProvider was inserted. */ function addExchangeProvider(address exchangeProvider) external returns (uint256 index); /** * @notice Set the Mento reserve address. * @param reserve The Mento reserve address. */ function setReserve(address reserve) external; }
/lib/mento-core-2.2.0/contracts/interfaces/IExchangeProvider.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; pragma experimental ABIEncoderV2; /** * @title ExchangeProvider interface * @notice The IExchangeProvider interface is the interface that the Broker uses * to communicate with different exchange manager implementations like the BiPoolManager */ interface IExchangeProvider { /** * @notice Exchange - a struct that's used only by UIs (frontends/CLIs) * in order to discover what asset swaps are possible within an * exchange provider. * It's up to the specific exchange provider to convert its internal * representation to this universal struct. This conversion should * only happen in view calls used for discovery. * @param exchangeId The ID of the exchange, used to initiate swaps or get quotes. * @param assets An array of addresses of ERC20 tokens that can be swapped. */ struct Exchange { bytes32 exchangeId; address[] assets; } /** * @notice Get all exchanges supported by the ExchangeProvider. * @return exchanges An array of Exchange structs. */ function getExchanges() external view returns (Exchange[] memory exchanges); /** * @notice Execute a token swap with fixed amountIn * @param exchangeId The id of the exchange to use * @param tokenIn The token to be sold * @param tokenOut The token to be bought * @param amountIn The amount of tokenIn to be sold * @return amountOut The amount of tokenOut to be bought */ function swapIn( bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountIn ) external returns (uint256 amountOut); /** * @notice Execute a token swap with fixed amountOut * @param exchangeId The id of the exchange to use * @param tokenIn The token to be sold * @param tokenOut The token to be bought * @param amountOut The amount of tokenOut to be bought * @return amountIn The amount of tokenIn to be sold */ function swapOut( bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountOut ) external returns (uint256 amountIn); /** * @notice Calculate amountOut of tokenOut received for a given amountIn of tokenIn * @param exchangeId The id of the exchange to use * @param tokenIn The token to be sold * @param tokenOut The token to be bought * @param amountIn The amount of tokenIn to be sold * @return amountOut The amount of tokenOut to be bought */ function getAmountOut( bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountIn ) external view returns (uint256 amountOut); /** * @notice Calculate amountIn of tokenIn needed for a given amountOut of tokenOut * @param exchangeId The id of the exchange to use * @param tokenIn The token to be sold * @param tokenOut The token to be bought * @param amountOut The amount of tokenOut to be bought * @return amountIn The amount of tokenIn to be sold */ function getAmountIn( bytes32 exchangeId, address tokenIn, address tokenOut, uint256 amountOut ) external view returns (uint256 amountIn); }
/lib/mento-core-2.2.0/contracts/interfaces/IReserve.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; interface IReserve { function setTobinTaxStalenessThreshold(uint256) external; function addToken(address) external returns (bool); function removeToken(address, uint256) external returns (bool); function transferGold(address payable, uint256) external returns (bool); function transferExchangeGold(address payable, uint256) external returns (bool); function transferCollateralAsset( address collateralAsset, address payable to, uint256 value ) external returns (bool); function getReserveGoldBalance() external view returns (uint256); function getUnfrozenReserveGoldBalance() external view returns (uint256); function getOrComputeTobinTax() external returns (uint256, uint256); function getTokens() external view returns (address[] memory); function getReserveRatio() external view returns (uint256); function addExchangeSpender(address) external; function removeExchangeSpender(address, uint256) external; function addSpender(address) external; function removeSpender(address) external; function isStableAsset(address) external view returns (bool); function isCollateralAsset(address) external view returns (bool); function getDailySpendingRatioForCollateralAsset(address collateralAsset) external view returns (uint256); function isExchangeSpender(address exchange) external view returns (bool); function addCollateralAsset(address asset) external returns (bool); function transferExchangeCollateralAsset( address collateralAsset, address payable to, uint256 value ) external returns (bool); }
/lib/mento-core-2.2.0/contracts/interfaces/IStableTokenV2.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.5.17 <0.8.19; interface IStableTokenV2 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function mint(address, uint256) external returns (bool); function burn(uint256) external returns (bool); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @notice Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. * @param comment The transfer comment. * @return True if the transaction succeeds. */ function transferWithComment( address to, uint256 value, string calldata comment ) external returns (bool); /** * @notice Initializes a StableTokenV2. * It keeps the same signature as the original initialize() function * in legacy/StableToken.sol * @param _name The name of the stable token (English) * @param _symbol A short symbol identifying the token (e.g. "cUSD") * deprecated-param decimals Tokens are divisible to this many decimal places. * deprecated-param registryAddress Address of the Registry contract. * deprecated-param inflationRate Weekly inflation rate. * deprecated-param inflationFactorUpdatePeriod How often the inflation factor is updated, in seconds. * @param initialBalanceAddresses Array of addresses with an initial balance. * @param initialBalanceValues Array of balance values corresponding to initialBalanceAddresses. * deprecated-param exchangeIdentifier String identifier of exchange in registry (for specific fiat pairs) */ function initialize( string calldata _name, string calldata _symbol, uint8, // deprecated: decimals address, // deprecated: registryAddress, uint256, // deprecated: inflationRate, uint256, // deprecated: inflationFactorUpdatePeriod, address[] calldata initialBalanceAddresses, uint256[] calldata initialBalanceValues, string calldata // deprecated: exchangeIdentifier ) external; /** * @notice Initializes a StableTokenV2 contract * when upgrading from legacy/StableToken.sol. * It sets the addresses that were previously read from the Registry. * It runs the ERC20PermitUpgradeable initializer. * @dev This function is only callable once. * @param _broker The address of the Broker contract. * @param _validators The address of the Validators contract. * @param _exchange The address of the Exchange contract. */ function initializeV2( address _broker, address _validators, address _exchange ) external; /** * @notice Gets the address of the Broker contract. */ function broker() external returns (address); function debitGasFees(address from, uint256 value) external; function creditGasFees( address from, address feeRecipient, address gatewayFeeRecipient, address communityFund, uint256 refund, uint256 tipTxFee, uint256 gatewayFee, uint256 baseTxFee ) external; }
/lib/mento-core-2.2.0/contracts/libraries/TradingLimits.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; pragma experimental ABIEncoderV2; /** * @title TradingLimits * @author Mento Team * @notice This library provides data structs and utility functions for * defining and verifying trading limits on the netflow of an asset. * There are three limits that can be enabled: * - L0: A timewindow based limit, verifies that: * -1 * limit0 <= netflow0 <= limit0, * for a netflow0 that resets every timespan0 seconds. * - L1: A timewindow based limit, verifies that: * -1 * limit1 <= netflow1 <= limit1, * for a netflow1 that resets every timespan1 second. * - LG: A global (or lifetime) limit that ensures that: * -1 * limitGlobal <= netflowGlobal <= limitGlobal, * for a netflowGlobal that doesn't reset until the * limit is disabled. * @dev All contained functions are pure or view and marked internal to * be inlined on consuming contracts at compile time for gas efficiency. * Both State and Config structs are designed to be packed in one * storage slot each. * In order to pack both the state and config into one slot each, * some assumptions are made: * 1. limit{0,1,Global} and netflow{0,1,Global} are recorded with * ZERO decimals precision to fit in an int48. * Any subunit delta in netflow will be rounded up to one unit. * 2. netflow{0,1,Global} have to fit in int48, thus have to fit in the range: * -140_737_488_355_328 to 140_737_488_355_328, which can cover most * tokens of interest, but will break down for tokens which trade * in large unit values. * 3. timespan{0,1} and lastUpdated{0,1} have to fit in int32 therefore * the timestamps will overflow sometime in the year 2102. * * The library ensures that netflow0 and netflow1 are reset during * the update phase, but does not control how the full State gets * updated if the Config changes, this is left to the library consumer. */ library TradingLimits { uint8 private constant L0 = 1; // 0b001 Limit0 uint8 private constant L1 = 2; // 0b010 Limit1 uint8 private constant LG = 4; // 0b100 LimitGlobal int48 private constant MAX_INT48 = int48(uint48(-1) / 2); /** * @dev The State struct contains the current state of a trading limit config. * @param lastUpdated0 The timestamp of the last reset of netflow0. * @param lastUpdated1 The timestamp of the last reset of netflow1. * @param netflow0 The current netflow of the asset for limit0. * @param netflow1 The current netflow of the asset for limit1. * @param netflowGlobal The current netflow of the asset for limitGlobal. */ struct State { uint32 lastUpdated0; uint32 lastUpdated1; int48 netflow0; int48 netflow1; int48 netflowGlobal; } /** * @dev The Config struct contains the configuration of trading limits. * @param timestep0 The time window in seconds for limit0. * @param timestep1 The time window in seconds for limit1. * @param limit0 The limit0 for the asset. * @param limit1 The limit1 for the asset. * @param limitGlobal The global limit for the asset. * @param flags A bitfield of flags to enable/disable the individual limits. */ struct Config { uint32 timestep0; uint32 timestep1; int48 limit0; int48 limit1; int48 limitGlobal; uint8 flags; } /** * @notice Validate a trading limit configuration. * @dev Reverts if the configuration is malformed. * @param self the Config struct to check. */ function validate(Config memory self) internal pure { require(self.flags & L1 == 0 || self.flags & L0 != 0, "L1 without L0 not allowed"); require(self.flags & L0 == 0 || self.timestep0 > 0, "timestep0 can't be zero if active"); require(self.flags & L1 == 0 || self.timestep1 > 0, "timestep1 can't be zero if active"); require(self.flags & L0 == 0 || self.limit0 > 0, "limit0 can't be zero if active"); require(self.flags & L1 == 0 || self.limit1 > 0, "limit1 can't be zero if active"); require(self.flags & LG == 0 || self.limitGlobal > 0, "limitGlobal can't be zero if active"); require(self.flags & (L0 | L1) != 3 || self.limit0 < self.limit1, "limit1 must be greater than limit0"); require(self.flags & (L1 | LG) != 6 || self.limit1 < self.limitGlobal, "limitGlobal must be greater than limit1"); require(self.flags & (L0 | LG) != 5 || self.limit0 < self.limitGlobal, "limitGlobal must be greater than limit0"); } /** * @notice Verify a trading limit State with a provided Config. * @dev Reverts if the limits are exceeded. * @param self the trading limit State to check. * @param config the trading limit Config to check against. */ function verify(State memory self, Config memory config) internal pure { if ((config.flags & L0) > 0 && (-1 * config.limit0 > self.netflow0 || self.netflow0 > config.limit0)) { revert("L0 Exceeded"); } if ((config.flags & L1) > 0 && (-1 * config.limit1 > self.netflow1 || self.netflow1 > config.limit1)) { revert("L1 Exceeded"); } if ( (config.flags & LG) > 0 && (-1 * config.limitGlobal > self.netflowGlobal || self.netflowGlobal > config.limitGlobal) ) { revert("LG Exceeded"); } } /** * @notice Reset an existing state with a new config. * It keps netflows of enabled limits and resets when disabled. * It resets all timestamp checkpoints to reset time-window limits * on next swap. * @param self the trading limit state to reset. * @param config the updated config to reset against. * @return the reset state. */ function reset(State memory self, Config memory config) internal pure returns (State memory) { // Ensure the next swap will reset the trading limits windows. self.lastUpdated0 = 0; self.lastUpdated1 = 0; if (config.flags & L0 == 0) { self.netflow0 = 0; } if (config.flags & L1 == 0) { self.netflow1 = 0; } if (config.flags & LG == 0) { self.netflowGlobal = 0; } return self; } /** * @notice Updates a trading limit State in the context of a Config with the deltaFlow provided. * @dev Reverts if the values provided cause overflows. * @param self the trading limit State to update. * @param config the trading limit Config for the provided State. * @param _deltaFlow the delta flow to add to the netflow. * @param decimals the number of decimals the _deltaFlow is denominated in. * @return State the updated state. */ function update( State memory self, Config memory config, int256 _deltaFlow, uint8 decimals ) internal view returns (State memory) { int256 _deltaFlowUnits = _deltaFlow / int256((10**uint256(decimals))); require(_deltaFlowUnits <= MAX_INT48, "dFlow too large"); int48 deltaFlowUnits = _deltaFlowUnits == 0 ? 1 : int48(_deltaFlowUnits); if (config.flags & L0 > 0) { if (block.timestamp > self.lastUpdated0 + config.timestep0) { self.netflow0 = 0; self.lastUpdated0 = uint32(block.timestamp); } self.netflow0 = safeINT48Add(self.netflow0, deltaFlowUnits); if (config.flags & L1 > 0) { if (block.timestamp > self.lastUpdated1 + config.timestep1) { self.netflow1 = 0; self.lastUpdated1 = uint32(block.timestamp); } self.netflow1 = safeINT48Add(self.netflow1, deltaFlowUnits); } } if (config.flags & LG > 0) { self.netflowGlobal = safeINT48Add(self.netflowGlobal, deltaFlowUnits); } return self; } /** * @notice Safe add two int48s. * @dev Reverts if addition causes over/underflow. * @param a number to add. * @param b number to add. * @return int48 result of addition. */ function safeINT48Add(int48 a, int48 b) internal pure returns (int48) { int256 c = int256(a) + int256(b); require(c >= -1 * MAX_INT48 && c <= MAX_INT48, "int48 addition overflow"); return int48(c); } }
Compiler Settings
{"remappings":[":celo-foundry/=lib/celo-foundry/src/",":contracts/=contracts/",":ds-test/=lib/celo-foundry/lib/forge-std/lib/ds-test/src/",":forge-std-next/=lib/mento-core-2.2.0/lib/forge-std-next/src/",":forge-std/=lib/celo-foundry/lib/forge-std/src/",":mento-core-2.0.0/=lib/mento-core-2.0.0/contracts/",":mento-core-2.1.0/=lib/mento-core-2.1.0/contracts/",":mento-core-2.2.0/=lib/mento-core-2.2.0/contracts/",":openzeppelin-contracts-next/=lib/mento-core-2.2.0/lib/openzeppelin-contracts-next/",":openzeppelin-contracts-upgradeable/=lib/mento-core-2.2.0/lib/openzeppelin-contracts-upgradeable/",":openzeppelin-contracts/=lib/mento-core-2.0.0/lib/openzeppelin-contracts/contracts/",":openzeppelin-solidity/=lib/mento-core-2.0.0/lib/openzeppelin-contracts/",":test/=lib/mento-core-2.0.0/test/"],"optimizer":{"runs":10000,"enabled":true},"libraries":{"AddressSortedLinkedListWithMedian":"0xed477a99035d0c1e11369f1d7a4e587893cc002b","AddressLinkedList":"0x6200f54d73491d56b8d7a975c9ee18efb4d518df"},"compilationTarget":{"lib/mento-core-2.2.0/contracts/swap/Broker.sol":"Broker"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"bool","name":"test","internalType":"bool"}]},{"type":"event","name":"ExchangeProviderAdded","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"ExchangeProviderRemoved","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"ReserveSet","inputs":[{"type":"address","name":"newAddress","internalType":"address","indexed":true},{"type":"address","name":"prevAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Swap","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address","indexed":false},{"type":"bytes32","name":"exchangeId","internalType":"bytes32","indexed":true},{"type":"address","name":"trader","internalType":"address","indexed":true},{"type":"address","name":"tokenIn","internalType":"address","indexed":true},{"type":"address","name":"tokenOut","internalType":"address","indexed":false},{"type":"uint256","name":"amountIn","internalType":"uint256","indexed":false},{"type":"uint256","name":"amountOut","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TradingLimitConfigured","inputs":[{"type":"bytes32","name":"exchangeId","internalType":"bytes32","indexed":false},{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"tuple","name":"config","internalType":"struct TradingLimits.Config","indexed":false,"components":[{"type":"uint32","name":"timestep0","internalType":"uint32"},{"type":"uint32","name":"timestep1","internalType":"uint32"},{"type":"int48","name":"limit0","internalType":"int48"},{"type":"int48","name":"limit1","internalType":"int48"},{"type":"int48","name":"limitGlobal","internalType":"int48"},{"type":"uint8","name":"flags","internalType":"uint8"}]}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"index","internalType":"uint256"}],"name":"addExchangeProvider","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"burnStableTokens","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","name":"configureTradingLimit","inputs":[{"type":"bytes32","name":"exchangeId","internalType":"bytes32"},{"type":"address","name":"token","internalType":"address"},{"type":"tuple","name":"config","internalType":"struct TradingLimits.Config","components":[{"type":"uint32","name":"timestep0","internalType":"uint32"},{"type":"uint32","name":"timestep1","internalType":"uint32"},{"type":"int48","name":"limit0","internalType":"int48"},{"type":"int48","name":"limit1","internalType":"int48"},{"type":"int48","name":"limitGlobal","internalType":"int48"},{"type":"uint8","name":"flags","internalType":"uint8"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"exchangeProviders","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"getAmountIn","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address"},{"type":"bytes32","name":"exchangeId","internalType":"bytes32"},{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountOut","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"getAmountOut","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address"},{"type":"bytes32","name":"exchangeId","internalType":"bytes32"},{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getExchangeProviders","inputs":[]},{"type":"function","stateMutability":"nonpayable","name":"initialize","inputs":[{"type":"address[]","name":"_exchangeProviders","internalType":"address[]"},{"type":"address","name":"_reserve","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExchangeProvider","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","name":"removeExchangeProvider","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IReserve"}],"name":"reserve","inputs":[]},{"type":"function","stateMutability":"nonpayable","name":"setReserve","inputs":[{"type":"address","name":"_reserve","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"swapIn","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address"},{"type":"bytes32","name":"exchangeId","internalType":"bytes32"},{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"swapOut","inputs":[{"type":"address","name":"exchangeProvider","internalType":"address"},{"type":"bytes32","name":"exchangeId","internalType":"bytes32"},{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"timestep0","internalType":"uint32"},{"type":"uint32","name":"timestep1","internalType":"uint32"},{"type":"int48","name":"limit0","internalType":"int48"},{"type":"int48","name":"limit1","internalType":"int48"},{"type":"int48","name":"limitGlobal","internalType":"int48"},{"type":"uint8","name":"flags","internalType":"uint8"}],"name":"tradingLimitsConfig","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"lastUpdated0","internalType":"uint32"},{"type":"uint32","name":"lastUpdated1","internalType":"uint32"},{"type":"int48","name":"netflow0","internalType":"int48"},{"type":"int48","name":"netflow1","internalType":"int48"},{"type":"int48","name":"netflowGlobal","internalType":"int48"}],"name":"tradingLimitsState","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b5060405162003ba238038062003ba28339810160408190526200003491620000d3565b808062000049576000805460ff191660011790555b5060006200005f6001600160e01b03620000bc16565b60008054610100600160a81b0319166101006001600160a01b038416908102919091178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35050600180556200011b565b3390565b8051620000cd8162000101565b92915050565b600060208284031215620000e657600080fd5b6000620000f48484620000c0565b949350505050565b151590565b6200010c81620000fc565b81146200011857600080fd5b50565b613a77806200012b6000396000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80638f32d59b116100d8578063cd3293de1161008c578063ddbbe85011610066578063ddbbe850146102ee578063f01ecd1714610301578063f2fde38b1461032557610177565b8063cd3293de146102b3578063d163b135146102c8578063d1d786b1146102db57610177565b8063a20f2305116100bd578063a20f23051461027a578063a9b5aab31461028d578063c4454fdc146102a057610177565b80638f32d59b1461025f5780639cecc80a1461026757610177565b8063462d0b2e1161012f57806373ec4cf41161011457806373ec4cf414610212578063821a816c146102255780638da5cb5b1461024a57610177565b8063462d0b2e146101f7578063715018a61461020a57610177565b8063131cab2a11610160578063131cab2a146101ba578063158ef93e146101da5780632cac2568146101e257610177565b806304710d531461017c57806304e4564014610191575b600080fd5b61018f61018a36600461283f565b610338565b005b6101a461019f366004612743565b6104ef565b6040516101b19190613870565b60405180910390f35b6101cd6101c836600461283f565b6105cc565b6040516101b191906135c2565b6101cd61075a565b6101ea610763565b6040516101b191906135b1565b61018f610205366004612879565b6107c5565b61018f610863565b6101a4610220366004612725565b6108ed565b6102386102333660046128ec565b610a48565b6040516101b1969594939291906138c0565b610252610ad3565b6040516101b19190613522565b6101cd610ae7565b61018f610275366004612725565b610b10565b6101a4610288366004612743565b610bcf565b61018f61029b36600461290a565b610c52565b6102526102ae3660046128ec565b611008565b6102bb61102f565b6040516101b19190613621565b6101a46102d63660046127b8565b61103e565b6101cd6102e9366004612725565b6111e3565b6101a46102fc3660046127b8565b6111f8565b61031461030f3660046128ec565b611369565b6040516101b195949392919061387e565b61018f610333366004612725565b6113d2565b610340610ae7565b6103655760405162461bcd60e51b815260040161035c90613750565b60405180910390fd5b816001600160a01b03166002828154811061037c57fe5b6000918252602090912001546001600160a01b0316146103ae5760405162461bcd60e51b815260040161035c906136c0565b600280546103c390600163ffffffff61140216565b815481106103cd57fe5b600091825260209091200154600280546001600160a01b0390921691839081106103f357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600280548061042c57fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690559092019092556001600160a01b0384168083526003909152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555190917f29e92ab2e30f4f74283034c28c451b6faac986b554f1808101eb6418bdba19d491a25050565b6001600160a01b03851660009081526003602052604081205460ff166105275760405162461bcd60e51b815260040161035c90613720565b6040517ff670dde10000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063f670dde1906105729088908890889088906004016135d0565b60206040518083038186803b15801561058a57600080fd5b505afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105c2919081019061294e565b9695505050505050565b6006546040517f4f8e6e230000000000000000000000000000000000000000000000000000000081526000916001600160a01b031690634f8e6e2390610616908690600401613522565b60206040518083038186803b15801561062e57600080fd5b505afa158015610642573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061066691908101906128ce565b6106825760405162461bcd60e51b815260040161035c906136f0565b61069d6001600160a01b03841633308563ffffffff61144b16565b6040517f42966c680000000000000000000000000000000000000000000000000000000081526001600160a01b038416906342966c68906106e2908590600401613870565b602060405180830381600087803b1580156106fc57600080fd5b505af1158015610710573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061073491908101906128ce565b6107505760405162461bcd60e51b815260040161035c90613790565b5060015b92915050565b60005460ff1681565b606060028054806020026020016040519081016040528092919081815260200182805480156107bb57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161079d575b5050505050905090565b60005460ff16156107e85760405162461bcd60e51b815260040161035c90613650565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561081c33611510565b60005b828110156108545761084b84848381811061083657fe5b90506020020160206102209190810190612725565b5060010161081f565b5061085e81610b10565b505050565b61086b610ae7565b6108875760405162461bcd60e51b815260040161035c90613750565b600080546040516101009091046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff169055565b60006108f7610ae7565b6109135760405162461bcd60e51b815260040161035c90613750565b6001600160a01b03821660009081526003602052604090205460ff161561094c5760405162461bcd60e51b815260040161035c90613640565b6001600160a01b0382166109725760405162461bcd60e51b815260040161035c90613740565b6002805460018082019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03851690811790915560008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909417909355915190917f2ee2cb0721ec60b86190cae5c48e25064b69b35abad32452a4ec99d232033de291a260025461075490600163ffffffff61140216565b60056020819052600091825260409091205463ffffffff80821692640100000000830490911691680100000000000000008104820b916e0100000000000000000000000000008204810b9174010000000000000000000000000000000000000000810490910b907a010000000000000000000000000000000000000000000000000000900460ff1686565b60005461010090046001600160a01b031690565b6000805461010090046001600160a01b0316610b016115b3565b6001600160a01b031614905090565b610b18610ae7565b610b345760405162461bcd60e51b815260040161035c90613750565b6001600160a01b038116610b5a5760405162461bcd60e51b815260040161035c90613820565b6006546040516001600160a01b03918216918316907fb69e1c416d8be92ac92c8e97e77c4626fba5e6ab50161099f659ea3303479e5090600090a3600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b03851660009081526003602052604081205460ff16610c075760405162461bcd60e51b815260040161035c90613720565b6040517f93c7e3bc0000000000000000000000000000000000000000000000000000000081526001600160a01b038716906393c7e3bc906105729088908890889088906004016135d0565b610c5a610ae7565b610c765760405162461bcd60e51b815260040161035c90613750565b610c7f816115b7565b6000826001600160a01b031660001b84189050816005600083815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a81548165ffffffffffff021916908360050b65ffffffffffff160217905550606082015181600001600e6101000a81548165ffffffffffff021916908360050b65ffffffffffff16021790555060808201518160000160146101000a81548165ffffffffffff021916908360050b65ffffffffffff16021790555060a082015181600001601a6101000a81548160ff021916908360ff160217905550905050610e7582600460008481526020019081526020016000206040518060a00160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160089054906101000a900460050b60050b60050b815260200160008201600e9054906101000a900460050b60050b60050b81526020016000820160149054906101000a900460050b60050b60050b815250506117c290919063ffffffff16565b6000828152600460209081526040918290208351815492850151858501516060870151608090970151600590810b65ffffffffffff90811674010000000000000000000000000000000000000000027fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff99830b82166e010000000000000000000000000000027fffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffff9490930b90911668010000000000000000027fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff63ffffffff958616640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff969097167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000909916989098179490941694909417959095169190911716929092179390931617909155517f1a082a1efaf1549c18917ddcb1f759680c29371609e24f4b946e93acf4ce5ad290610ffa908690869086906135f8565b60405180910390a150505050565b6002818154811061101557fe5b6000918252602090912001546001600160a01b0316905081565b6006546001600160a01b031681565b600180548101908190556001600160a01b03871660009081526003602052604081205490919060ff166110835760405162461bcd60e51b815260040161035c90613720565b6040517fd3385d050000000000000000000000000000000000000000000000000000000081526001600160a01b0389169063d3385d05906110ce908a908a908a908a906004016135d0565b602060405180830381600087803b1580156110e857600080fd5b505af11580156110fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611120919081019061294e565b9150828211156111425760405162461bcd60e51b815260040161035c906136a0565b61114f8787848888611817565b61115a3387846118ea565b611165338686611b33565b856001600160a01b0316336001600160a01b0316887fe7b046415cac9de47940c3087e06db13a0e058ccf53ac5f0edd49ebb4c2c3a6f8b89878a6040516111af9493929190613573565b60405180910390a460015481146111d85760405162461bcd60e51b815260040161035c90613710565b509695505050505050565b60036020526000908152604090205460ff1681565b600180548101908190556001600160a01b03871660009081526003602052604081205490919060ff1661123d5760405162461bcd60e51b815260040161035c90613720565b6040517f42bfc99c0000000000000000000000000000000000000000000000000000000081526001600160a01b038916906342bfc99c90611288908a908a908a908a906004016135d0565b602060405180830381600087803b1580156112a257600080fd5b505af11580156112b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112da919081019061294e565b9150828210156112fc5760405162461bcd60e51b815260040161035c906137d0565b6113098787868886611817565b6113143387866118ea565b61131f338684611b33565b856001600160a01b0316336001600160a01b0316887fe7b046415cac9de47940c3087e06db13a0e058ccf53ac5f0edd49ebb4c2c3a6f8b8989886040516111af9493929190613573565b60046020526000908152604090205463ffffffff80821691640100000000810490911690680100000000000000008104600590810b916e0100000000000000000000000000008104820b9174010000000000000000000000000000000000000000909104900b85565b6113da610ae7565b6113f65760405162461bcd60e51b815260040161035c90613750565b6113ff81611510565b50565b600061144483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ddf565b9392505050565b60405161150a9085907f23b872dd00000000000000000000000000000000000000000000000000000000906114889087908790879060240161354b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611e0b565b50505050565b6001600160a01b0381166115365760405162461bcd60e51b815260040161035c90613670565b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b3390565b60a081015160021615806115d1575060a081015160011615155b6115ed5760405162461bcd60e51b815260040161035c906136b0565b60a081015160011615806116075750805163ffffffff1615155b6116235760405162461bcd60e51b815260040161035c90613730565b60a0810151600216158061164157506000816020015163ffffffff16115b61165d5760405162461bcd60e51b815260040161035c906136e0565b60a0810151600116158061167857506000816040015160050b135b6116945760405162461bcd60e51b815260040161035c90613770565b60a081015160021615806116af57506000816060015160050b135b6116cb5760405162461bcd60e51b815260040161035c90613660565b60a081015160041615806116e657506000816080015160050b135b6117025760405162461bcd60e51b815260040161035c90613800565b60a081015160039081161415806117265750806060015160050b816040015160050b125b6117425760405162461bcd60e51b815260040161035c90613760565b60a081015160069081161415806117665750806080015160050b816060015160050b125b6117825760405162461bcd60e51b815260040161035c906137a0565b60a081015160059081161415806117a65750806080015160050b816040015160050b125b6113ff5760405162461bcd60e51b815260040161035c90613680565b6117ca61258a565b6000808452602084015260a08201516001166117e857600060408401525b60a08201516002166117fc57600060608401525b60a082015160041661181057600060808401525b5090919050565b6001600160a01b038481169083167f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8511156118655760405162461bcd60e51b815260040161035c90613780565b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156118a55760405162461bcd60e51b815260040161035c906137b0565b6118b28288188688611ef0565b6118e1818818847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0286611ef0565b50505050505050565b6006546040517f4f8e6e230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634f8e6e2390611933908590600401613522565b60206040518083038186803b15801561194b57600080fd5b505afa15801561195f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061198391908101906128ce565b15611a5b576119a36001600160a01b03831684308463ffffffff61144b16565b6040517f42966c680000000000000000000000000000000000000000000000000000000081526001600160a01b038316906342966c68906119e8908490600401613870565b602060405180830381600087803b158015611a0257600080fd5b505af1158015611a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a3a91908101906128ce565b611a565760405162461bcd60e51b815260040161035c90613790565b61085e565b6006546040517fcae182fe0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063cae182fe90611aa4908590600401613522565b60206040518083038186803b158015611abc57600080fd5b505afa158015611ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611af491908101906128ce565b15611b1b57600654611a56906001600160a01b03848116918691168463ffffffff61144b16565b60405162461bcd60e51b815260040161035c90613840565b6006546040517f4f8e6e230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634f8e6e2390611b7c908590600401613522565b60206040518083038186803b158015611b9457600080fd5b505afa158015611ba8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bcc91908101906128ce565b15611c86576040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b038316906340c10f1990611c189086908590600401613530565b602060405180830381600087803b158015611c3257600080fd5b505af1158015611c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c6a91908101906128ce565b611a565760405162461bcd60e51b815260040161035c90613810565b6006546040517fcae182fe0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063cae182fe90611ccf908590600401613522565b60206040518083038186803b158015611ce757600080fd5b505afa158015611cfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d1f91908101906128ce565b15611b1b576006546040517f6be383fc0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690636be383fc90611d719085908790869060040161354b565b602060405180830381600087803b158015611d8b57600080fd5b505af1158015611d9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dc391908101906128ce565b611a565760405162461bcd60e51b815260040161035c90613850565b60008184841115611e035760405162461bcd60e51b815260040161035c919061362f565b505050900390565b611e1d826001600160a01b031661225a565b611e395760405162461bcd60e51b815260040161035c90613860565b60006060836001600160a01b031683604051611e559190613516565b6000604051808303816000865af19150503d8060008114611e92576040519150601f19603f3d011682016040523d82523d6000602084013e611e97565b606091505b509150915081611eb95760405162461bcd60e51b815260040161035c906136d0565b80511561150a5780806020019051611ed491908101906128ce565b61150a5760405162461bcd60e51b815260040161035c90613830565b611ef86125b8565b50600083815260056020818152604092839020835160c081018552905463ffffffff808216835264010000000082041692820192909252680100000000000000008204830b830b830b938101939093526e0100000000000000000000000000008104820b820b820b6060840152740100000000000000000000000000000000000000008104820b820b90910b60808301527a010000000000000000000000000000000000000000000000000000900460ff1660a082018190521561150a57611fbe61258a565b50600084815260046020818152604092839020835160a081018552905463ffffffff808216835264010000000082041682840152680100000000000000008104600590810b810b810b838701526e0100000000000000000000000000008204810b810b810b606084015274010000000000000000000000000000000000000000909104810b810b900b608082015283517f313ce567000000000000000000000000000000000000000000000000000000008152935190936120ef93869389936001600160a01b038a169363313ce56793818101939291829003018186803b1580156120a857600080fd5b505afa1580156120bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506120e0919081019061296c565b8492919063ffffffff61229616565b9050612101818363ffffffff6123bd16565b60009485526004602090815260409586902082518154928401519784015160608501516080909501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000090941663ffffffff928316177fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff166401000000009290991691909102979097177fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff1668010000000000000000600598890b65ffffffffffff90811691909102919091177fffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffff166e01000000000000000000000000000094890b821694909402939093177fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000009290970b929092160294909417909355505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061228e57508115155b949350505050565b61229e61258a565b60008260ff16600a0a84816122af57fe5b059050657fffffffffff8113156122d85760405162461bcd60e51b815260040161035c906137e0565b600081156122e657816122e9565b60015b60a08701519091506001161561238a57855187510163ffffffff1642111561231c576000604088015263ffffffff421687525b61232a87604001518261252c565b600590810b900b604088015260a08601516002161561238a57856020015187602001510163ffffffff1642111561236f576000606088015263ffffffff421660208801525b61237d87606001518261252c565b600590810b900b60608801525b60a0860151600416156123b2576123a587608001518261252c565b600590810b900b60808801525b509495945050505050565b60a0810151600116158015906124195750816040015160050b81604001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0260050b13806124195750806040015160050b826040015160050b135b156124365760405162461bcd60e51b815260040161035c906137c0565b60a0810151600216158015906124925750816060015160050b81606001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0260050b13806124925750806060015160050b826060015160050b135b156124af5760405162461bcd60e51b815260040161035c90613700565b60a08101516004161580159061250b5750816080015160050b81608001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0260050b138061250b5750806080015160050b826080015160050b135b156125285760405162461bcd60e51b815260040161035c906137f0565b5050565b6000600582810b9084900b017fffffffffffffffffffffffffffffffffffffffffffffffffffff800000000001811280159061256e5750657fffffffffff8113155b6114445760405162461bcd60e51b815260040161035c90613690565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035610754816139f3565b60008083601f84011261260a57600080fd5b50813567ffffffffffffffff81111561262257600080fd5b60208301915083602082028301111561263a57600080fd5b9250929050565b805161075481613a07565b803561075481613a10565b803561075481613a19565b600060c0828403121561267457600080fd5b61267e60c061391a565b9050600061268c8484612704565b825250602061269d84848301612704565b60208301525060406126b184828501612657565b60408301525060606126c584828501612657565b60608301525060806126d984828501612657565b60808301525060a06126ed8482850161270f565b60a08301525092915050565b805161075481613a10565b803561075481613a22565b803561075481613a2b565b805161075481613a2b565b60006020828403121561273757600080fd5b600061228e84846125ed565b600080600080600060a0868803121561275b57600080fd5b600061276788886125ed565b95505060206127788882890161264c565b9450506040612789888289016125ed565b935050606061279a888289016125ed565b92505060806127ab8882890161264c565b9150509295509295909350565b60008060008060008060c087890312156127d157600080fd5b60006127dd89896125ed565b96505060206127ee89828a0161264c565b95505060406127ff89828a016125ed565b945050606061281089828a016125ed565b935050608061282189828a0161264c565b92505060a061283289828a0161264c565b9150509295509295509295565b6000806040838503121561285257600080fd5b600061285e85856125ed565b925050602061286f8582860161264c565b9150509250929050565b60008060006040848603121561288e57600080fd5b833567ffffffffffffffff8111156128a557600080fd5b6128b1868287016125f8565b935093505060206128c4868287016125ed565b9150509250925092565b6000602082840312156128e057600080fd5b600061228e8484612641565b6000602082840312156128fe57600080fd5b600061228e848461264c565b6000806000610100848603121561292057600080fd5b600061292c868661264c565b935050602061293d868287016125ed565b92505060406128c486828701612662565b60006020828403121561296057600080fd5b600061228e84846126f9565b60006020828403121561297e57600080fd5b600061228e848461271a565b600061299683836129ad565b505060200190565b6129a78161398d565b82525050565b6129a781613959565b60006129c182613947565b6129cb818561394b565b93506129d683613941565b8060005b838110156123b25781516129ee888261298a565b97506129f983613941565b9250506001016129da565b6129a781613964565b6129a781613969565b6000612a2182613947565b612a2b8185613954565b9350612a3b81856020860161399f565b9290920192915050565b6129a781613994565b6129a78161396c565b6000612a6282613947565b612a6c818561394b565b9350612a7c81856020860161399f565b612a85816139cb565b9093019392505050565b6000612a9c602b8361394b565b7f45786368616e676550726f766964657220616c7265616479206578697374732081527f696e20746865206c697374000000000000000000000000000000000000000000602082015260400192915050565b6000612afb601c8361394b565b7f636f6e747261637420616c726561647920696e697469616c697a656400000000815260200192915050565b6000612b34601e8361394b565b7f6c696d6974312063616e2774206265207a65726f206966206163746976650000815260200192915050565b6000612b6d60268361394b565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612bcc60278361394b565b7f6c696d6974476c6f62616c206d7573742062652067726561746572207468616e81527f206c696d69743000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612c2b60178361394b565b7f696e743438206164646974696f6e206f766572666c6f77000000000000000000815260200192915050565b6000612c6460148361394b565b7f616d6f756e74496e4d6178206578636565646564000000000000000000000000815260200192915050565b6000612c9d60198361394b565b7f4c3120776974686f7574204c30206e6f7420616c6c6f77656400000000000000815260200192915050565b6000612cd6601c8361394b565b7f696e64657820646f65736e2774206d617463682070726f766964657200000000815260200192915050565b6000612d0f60208361394b565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000612d4860218361394b565b7f74696d6573746570312063616e2774206265207a65726f20696620616374697681527f6500000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612da760248361394b565b7f546f6b656e206d7573742062652061207265736572766520737461626c65206181527f7373657400000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612e06600b8361394b565b7f4c31204578636565646564000000000000000000000000000000000000000000815260200192915050565b6000612e3f600e8361394b565b7f7265656e7472616e742063616c6c000000000000000000000000000000000000815260200192915050565b6000612e78601f8361394b565b7f45786368616e676550726f766964657220646f6573206e6f7420657869737400815260200192915050565b6000612eb160218361394b565b7f74696d6573746570302063616e2774206265207a65726f20696620616374697681527f6500000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612f1060238361394b565b7f45786368616e676550726f766964657220616464726573732063616e2774206281527f6520300000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612f6f60208361394b565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000612fa860228361394b565b7f6c696d697431206d7573742062652067726561746572207468616e206c696d6981527f7430000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000613007601e8361394b565b7f6c696d6974302063616e2774206265207a65726f206966206163746976650000815260200192915050565b600061304060128361394b565b7f616d6f756e74496e20746f6f206c617267650000000000000000000000000000815260200192915050565b600061307960228361394b565b7f4275726e696e67206f662074686520737461626c65206173736574206661696c81527f6564000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006130d860278361394b565b7f6c696d6974476c6f62616c206d7573742062652067726561746572207468616e81527f206c696d69743100000000000000000000000000000000000000000000000000602082015260400192915050565b600061313760138361394b565b7f616d6f756e744f757420746f6f206c6172676500000000000000000000000000815260200192915050565b6000613170600b8361394b565b7f4c30204578636565646564000000000000000000000000000000000000000000815260200192915050565b60006131a960148361394b565b7f616d6f756e744f75744d696e206e6f74206d6574000000000000000000000000815260200192915050565b60006131e2600f8361394b565b7f64466c6f7720746f6f206c617267650000000000000000000000000000000000815260200192915050565b600061321b600b8361394b565b7f4c47204578636565646564000000000000000000000000000000000000000000815260200192915050565b600061325460238361394b565b7f6c696d6974476c6f62616c2063616e2774206265207a65726f2069662061637481527f6976650000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006132b360228361394b565b7f4d696e74696e67206f662074686520737461626c65206173736574206661696c81527f6564000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000613312601b8361394b565b7f526573657276652061646472657373206d757374206265207365740000000000815260200192915050565b600061334b602a8361394b565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e81527f6f74207375636365656400000000000000000000000000000000000000000000602082015260400192915050565b60006133aa60298361394b565b7f546f6b656e206d75737420626520737461626c65206f7220636f6c6c6174657281527f616c206173736572740000000000000000000000000000000000000000000000602082015260400192915050565b600061340960278361394b565b7f5472616e73666572206f662074686520636f6c6c61746572616c20617373657481527f206661696c656400000000000000000000000000000000000000000000000000602082015260400192915050565b6000613468601f8361394b565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b805160c08301906134a58482613504565b5060208201516134b86020850182613504565b5060408201516134cb6040850182612a4e565b5060608201516134de6060850182612a4e565b5060808201516134f16080850182612a4e565b5060a082015161150a60a085018261350d565b6129a78161397e565b6129a781613987565b60006114448284612a16565b6020810161075482846129ad565b6040810161353e828561299e565b6114446020830184612a0d565b6060810161355982866129ad565b61356660208301856129ad565b61228e6040830184612a0d565b6080810161358182876129ad565b61358e60208301866129ad565b61359b6040830185612a0d565b6135a86060830184612a0d565b95945050505050565b6020808252810161144481846129b6565b602081016107548284612a04565b608081016135de8287612a0d565b6135eb60208301866129ad565b61359b60408301856129ad565b61010081016136078286612a0d565b61361460208301856129ad565b61228e6040830184613494565b602081016107548284612a45565b602080825281016114448184612a57565b6020808252810161075481612a8f565b6020808252810161075481612aee565b6020808252810161075481612b27565b6020808252810161075481612b60565b6020808252810161075481612bbf565b6020808252810161075481612c1e565b6020808252810161075481612c57565b6020808252810161075481612c90565b6020808252810161075481612cc9565b6020808252810161075481612d02565b6020808252810161075481612d3b565b6020808252810161075481612d9a565b6020808252810161075481612df9565b6020808252810161075481612e32565b6020808252810161075481612e6b565b6020808252810161075481612ea4565b6020808252810161075481612f03565b6020808252810161075481612f62565b6020808252810161075481612f9b565b6020808252810161075481612ffa565b6020808252810161075481613033565b602080825281016107548161306c565b60208082528101610754816130cb565b602080825281016107548161312a565b6020808252810161075481613163565b602080825281016107548161319c565b60208082528101610754816131d5565b602080825281016107548161320e565b6020808252810161075481613247565b60208082528101610754816132a6565b6020808252810161075481613305565b602080825281016107548161333e565b602080825281016107548161339d565b60208082528101610754816133fc565b602080825281016107548161345b565b602081016107548284612a0d565b60a0810161388c8288613504565b6138996020830187613504565b6138a66040830186612a4e565b6138b36060830185612a4e565b6105c26080830184612a4e565b60c081016138ce8289613504565b6138db6020830188613504565b6138e86040830187612a4e565b6138f56060830186612a4e565b6139026080830185612a4e565b61390f60a083018461350d565b979650505050505050565b60405181810167ffffffffffffffff8111828210171561393957600080fd5b604052919050565b60200190565b5190565b90815260200190565b919050565b600061075482613972565b151590565b90565b60050b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6000610754825b600061075482613959565b60005b838110156139ba5781810151838201526020016139a2565b8381111561150a5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b6139fc81613959565b81146113ff57600080fd5b6139fc81613964565b6139fc81613969565b6139fc8161396c565b6139fc8161397e565b6139fc8161398756fea365627a7a7231582009020e48eeea2b6a9d3dd2ecbfafc07fe7dbcfed935c640b6497d70f64ca262e6c6578706572696d656e74616cf564736f6c634300051100400000000000000000000000000000000000000000000000000000000000000000
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101775760003560e01c80638f32d59b116100d8578063cd3293de1161008c578063ddbbe85011610066578063ddbbe850146102ee578063f01ecd1714610301578063f2fde38b1461032557610177565b8063cd3293de146102b3578063d163b135146102c8578063d1d786b1146102db57610177565b8063a20f2305116100bd578063a20f23051461027a578063a9b5aab31461028d578063c4454fdc146102a057610177565b80638f32d59b1461025f5780639cecc80a1461026757610177565b8063462d0b2e1161012f57806373ec4cf41161011457806373ec4cf414610212578063821a816c146102255780638da5cb5b1461024a57610177565b8063462d0b2e146101f7578063715018a61461020a57610177565b8063131cab2a11610160578063131cab2a146101ba578063158ef93e146101da5780632cac2568146101e257610177565b806304710d531461017c57806304e4564014610191575b600080fd5b61018f61018a36600461283f565b610338565b005b6101a461019f366004612743565b6104ef565b6040516101b19190613870565b60405180910390f35b6101cd6101c836600461283f565b6105cc565b6040516101b191906135c2565b6101cd61075a565b6101ea610763565b6040516101b191906135b1565b61018f610205366004612879565b6107c5565b61018f610863565b6101a4610220366004612725565b6108ed565b6102386102333660046128ec565b610a48565b6040516101b1969594939291906138c0565b610252610ad3565b6040516101b19190613522565b6101cd610ae7565b61018f610275366004612725565b610b10565b6101a4610288366004612743565b610bcf565b61018f61029b36600461290a565b610c52565b6102526102ae3660046128ec565b611008565b6102bb61102f565b6040516101b19190613621565b6101a46102d63660046127b8565b61103e565b6101cd6102e9366004612725565b6111e3565b6101a46102fc3660046127b8565b6111f8565b61031461030f3660046128ec565b611369565b6040516101b195949392919061387e565b61018f610333366004612725565b6113d2565b610340610ae7565b6103655760405162461bcd60e51b815260040161035c90613750565b60405180910390fd5b816001600160a01b03166002828154811061037c57fe5b6000918252602090912001546001600160a01b0316146103ae5760405162461bcd60e51b815260040161035c906136c0565b600280546103c390600163ffffffff61140216565b815481106103cd57fe5b600091825260209091200154600280546001600160a01b0390921691839081106103f357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600280548061042c57fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690559092019092556001600160a01b0384168083526003909152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555190917f29e92ab2e30f4f74283034c28c451b6faac986b554f1808101eb6418bdba19d491a25050565b6001600160a01b03851660009081526003602052604081205460ff166105275760405162461bcd60e51b815260040161035c90613720565b6040517ff670dde10000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063f670dde1906105729088908890889088906004016135d0565b60206040518083038186803b15801561058a57600080fd5b505afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105c2919081019061294e565b9695505050505050565b6006546040517f4f8e6e230000000000000000000000000000000000000000000000000000000081526000916001600160a01b031690634f8e6e2390610616908690600401613522565b60206040518083038186803b15801561062e57600080fd5b505afa158015610642573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061066691908101906128ce565b6106825760405162461bcd60e51b815260040161035c906136f0565b61069d6001600160a01b03841633308563ffffffff61144b16565b6040517f42966c680000000000000000000000000000000000000000000000000000000081526001600160a01b038416906342966c68906106e2908590600401613870565b602060405180830381600087803b1580156106fc57600080fd5b505af1158015610710573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061073491908101906128ce565b6107505760405162461bcd60e51b815260040161035c90613790565b5060015b92915050565b60005460ff1681565b606060028054806020026020016040519081016040528092919081815260200182805480156107bb57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161079d575b5050505050905090565b60005460ff16156107e85760405162461bcd60e51b815260040161035c90613650565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561081c33611510565b60005b828110156108545761084b84848381811061083657fe5b90506020020160206102209190810190612725565b5060010161081f565b5061085e81610b10565b505050565b61086b610ae7565b6108875760405162461bcd60e51b815260040161035c90613750565b600080546040516101009091046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffff0000000000000000000000000000000000000000ff169055565b60006108f7610ae7565b6109135760405162461bcd60e51b815260040161035c90613750565b6001600160a01b03821660009081526003602052604090205460ff161561094c5760405162461bcd60e51b815260040161035c90613640565b6001600160a01b0382166109725760405162461bcd60e51b815260040161035c90613740565b6002805460018082019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03851690811790915560008181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909417909355915190917f2ee2cb0721ec60b86190cae5c48e25064b69b35abad32452a4ec99d232033de291a260025461075490600163ffffffff61140216565b60056020819052600091825260409091205463ffffffff80821692640100000000830490911691680100000000000000008104820b916e0100000000000000000000000000008204810b9174010000000000000000000000000000000000000000810490910b907a010000000000000000000000000000000000000000000000000000900460ff1686565b60005461010090046001600160a01b031690565b6000805461010090046001600160a01b0316610b016115b3565b6001600160a01b031614905090565b610b18610ae7565b610b345760405162461bcd60e51b815260040161035c90613750565b6001600160a01b038116610b5a5760405162461bcd60e51b815260040161035c90613820565b6006546040516001600160a01b03918216918316907fb69e1c416d8be92ac92c8e97e77c4626fba5e6ab50161099f659ea3303479e5090600090a3600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b03851660009081526003602052604081205460ff16610c075760405162461bcd60e51b815260040161035c90613720565b6040517f93c7e3bc0000000000000000000000000000000000000000000000000000000081526001600160a01b038716906393c7e3bc906105729088908890889088906004016135d0565b610c5a610ae7565b610c765760405162461bcd60e51b815260040161035c90613750565b610c7f816115b7565b6000826001600160a01b031660001b84189050816005600083815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a81548165ffffffffffff021916908360050b65ffffffffffff160217905550606082015181600001600e6101000a81548165ffffffffffff021916908360050b65ffffffffffff16021790555060808201518160000160146101000a81548165ffffffffffff021916908360050b65ffffffffffff16021790555060a082015181600001601a6101000a81548160ff021916908360ff160217905550905050610e7582600460008481526020019081526020016000206040518060a00160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160089054906101000a900460050b60050b60050b815260200160008201600e9054906101000a900460050b60050b60050b81526020016000820160149054906101000a900460050b60050b60050b815250506117c290919063ffffffff16565b6000828152600460209081526040918290208351815492850151858501516060870151608090970151600590810b65ffffffffffff90811674010000000000000000000000000000000000000000027fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff99830b82166e010000000000000000000000000000027fffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffff9490930b90911668010000000000000000027fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff63ffffffff958616640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff969097167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000909916989098179490941694909417959095169190911716929092179390931617909155517f1a082a1efaf1549c18917ddcb1f759680c29371609e24f4b946e93acf4ce5ad290610ffa908690869086906135f8565b60405180910390a150505050565b6002818154811061101557fe5b6000918252602090912001546001600160a01b0316905081565b6006546001600160a01b031681565b600180548101908190556001600160a01b03871660009081526003602052604081205490919060ff166110835760405162461bcd60e51b815260040161035c90613720565b6040517fd3385d050000000000000000000000000000000000000000000000000000000081526001600160a01b0389169063d3385d05906110ce908a908a908a908a906004016135d0565b602060405180830381600087803b1580156110e857600080fd5b505af11580156110fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611120919081019061294e565b9150828211156111425760405162461bcd60e51b815260040161035c906136a0565b61114f8787848888611817565b61115a3387846118ea565b611165338686611b33565b856001600160a01b0316336001600160a01b0316887fe7b046415cac9de47940c3087e06db13a0e058ccf53ac5f0edd49ebb4c2c3a6f8b89878a6040516111af9493929190613573565b60405180910390a460015481146111d85760405162461bcd60e51b815260040161035c90613710565b509695505050505050565b60036020526000908152604090205460ff1681565b600180548101908190556001600160a01b03871660009081526003602052604081205490919060ff1661123d5760405162461bcd60e51b815260040161035c90613720565b6040517f42bfc99c0000000000000000000000000000000000000000000000000000000081526001600160a01b038916906342bfc99c90611288908a908a908a908a906004016135d0565b602060405180830381600087803b1580156112a257600080fd5b505af11580156112b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112da919081019061294e565b9150828210156112fc5760405162461bcd60e51b815260040161035c906137d0565b6113098787868886611817565b6113143387866118ea565b61131f338684611b33565b856001600160a01b0316336001600160a01b0316887fe7b046415cac9de47940c3087e06db13a0e058ccf53ac5f0edd49ebb4c2c3a6f8b8989886040516111af9493929190613573565b60046020526000908152604090205463ffffffff80821691640100000000810490911690680100000000000000008104600590810b916e0100000000000000000000000000008104820b9174010000000000000000000000000000000000000000909104900b85565b6113da610ae7565b6113f65760405162461bcd60e51b815260040161035c90613750565b6113ff81611510565b50565b600061144483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ddf565b9392505050565b60405161150a9085907f23b872dd00000000000000000000000000000000000000000000000000000000906114889087908790879060240161354b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611e0b565b50505050565b6001600160a01b0381166115365760405162461bcd60e51b815260040161035c90613670565b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b3390565b60a081015160021615806115d1575060a081015160011615155b6115ed5760405162461bcd60e51b815260040161035c906136b0565b60a081015160011615806116075750805163ffffffff1615155b6116235760405162461bcd60e51b815260040161035c90613730565b60a0810151600216158061164157506000816020015163ffffffff16115b61165d5760405162461bcd60e51b815260040161035c906136e0565b60a0810151600116158061167857506000816040015160050b135b6116945760405162461bcd60e51b815260040161035c90613770565b60a081015160021615806116af57506000816060015160050b135b6116cb5760405162461bcd60e51b815260040161035c90613660565b60a081015160041615806116e657506000816080015160050b135b6117025760405162461bcd60e51b815260040161035c90613800565b60a081015160039081161415806117265750806060015160050b816040015160050b125b6117425760405162461bcd60e51b815260040161035c90613760565b60a081015160069081161415806117665750806080015160050b816060015160050b125b6117825760405162461bcd60e51b815260040161035c906137a0565b60a081015160059081161415806117a65750806080015160050b816040015160050b125b6113ff5760405162461bcd60e51b815260040161035c90613680565b6117ca61258a565b6000808452602084015260a08201516001166117e857600060408401525b60a08201516002166117fc57600060608401525b60a082015160041661181057600060808401525b5090919050565b6001600160a01b038481169083167f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8511156118655760405162461bcd60e51b815260040161035c90613780565b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156118a55760405162461bcd60e51b815260040161035c906137b0565b6118b28288188688611ef0565b6118e1818818847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0286611ef0565b50505050505050565b6006546040517f4f8e6e230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634f8e6e2390611933908590600401613522565b60206040518083038186803b15801561194b57600080fd5b505afa15801561195f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061198391908101906128ce565b15611a5b576119a36001600160a01b03831684308463ffffffff61144b16565b6040517f42966c680000000000000000000000000000000000000000000000000000000081526001600160a01b038316906342966c68906119e8908490600401613870565b602060405180830381600087803b158015611a0257600080fd5b505af1158015611a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a3a91908101906128ce565b611a565760405162461bcd60e51b815260040161035c90613790565b61085e565b6006546040517fcae182fe0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063cae182fe90611aa4908590600401613522565b60206040518083038186803b158015611abc57600080fd5b505afa158015611ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611af491908101906128ce565b15611b1b57600654611a56906001600160a01b03848116918691168463ffffffff61144b16565b60405162461bcd60e51b815260040161035c90613840565b6006546040517f4f8e6e230000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690634f8e6e2390611b7c908590600401613522565b60206040518083038186803b158015611b9457600080fd5b505afa158015611ba8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bcc91908101906128ce565b15611c86576040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b038316906340c10f1990611c189086908590600401613530565b602060405180830381600087803b158015611c3257600080fd5b505af1158015611c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c6a91908101906128ce565b611a565760405162461bcd60e51b815260040161035c90613810565b6006546040517fcae182fe0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063cae182fe90611ccf908590600401613522565b60206040518083038186803b158015611ce757600080fd5b505afa158015611cfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d1f91908101906128ce565b15611b1b576006546040517f6be383fc0000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690636be383fc90611d719085908790869060040161354b565b602060405180830381600087803b158015611d8b57600080fd5b505af1158015611d9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dc391908101906128ce565b611a565760405162461bcd60e51b815260040161035c90613850565b60008184841115611e035760405162461bcd60e51b815260040161035c919061362f565b505050900390565b611e1d826001600160a01b031661225a565b611e395760405162461bcd60e51b815260040161035c90613860565b60006060836001600160a01b031683604051611e559190613516565b6000604051808303816000865af19150503d8060008114611e92576040519150601f19603f3d011682016040523d82523d6000602084013e611e97565b606091505b509150915081611eb95760405162461bcd60e51b815260040161035c906136d0565b80511561150a5780806020019051611ed491908101906128ce565b61150a5760405162461bcd60e51b815260040161035c90613830565b611ef86125b8565b50600083815260056020818152604092839020835160c081018552905463ffffffff808216835264010000000082041692820192909252680100000000000000008204830b830b830b938101939093526e0100000000000000000000000000008104820b820b820b6060840152740100000000000000000000000000000000000000008104820b820b90910b60808301527a010000000000000000000000000000000000000000000000000000900460ff1660a082018190521561150a57611fbe61258a565b50600084815260046020818152604092839020835160a081018552905463ffffffff808216835264010000000082041682840152680100000000000000008104600590810b810b810b838701526e0100000000000000000000000000008204810b810b810b606084015274010000000000000000000000000000000000000000909104810b810b900b608082015283517f313ce567000000000000000000000000000000000000000000000000000000008152935190936120ef93869389936001600160a01b038a169363313ce56793818101939291829003018186803b1580156120a857600080fd5b505afa1580156120bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506120e0919081019061296c565b8492919063ffffffff61229616565b9050612101818363ffffffff6123bd16565b60009485526004602090815260409586902082518154928401519784015160608501516080909501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000090941663ffffffff928316177fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff166401000000009290991691909102979097177fffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffff1668010000000000000000600598890b65ffffffffffff90811691909102919091177fffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffff166e01000000000000000000000000000094890b821694909402939093177fffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000009290970b929092160294909417909355505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061228e57508115155b949350505050565b61229e61258a565b60008260ff16600a0a84816122af57fe5b059050657fffffffffff8113156122d85760405162461bcd60e51b815260040161035c906137e0565b600081156122e657816122e9565b60015b60a08701519091506001161561238a57855187510163ffffffff1642111561231c576000604088015263ffffffff421687525b61232a87604001518261252c565b600590810b900b604088015260a08601516002161561238a57856020015187602001510163ffffffff1642111561236f576000606088015263ffffffff421660208801525b61237d87606001518261252c565b600590810b900b60608801525b60a0860151600416156123b2576123a587608001518261252c565b600590810b900b60808801525b509495945050505050565b60a0810151600116158015906124195750816040015160050b81604001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0260050b13806124195750806040015160050b826040015160050b135b156124365760405162461bcd60e51b815260040161035c906137c0565b60a0810151600216158015906124925750816060015160050b81606001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0260050b13806124925750806060015160050b826060015160050b135b156124af5760405162461bcd60e51b815260040161035c90613700565b60a08101516004161580159061250b5750816080015160050b81608001517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0260050b138061250b5750806080015160050b826080015160050b135b156125285760405162461bcd60e51b815260040161035c906137f0565b5050565b6000600582810b9084900b017fffffffffffffffffffffffffffffffffffffffffffffffffffff800000000001811280159061256e5750657fffffffffff8113155b6114445760405162461bcd60e51b815260040161035c90613690565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b8035610754816139f3565b60008083601f84011261260a57600080fd5b50813567ffffffffffffffff81111561262257600080fd5b60208301915083602082028301111561263a57600080fd5b9250929050565b805161075481613a07565b803561075481613a10565b803561075481613a19565b600060c0828403121561267457600080fd5b61267e60c061391a565b9050600061268c8484612704565b825250602061269d84848301612704565b60208301525060406126b184828501612657565b60408301525060606126c584828501612657565b60608301525060806126d984828501612657565b60808301525060a06126ed8482850161270f565b60a08301525092915050565b805161075481613a10565b803561075481613a22565b803561075481613a2b565b805161075481613a2b565b60006020828403121561273757600080fd5b600061228e84846125ed565b600080600080600060a0868803121561275b57600080fd5b600061276788886125ed565b95505060206127788882890161264c565b9450506040612789888289016125ed565b935050606061279a888289016125ed565b92505060806127ab8882890161264c565b9150509295509295909350565b60008060008060008060c087890312156127d157600080fd5b60006127dd89896125ed565b96505060206127ee89828a0161264c565b95505060406127ff89828a016125ed565b945050606061281089828a016125ed565b935050608061282189828a0161264c565b92505060a061283289828a0161264c565b9150509295509295509295565b6000806040838503121561285257600080fd5b600061285e85856125ed565b925050602061286f8582860161264c565b9150509250929050565b60008060006040848603121561288e57600080fd5b833567ffffffffffffffff8111156128a557600080fd5b6128b1868287016125f8565b935093505060206128c4868287016125ed565b9150509250925092565b6000602082840312156128e057600080fd5b600061228e8484612641565b6000602082840312156128fe57600080fd5b600061228e848461264c565b6000806000610100848603121561292057600080fd5b600061292c868661264c565b935050602061293d868287016125ed565b92505060406128c486828701612662565b60006020828403121561296057600080fd5b600061228e84846126f9565b60006020828403121561297e57600080fd5b600061228e848461271a565b600061299683836129ad565b505060200190565b6129a78161398d565b82525050565b6129a781613959565b60006129c182613947565b6129cb818561394b565b93506129d683613941565b8060005b838110156123b25781516129ee888261298a565b97506129f983613941565b9250506001016129da565b6129a781613964565b6129a781613969565b6000612a2182613947565b612a2b8185613954565b9350612a3b81856020860161399f565b9290920192915050565b6129a781613994565b6129a78161396c565b6000612a6282613947565b612a6c818561394b565b9350612a7c81856020860161399f565b612a85816139cb565b9093019392505050565b6000612a9c602b8361394b565b7f45786368616e676550726f766964657220616c7265616479206578697374732081527f696e20746865206c697374000000000000000000000000000000000000000000602082015260400192915050565b6000612afb601c8361394b565b7f636f6e747261637420616c726561647920696e697469616c697a656400000000815260200192915050565b6000612b34601e8361394b565b7f6c696d6974312063616e2774206265207a65726f206966206163746976650000815260200192915050565b6000612b6d60268361394b565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612bcc60278361394b565b7f6c696d6974476c6f62616c206d7573742062652067726561746572207468616e81527f206c696d69743000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612c2b60178361394b565b7f696e743438206164646974696f6e206f766572666c6f77000000000000000000815260200192915050565b6000612c6460148361394b565b7f616d6f756e74496e4d6178206578636565646564000000000000000000000000815260200192915050565b6000612c9d60198361394b565b7f4c3120776974686f7574204c30206e6f7420616c6c6f77656400000000000000815260200192915050565b6000612cd6601c8361394b565b7f696e64657820646f65736e2774206d617463682070726f766964657200000000815260200192915050565b6000612d0f60208361394b565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000612d4860218361394b565b7f74696d6573746570312063616e2774206265207a65726f20696620616374697681527f6500000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612da760248361394b565b7f546f6b656e206d7573742062652061207265736572766520737461626c65206181527f7373657400000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612e06600b8361394b565b7f4c31204578636565646564000000000000000000000000000000000000000000815260200192915050565b6000612e3f600e8361394b565b7f7265656e7472616e742063616c6c000000000000000000000000000000000000815260200192915050565b6000612e78601f8361394b565b7f45786368616e676550726f766964657220646f6573206e6f7420657869737400815260200192915050565b6000612eb160218361394b565b7f74696d6573746570302063616e2774206265207a65726f20696620616374697681527f6500000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612f1060238361394b565b7f45786368616e676550726f766964657220616464726573732063616e2774206281527f6520300000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000612f6f60208361394b565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b6000612fa860228361394b565b7f6c696d697431206d7573742062652067726561746572207468616e206c696d6981527f7430000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000613007601e8361394b565b7f6c696d6974302063616e2774206265207a65726f206966206163746976650000815260200192915050565b600061304060128361394b565b7f616d6f756e74496e20746f6f206c617267650000000000000000000000000000815260200192915050565b600061307960228361394b565b7f4275726e696e67206f662074686520737461626c65206173736574206661696c81527f6564000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006130d860278361394b565b7f6c696d6974476c6f62616c206d7573742062652067726561746572207468616e81527f206c696d69743100000000000000000000000000000000000000000000000000602082015260400192915050565b600061313760138361394b565b7f616d6f756e744f757420746f6f206c6172676500000000000000000000000000815260200192915050565b6000613170600b8361394b565b7f4c30204578636565646564000000000000000000000000000000000000000000815260200192915050565b60006131a960148361394b565b7f616d6f756e744f75744d696e206e6f74206d6574000000000000000000000000815260200192915050565b60006131e2600f8361394b565b7f64466c6f7720746f6f206c617267650000000000000000000000000000000000815260200192915050565b600061321b600b8361394b565b7f4c47204578636565646564000000000000000000000000000000000000000000815260200192915050565b600061325460238361394b565b7f6c696d6974476c6f62616c2063616e2774206265207a65726f2069662061637481527f6976650000000000000000000000000000000000000000000000000000000000602082015260400192915050565b60006132b360228361394b565b7f4d696e74696e67206f662074686520737461626c65206173736574206661696c81527f6564000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000613312601b8361394b565b7f526573657276652061646472657373206d757374206265207365740000000000815260200192915050565b600061334b602a8361394b565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e81527f6f74207375636365656400000000000000000000000000000000000000000000602082015260400192915050565b60006133aa60298361394b565b7f546f6b656e206d75737420626520737461626c65206f7220636f6c6c6174657281527f616c206173736572740000000000000000000000000000000000000000000000602082015260400192915050565b600061340960278361394b565b7f5472616e73666572206f662074686520636f6c6c61746572616c20617373657481527f206661696c656400000000000000000000000000000000000000000000000000602082015260400192915050565b6000613468601f8361394b565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b805160c08301906134a58482613504565b5060208201516134b86020850182613504565b5060408201516134cb6040850182612a4e565b5060608201516134de6060850182612a4e565b5060808201516134f16080850182612a4e565b5060a082015161150a60a085018261350d565b6129a78161397e565b6129a781613987565b60006114448284612a16565b6020810161075482846129ad565b6040810161353e828561299e565b6114446020830184612a0d565b6060810161355982866129ad565b61356660208301856129ad565b61228e6040830184612a0d565b6080810161358182876129ad565b61358e60208301866129ad565b61359b6040830185612a0d565b6135a86060830184612a0d565b95945050505050565b6020808252810161144481846129b6565b602081016107548284612a04565b608081016135de8287612a0d565b6135eb60208301866129ad565b61359b60408301856129ad565b61010081016136078286612a0d565b61361460208301856129ad565b61228e6040830184613494565b602081016107548284612a45565b602080825281016114448184612a57565b6020808252810161075481612a8f565b6020808252810161075481612aee565b6020808252810161075481612b27565b6020808252810161075481612b60565b6020808252810161075481612bbf565b6020808252810161075481612c1e565b6020808252810161075481612c57565b6020808252810161075481612c90565b6020808252810161075481612cc9565b6020808252810161075481612d02565b6020808252810161075481612d3b565b6020808252810161075481612d9a565b6020808252810161075481612df9565b6020808252810161075481612e32565b6020808252810161075481612e6b565b6020808252810161075481612ea4565b6020808252810161075481612f03565b6020808252810161075481612f62565b6020808252810161075481612f9b565b6020808252810161075481612ffa565b6020808252810161075481613033565b602080825281016107548161306c565b60208082528101610754816130cb565b602080825281016107548161312a565b6020808252810161075481613163565b602080825281016107548161319c565b60208082528101610754816131d5565b602080825281016107548161320e565b6020808252810161075481613247565b60208082528101610754816132a6565b6020808252810161075481613305565b602080825281016107548161333e565b602080825281016107548161339d565b60208082528101610754816133fc565b602080825281016107548161345b565b602081016107548284612a0d565b60a0810161388c8288613504565b6138996020830187613504565b6138a66040830186612a4e565b6138b36060830185612a4e565b6105c26080830184612a4e565b60c081016138ce8289613504565b6138db6020830188613504565b6138e86040830187612a4e565b6138f56060830186612a4e565b6139026080830185612a4e565b61390f60a083018461350d565b979650505050505050565b60405181810167ffffffffffffffff8111828210171561393957600080fd5b604052919050565b60200190565b5190565b90815260200190565b919050565b600061075482613972565b151590565b90565b60050b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6000610754825b600061075482613959565b60005b838110156139ba5781810151838201526020016139a2565b8381111561150a5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b6139fc81613959565b81146113ff57600080fd5b6139fc81613964565b6139fc81613969565b6139fc8161396c565b6139fc8161397e565b6139fc8161398756fea365627a7a7231582009020e48eeea2b6a9d3dd2ecbfafc07fe7dbcfed935c640b6497d70f64ca262e6c6578706572696d656e74616cf564736f6c63430005110040
External libraries
AddressLinkedList : 0x6200f54d73491d56b8d7a975c9ee18efb4d518df
AddressSortedLinkedListWithMedian : 0xed477a99035d0c1e11369f1d7a4e587893cc002b