Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
CentaurPool
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; pragma experimental ABIEncoderV2; import './CentaurLPToken.sol'; import './libraries/Initializable.sol'; import './libraries/SafeMath.sol'; import './libraries/CentaurMath.sol'; import './interfaces/IERC20.sol'; import './interfaces/ICentaurFactory.sol'; import './interfaces/ICentaurPool.sol'; import './interfaces/ICentaurSettlement.sol'; import './interfaces/IOracle.sol'; contract CentaurPool is Initializable, CentaurLPToken { using SafeMath for uint; bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)'))); address public factory; address public baseToken; uint public baseTokenDecimals; address public oracle; uint public oracleDecimals; uint public baseTokenTargetAmount; uint public baseTokenBalance; uint public liquidityParameter; bool public tradeEnabled; bool public depositEnabled; bool public withdrawEnabled; uint private unlocked; modifier lock() { require(unlocked == 1, 'CentaurSwap: LOCKED'); unlocked = 0; _; unlocked = 1; } modifier tradeAllowed() { require(tradeEnabled, "CentaurSwap: TRADE_NOT_ALLOWED"); _; } modifier depositAllowed() { require(depositEnabled, "CentaurSwap: DEPOSIT_NOT_ALLOWED"); _; } modifier withdrawAllowed() { require(withdrawEnabled, "CentaurSwap: WITHDRAW_NOT_ALLOWED"); _; } modifier onlyRouter() { require(msg.sender == ICentaurFactory(factory).router(), 'CentaurSwap: ONLY_ROUTER_ALLOWED'); _; } modifier onlyFactory() { require(msg.sender == factory, 'CentaurSwap: ONLY_FACTORY_ALLOWED'); _; } event Mint(address indexed sender, uint amount); event Burn(address indexed sender, uint amount, address indexed to); event AmountIn(address indexed sender, uint amount); event AmountOut(address indexed sender, uint amount, address indexed to); event EmergencyWithdraw(uint256 _timestamp, address indexed _token, uint256 _amount, address indexed _to); function init(address _factory, address _baseToken, address _oracle, uint _liquidityParameter) external initializer { factory = _factory; baseToken = _baseToken; baseTokenDecimals = IERC20(baseToken).decimals(); oracle = _oracle; oracleDecimals = IOracle(oracle).decimals(); tradeEnabled = false; depositEnabled = false; withdrawEnabled = false; liquidityParameter = _liquidityParameter; symbol = string(abi.encodePacked("CS-", IERC20(baseToken).symbol())); decimals = baseTokenDecimals; unlocked = 1; } function _safeTransfer(address token, address to, uint value) private { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'CentaurSwap: TRANSFER_FAILED'); } function mint(address to) external lock onlyRouter depositAllowed returns (uint liquidity) { uint balance = IERC20(baseToken).balanceOf(address(this)); uint amount = balance.sub(baseTokenBalance); if (totalSupply == 0) { liquidity = amount.add(baseTokenTargetAmount); } else { liquidity = amount.mul(totalSupply).div(baseTokenTargetAmount); } require(liquidity > 0, 'CentaurSwap: INSUFFICIENT_LIQUIDITY_MINTED'); _mint(to, liquidity); baseTokenBalance = baseTokenBalance.add(amount); baseTokenTargetAmount = baseTokenTargetAmount.add(amount); emit Mint(msg.sender, amount); } function burn(address to) external lock onlyRouter withdrawAllowed returns (uint amount) { uint liquidity = balanceOf[address(this)]; amount = liquidity.mul(baseTokenTargetAmount).div(totalSupply); require(amount > 0, 'CentaurSwap: INSUFFICIENT_LIQUIDITY_BURNED'); require(baseTokenBalance >= amount, 'CentaurSwap: INSUFFICIENT_LIQUIDITY'); _burn(address(this), liquidity); _safeTransfer(baseToken, to, amount); baseTokenBalance = baseTokenBalance.sub(amount); baseTokenTargetAmount = baseTokenTargetAmount.sub(amount); emit Burn(msg.sender, amount, to); } function swapTo(address _sender, address _fromToken, uint _amountIn, uint _value, address _receiver) external lock onlyRouter tradeAllowed returns (uint maxAmount) { require(_fromToken != baseToken, 'CentaurSwap: INVALID_POOL'); address pool = ICentaurFactory(factory).getPool(_fromToken); require(pool != address(0), 'CentaurSwap: POOL_NOT_FOUND'); // Check if has pendingSettlement address settlement = ICentaurFactory(factory).settlement(); require(!ICentaurSettlement(settlement).hasPendingSettlement(_sender, address(this)), 'CentaurSwap: PENDING_SETTLEMENT'); // maxAmount because amount might be lesser during settlement. (If amount is more, excess is given back to pool) maxAmount = getAmountOutFromValue(_value); ICentaurSettlement.Settlement memory pendingSettlement = ICentaurSettlement.Settlement( pool, _amountIn, ICentaurPool(pool).baseTokenTargetAmount(), (ICentaurPool(pool).baseTokenBalance()).sub(_amountIn), ICentaurPool(pool).liquidityParameter(), address(this), maxAmount, baseTokenTargetAmount, baseTokenBalance, liquidityParameter, _receiver, block.timestamp.add(ICentaurSettlement(settlement).settlementDuration()) ); // Subtract maxAmount from baseTokenBalance first, difference (if any) will be added back during settlement baseTokenBalance = baseTokenBalance.sub(maxAmount); // Add to pending settlement ICentaurSettlement(settlement).addSettlement(_sender, pendingSettlement); // Transfer amount to settlement for escrow _safeTransfer(baseToken, settlement, maxAmount); return maxAmount; } function swapFrom(address _sender) external lock onlyRouter tradeAllowed returns (uint amount, uint value) { uint balance = IERC20(baseToken).balanceOf(address(this)); require(balance > baseTokenBalance, 'CentaurSwap: INSUFFICIENT_SWAP_AMOUNT'); // Check if has pendingSettlement address settlement = ICentaurFactory(factory).settlement(); require(!ICentaurSettlement(settlement).hasPendingSettlement(_sender, address(this)), 'CentaurSwap: PENDING_SETTLEMENT'); amount = balance.sub(baseTokenBalance); value = getValueFromAmountIn(amount); baseTokenBalance = balance; emit AmountIn(_sender, amount); return (amount, value); } function swapSettle(address _sender) external lock returns (uint, address) { address settlement = ICentaurFactory(factory).settlement(); ICentaurSettlement.Settlement memory pendingSettlement = ICentaurSettlement(settlement).getPendingSettlement(_sender, address(this)); require (pendingSettlement.settlementTimestamp != 0, 'CentaurSwap: NO_PENDING_SETTLEMENT'); require (pendingSettlement.tPool == address(this), 'CentaurSwap: WRONG_POOL_SETTLEMENT'); require (block.timestamp >= pendingSettlement.settlementTimestamp, 'CentaurSwap: SETTLEMENT_STILL_PENDING'); uint newfPoolOraclePrice = ICentaurPool(pendingSettlement.fPool).getOraclePrice(); uint newtPoolOraclePrice = getOraclePrice(); uint newValue = CentaurMath.getValueFromAmountIn(pendingSettlement.amountIn, newfPoolOraclePrice, ICentaurPool(pendingSettlement.fPool).baseTokenDecimals(), pendingSettlement.fPoolBaseTokenTargetAmount, pendingSettlement.fPoolBaseTokenBalance, pendingSettlement.fPoolLiquidityParameter); uint newAmount = CentaurMath.getAmountOutFromValue(newValue, newtPoolOraclePrice, baseTokenDecimals, pendingSettlement.tPoolBaseTokenTargetAmount, pendingSettlement.tPoolBaseTokenBalance, pendingSettlement.tPoolLiquidityParameter); uint poolFee = ICentaurFactory(factory).poolFee(); address router = ICentaurFactory(factory).router(); // Remove settlement and receive escrowed amount ICentaurSettlement(settlement).removeSettlement(_sender, pendingSettlement.fPool, pendingSettlement.tPool); if (newAmount > pendingSettlement.maxAmountOut) { uint fee = (pendingSettlement.maxAmountOut).mul(poolFee).div(100 ether); uint amountOut = pendingSettlement.maxAmountOut.sub(fee); if (msg.sender == router) { _safeTransfer(baseToken, router, amountOut); } else { _safeTransfer(baseToken, pendingSettlement.receiver, amountOut); } emit AmountOut(_sender, amountOut, pendingSettlement.receiver); baseTokenBalance = baseTokenBalance.add(fee); baseTokenTargetAmount = baseTokenTargetAmount.add(fee); return (amountOut, pendingSettlement.receiver); } else { uint fee = (newAmount).mul(poolFee).div(100 ether); uint amountOut = newAmount.sub(fee); if (msg.sender == router) { _safeTransfer(baseToken, router, amountOut); } else { _safeTransfer(baseToken, pendingSettlement.receiver, amountOut); } emit AmountOut(_sender, amountOut, pendingSettlement.receiver); // Difference added back to baseTokenBalance uint difference = (pendingSettlement.maxAmountOut).sub(amountOut); baseTokenBalance = baseTokenBalance.add(difference); // TX fee goes back into pool for liquidity providers baseTokenTargetAmount = baseTokenTargetAmount.add(difference); return (amountOut, pendingSettlement.receiver); } } function getOraclePrice() public view returns (uint price) { (, int answer,,,) = IOracle(oracle).latestRoundData(); // Returns price in 18 decimals price = uint(answer).mul(10 ** uint(18).sub(oracleDecimals)); } // Swap Exact Tokens For Tokens (getAmountOut) function getAmountOutFromValue(uint _value) public view returns (uint amount) { amount = CentaurMath.getAmountOutFromValue(_value, getOraclePrice(), baseTokenDecimals, baseTokenTargetAmount, baseTokenBalance, liquidityParameter); require(baseTokenBalance > amount, "CentaurSwap: INSUFFICIENT_LIQUIDITY"); } function getValueFromAmountIn(uint _amount) public view returns (uint value) { value = CentaurMath.getValueFromAmountIn(_amount, getOraclePrice(), baseTokenDecimals, baseTokenTargetAmount, baseTokenBalance, liquidityParameter); } // Swap Tokens For Exact Tokens (getAmountIn) function getAmountInFromValue(uint _value) public view returns (uint amount) { amount = CentaurMath.getAmountInFromValue(_value, getOraclePrice(), baseTokenDecimals, baseTokenTargetAmount, baseTokenBalance, liquidityParameter); } function getValueFromAmountOut(uint _amount) public view returns (uint value) { require(baseTokenBalance > _amount, "CentaurSwap: INSUFFICIENT_LIQUIDITY"); value = CentaurMath.getValueFromAmountOut(_amount, getOraclePrice(), baseTokenDecimals, baseTokenTargetAmount, baseTokenBalance, liquidityParameter); } // Helper functions function setFactory(address _factory) external onlyFactory { factory = _factory; } function setTradeEnabled(bool _tradeEnabled) external onlyFactory { tradeEnabled = _tradeEnabled; } function setDepositEnabled(bool _depositEnabled) external onlyFactory { depositEnabled = _depositEnabled; } function setWithdrawEnabled(bool _withdrawEnabled) external onlyFactory { withdrawEnabled = _withdrawEnabled; } function setLiquidityParameter(uint _liquidityParameter) external onlyFactory { liquidityParameter = _liquidityParameter; } function emergencyWithdraw(address _token, uint _amount, address _to) external onlyFactory { _safeTransfer(_token, _to, _amount); emit EmergencyWithdraw(block.timestamp, _token, _amount, _to); } }
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; import './libraries/SafeMath.sol'; contract CentaurLPToken { using SafeMath for uint; string public constant name = 'CentaurSwap LP Token'; string public symbol; uint256 public decimals = 18; uint public totalSupply; mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) public allowance; event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function _mint(address to, uint value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(address(0), to, value); } function _burn(address from, uint value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function _approve(address owner, address spender, uint value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer(address from, address to, uint value) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint value) external returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint value) external returns (bool) { if (allowance[from][msg.sender] != uint(-1)) { allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); } _transfer(from, to, value); return true; } }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; // solhint-disable-next-line no-inline-assembly assembly { cs := extcodesize(self) } return cs == 0; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, 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. */ 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. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import { SafeMath } from "./SafeMath.sol"; import { ABDKMathQuad } from './ABDKMathQuad.sol'; library CentaurMath { using SafeMath for uint256; bytes16 constant ONE_ETHER_QUAD = 0x403ABC16D674EC800000000000000000; // Helper Functions function getAmountOutFromValue(uint _value, uint _P, uint _tokenDecimals, uint _baseTokenTargetAmount, uint _baseTokenBalance, uint _liquidityParameter) external pure returns (uint amount) { bytes16 DECIMAL_QUAD = ABDKMathQuad.fromUInt(10 ** _tokenDecimals); bytes16 value_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_value), ONE_ETHER_QUAD); bytes16 P_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_P), ONE_ETHER_QUAD); bytes16 baseTokenTargetAmount_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenTargetAmount), DECIMAL_QUAD); bytes16 baseTokenBalance_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenBalance), DECIMAL_QUAD); bytes16 k_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_liquidityParameter), DECIMAL_QUAD); bytes16 X2 = ABDKMathQuad.sub(baseTokenBalance_quad, baseTokenTargetAmount_quad); bytes16 X1 = _solveEquationForAmountOut( value_quad, X2, k_quad, P_quad ); bytes16 amountOut = ABDKMathQuad.sub(X2, X1); amount = ABDKMathQuad.toUInt(ABDKMathQuad.mul(amountOut, DECIMAL_QUAD)); } function getValueFromAmountIn(uint _amount, uint _P, uint _tokenDecimals, uint _baseTokenTargetAmount, uint _baseTokenBalance, uint _liquidityParameter) external pure returns (uint value) { bytes16 DECIMAL_QUAD = ABDKMathQuad.fromUInt(10 ** _tokenDecimals); bytes16 amount_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_amount), DECIMAL_QUAD); bytes16 P_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_P), ONE_ETHER_QUAD); bytes16 baseTokenTargetAmount_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenTargetAmount), DECIMAL_QUAD); bytes16 baseTokenBalance_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenBalance), DECIMAL_QUAD); bytes16 k_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_liquidityParameter), DECIMAL_QUAD); bytes16 X1 = ABDKMathQuad.sub(baseTokenBalance_quad, baseTokenTargetAmount_quad); bytes16 X2 = ABDKMathQuad.add(X1, amount_quad); value = _solveForIntegral( X1, X2, k_quad, P_quad ); } function getAmountInFromValue(uint _value, uint _P, uint _tokenDecimals, uint _baseTokenTargetAmount, uint _baseTokenBalance, uint _liquidityParameter) external pure returns (uint amount) { bytes16 DECIMAL_QUAD = ABDKMathQuad.fromUInt(10 ** _tokenDecimals); bytes16 value_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_value), ONE_ETHER_QUAD); bytes16 P_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_P), ONE_ETHER_QUAD); bytes16 baseTokenTargetAmount_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenTargetAmount), DECIMAL_QUAD); bytes16 baseTokenBalance_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenBalance), DECIMAL_QUAD); bytes16 k_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_liquidityParameter), DECIMAL_QUAD); bytes16 X1 = ABDKMathQuad.sub(baseTokenBalance_quad, baseTokenTargetAmount_quad); bytes16 X2 = _solveEquationForAmountIn( value_quad, X1, k_quad, P_quad ); bytes16 amountOut = ABDKMathQuad.sub(X2, X1); amount = ABDKMathQuad.toUInt(ABDKMathQuad.mul(amountOut, DECIMAL_QUAD)); } function getValueFromAmountOut(uint _amount, uint _P, uint _tokenDecimals, uint _baseTokenTargetAmount, uint _baseTokenBalance, uint _liquidityParameter) external pure returns (uint value) { bytes16 DECIMAL_QUAD = ABDKMathQuad.fromUInt(10 ** _tokenDecimals); bytes16 amount_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_amount), DECIMAL_QUAD); bytes16 P_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_P), ONE_ETHER_QUAD); bytes16 baseTokenTargetAmount_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenTargetAmount), DECIMAL_QUAD); bytes16 baseTokenBalance_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_baseTokenBalance), DECIMAL_QUAD); bytes16 k_quad = ABDKMathQuad.div(ABDKMathQuad.fromUInt(_liquidityParameter), DECIMAL_QUAD); bytes16 X2 = ABDKMathQuad.sub(baseTokenBalance_quad, baseTokenTargetAmount_quad); bytes16 X1 = ABDKMathQuad.sub(X2, amount_quad); value = _solveForIntegral( X1, X2, k_quad, P_quad ); } // Core Functions // Solve for Delta function _solveForIntegral ( bytes16 X1, bytes16 X2, bytes16 k, bytes16 P ) internal pure returns (uint256) { bytes16 multiplier = ABDKMathQuad.mul(k, P); bytes16 NLog_X2 = ABDKMathQuad.ln(ABDKMathQuad.add(X2, k)); bytes16 NLog_X1 = ABDKMathQuad.ln(ABDKMathQuad.add(X1, k)); bytes16 delta = ABDKMathQuad.mul(multiplier, ABDKMathQuad.sub(NLog_X2, NLog_X1)); return ABDKMathQuad.toUInt(ABDKMathQuad.mul(delta, ONE_ETHER_QUAD)); } // Solve for amountOut // Given X2, solve for X1 function _solveEquationForAmountOut ( bytes16 delta, bytes16 X2, bytes16 k, bytes16 P ) internal pure returns (bytes16 X1) { bytes16 NLog_X2 = ABDKMathQuad.ln(ABDKMathQuad.add(X2, k)); bytes16 deltaOverTotal = ABDKMathQuad.div(delta, ABDKMathQuad.mul(k, P)); bytes16 ePower = ABDKMathQuad.exp(ABDKMathQuad.sub(NLog_X2, deltaOverTotal)); X1 = ABDKMathQuad.sub(ePower, k); } // Solve for amountOut // Given X1, solve for X2 function _solveEquationForAmountIn ( bytes16 delta, bytes16 X1, bytes16 k, bytes16 P ) internal pure returns (bytes16 X2) { bytes16 NLog_X1 = ABDKMathQuad.ln(ABDKMathQuad.add(X1, k)); bytes16 deltaOverTotal = ABDKMathQuad.div(delta, ABDKMathQuad.mul(k, P)); bytes16 ePower = ABDKMathQuad.exp(ABDKMathQuad.add(deltaOverTotal, NLog_X1)); X2 = ABDKMathQuad.sub(ePower, k); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function symbol() external pure returns (string memory); /** * @dev Returns the token decimal. */ function decimals() external pure 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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ICentaurFactory { event PoolCreated(address indexed token, address pool, uint); function poolFee() external view returns (uint); function poolLogic() external view returns (address); function cloneFactory() external view returns (address); function settlement() external view returns (address); function router() external view returns (address payable); function getPool(address token) external view returns (address pool); function allPools(uint) external view returns (address pool); function allPoolsLength() external view returns (uint); function isValidPool(address pool) external view returns (bool); function createPool(address token, address oracle, uint poolUtilizationPercentage) external returns (address pool); function addPool(address pool) external; function removePool(address pool) external; function setPoolLiquidityParameter(address, uint) external; function setPoolTradeEnabled(address, bool) external; function setPoolDepositEnabled(address, bool) external; function setPoolWithdrawEnabled(address, bool) external; function setAllPoolsTradeEnabled(bool) external; function setAllPoolsDepositEnabled(bool) external; function setAllPoolsWithdrawEnabled(bool) external; function emergencyWithdrawFromPool(address, address, uint, address) external; function setRouterOnlyEOAEnabled(bool) external; function setRouterContractWhitelist(address, bool) external; function setSettlementDuration(uint) external; function setPoolFee(uint) external; function setPoolLogic(address) external; function setCloneFactory(address) external; function setSettlement(address) external; function setRouter(address payable) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ICentaurPool { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); event Mint(address indexed sender, uint amount); event Burn(address indexed sender, uint amount, address indexed to); event AmountIn(address indexed sender, uint amount); event AmountOut(address indexed sender, uint amount, address indexed to); event EmergencyWithdraw(uint256 _timestamp, address indexed _token, uint256 _amount, address indexed _to); function factory() external view returns (address); function settlement() external view returns (address); function baseToken() external view returns (address); function baseTokenDecimals() external view returns (uint); function oracle() external view returns (address); function oracleDecimals() external view returns (uint); function baseTokenTargetAmount() external view returns (uint); function baseTokenBalance() external view returns (uint); function liquidityParameter() external view returns (uint); function init(address, address, address, uint) external; function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount); function swapTo(address _sender, address _fromToken, uint _amountIn, uint _value, address _receiver) external returns (uint maxAmount); function swapFrom(address _sender) external returns (uint amount, uint value); function swapSettle(address _sender) external returns (uint, address); function getOraclePrice() external view returns (uint price); function getAmountOutFromValue(uint _value) external view returns (uint amount); function getValueFromAmountIn(uint _amount) external view returns (uint value); function getAmountInFromValue(uint _value) external view returns (uint amount); function getValueFromAmountOut(uint _amount) external view returns (uint value); function setFactory(address) external; function setTradeEnabled(bool) external; function setDepositEnabled(bool) external; function setWithdrawEnabled(bool) external; function setLiquidityParameter(uint) external; function emergencyWithdraw(address, uint, address) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; pragma experimental ABIEncoderV2; interface ICentaurSettlement { // event SettlementAdded(address indexed sender, address indexed _fromToken, uint _amountIn, address indexed _toToken, uint _amountOut); // event SettlementRemoved(address indexed sender, address indexed _fromToken, address indexed _toToken); struct Settlement { address fPool; uint amountIn; uint fPoolBaseTokenTargetAmount; uint fPoolBaseTokenBalance; uint fPoolLiquidityParameter; address tPool; uint maxAmountOut; uint tPoolBaseTokenTargetAmount; uint tPoolBaseTokenBalance; uint tPoolLiquidityParameter; address receiver; uint settlementTimestamp; } function factory() external pure returns (address); function settlementDuration() external pure returns (uint); function addSettlement( address _sender, Settlement memory _pendingSettlement ) external; function removeSettlement(address _sender, address _fPool, address _tPool) external; function getPendingSettlement(address _sender, address _pool) external view returns (Settlement memory); function hasPendingSettlement(address _sender, address _pool) external view returns (bool); function setSettlementDuration(uint) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IOracle { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
// SPDX-License-Identifier: BSD-4-Clause /* * ABDK Math Quad Smart Contract Library. Copyright © 2019 by ABDK Consulting. * Author: Mikhail Vladimirov <[email protected]> */ pragma solidity ^0.5.0 || ^0.6.0 || ^0.7.0; /** * Smart contract library of mathematical functions operating with IEEE 754 * quadruple-precision binary floating-point numbers (quadruple precision * numbers). As long as quadruple precision numbers are 16-bytes long, they are * represented by bytes16 type. */ library ABDKMathQuad { /* * 0. */ bytes16 private constant POSITIVE_ZERO = 0x00000000000000000000000000000000; /* * -0. */ bytes16 private constant NEGATIVE_ZERO = 0x80000000000000000000000000000000; /* * +Infinity. */ bytes16 private constant POSITIVE_INFINITY = 0x7FFF0000000000000000000000000000; /* * -Infinity. */ bytes16 private constant NEGATIVE_INFINITY = 0xFFFF0000000000000000000000000000; /* * Canonical NaN value. */ bytes16 private constant NaN = 0x7FFF8000000000000000000000000000; /** * Convert signed 256-bit integer number into quadruple precision number. * * @param x signed 256-bit integer number * @return quadruple precision number */ function fromInt (int256 x) internal pure returns (bytes16) { if (x == 0) return bytes16 (0); else { // We rely on overflow behavior here uint256 result = uint256 (x > 0 ? x : -x); uint256 msb = msb (result); if (msb < 112) result <<= 112 - msb; else if (msb > 112) result >>= msb - 112; result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16383 + msb << 112; if (x < 0) result |= 0x80000000000000000000000000000000; return bytes16 (uint128 (result)); } } /** * Convert quadruple precision number into signed 256-bit integer number * rounding towards zero. Revert on overflow. * * @param x quadruple precision number * @return signed 256-bit integer number */ function toInt (bytes16 x) internal pure returns (int256) { uint256 exponent = uint128 (x) >> 112 & 0x7FFF; require (exponent <= 16638); // Overflow if (exponent < 16383) return 0; // Underflow uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 0x10000000000000000000000000000; if (exponent < 16495) result >>= 16495 - exponent; else if (exponent > 16495) result <<= exponent - 16495; if (uint128 (x) >= 0x80000000000000000000000000000000) { // Negative require (result <= 0x8000000000000000000000000000000000000000000000000000000000000000); return -int256 (result); // We rely on overflow behavior here } else { require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int256 (result); } } /** * Convert unsigned 256-bit integer number into quadruple precision number. * * @param x unsigned 256-bit integer number * @return quadruple precision number */ function fromUInt (uint256 x) internal pure returns (bytes16) { if (x == 0) return bytes16 (0); else { uint256 result = x; uint256 msb = msb (result); if (msb < 112) result <<= 112 - msb; else if (msb > 112) result >>= msb - 112; result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16383 + msb << 112; return bytes16 (uint128 (result)); } } /** * Convert quadruple precision number into unsigned 256-bit integer number * rounding towards zero. Revert on underflow. Note, that negative floating * point numbers in range (-1.0 .. 0.0) may be converted to unsigned integer * without error, because they are rounded to zero. * * @param x quadruple precision number * @return unsigned 256-bit integer number */ function toUInt (bytes16 x) internal pure returns (uint256) { uint256 exponent = uint128 (x) >> 112 & 0x7FFF; if (exponent < 16383) return 0; // Underflow require (uint128 (x) < 0x80000000000000000000000000000000); // Negative require (exponent <= 16638); // Overflow uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 0x10000000000000000000000000000; if (exponent < 16495) result >>= 16495 - exponent; else if (exponent > 16495) result <<= exponent - 16495; return result; } /** * Convert signed 128.128 bit fixed point number into quadruple precision * number. * * @param x signed 128.128 bit fixed point number * @return quadruple precision number */ function from128x128 (int256 x) internal pure returns (bytes16) { if (x == 0) return bytes16 (0); else { // We rely on overflow behavior here uint256 result = uint256 (x > 0 ? x : -x); uint256 msb = msb (result); if (msb < 112) result <<= 112 - msb; else if (msb > 112) result >>= msb - 112; result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16255 + msb << 112; if (x < 0) result |= 0x80000000000000000000000000000000; return bytes16 (uint128 (result)); } } /** * Convert quadruple precision number into signed 128.128 bit fixed point * number. Revert on overflow. * * @param x quadruple precision number * @return signed 128.128 bit fixed point number */ function to128x128 (bytes16 x) internal pure returns (int256) { uint256 exponent = uint128 (x) >> 112 & 0x7FFF; require (exponent <= 16510); // Overflow if (exponent < 16255) return 0; // Underflow uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 0x10000000000000000000000000000; if (exponent < 16367) result >>= 16367 - exponent; else if (exponent > 16367) result <<= exponent - 16367; if (uint128 (x) >= 0x80000000000000000000000000000000) { // Negative require (result <= 0x8000000000000000000000000000000000000000000000000000000000000000); return -int256 (result); // We rely on overflow behavior here } else { require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int256 (result); } } /** * Convert signed 64.64 bit fixed point number into quadruple precision * number. * * @param x signed 64.64 bit fixed point number * @return quadruple precision number */ function from64x64 (int128 x) internal pure returns (bytes16) { if (x == 0) return bytes16 (0); else { // We rely on overflow behavior here uint256 result = uint128 (x > 0 ? x : -x); uint256 msb = msb (result); if (msb < 112) result <<= 112 - msb; else if (msb > 112) result >>= msb - 112; result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16319 + msb << 112; if (x < 0) result |= 0x80000000000000000000000000000000; return bytes16 (uint128 (result)); } } /** * Convert quadruple precision number into signed 64.64 bit fixed point * number. Revert on overflow. * * @param x quadruple precision number * @return signed 64.64 bit fixed point number */ function to64x64 (bytes16 x) internal pure returns (int128) { uint256 exponent = uint128 (x) >> 112 & 0x7FFF; require (exponent <= 16446); // Overflow if (exponent < 16319) return 0; // Underflow uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 0x10000000000000000000000000000; if (exponent < 16431) result >>= 16431 - exponent; else if (exponent > 16431) result <<= exponent - 16431; if (uint128 (x) >= 0x80000000000000000000000000000000) { // Negative require (result <= 0x80000000000000000000000000000000); return -int128 (result); // We rely on overflow behavior here } else { require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int128 (result); } } /** * Convert octuple precision number into quadruple precision number. * * @param x octuple precision number * @return quadruple precision number */ function fromOctuple (bytes32 x) internal pure returns (bytes16) { bool negative = x & 0x8000000000000000000000000000000000000000000000000000000000000000 > 0; uint256 exponent = uint256 (x) >> 236 & 0x7FFFF; uint256 significand = uint256 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (exponent == 0x7FFFF) { if (significand > 0) return NaN; else return negative ? NEGATIVE_INFINITY : POSITIVE_INFINITY; } if (exponent > 278526) return negative ? NEGATIVE_INFINITY : POSITIVE_INFINITY; else if (exponent < 245649) return negative ? NEGATIVE_ZERO : POSITIVE_ZERO; else if (exponent < 245761) { significand = (significand | 0x100000000000000000000000000000000000000000000000000000000000) >> 245885 - exponent; exponent = 0; } else { significand >>= 124; exponent -= 245760; } uint128 result = uint128 (significand | exponent << 112); if (negative) result |= 0x80000000000000000000000000000000; return bytes16 (result); } /** * Convert quadruple precision number into octuple precision number. * * @param x quadruple precision number * @return octuple precision number */ function toOctuple (bytes16 x) internal pure returns (bytes32) { uint256 exponent = uint128 (x) >> 112 & 0x7FFF; uint256 result = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (exponent == 0x7FFF) exponent = 0x7FFFF; // Infinity or NaN else if (exponent == 0) { if (result > 0) { uint256 msb = msb (result); result = result << 236 - msb & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; exponent = 245649 + msb; } } else { result <<= 124; exponent += 245760; } result |= exponent << 236; if (uint128 (x) >= 0x80000000000000000000000000000000) result |= 0x8000000000000000000000000000000000000000000000000000000000000000; return bytes32 (result); } /** * Convert double precision number into quadruple precision number. * * @param x double precision number * @return quadruple precision number */ function fromDouble (bytes8 x) internal pure returns (bytes16) { uint256 exponent = uint64 (x) >> 52 & 0x7FF; uint256 result = uint64 (x) & 0xFFFFFFFFFFFFF; if (exponent == 0x7FF) exponent = 0x7FFF; // Infinity or NaN else if (exponent == 0) { if (result > 0) { uint256 msb = msb (result); result = result << 112 - msb & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; exponent = 15309 + msb; } } else { result <<= 60; exponent += 15360; } result |= exponent << 112; if (x & 0x8000000000000000 > 0) result |= 0x80000000000000000000000000000000; return bytes16 (uint128 (result)); } /** * Convert quadruple precision number into double precision number. * * @param x quadruple precision number * @return double precision number */ function toDouble (bytes16 x) internal pure returns (bytes8) { bool negative = uint128 (x) >= 0x80000000000000000000000000000000; uint256 exponent = uint128 (x) >> 112 & 0x7FFF; uint256 significand = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (exponent == 0x7FFF) { if (significand > 0) return 0x7FF8000000000000; // NaN else return negative ? bytes8 (0xFFF0000000000000) : // -Infinity bytes8 (0x7FF0000000000000); // Infinity } if (exponent > 17406) return negative ? bytes8 (0xFFF0000000000000) : // -Infinity bytes8 (0x7FF0000000000000); // Infinity else if (exponent < 15309) return negative ? bytes8 (0x8000000000000000) : // -0 bytes8 (0x0000000000000000); // 0 else if (exponent < 15361) { significand = (significand | 0x10000000000000000000000000000) >> 15421 - exponent; exponent = 0; } else { significand >>= 60; exponent -= 15360; } uint64 result = uint64 (significand | exponent << 52); if (negative) result |= 0x8000000000000000; return bytes8 (result); } /** * Test whether given quadruple precision number is NaN. * * @param x quadruple precision number * @return true if x is NaN, false otherwise */ function isNaN (bytes16 x) internal pure returns (bool) { return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF > 0x7FFF0000000000000000000000000000; } /** * Test whether given quadruple precision number is positive or negative * infinity. * * @param x quadruple precision number * @return true if x is positive or negative infinity, false otherwise */ function isInfinity (bytes16 x) internal pure returns (bool) { return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0x7FFF0000000000000000000000000000; } /** * Calculate sign of x, i.e. -1 if x is negative, 0 if x if zero, and 1 if x * is positive. Note that sign (-0) is zero. Revert if x is NaN. * * @param x quadruple precision number * @return sign of x */ function sign (bytes16 x) internal pure returns (int8) { uint128 absoluteX = uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; require (absoluteX <= 0x7FFF0000000000000000000000000000); // Not NaN if (absoluteX == 0) return 0; else if (uint128 (x) >= 0x80000000000000000000000000000000) return -1; else return 1; } /** * Calculate sign (x - y). Revert if either argument is NaN, or both * arguments are infinities of the same sign. * * @param x quadruple precision number * @param y quadruple precision number * @return sign (x - y) */ function cmp (bytes16 x, bytes16 y) internal pure returns (int8) { uint128 absoluteX = uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; require (absoluteX <= 0x7FFF0000000000000000000000000000); // Not NaN uint128 absoluteY = uint128 (y) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; require (absoluteY <= 0x7FFF0000000000000000000000000000); // Not NaN // Not infinities of the same sign require (x != y || absoluteX < 0x7FFF0000000000000000000000000000); if (x == y) return 0; else { bool negativeX = uint128 (x) >= 0x80000000000000000000000000000000; bool negativeY = uint128 (y) >= 0x80000000000000000000000000000000; if (negativeX) { if (negativeY) return absoluteX > absoluteY ? -1 : int8 (1); else return -1; } else { if (negativeY) return 1; else return absoluteX > absoluteY ? int8 (1) : -1; } } } /** * Test whether x equals y. NaN, infinity, and -infinity are not equal to * anything. * * @param x quadruple precision number * @param y quadruple precision number * @return true if x equals to y, false otherwise */ function eq (bytes16 x, bytes16 y) internal pure returns (bool) { if (x == y) { return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF < 0x7FFF0000000000000000000000000000; } else return false; } /** * Calculate x + y. Special values behave in the following way: * * NaN + x = NaN for any x. * Infinity + x = Infinity for any finite x. * -Infinity + x = -Infinity for any finite x. * Infinity + Infinity = Infinity. * -Infinity + -Infinity = -Infinity. * Infinity + -Infinity = -Infinity + Infinity = NaN. * * @param x quadruple precision number * @param y quadruple precision number * @return quadruple precision number */ function add (bytes16 x, bytes16 y) internal pure returns (bytes16) { uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; uint256 yExponent = uint128 (y) >> 112 & 0x7FFF; if (xExponent == 0x7FFF) { if (yExponent == 0x7FFF) { if (x == y) return x; else return NaN; } else return x; } else if (yExponent == 0x7FFF) return y; else { bool xSign = uint128 (x) >= 0x80000000000000000000000000000000; uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0) xExponent = 1; else xSignifier |= 0x10000000000000000000000000000; bool ySign = uint128 (y) >= 0x80000000000000000000000000000000; uint256 ySignifier = uint128 (y) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (yExponent == 0) yExponent = 1; else ySignifier |= 0x10000000000000000000000000000; if (xSignifier == 0) return y == NEGATIVE_ZERO ? POSITIVE_ZERO : y; else if (ySignifier == 0) return x == NEGATIVE_ZERO ? POSITIVE_ZERO : x; else { int256 delta = int256 (xExponent) - int256 (yExponent); if (xSign == ySign) { if (delta > 112) return x; else if (delta > 0) ySignifier >>= uint256 (delta); else if (delta < -112) return y; else if (delta < 0) { xSignifier >>= uint256 (-delta); xExponent = yExponent; } xSignifier += ySignifier; if (xSignifier >= 0x20000000000000000000000000000) { xSignifier >>= 1; xExponent += 1; } if (xExponent == 0x7FFF) return xSign ? NEGATIVE_INFINITY : POSITIVE_INFINITY; else { if (xSignifier < 0x10000000000000000000000000000) xExponent = 0; else xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; return bytes16 (uint128 ( (xSign ? 0x80000000000000000000000000000000 : 0) | (xExponent << 112) | xSignifier)); } } else { if (delta > 0) { xSignifier <<= 1; xExponent -= 1; } else if (delta < 0) { ySignifier <<= 1; xExponent = yExponent - 1; } if (delta > 112) ySignifier = 1; else if (delta > 1) ySignifier = (ySignifier - 1 >> uint256 (delta - 1)) + 1; else if (delta < -112) xSignifier = 1; else if (delta < -1) xSignifier = (xSignifier - 1 >> uint256 (-delta - 1)) + 1; if (xSignifier >= ySignifier) xSignifier -= ySignifier; else { xSignifier = ySignifier - xSignifier; xSign = ySign; } if (xSignifier == 0) return POSITIVE_ZERO; uint256 msb = msb (xSignifier); if (msb == 113) { xSignifier = xSignifier >> 1 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; xExponent += 1; } else if (msb < 112) { uint256 shift = 112 - msb; if (xExponent > shift) { xSignifier = xSignifier << shift & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; xExponent -= shift; } else { xSignifier <<= xExponent - 1; xExponent = 0; } } else xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0x7FFF) return xSign ? NEGATIVE_INFINITY : POSITIVE_INFINITY; else return bytes16 (uint128 ( (xSign ? 0x80000000000000000000000000000000 : 0) | (xExponent << 112) | xSignifier)); } } } } /** * Calculate x - y. Special values behave in the following way: * * NaN - x = NaN for any x. * Infinity - x = Infinity for any finite x. * -Infinity - x = -Infinity for any finite x. * Infinity - -Infinity = Infinity. * -Infinity - Infinity = -Infinity. * Infinity - Infinity = -Infinity - -Infinity = NaN. * * @param x quadruple precision number * @param y quadruple precision number * @return quadruple precision number */ function sub (bytes16 x, bytes16 y) internal pure returns (bytes16) { return add (x, y ^ 0x80000000000000000000000000000000); } /** * Calculate x * y. Special values behave in the following way: * * NaN * x = NaN for any x. * Infinity * x = Infinity for any finite positive x. * Infinity * x = -Infinity for any finite negative x. * -Infinity * x = -Infinity for any finite positive x. * -Infinity * x = Infinity for any finite negative x. * Infinity * 0 = NaN. * -Infinity * 0 = NaN. * Infinity * Infinity = Infinity. * Infinity * -Infinity = -Infinity. * -Infinity * Infinity = -Infinity. * -Infinity * -Infinity = Infinity. * * @param x quadruple precision number * @param y quadruple precision number * @return quadruple precision number */ function mul (bytes16 x, bytes16 y) internal pure returns (bytes16) { uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; uint256 yExponent = uint128 (y) >> 112 & 0x7FFF; if (xExponent == 0x7FFF) { if (yExponent == 0x7FFF) { if (x == y) return x ^ y & 0x80000000000000000000000000000000; else if (x ^ y == 0x80000000000000000000000000000000) return x | y; else return NaN; } else { if (y & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) return NaN; else return x ^ y & 0x80000000000000000000000000000000; } } else if (yExponent == 0x7FFF) { if (x & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) return NaN; else return y ^ x & 0x80000000000000000000000000000000; } else { uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0) xExponent = 1; else xSignifier |= 0x10000000000000000000000000000; uint256 ySignifier = uint128 (y) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (yExponent == 0) yExponent = 1; else ySignifier |= 0x10000000000000000000000000000; xSignifier *= ySignifier; if (xSignifier == 0) return (x ^ y) & 0x80000000000000000000000000000000 > 0 ? NEGATIVE_ZERO : POSITIVE_ZERO; xExponent += yExponent; uint256 msb = xSignifier >= 0x200000000000000000000000000000000000000000000000000000000 ? 225 : xSignifier >= 0x100000000000000000000000000000000000000000000000000000000 ? 224 : msb (xSignifier); if (xExponent + msb < 16496) { // Underflow xExponent = 0; xSignifier = 0; } else if (xExponent + msb < 16608) { // Subnormal if (xExponent < 16496) xSignifier >>= 16496 - xExponent; else if (xExponent > 16496) xSignifier <<= xExponent - 16496; xExponent = 0; } else if (xExponent + msb > 49373) { xExponent = 0x7FFF; xSignifier = 0; } else { if (msb > 112) xSignifier >>= msb - 112; else if (msb < 112) xSignifier <<= 112 - msb; xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; xExponent = xExponent + msb - 16607; } return bytes16 (uint128 (uint128 ((x ^ y) & 0x80000000000000000000000000000000) | xExponent << 112 | xSignifier)); } } /** * Calculate x / y. Special values behave in the following way: * * NaN / x = NaN for any x. * x / NaN = NaN for any x. * Infinity / x = Infinity for any finite non-negative x. * Infinity / x = -Infinity for any finite negative x including -0. * -Infinity / x = -Infinity for any finite non-negative x. * -Infinity / x = Infinity for any finite negative x including -0. * x / Infinity = 0 for any finite non-negative x. * x / -Infinity = -0 for any finite non-negative x. * x / Infinity = -0 for any finite non-negative x including -0. * x / -Infinity = 0 for any finite non-negative x including -0. * * Infinity / Infinity = NaN. * Infinity / -Infinity = -NaN. * -Infinity / Infinity = -NaN. * -Infinity / -Infinity = NaN. * * Division by zero behaves in the following way: * * x / 0 = Infinity for any finite positive x. * x / -0 = -Infinity for any finite positive x. * x / 0 = -Infinity for any finite negative x. * x / -0 = Infinity for any finite negative x. * 0 / 0 = NaN. * 0 / -0 = NaN. * -0 / 0 = NaN. * -0 / -0 = NaN. * * @param x quadruple precision number * @param y quadruple precision number * @return quadruple precision number */ function div (bytes16 x, bytes16 y) internal pure returns (bytes16) { uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; uint256 yExponent = uint128 (y) >> 112 & 0x7FFF; if (xExponent == 0x7FFF) { if (yExponent == 0x7FFF) return NaN; else return x ^ y & 0x80000000000000000000000000000000; } else if (yExponent == 0x7FFF) { if (y & 0x0000FFFFFFFFFFFFFFFFFFFFFFFFFFFF != 0) return NaN; else return POSITIVE_ZERO | (x ^ y) & 0x80000000000000000000000000000000; } else if (y & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) { if (x & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) return NaN; else return POSITIVE_INFINITY | (x ^ y) & 0x80000000000000000000000000000000; } else { uint256 ySignifier = uint128 (y) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (yExponent == 0) yExponent = 1; else ySignifier |= 0x10000000000000000000000000000; uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0) { if (xSignifier != 0) { uint shift = 226 - msb (xSignifier); xSignifier <<= shift; xExponent = 1; yExponent += shift - 114; } } else { xSignifier = (xSignifier | 0x10000000000000000000000000000) << 114; } xSignifier = xSignifier / ySignifier; if (xSignifier == 0) return (x ^ y) & 0x80000000000000000000000000000000 > 0 ? NEGATIVE_ZERO : POSITIVE_ZERO; assert (xSignifier >= 0x1000000000000000000000000000); uint256 msb = xSignifier >= 0x80000000000000000000000000000 ? msb (xSignifier) : xSignifier >= 0x40000000000000000000000000000 ? 114 : xSignifier >= 0x20000000000000000000000000000 ? 113 : 112; if (xExponent + msb > yExponent + 16497) { // Overflow xExponent = 0x7FFF; xSignifier = 0; } else if (xExponent + msb + 16380 < yExponent) { // Underflow xExponent = 0; xSignifier = 0; } else if (xExponent + msb + 16268 < yExponent) { // Subnormal if (xExponent + 16380 > yExponent) xSignifier <<= xExponent + 16380 - yExponent; else if (xExponent + 16380 < yExponent) xSignifier >>= yExponent - xExponent - 16380; xExponent = 0; } else { // Normal if (msb > 112) xSignifier >>= msb - 112; xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; xExponent = xExponent + msb + 16269 - yExponent; } return bytes16 (uint128 (uint128 ((x ^ y) & 0x80000000000000000000000000000000) | xExponent << 112 | xSignifier)); } } /** * Calculate -x. * * @param x quadruple precision number * @return quadruple precision number */ function neg (bytes16 x) internal pure returns (bytes16) { return x ^ 0x80000000000000000000000000000000; } /** * Calculate |x|. * * @param x quadruple precision number * @return quadruple precision number */ function abs (bytes16 x) internal pure returns (bytes16) { return x & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; } /** * Calculate square root of x. Return NaN on negative x excluding -0. * * @param x quadruple precision number * @return quadruple precision number */ function sqrt (bytes16 x) internal pure returns (bytes16) { if (uint128 (x) > 0x80000000000000000000000000000000) return NaN; else { uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; if (xExponent == 0x7FFF) return x; else { uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0) xExponent = 1; else xSignifier |= 0x10000000000000000000000000000; if (xSignifier == 0) return POSITIVE_ZERO; bool oddExponent = xExponent & 0x1 == 0; xExponent = xExponent + 16383 >> 1; if (oddExponent) { if (xSignifier >= 0x10000000000000000000000000000) xSignifier <<= 113; else { uint256 msb = msb (xSignifier); uint256 shift = (226 - msb) & 0xFE; xSignifier <<= shift; xExponent -= shift - 112 >> 1; } } else { if (xSignifier >= 0x10000000000000000000000000000) xSignifier <<= 112; else { uint256 msb = msb (xSignifier); uint256 shift = (225 - msb) & 0xFE; xSignifier <<= shift; xExponent -= shift - 112 >> 1; } } uint256 r = 0x10000000000000000000000000000; r = (r + xSignifier / r) >> 1; r = (r + xSignifier / r) >> 1; r = (r + xSignifier / r) >> 1; r = (r + xSignifier / r) >> 1; r = (r + xSignifier / r) >> 1; r = (r + xSignifier / r) >> 1; r = (r + xSignifier / r) >> 1; // Seven iterations should be enough uint256 r1 = xSignifier / r; if (r1 < r) r = r1; return bytes16 (uint128 (xExponent << 112 | r & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); } } } /** * Calculate binary logarithm of x. Return NaN on negative x excluding -0. * * @param x quadruple precision number * @return quadruple precision number */ function log_2 (bytes16 x) internal pure returns (bytes16) { if (uint128 (x) > 0x80000000000000000000000000000000) return NaN; else if (x == 0x3FFF0000000000000000000000000000) return POSITIVE_ZERO; else { uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; if (xExponent == 0x7FFF) return x; else { uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0) xExponent = 1; else xSignifier |= 0x10000000000000000000000000000; if (xSignifier == 0) return NEGATIVE_INFINITY; bool resultNegative; uint256 resultExponent = 16495; uint256 resultSignifier; if (xExponent >= 0x3FFF) { resultNegative = false; resultSignifier = xExponent - 0x3FFF; xSignifier <<= 15; } else { resultNegative = true; if (xSignifier >= 0x10000000000000000000000000000) { resultSignifier = 0x3FFE - xExponent; xSignifier <<= 15; } else { uint256 msb = msb (xSignifier); resultSignifier = 16493 - msb; xSignifier <<= 127 - msb; } } if (xSignifier == 0x80000000000000000000000000000000) { if (resultNegative) resultSignifier += 1; uint256 shift = 112 - msb (resultSignifier); resultSignifier <<= shift; resultExponent -= shift; } else { uint256 bb = resultNegative ? 1 : 0; while (resultSignifier < 0x10000000000000000000000000000) { resultSignifier <<= 1; resultExponent -= 1; xSignifier *= xSignifier; uint256 b = xSignifier >> 255; resultSignifier += b ^ bb; xSignifier >>= 127 + b; } } return bytes16 (uint128 ((resultNegative ? 0x80000000000000000000000000000000 : 0) | resultExponent << 112 | resultSignifier & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); } } } /** * Calculate natural logarithm of x. Return NaN on negative x excluding -0. * * @param x quadruple precision number * @return quadruple precision number */ function ln (bytes16 x) internal pure returns (bytes16) { return mul (log_2 (x), 0x3FFE62E42FEFA39EF35793C7673007E5); } /** * Calculate 2^x. * * @param x quadruple precision number * @return quadruple precision number */ function pow_2 (bytes16 x) internal pure returns (bytes16) { bool xNegative = uint128 (x) > 0x80000000000000000000000000000000; uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xExponent == 0x7FFF && xSignifier != 0) return NaN; else if (xExponent > 16397) return xNegative ? POSITIVE_ZERO : POSITIVE_INFINITY; else if (xExponent < 16255) return 0x3FFF0000000000000000000000000000; else { if (xExponent == 0) xExponent = 1; else xSignifier |= 0x10000000000000000000000000000; if (xExponent > 16367) xSignifier <<= xExponent - 16367; else if (xExponent < 16367) xSignifier >>= 16367 - xExponent; if (xNegative && xSignifier > 0x406E00000000000000000000000000000000) return POSITIVE_ZERO; if (!xNegative && xSignifier > 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) return POSITIVE_INFINITY; uint256 resultExponent = xSignifier >> 128; xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; if (xNegative && xSignifier != 0) { xSignifier = ~xSignifier; resultExponent += 1; } uint256 resultSignifier = 0x80000000000000000000000000000000; if (xSignifier & 0x80000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128; if (xSignifier & 0x40000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128; if (xSignifier & 0x20000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128; if (xSignifier & 0x10000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10B5586CF9890F6298B92B71842A98363 >> 128; if (xSignifier & 0x8000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1059B0D31585743AE7C548EB68CA417FD >> 128; if (xSignifier & 0x4000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128; if (xSignifier & 0x2000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128; if (xSignifier & 0x1000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128; if (xSignifier & 0x800000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128; if (xSignifier & 0x400000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128; if (xSignifier & 0x200000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100162F3904051FA128BCA9C55C31E5DF >> 128; if (xSignifier & 0x100000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000B175EFFDC76BA38E31671CA939725 >> 128; if (xSignifier & 0x80000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128; if (xSignifier & 0x40000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128; if (xSignifier & 0x20000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000162E525EE054754457D5995292026 >> 128; if (xSignifier & 0x10000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000B17255775C040618BF4A4ADE83FC >> 128; if (xSignifier & 0x8000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128; if (xSignifier & 0x4000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128; if (xSignifier & 0x2000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000162E43F4F831060E02D839A9D16D >> 128; if (xSignifier & 0x1000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000B1721BCFC99D9F890EA06911763 >> 128; if (xSignifier & 0x800000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128; if (xSignifier & 0x400000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128; if (xSignifier & 0x200000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000162E430E5A18F6119E3C02282A5 >> 128; if (xSignifier & 0x100000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000B1721835514B86E6D96EFD1BFE >> 128; if (xSignifier & 0x80000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128; if (xSignifier & 0x40000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000002C5C8601CC6B9E94213C72737A >> 128; if (xSignifier & 0x20000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000162E42FFF037DF38AA2B219F06 >> 128; if (xSignifier & 0x10000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000B17217FBA9C739AA5819F44F9 >> 128; if (xSignifier & 0x8000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128; if (xSignifier & 0x4000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128; if (xSignifier & 0x2000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000162E42FF0999CE3541B9FFFCF >> 128; if (xSignifier & 0x1000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000B17217F80F4EF5AADDA45554 >> 128; if (xSignifier & 0x800000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000058B90BFBF8479BD5A81B51AD >> 128; if (xSignifier & 0x400000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128; if (xSignifier & 0x200000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000162E42FEFB2FED257559BDAA >> 128; if (xSignifier & 0x100000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128; if (xSignifier & 0x80000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128; if (xSignifier & 0x40000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128; if (xSignifier & 0x20000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000162E42FEFA494F1478FDE05 >> 128; if (xSignifier & 0x10000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000B17217F7D20CF927C8E94C >> 128; if (xSignifier & 0x8000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128; if (xSignifier & 0x4000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000002C5C85FDF477B662B26945 >> 128; if (xSignifier & 0x2000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000162E42FEFA3AE53369388C >> 128; if (xSignifier & 0x1000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000B17217F7D1D351A389D40 >> 128; if (xSignifier & 0x800000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128; if (xSignifier & 0x400000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000002C5C85FDF4741BEA6E77E >> 128; if (xSignifier & 0x200000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000162E42FEFA39FE95583C2 >> 128; if (xSignifier & 0x100000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000B17217F7D1CFB72B45E1 >> 128; if (xSignifier & 0x80000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128; if (xSignifier & 0x40000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000002C5C85FDF473E242EA38 >> 128; if (xSignifier & 0x20000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000162E42FEFA39F02B772C >> 128; if (xSignifier & 0x10000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000B17217F7D1CF7D83C1A >> 128; if (xSignifier & 0x8000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128; if (xSignifier & 0x4000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000002C5C85FDF473DEA871F >> 128; if (xSignifier & 0x2000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000162E42FEFA39EF44D91 >> 128; if (xSignifier & 0x1000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000B17217F7D1CF79E949 >> 128; if (xSignifier & 0x800000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000058B90BFBE8E7BCE544 >> 128; if (xSignifier & 0x400000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000002C5C85FDF473DE6ECA >> 128; if (xSignifier & 0x200000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000162E42FEFA39EF366F >> 128; if (xSignifier & 0x100000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000B17217F7D1CF79AFA >> 128; if (xSignifier & 0x80000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000058B90BFBE8E7BCD6D >> 128; if (xSignifier & 0x40000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000002C5C85FDF473DE6B2 >> 128; if (xSignifier & 0x20000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000162E42FEFA39EF358 >> 128; if (xSignifier & 0x10000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000B17217F7D1CF79AB >> 128; if (xSignifier & 0x8000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000058B90BFBE8E7BCD5 >> 128; if (xSignifier & 0x4000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000002C5C85FDF473DE6A >> 128; if (xSignifier & 0x2000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000162E42FEFA39EF34 >> 128; if (xSignifier & 0x1000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000B17217F7D1CF799 >> 128; if (xSignifier & 0x800000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000058B90BFBE8E7BCC >> 128; if (xSignifier & 0x400000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000002C5C85FDF473DE5 >> 128; if (xSignifier & 0x200000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000162E42FEFA39EF2 >> 128; if (xSignifier & 0x100000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000B17217F7D1CF78 >> 128; if (xSignifier & 0x80000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000058B90BFBE8E7BB >> 128; if (xSignifier & 0x40000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000002C5C85FDF473DD >> 128; if (xSignifier & 0x20000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000162E42FEFA39EE >> 128; if (xSignifier & 0x10000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000B17217F7D1CF6 >> 128; if (xSignifier & 0x8000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000058B90BFBE8E7A >> 128; if (xSignifier & 0x4000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000002C5C85FDF473C >> 128; if (xSignifier & 0x2000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000162E42FEFA39D >> 128; if (xSignifier & 0x1000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000B17217F7D1CE >> 128; if (xSignifier & 0x800000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000058B90BFBE8E6 >> 128; if (xSignifier & 0x400000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000002C5C85FDF472 >> 128; if (xSignifier & 0x200000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000162E42FEFA38 >> 128; if (xSignifier & 0x100000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000B17217F7D1B >> 128; if (xSignifier & 0x80000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000058B90BFBE8D >> 128; if (xSignifier & 0x40000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000002C5C85FDF46 >> 128; if (xSignifier & 0x20000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000162E42FEFA2 >> 128; if (xSignifier & 0x10000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000B17217F7D0 >> 128; if (xSignifier & 0x8000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000058B90BFBE7 >> 128; if (xSignifier & 0x4000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000002C5C85FDF3 >> 128; if (xSignifier & 0x2000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000162E42FEF9 >> 128; if (xSignifier & 0x1000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000B17217F7C >> 128; if (xSignifier & 0x800000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000058B90BFBD >> 128; if (xSignifier & 0x400000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000002C5C85FDE >> 128; if (xSignifier & 0x200000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000162E42FEE >> 128; if (xSignifier & 0x100000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000B17217F6 >> 128; if (xSignifier & 0x80000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000058B90BFA >> 128; if (xSignifier & 0x40000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000002C5C85FC >> 128; if (xSignifier & 0x20000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000162E42FD >> 128; if (xSignifier & 0x10000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000B17217E >> 128; if (xSignifier & 0x8000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000058B90BE >> 128; if (xSignifier & 0x4000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000002C5C85E >> 128; if (xSignifier & 0x2000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000162E42E >> 128; if (xSignifier & 0x1000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000B17216 >> 128; if (xSignifier & 0x800000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000058B90A >> 128; if (xSignifier & 0x400000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000002C5C84 >> 128; if (xSignifier & 0x200000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000162E41 >> 128; if (xSignifier & 0x100000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000B1720 >> 128; if (xSignifier & 0x80000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000058B8F >> 128; if (xSignifier & 0x40000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000002C5C7 >> 128; if (xSignifier & 0x20000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000162E3 >> 128; if (xSignifier & 0x10000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000B171 >> 128; if (xSignifier & 0x8000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000058B8 >> 128; if (xSignifier & 0x4000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000002C5B >> 128; if (xSignifier & 0x2000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000162D >> 128; if (xSignifier & 0x1000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000B16 >> 128; if (xSignifier & 0x800 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000058A >> 128; if (xSignifier & 0x400 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000002C4 >> 128; if (xSignifier & 0x200 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000161 >> 128; if (xSignifier & 0x100 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000000B0 >> 128; if (xSignifier & 0x80 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000057 >> 128; if (xSignifier & 0x40 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000002B >> 128; if (xSignifier & 0x20 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000015 >> 128; if (xSignifier & 0x10 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000000A >> 128; if (xSignifier & 0x8 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000004 >> 128; if (xSignifier & 0x4 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000001 >> 128; if (!xNegative) { resultSignifier = resultSignifier >> 15 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; resultExponent += 0x3FFF; } else if (resultExponent <= 0x3FFE) { resultSignifier = resultSignifier >> 15 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; resultExponent = 0x3FFF - resultExponent; } else { resultSignifier = resultSignifier >> resultExponent - 16367; resultExponent = 0; } return bytes16 (uint128 (resultExponent << 112 | resultSignifier)); } } /** * Calculate e^x. * * @param x quadruple precision number * @return quadruple precision number */ function exp (bytes16 x) internal pure returns (bytes16) { return pow_2 (mul (x, 0x3FFF71547652B82FE1777D0FFDA0D23A)); } /** * Get index of the most significant non-zero bit in binary representation of * x. Reverts if x is zero. * * @return index of the most significant non-zero bit in binary representation * of x */ function msb (uint256 x) private pure returns (uint256) { require (x > 0); uint256 result = 0; if (x >= 0x100000000000000000000000000000000) { x >>= 128; result += 128; } if (x >= 0x10000000000000000) { x >>= 64; result += 64; } if (x >= 0x100000000) { x >>= 32; result += 32; } if (x >= 0x10000) { x >>= 16; result += 16; } if (x >= 0x100) { x >>= 8; result += 8; } if (x >= 0x10) { x >>= 4; result += 4; } if (x >= 0x4) { x >>= 2; result += 2; } if (x >= 0x2) result += 1; // No need to shift x anymore return result; } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": { "contracts/libraries/CentaurMath.sol": { "CentaurMath": "0xfe40675976c6dbecad7b98b07c29f1cd90e70129" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AmountIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"AmountOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"_to","type":"address"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenTargetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"getAmountInFromValue","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"getAmountOutFromValue","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOraclePrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getValueFromAmountIn","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getValueFromAmountOut","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_baseToken","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"uint256","name":"_liquidityParameter","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityParameter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_depositEnabled","type":"bool"}],"name":"setDepositEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"}],"name":"setFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityParameter","type":"uint256"}],"name":"setLiquidityParameter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_tradeEnabled","type":"bool"}],"name":"setTradeEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_withdrawEnabled","type":"bool"}],"name":"setWithdrawEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"swapFrom","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"swapSettle","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_fromToken","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"swapTo","outputs":[{"internalType":"uint256","name":"maxAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradeEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052601260025534801561001557600080fd5b506155e980620000266000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637dc0d1d011610130578063a0930ebe116100b8578063d621e8131161007c578063d621e813146106b8578063dd62ed3e146106d6578063e68b52e714610706578063faa4822414610724578063fecc5a561461074257610227565b8063a0930ebe14610600578063a9059cbb14610630578063b464f46914610660578063c45a01551461067c578063c55dae631461069a57610227565b80638d2f19bc116100ff5780638d2f19bc146105475780638f87ff1c1461057757806392a3d6c01461059557806395d89b41146105c65780639ec004a2146105e457610227565b80637dc0d1d0146104ab578063807e6cc6146104c957806382aa1c88146104f957806389afcb441461051757610227565b80633a69a1be116101b35780635b17d04b116101825780635b17d04b146103f55780635bb47808146104115780636a6278421461042d57806370a082311461045d578063796da7af1461048d57610227565b80633a69a1be146103835780633bec2bf3146103a157806346639dba146103bd578063551512de146103d957610227565b80632287e96a116101fa5780632287e96a146102c857806323b872dd146102e657806328a4a0d1146103165780632eebe78e14610347578063313ce5671461036557610227565b806306fdde031461022c578063095ea7b31461024a57806318160ddd1461027a5780631a275a0314610298575b600080fd5b610234610772565b6040516102419190615041565b60405180910390f35b610264600480360381019061025f9190614418565b6107ab565b6040516102719190615026565b60405180910390f35b6102826107c2565b60405161028f91906152e3565b60405180910390f35b6102b260048036038101906102ad91906143a1565b6107c8565b6040516102bf91906152e3565b60405180910390f35b6102d0611022565b6040516102dd9190615026565b60405180910390f35b61030060048036038101906102fb9190614352565b611035565b60405161030d9190615026565b60405180910390f35b610330600480360381019061032b9190614238565b611200565b60405161033e929190615327565b60405180910390f35b61034f611694565b60405161035c9190615026565b60405180910390f35b61036d6116a7565b60405161037a91906152e3565b60405180910390f35b61038b6116ad565b60405161039891906152e3565b60405180910390f35b6103bb60048036038101906103b691906144a3565b6116b3565b005b6103d760048036038101906103d291906142ef565b611760565b005b6103f360048036038101906103ee9190614454565b611ba4565b005b61040f600480360381019061040a91906144a3565b611cab565b005b61042b60048036038101906104269190614238565b611d58565b005b61044760048036038101906104429190614238565b611e2c565b60405161045491906152e3565b60405180910390f35b61047760048036038101906104729190614238565b6121d2565b60405161048491906152e3565b60405180910390f35b6104956121ea565b6040516104a291906152e3565b60405180910390f35b6104b36122c4565b6040516104c09190614f58565b60405180910390f35b6104e360048036038101906104de9190614560565b6122ea565b6040516104f091906152e3565b60405180910390f35b6105016123d7565b60405161050e91906152e3565b60405180910390f35b610531600480360381019061052c9190614238565b6123dd565b60405161053e91906152e3565b60405180910390f35b610561600480360381019061055c9190614560565b61275f565b60405161056e91906152e3565b60405180910390f35b61057f612808565b60405161058c91906152e3565b60405180910390f35b6105af60048036038101906105aa9190614238565b61280e565b6040516105bd9291906152fe565b60405180910390f35b6105ce613228565b6040516105db9190615041565b60405180910390f35b6105fe60048036038101906105f991906144a3565b6132c6565b005b61061a60048036038101906106159190614560565b613373565b60405161062791906152e3565b60405180910390f35b61064a60048036038101906106459190614418565b613460565b6040516106579190615026565b60405180910390f35b61067a60048036038101906106759190614560565b613477565b005b610684613511565b6040516106919190614f58565b60405180910390f35b6106a2613537565b6040516106af9190614f58565b60405180910390f35b6106c061355d565b6040516106cd9190615026565b60405180910390f35b6106f060048036038101906106eb91906142b3565b613570565b6040516106fd91906152e3565b60405180910390f35b61070e613595565b60405161071b91906152e3565b60405180910390f35b61072c61359b565b60405161073991906152e3565b60405180910390f35b61075c60048036038101906107579190614560565b6135a1565b60405161076991906152e3565b60405180910390f35b6040518060400160405280601481526020017f43656e7461757253776170204c5020546f6b656e00000000000000000000000081525081565b60006107b833848461364a565b6001905092915050565b60035481565b60006001600f541461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080690615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b7919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091b90615283565b60405180910390fd5b600e60009054906101000a900460ff16610973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096a90615063565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610a04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fb90615183565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bbe4f6db876040518263ffffffff1660e01b8152600401610a619190614f58565b60206040518083038186803b158015610a7957600080fd5b505afa158015610a8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab19190614261565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1a90615263565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511606306040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8d57600080fd5b505afa158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc59190614261565b90508073ffffffffffffffffffffffffffffffffffffffff1663e9c0f42389306040518363ffffffff1660e01b8152600401610c02929190614f73565b60206040518083038186803b158015610c1a57600080fd5b505afa158015610c2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5291906144cc565b15610c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8990615143565b60405180910390fd5b610c9b85613373565b9250610ca5613eb4565b6040518061018001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018473ffffffffffffffffffffffffffffffffffffffff1663faa482246040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1957600080fd5b505afa158015610d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d519190614589565b8152602001610de6898673ffffffffffffffffffffffffffffffffffffffff16638f87ff1c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610da057600080fd5b505afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190614589565b61373590919063ffffffff16565b81526020018473ffffffffffffffffffffffffffffffffffffffff16633a69a1be6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3157600080fd5b505afa158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e699190614589565b81526020013073ffffffffffffffffffffffffffffffffffffffff168152602001858152602001600b548152602001600c548152602001600d5481526020018673ffffffffffffffffffffffffffffffffffffffff168152602001610f548473ffffffffffffffffffffffffffffffffffffffff1663576922136040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0d57600080fd5b505afa158015610f21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f459190614589565b4261377f90919063ffffffff16565b8152509050610f6e84600c5461373590919063ffffffff16565b600c819055508173ffffffffffffffffffffffffffffffffffffffff16631b54b99d8a836040518363ffffffff1660e01b8152600401610faf929190614fd3565b600060405180830381600087803b158015610fc957600080fd5b505af1158015610fdd573d6000803e3d6000fd5b5050505061100e600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683866137d4565b5050506001600f8190555095945050505050565b600e60029054906101000a900460ff1681565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146111ea5761116982600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461373590919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6111f584848461395f565b600190509392505050565b6000806001600f5414611248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123f90615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b1580156112b857600080fd5b505afa1580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f0919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461135d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135490615283565b60405180910390fd5b600e60009054906101000a900460ff166113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a390615063565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016114099190614f58565b60206040518083038186803b15801561142157600080fd5b505afa158015611435573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114599190614589565b9050600c54811161149f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611496906152a3565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511606306040518163ffffffff1660e01b815260040160206040518083038186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115419190614261565b90508073ffffffffffffffffffffffffffffffffffffffff1663e9c0f42386306040518363ffffffff1660e01b815260040161157e929190614f73565b60206040518083038186803b15801561159657600080fd5b505afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce91906144cc565b1561160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160590615143565b60405180910390fd5b611623600c548361373590919063ffffffff16565b935061162e846135a1565b925081600c819055508473ffffffffffffffffffffffffffffffffffffffff167f7bf2a01640cc1b6eeeab1bcad625d2d9e37eda9d74b776d36fe4d233983b682c8560405161167d91906152e3565b60405180910390a250506001600f81905550915091565b600e60019054906101000a900460ff1681565b60025481565b600d5481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a90615243565b60405180910390fd5b80600e60006101000a81548160ff02191690831515021790555050565b600060019054906101000a900460ff168061177f575061177e613af3565b5b80611795575060008054906101000a900460ff16155b6117d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cb906151e3565b60405180910390fd5b60008060019054906101000a900460ff161590508015611824576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b84600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561190e57600080fd5b505afa158015611922573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119469190614629565b60ff1660088190555082600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f857600080fd5b505afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a309190614629565b60ff16600a819055506000600e60006101000a81548160ff0219169083151502179055506000600e60016101000a81548160ff0219169083151502179055506000600e60026101000a81548160ff02191690831515021790555081600d81905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611af957600080fd5b505afa158015611b0d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611b3691906144f5565b604051602001611b469190614f36565b60405160208183030381529060405260019080519060200190611b6a929190613f57565b506008546002819055506001600f819055508015611b9d5760008060016101000a81548160ff0219169083151502179055505b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b90615243565b60405180910390fd5b611c3f8382846137d4565b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8e9e3b804e5b56d0c8cbb012e3cb707f9666570bd8ef94b5342894dde33701bf4285604051611c9e929190615327565b60405180910390a3505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3290615243565b60405180910390fd5b80600e60016101000a81548160ff02191690831515021790555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611de8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ddf90615243565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006001600f5414611e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6a90615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7f90615283565b60405180910390fd5b600e60019054906101000a900460ff16611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce906150e3565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016120349190614f58565b60206040518083038186803b15801561204c57600080fd5b505afa158015612060573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120849190614589565b9050600061209d600c548361373590919063ffffffff16565b9050600060035414156120c6576120bf600b548261377f90919063ffffffff16565b92506120f2565b6120ef600b546120e160035484613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b92505b60008311612135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212c90615083565b60405180910390fd5b61213f8484613bc4565b61215481600c5461377f90919063ffffffff16565b600c8190555061216f81600b5461377f90919063ffffffff16565b600b819055503373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040516121bb91906152e3565b60405180910390a250506001600f81905550919050565b60046020528060005260406000206000915090505481565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561225557600080fd5b505afa158015612269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228d91906145b2565b5050509150506122be6122ac600a54601261373590919063ffffffff16565b600a0a82613b0a90919063ffffffff16565b91505090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600c5411612330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612327906151c3565b60405180910390fd5b73fe40675976c6dbecad7b98b07c29f1cd90e7012963985ae292836123536121ea565b600854600b54600c54600d546040518763ffffffff1660e01b815260040161238096959493929190615350565b60206040518083038186803b15801561239857600080fd5b505af41580156123ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d09190614589565b9050919050565b60085481565b60006001600f5414612424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241b90615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b15801561249457600080fd5b505afa1580156124a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124cc919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612539576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253090615283565b60405180910390fd5b600e60029054906101000a900460ff16612588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257f90615203565b60405180910390fd5b6000600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506125f56003546125e7600b5484613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b91506000821161263a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161263190615163565b60405180910390fd5b81600c54101561267f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612676906151c3565b60405180910390fd5b6126893082613cde565b6126b6600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846137d4565b6126cb82600c5461373590919063ffffffff16565b600c819055506126e682600b5461373590919063ffffffff16565b600b819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdbdf9b8e4b75e75b162d151ec8fc7f0561cabab5fcccfa2600be62223e4300c48460405161274991906152e3565b60405180910390a3506001600f81905550919050565b600073fe40675976c6dbecad7b98b07c29f1cd90e70129631afdf047836127846121ea565b600854600b54600c54600d546040518763ffffffff1660e01b81526004016127b196959493929190615350565b60206040518083038186803b1580156127c957600080fd5b505af41580156127dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128019190614589565b9050919050565b600c5481565b6000806001600f5414612856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284d90615103565b60405180910390fd5b6000600f819055506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511606306040518163ffffffff1660e01b815260040160206040518083038186803b1580156128c857600080fd5b505afa1580156128dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129009190614261565b905061290a613eb4565b8173ffffffffffffffffffffffffffffffffffffffff16633da3535f86306040518363ffffffff1660e01b8152600401612945929190614f73565b6101806040518083038186803b15801561295e57600080fd5b505afa158015612972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129969190614536565b9050600081610160015114156129e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129d8906150a3565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168160a0015173ffffffffffffffffffffffffffffffffffffffff1614612a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4a906152c3565b60405180910390fd5b806101600151421015612a9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a92906151a3565b60405180910390fd5b6000816000015173ffffffffffffffffffffffffffffffffffffffff1663796da7af6040518163ffffffff1660e01b815260040160206040518083038186803b158015612ae757600080fd5b505afa158015612afb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b1f9190614589565b90506000612b2b6121ea565b9050600073fe40675976c6dbecad7b98b07c29f1cd90e70129635b81a88b856020015185876000015173ffffffffffffffffffffffffffffffffffffffff166382aa1c886040518163ffffffff1660e01b815260040160206040518083038186803b158015612b9957600080fd5b505afa158015612bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd19190614589565b886040015189606001518a608001516040518763ffffffff1660e01b8152600401612c0196959493929190615350565b60206040518083038186803b158015612c1957600080fd5b505af4158015612c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c519190614589565b9050600073fe40675976c6dbecad7b98b07c29f1cd90e70129634ea9cefa83856008548960e001518a61010001518b61012001516040518763ffffffff1660e01b8152600401612ca696959493929190615350565b60206040518083038186803b158015612cbe57600080fd5b505af4158015612cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf69190614589565b90506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663089fe6aa6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d6257600080fd5b505afa158015612d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d9a9190614589565b90506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b158015612e0657600080fd5b505afa158015612e1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e3e919061428a565b90508773ffffffffffffffffffffffffffffffffffffffff16637b5947598c89600001518a60a001516040518463ffffffff1660e01b8152600401612e8593929190614f9c565b600060405180830381600087803b158015612e9f57600080fd5b505af1158015612eb3573d6000803e3d6000fd5b505050508660c00151831115613067576000612ef768056bc75e2d63100000612ee9858b60c00151613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b90506000612f12828a60c0015161373590919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415612f7a57612f75600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684836137d4565b612fad565b612fac600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a6101400151836137d4565b5b88610140015173ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fca4abd68d6de5109ded7a3e3e0292098e88893ba6b75ebf87f3fd18da2e01ab08360405161300f91906152e3565b60405180910390a361302c82600c5461377f90919063ffffffff16565b600c8190555061304782600b5461377f90919063ffffffff16565b600b81905550808961014001519b509b505050505050505050505061321b565b600061309768056bc75e2d631000006130898587613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b905060006130ae828661373590919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561311657613111600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684836137d4565b613149565b613148600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a6101400151836137d4565b5b88610140015173ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fca4abd68d6de5109ded7a3e3e0292098e88893ba6b75ebf87f3fd18da2e01ab0836040516131ab91906152e3565b60405180910390a360006131cc828b60c0015161373590919063ffffffff16565b90506131e381600c5461377f90919063ffffffff16565b600c819055506131fe81600b5461377f90919063ffffffff16565b600b81905550818a61014001519c509c5050505050505050505050505b6001600f81905550915091565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132be5780601f10613293576101008083540402835291602001916132be565b820191906000526020600020905b8154815290600101906020018083116132a157829003601f168201915b505050505081565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161334d90615243565b60405180910390fd5b80600e60026101000a81548160ff02191690831515021790555050565b600073fe40675976c6dbecad7b98b07c29f1cd90e70129634ea9cefa836133986121ea565b600854600b54600c54600d546040518763ffffffff1660e01b81526004016133c596959493929190615350565b60206040518083038186803b1580156133dd57600080fd5b505af41580156133f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134159190614589565b905080600c541161345b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613452906151c3565b60405180910390fd5b919050565b600061346d33848461395f565b6001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134fe90615243565b60405180910390fd5b80600d8190555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e60009054906101000a900460ff1681565b6005602052816000526040600020602052806000526040600020600091509150505481565b600a5481565b600b5481565b600073fe40675976c6dbecad7b98b07c29f1cd90e70129635b81a88b836135c66121ea565b600854600b54600c54600d546040518763ffffffff1660e01b81526004016135f396959493929190615350565b60206040518083038186803b15801561360b57600080fd5b505af415801561361f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136439190614589565b9050919050565b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161372891906152e3565b60405180910390a3505050565b600061377783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613df8565b905092915050565b6000808284019050838110156137ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137c1906150c3565b60405180910390fd5b8091505092915050565b600060608473ffffffffffffffffffffffffffffffffffffffff166040518060400160405280601981526020017f7472616e7366657228616464726573732c75696e74323536290000000000000081525080519060200120858560405160240161383f929190614ffd565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516138a99190614f1f565b6000604051808303816000865af19150503d80600081146138e6576040519150601f19603f3d011682016040523d82523d6000602084013e6138eb565b606091505b5091509150818015613919575060008151148061391857508080602001905181019061391791906144cc565b5b5b613958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161394f90615123565b60405180910390fd5b5050505050565b6139b181600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461373590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a4681600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461377f90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613ae691906152e3565b60405180910390a3505050565b6000803090506000813b9050600081149250505090565b600080831415613b1d5760009050613b74565b6000828402905082848281613b2e57fe5b0414613b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b6690615223565b60405180910390fd5b809150505b92915050565b6000613bbc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613e53565b905092915050565b613bd98160035461377f90919063ffffffff16565b600381905550613c3181600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461377f90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613cd291906152e3565b60405180910390a35050565b613d3081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461373590919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613d888160035461373590919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613dec91906152e3565b60405180910390a35050565b6000838311158290613e40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e379190615041565b60405180910390fd5b5060008385039050809150509392505050565b60008083118290613e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e919190615041565b60405180910390fd5b506000838581613ea657fe5b049050809150509392505050565b604051806101800160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f9857805160ff1916838001178555613fc6565b82800160010185558215613fc6579182015b82811115613fc5578251825591602001919060010190613faa565b5b509050613fd39190613fd7565b5090565b5b80821115613ff0576000816000905550600101613fd8565b5090565b60008135905061400381615512565b92915050565b60008151905061401881615512565b92915050565b60008151905061402d81615529565b92915050565b60008135905061404281615540565b92915050565b60008151905061405781615540565b92915050565b60008151905061406c81615557565b92915050565b600082601f83011261408357600080fd5b8151614096614091826153de565b6153b1565b915080825260208301602083018583830111156140b257600080fd5b6140bd8382846154ce565b50505092915050565b600061018082840312156140d957600080fd5b6140e46101806153b1565b905060006140f484828501614009565b6000830152506020614108848285016141f9565b602083015250604061411c848285016141f9565b6040830152506060614130848285016141f9565b6060830152506080614144848285016141f9565b60808301525060a061415884828501614009565b60a08301525060c061416c848285016141f9565b60c08301525060e0614180848285016141f9565b60e083015250610100614195848285016141f9565b610100830152506101206141ab848285016141f9565b610120830152506101406141c184828501614009565b610140830152506101606141d7848285016141f9565b6101608301525092915050565b6000813590506141f38161556e565b92915050565b6000815190506142088161556e565b92915050565b60008151905061421d8161559c565b92915050565b60008151905061423281615585565b92915050565b60006020828403121561424a57600080fd5b600061425884828501613ff4565b91505092915050565b60006020828403121561427357600080fd5b600061428184828501614009565b91505092915050565b60006020828403121561429c57600080fd5b60006142aa8482850161401e565b91505092915050565b600080604083850312156142c657600080fd5b60006142d485828601613ff4565b92505060206142e585828601613ff4565b9150509250929050565b6000806000806080858703121561430557600080fd5b600061431387828801613ff4565b945050602061432487828801613ff4565b935050604061433587828801613ff4565b9250506060614346878288016141e4565b91505092959194509250565b60008060006060848603121561436757600080fd5b600061437586828701613ff4565b935050602061438686828701613ff4565b9250506040614397868287016141e4565b9150509250925092565b600080600080600060a086880312156143b957600080fd5b60006143c788828901613ff4565b95505060206143d888828901613ff4565b94505060406143e9888289016141e4565b93505060606143fa888289016141e4565b925050608061440b88828901613ff4565b9150509295509295909350565b6000806040838503121561442b57600080fd5b600061443985828601613ff4565b925050602061444a858286016141e4565b9150509250929050565b60008060006060848603121561446957600080fd5b600061447786828701613ff4565b9350506020614488868287016141e4565b925050604061449986828701613ff4565b9150509250925092565b6000602082840312156144b557600080fd5b60006144c384828501614033565b91505092915050565b6000602082840312156144de57600080fd5b60006144ec84828501614048565b91505092915050565b60006020828403121561450757600080fd5b600082015167ffffffffffffffff81111561452157600080fd5b61452d84828501614072565b91505092915050565b6000610180828403121561454957600080fd5b6000614557848285016140c6565b91505092915050565b60006020828403121561457257600080fd5b6000614580848285016141e4565b91505092915050565b60006020828403121561459b57600080fd5b60006145a9848285016141f9565b91505092915050565b600080600080600060a086880312156145ca57600080fd5b60006145d88882890161420e565b95505060206145e98882890161405d565b94505060406145fa888289016141f9565b935050606061460b888289016141f9565b925050608061461c8882890161420e565b9150509295509295909350565b60006020828403121561463b57600080fd5b600061464984828501614223565b91505092915050565b61465b81615447565b82525050565b61466a81615447565b82525050565b6146798161546b565b82525050565b600061468a8261540a565b6146948185615420565b93506146a48185602086016154ce565b80840191505092915050565b60006146bb82615415565b6146c5818561542b565b93506146d58185602086016154ce565b6146de81615501565b840191505092915050565b60006146f482615415565b6146fe818561543c565b935061470e8185602086016154ce565b80840191505092915050565b6000614727601e8361542b565b91507f43656e74617572537761703a2054524144455f4e4f545f414c4c4f57454400006000830152602082019050919050565b6000614767602a8361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f4c495155494460008301527f4954595f4d494e544544000000000000000000000000000000000000000000006020830152604082019050919050565b60006147cd60038361543c565b91507f43532d00000000000000000000000000000000000000000000000000000000006000830152600382019050919050565b600061480d60228361542b565b91507f43656e74617572537761703a204e4f5f50454e44494e475f534554544c454d4560008301527f4e540000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614873601b8361542b565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006148b360208361542b565b91507f43656e74617572537761703a204445504f5349545f4e4f545f414c4c4f5745446000830152602082019050919050565b60006148f360138361542b565b91507f43656e74617572537761703a204c4f434b4544000000000000000000000000006000830152602082019050919050565b6000614933601c8361542b565b91507f43656e74617572537761703a205452414e534645525f4641494c4544000000006000830152602082019050919050565b6000614973601f8361542b565b91507f43656e74617572537761703a2050454e44494e475f534554544c454d454e54006000830152602082019050919050565b60006149b3602a8361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f4c495155494460008301527f4954595f4255524e4544000000000000000000000000000000000000000000006020830152604082019050919050565b6000614a1960198361542b565b91507f43656e74617572537761703a20494e56414c49445f504f4f4c000000000000006000830152602082019050919050565b6000614a5960258361542b565b91507f43656e74617572537761703a20534554544c454d454e545f5354494c4c5f504560008301527f4e44494e470000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614abf60238361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f4c495155494460008301527f49545900000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614b25602e8361542b565b91507f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008301527f647920696e697469616c697a65640000000000000000000000000000000000006020830152604082019050919050565b6000614b8b60218361542b565b91507f43656e74617572537761703a2057495448445241575f4e4f545f414c4c4f574560008301527f44000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614bf160218361542b565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614c5760218361542b565b91507f43656e74617572537761703a204f4e4c595f464143544f52595f414c4c4f574560008301527f44000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614cbd601b8361542b565b91507f43656e74617572537761703a20504f4f4c5f4e4f545f464f554e4400000000006000830152602082019050919050565b6000614cfd60208361542b565b91507f43656e74617572537761703a204f4e4c595f524f555445525f414c4c4f5745446000830152602082019050919050565b6000614d3d60258361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f535741505f4160008301527f4d4f554e540000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614da360228361542b565b91507f43656e74617572537761703a2057524f4e475f504f4f4c5f534554544c454d4560008301527f4e540000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61018082016000820151614e136000850182614652565b506020820151614e266020850182614ef2565b506040820151614e396040850182614ef2565b506060820151614e4c6060850182614ef2565b506080820151614e5f6080850182614ef2565b5060a0820151614e7260a0850182614652565b5060c0820151614e8560c0850182614ef2565b5060e0820151614e9860e0850182614ef2565b50610100820151614ead610100850182614ef2565b50610120820151614ec2610120850182614ef2565b50610140820151614ed7610140850182614652565b50610160820151614eec610160850182614ef2565b50505050565b614efb816154a1565b82525050565b614f0a816154a1565b82525050565b614f19816154a1565b82525050565b6000614f2b828461467f565b915081905092915050565b6000614f41826147c0565b9150614f4d82846146e9565b915081905092915050565b6000602082019050614f6d6000830184614661565b92915050565b6000604082019050614f886000830185614661565b614f956020830184614661565b9392505050565b6000606082019050614fb16000830186614661565b614fbe6020830185614661565b614fcb6040830184614661565b949350505050565b60006101a082019050614fe96000830185614661565b614ff66020830184614dfc565b9392505050565b60006040820190506150126000830185614661565b61501f6020830184614f01565b9392505050565b600060208201905061503b6000830184614670565b92915050565b6000602082019050818103600083015261505b81846146b0565b905092915050565b6000602082019050818103600083015261507c8161471a565b9050919050565b6000602082019050818103600083015261509c8161475a565b9050919050565b600060208201905081810360008301526150bc81614800565b9050919050565b600060208201905081810360008301526150dc81614866565b9050919050565b600060208201905081810360008301526150fc816148a6565b9050919050565b6000602082019050818103600083015261511c816148e6565b9050919050565b6000602082019050818103600083015261513c81614926565b9050919050565b6000602082019050818103600083015261515c81614966565b9050919050565b6000602082019050818103600083015261517c816149a6565b9050919050565b6000602082019050818103600083015261519c81614a0c565b9050919050565b600060208201905081810360008301526151bc81614a4c565b9050919050565b600060208201905081810360008301526151dc81614ab2565b9050919050565b600060208201905081810360008301526151fc81614b18565b9050919050565b6000602082019050818103600083015261521c81614b7e565b9050919050565b6000602082019050818103600083015261523c81614be4565b9050919050565b6000602082019050818103600083015261525c81614c4a565b9050919050565b6000602082019050818103600083015261527c81614cb0565b9050919050565b6000602082019050818103600083015261529c81614cf0565b9050919050565b600060208201905081810360008301526152bc81614d30565b9050919050565b600060208201905081810360008301526152dc81614d96565b9050919050565b60006020820190506152f86000830184614f01565b92915050565b60006040820190506153136000830185614f01565b6153206020830184614661565b9392505050565b600060408201905061533c6000830185614f01565b6153496020830184614f01565b9392505050565b600060c0820190506153656000830189614f10565b6153726020830188614f10565b61537f6040830187614f10565b61538c6060830186614f10565b6153996080830185614f10565b6153a660a0830184614f10565b979650505050505050565b6000604051905081810181811067ffffffffffffffff821117156153d457600080fd5b8060405250919050565b600067ffffffffffffffff8211156153f557600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061545282615481565b9050919050565b600061546482615481565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600069ffffffffffffffffffff82169050919050565b60005b838110156154ec5780820151818401526020810190506154d1565b838111156154fb576000848401525b50505050565b6000601f19601f8301169050919050565b61551b81615447565b811461552657600080fd5b50565b61553281615459565b811461553d57600080fd5b50565b6155498161546b565b811461555457600080fd5b50565b61556081615477565b811461556b57600080fd5b50565b615577816154a1565b811461558257600080fd5b50565b61558e816154ab565b811461559957600080fd5b50565b6155a5816154b8565b81146155b057600080fd5b5056fea2646970667358221220f3253a50ed510b03e15559f20b1cee541ccb572d2877250583f023c3cd34e26164736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637dc0d1d011610130578063a0930ebe116100b8578063d621e8131161007c578063d621e813146106b8578063dd62ed3e146106d6578063e68b52e714610706578063faa4822414610724578063fecc5a561461074257610227565b8063a0930ebe14610600578063a9059cbb14610630578063b464f46914610660578063c45a01551461067c578063c55dae631461069a57610227565b80638d2f19bc116100ff5780638d2f19bc146105475780638f87ff1c1461057757806392a3d6c01461059557806395d89b41146105c65780639ec004a2146105e457610227565b80637dc0d1d0146104ab578063807e6cc6146104c957806382aa1c88146104f957806389afcb441461051757610227565b80633a69a1be116101b35780635b17d04b116101825780635b17d04b146103f55780635bb47808146104115780636a6278421461042d57806370a082311461045d578063796da7af1461048d57610227565b80633a69a1be146103835780633bec2bf3146103a157806346639dba146103bd578063551512de146103d957610227565b80632287e96a116101fa5780632287e96a146102c857806323b872dd146102e657806328a4a0d1146103165780632eebe78e14610347578063313ce5671461036557610227565b806306fdde031461022c578063095ea7b31461024a57806318160ddd1461027a5780631a275a0314610298575b600080fd5b610234610772565b6040516102419190615041565b60405180910390f35b610264600480360381019061025f9190614418565b6107ab565b6040516102719190615026565b60405180910390f35b6102826107c2565b60405161028f91906152e3565b60405180910390f35b6102b260048036038101906102ad91906143a1565b6107c8565b6040516102bf91906152e3565b60405180910390f35b6102d0611022565b6040516102dd9190615026565b60405180910390f35b61030060048036038101906102fb9190614352565b611035565b60405161030d9190615026565b60405180910390f35b610330600480360381019061032b9190614238565b611200565b60405161033e929190615327565b60405180910390f35b61034f611694565b60405161035c9190615026565b60405180910390f35b61036d6116a7565b60405161037a91906152e3565b60405180910390f35b61038b6116ad565b60405161039891906152e3565b60405180910390f35b6103bb60048036038101906103b691906144a3565b6116b3565b005b6103d760048036038101906103d291906142ef565b611760565b005b6103f360048036038101906103ee9190614454565b611ba4565b005b61040f600480360381019061040a91906144a3565b611cab565b005b61042b60048036038101906104269190614238565b611d58565b005b61044760048036038101906104429190614238565b611e2c565b60405161045491906152e3565b60405180910390f35b61047760048036038101906104729190614238565b6121d2565b60405161048491906152e3565b60405180910390f35b6104956121ea565b6040516104a291906152e3565b60405180910390f35b6104b36122c4565b6040516104c09190614f58565b60405180910390f35b6104e360048036038101906104de9190614560565b6122ea565b6040516104f091906152e3565b60405180910390f35b6105016123d7565b60405161050e91906152e3565b60405180910390f35b610531600480360381019061052c9190614238565b6123dd565b60405161053e91906152e3565b60405180910390f35b610561600480360381019061055c9190614560565b61275f565b60405161056e91906152e3565b60405180910390f35b61057f612808565b60405161058c91906152e3565b60405180910390f35b6105af60048036038101906105aa9190614238565b61280e565b6040516105bd9291906152fe565b60405180910390f35b6105ce613228565b6040516105db9190615041565b60405180910390f35b6105fe60048036038101906105f991906144a3565b6132c6565b005b61061a60048036038101906106159190614560565b613373565b60405161062791906152e3565b60405180910390f35b61064a60048036038101906106459190614418565b613460565b6040516106579190615026565b60405180910390f35b61067a60048036038101906106759190614560565b613477565b005b610684613511565b6040516106919190614f58565b60405180910390f35b6106a2613537565b6040516106af9190614f58565b60405180910390f35b6106c061355d565b6040516106cd9190615026565b60405180910390f35b6106f060048036038101906106eb91906142b3565b613570565b6040516106fd91906152e3565b60405180910390f35b61070e613595565b60405161071b91906152e3565b60405180910390f35b61072c61359b565b60405161073991906152e3565b60405180910390f35b61075c60048036038101906107579190614560565b6135a1565b60405161076991906152e3565b60405180910390f35b6040518060400160405280601481526020017f43656e7461757253776170204c5020546f6b656e00000000000000000000000081525081565b60006107b833848461364a565b6001905092915050565b60035481565b60006001600f541461080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080690615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b7919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091b90615283565b60405180910390fd5b600e60009054906101000a900460ff16610973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096a90615063565b60405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610a04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fb90615183565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bbe4f6db876040518263ffffffff1660e01b8152600401610a619190614f58565b60206040518083038186803b158015610a7957600080fd5b505afa158015610a8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab19190614261565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1a90615263565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511606306040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8d57600080fd5b505afa158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc59190614261565b90508073ffffffffffffffffffffffffffffffffffffffff1663e9c0f42389306040518363ffffffff1660e01b8152600401610c02929190614f73565b60206040518083038186803b158015610c1a57600080fd5b505afa158015610c2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5291906144cc565b15610c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8990615143565b60405180910390fd5b610c9b85613373565b9250610ca5613eb4565b6040518061018001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018473ffffffffffffffffffffffffffffffffffffffff1663faa482246040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1957600080fd5b505afa158015610d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d519190614589565b8152602001610de6898673ffffffffffffffffffffffffffffffffffffffff16638f87ff1c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610da057600080fd5b505afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190614589565b61373590919063ffffffff16565b81526020018473ffffffffffffffffffffffffffffffffffffffff16633a69a1be6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3157600080fd5b505afa158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e699190614589565b81526020013073ffffffffffffffffffffffffffffffffffffffff168152602001858152602001600b548152602001600c548152602001600d5481526020018673ffffffffffffffffffffffffffffffffffffffff168152602001610f548473ffffffffffffffffffffffffffffffffffffffff1663576922136040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0d57600080fd5b505afa158015610f21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f459190614589565b4261377f90919063ffffffff16565b8152509050610f6e84600c5461373590919063ffffffff16565b600c819055508173ffffffffffffffffffffffffffffffffffffffff16631b54b99d8a836040518363ffffffff1660e01b8152600401610faf929190614fd3565b600060405180830381600087803b158015610fc957600080fd5b505af1158015610fdd573d6000803e3d6000fd5b5050505061100e600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683866137d4565b5050506001600f8190555095945050505050565b600e60029054906101000a900460ff1681565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146111ea5761116982600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461373590919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6111f584848461395f565b600190509392505050565b6000806001600f5414611248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123f90615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b1580156112b857600080fd5b505afa1580156112cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f0919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461135d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135490615283565b60405180910390fd5b600e60009054906101000a900460ff166113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a390615063565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016114099190614f58565b60206040518083038186803b15801561142157600080fd5b505afa158015611435573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114599190614589565b9050600c54811161149f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611496906152a3565b60405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511606306040518163ffffffff1660e01b815260040160206040518083038186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115419190614261565b90508073ffffffffffffffffffffffffffffffffffffffff1663e9c0f42386306040518363ffffffff1660e01b815260040161157e929190614f73565b60206040518083038186803b15801561159657600080fd5b505afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce91906144cc565b1561160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160590615143565b60405180910390fd5b611623600c548361373590919063ffffffff16565b935061162e846135a1565b925081600c819055508473ffffffffffffffffffffffffffffffffffffffff167f7bf2a01640cc1b6eeeab1bcad625d2d9e37eda9d74b776d36fe4d233983b682c8560405161167d91906152e3565b60405180910390a250506001600f81905550915091565b600e60019054906101000a900460ff1681565b60025481565b600d5481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a90615243565b60405180910390fd5b80600e60006101000a81548160ff02191690831515021790555050565b600060019054906101000a900460ff168061177f575061177e613af3565b5b80611795575060008054906101000a900460ff16155b6117d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cb906151e3565b60405180910390fd5b60008060019054906101000a900460ff161590508015611824576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b84600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561190e57600080fd5b505afa158015611922573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119469190614629565b60ff1660088190555082600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f857600080fd5b505afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a309190614629565b60ff16600a819055506000600e60006101000a81548160ff0219169083151502179055506000600e60016101000a81548160ff0219169083151502179055506000600e60026101000a81548160ff02191690831515021790555081600d81905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611af957600080fd5b505afa158015611b0d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611b3691906144f5565b604051602001611b469190614f36565b60405160208183030381529060405260019080519060200190611b6a929190613f57565b506008546002819055506001600f819055508015611b9d5760008060016101000a81548160ff0219169083151502179055505b5050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b90615243565b60405180910390fd5b611c3f8382846137d4565b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8e9e3b804e5b56d0c8cbb012e3cb707f9666570bd8ef94b5342894dde33701bf4285604051611c9e929190615327565b60405180910390a3505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3290615243565b60405180910390fd5b80600e60016101000a81548160ff02191690831515021790555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611de8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ddf90615243565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006001600f5414611e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6a90615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7f90615283565b60405180910390fd5b600e60019054906101000a900460ff16611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce906150e3565b60405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016120349190614f58565b60206040518083038186803b15801561204c57600080fd5b505afa158015612060573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120849190614589565b9050600061209d600c548361373590919063ffffffff16565b9050600060035414156120c6576120bf600b548261377f90919063ffffffff16565b92506120f2565b6120ef600b546120e160035484613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b92505b60008311612135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212c90615083565b60405180910390fd5b61213f8484613bc4565b61215481600c5461377f90919063ffffffff16565b600c8190555061216f81600b5461377f90919063ffffffff16565b600b819055503373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040516121bb91906152e3565b60405180910390a250506001600f81905550919050565b60046020528060005260406000206000915090505481565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561225557600080fd5b505afa158015612269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228d91906145b2565b5050509150506122be6122ac600a54601261373590919063ffffffff16565b600a0a82613b0a90919063ffffffff16565b91505090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600c5411612330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612327906151c3565b60405180910390fd5b73fe40675976c6dbecad7b98b07c29f1cd90e7012963985ae292836123536121ea565b600854600b54600c54600d546040518763ffffffff1660e01b815260040161238096959493929190615350565b60206040518083038186803b15801561239857600080fd5b505af41580156123ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d09190614589565b9050919050565b60085481565b60006001600f5414612424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241b90615103565b60405180910390fd5b6000600f81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b15801561249457600080fd5b505afa1580156124a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124cc919061428a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612539576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253090615283565b60405180910390fd5b600e60029054906101000a900460ff16612588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257f90615203565b60405180910390fd5b6000600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506125f56003546125e7600b5484613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b91506000821161263a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161263190615163565b60405180910390fd5b81600c54101561267f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612676906151c3565b60405180910390fd5b6126893082613cde565b6126b6600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846137d4565b6126cb82600c5461373590919063ffffffff16565b600c819055506126e682600b5461373590919063ffffffff16565b600b819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdbdf9b8e4b75e75b162d151ec8fc7f0561cabab5fcccfa2600be62223e4300c48460405161274991906152e3565b60405180910390a3506001600f81905550919050565b600073fe40675976c6dbecad7b98b07c29f1cd90e70129631afdf047836127846121ea565b600854600b54600c54600d546040518763ffffffff1660e01b81526004016127b196959493929190615350565b60206040518083038186803b1580156127c957600080fd5b505af41580156127dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128019190614589565b9050919050565b600c5481565b6000806001600f5414612856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284d90615103565b60405180910390fd5b6000600f819055506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663511606306040518163ffffffff1660e01b815260040160206040518083038186803b1580156128c857600080fd5b505afa1580156128dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129009190614261565b905061290a613eb4565b8173ffffffffffffffffffffffffffffffffffffffff16633da3535f86306040518363ffffffff1660e01b8152600401612945929190614f73565b6101806040518083038186803b15801561295e57600080fd5b505afa158015612972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129969190614536565b9050600081610160015114156129e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129d8906150a3565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168160a0015173ffffffffffffffffffffffffffffffffffffffff1614612a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4a906152c3565b60405180910390fd5b806101600151421015612a9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a92906151a3565b60405180910390fd5b6000816000015173ffffffffffffffffffffffffffffffffffffffff1663796da7af6040518163ffffffff1660e01b815260040160206040518083038186803b158015612ae757600080fd5b505afa158015612afb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b1f9190614589565b90506000612b2b6121ea565b9050600073fe40675976c6dbecad7b98b07c29f1cd90e70129635b81a88b856020015185876000015173ffffffffffffffffffffffffffffffffffffffff166382aa1c886040518163ffffffff1660e01b815260040160206040518083038186803b158015612b9957600080fd5b505afa158015612bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd19190614589565b886040015189606001518a608001516040518763ffffffff1660e01b8152600401612c0196959493929190615350565b60206040518083038186803b158015612c1957600080fd5b505af4158015612c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c519190614589565b9050600073fe40675976c6dbecad7b98b07c29f1cd90e70129634ea9cefa83856008548960e001518a61010001518b61012001516040518763ffffffff1660e01b8152600401612ca696959493929190615350565b60206040518083038186803b158015612cbe57600080fd5b505af4158015612cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf69190614589565b90506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663089fe6aa6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d6257600080fd5b505afa158015612d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d9a9190614589565b90506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f887ea406040518163ffffffff1660e01b815260040160206040518083038186803b158015612e0657600080fd5b505afa158015612e1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e3e919061428a565b90508773ffffffffffffffffffffffffffffffffffffffff16637b5947598c89600001518a60a001516040518463ffffffff1660e01b8152600401612e8593929190614f9c565b600060405180830381600087803b158015612e9f57600080fd5b505af1158015612eb3573d6000803e3d6000fd5b505050508660c00151831115613067576000612ef768056bc75e2d63100000612ee9858b60c00151613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b90506000612f12828a60c0015161373590919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415612f7a57612f75600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684836137d4565b612fad565b612fac600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a6101400151836137d4565b5b88610140015173ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fca4abd68d6de5109ded7a3e3e0292098e88893ba6b75ebf87f3fd18da2e01ab08360405161300f91906152e3565b60405180910390a361302c82600c5461377f90919063ffffffff16565b600c8190555061304782600b5461377f90919063ffffffff16565b600b81905550808961014001519b509b505050505050505050505061321b565b600061309768056bc75e2d631000006130898587613b0a90919063ffffffff16565b613b7a90919063ffffffff16565b905060006130ae828661373590919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561311657613111600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684836137d4565b613149565b613148600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a6101400151836137d4565b5b88610140015173ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fca4abd68d6de5109ded7a3e3e0292098e88893ba6b75ebf87f3fd18da2e01ab0836040516131ab91906152e3565b60405180910390a360006131cc828b60c0015161373590919063ffffffff16565b90506131e381600c5461377f90919063ffffffff16565b600c819055506131fe81600b5461377f90919063ffffffff16565b600b81905550818a61014001519c509c5050505050505050505050505b6001600f81905550915091565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132be5780601f10613293576101008083540402835291602001916132be565b820191906000526020600020905b8154815290600101906020018083116132a157829003601f168201915b505050505081565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161334d90615243565b60405180910390fd5b80600e60026101000a81548160ff02191690831515021790555050565b600073fe40675976c6dbecad7b98b07c29f1cd90e70129634ea9cefa836133986121ea565b600854600b54600c54600d546040518763ffffffff1660e01b81526004016133c596959493929190615350565b60206040518083038186803b1580156133dd57600080fd5b505af41580156133f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134159190614589565b905080600c541161345b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613452906151c3565b60405180910390fd5b919050565b600061346d33848461395f565b6001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134fe90615243565b60405180910390fd5b80600d8190555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e60009054906101000a900460ff1681565b6005602052816000526040600020602052806000526040600020600091509150505481565b600a5481565b600b5481565b600073fe40675976c6dbecad7b98b07c29f1cd90e70129635b81a88b836135c66121ea565b600854600b54600c54600d546040518763ffffffff1660e01b81526004016135f396959493929190615350565b60206040518083038186803b15801561360b57600080fd5b505af415801561361f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136439190614589565b9050919050565b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161372891906152e3565b60405180910390a3505050565b600061377783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613df8565b905092915050565b6000808284019050838110156137ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137c1906150c3565b60405180910390fd5b8091505092915050565b600060608473ffffffffffffffffffffffffffffffffffffffff166040518060400160405280601981526020017f7472616e7366657228616464726573732c75696e74323536290000000000000081525080519060200120858560405160240161383f929190614ffd565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516138a99190614f1f565b6000604051808303816000865af19150503d80600081146138e6576040519150601f19603f3d011682016040523d82523d6000602084013e6138eb565b606091505b5091509150818015613919575060008151148061391857508080602001905181019061391791906144cc565b5b5b613958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161394f90615123565b60405180910390fd5b5050505050565b6139b181600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461373590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a4681600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461377f90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613ae691906152e3565b60405180910390a3505050565b6000803090506000813b9050600081149250505090565b600080831415613b1d5760009050613b74565b6000828402905082848281613b2e57fe5b0414613b6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b6690615223565b60405180910390fd5b809150505b92915050565b6000613bbc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613e53565b905092915050565b613bd98160035461377f90919063ffffffff16565b600381905550613c3181600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461377f90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613cd291906152e3565b60405180910390a35050565b613d3081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461373590919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613d888160035461373590919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613dec91906152e3565b60405180910390a35050565b6000838311158290613e40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e379190615041565b60405180910390fd5b5060008385039050809150509392505050565b60008083118290613e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e919190615041565b60405180910390fd5b506000838581613ea657fe5b049050809150509392505050565b604051806101800160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f9857805160ff1916838001178555613fc6565b82800160010185558215613fc6579182015b82811115613fc5578251825591602001919060010190613faa565b5b509050613fd39190613fd7565b5090565b5b80821115613ff0576000816000905550600101613fd8565b5090565b60008135905061400381615512565b92915050565b60008151905061401881615512565b92915050565b60008151905061402d81615529565b92915050565b60008135905061404281615540565b92915050565b60008151905061405781615540565b92915050565b60008151905061406c81615557565b92915050565b600082601f83011261408357600080fd5b8151614096614091826153de565b6153b1565b915080825260208301602083018583830111156140b257600080fd5b6140bd8382846154ce565b50505092915050565b600061018082840312156140d957600080fd5b6140e46101806153b1565b905060006140f484828501614009565b6000830152506020614108848285016141f9565b602083015250604061411c848285016141f9565b6040830152506060614130848285016141f9565b6060830152506080614144848285016141f9565b60808301525060a061415884828501614009565b60a08301525060c061416c848285016141f9565b60c08301525060e0614180848285016141f9565b60e083015250610100614195848285016141f9565b610100830152506101206141ab848285016141f9565b610120830152506101406141c184828501614009565b610140830152506101606141d7848285016141f9565b6101608301525092915050565b6000813590506141f38161556e565b92915050565b6000815190506142088161556e565b92915050565b60008151905061421d8161559c565b92915050565b60008151905061423281615585565b92915050565b60006020828403121561424a57600080fd5b600061425884828501613ff4565b91505092915050565b60006020828403121561427357600080fd5b600061428184828501614009565b91505092915050565b60006020828403121561429c57600080fd5b60006142aa8482850161401e565b91505092915050565b600080604083850312156142c657600080fd5b60006142d485828601613ff4565b92505060206142e585828601613ff4565b9150509250929050565b6000806000806080858703121561430557600080fd5b600061431387828801613ff4565b945050602061432487828801613ff4565b935050604061433587828801613ff4565b9250506060614346878288016141e4565b91505092959194509250565b60008060006060848603121561436757600080fd5b600061437586828701613ff4565b935050602061438686828701613ff4565b9250506040614397868287016141e4565b9150509250925092565b600080600080600060a086880312156143b957600080fd5b60006143c788828901613ff4565b95505060206143d888828901613ff4565b94505060406143e9888289016141e4565b93505060606143fa888289016141e4565b925050608061440b88828901613ff4565b9150509295509295909350565b6000806040838503121561442b57600080fd5b600061443985828601613ff4565b925050602061444a858286016141e4565b9150509250929050565b60008060006060848603121561446957600080fd5b600061447786828701613ff4565b9350506020614488868287016141e4565b925050604061449986828701613ff4565b9150509250925092565b6000602082840312156144b557600080fd5b60006144c384828501614033565b91505092915050565b6000602082840312156144de57600080fd5b60006144ec84828501614048565b91505092915050565b60006020828403121561450757600080fd5b600082015167ffffffffffffffff81111561452157600080fd5b61452d84828501614072565b91505092915050565b6000610180828403121561454957600080fd5b6000614557848285016140c6565b91505092915050565b60006020828403121561457257600080fd5b6000614580848285016141e4565b91505092915050565b60006020828403121561459b57600080fd5b60006145a9848285016141f9565b91505092915050565b600080600080600060a086880312156145ca57600080fd5b60006145d88882890161420e565b95505060206145e98882890161405d565b94505060406145fa888289016141f9565b935050606061460b888289016141f9565b925050608061461c8882890161420e565b9150509295509295909350565b60006020828403121561463b57600080fd5b600061464984828501614223565b91505092915050565b61465b81615447565b82525050565b61466a81615447565b82525050565b6146798161546b565b82525050565b600061468a8261540a565b6146948185615420565b93506146a48185602086016154ce565b80840191505092915050565b60006146bb82615415565b6146c5818561542b565b93506146d58185602086016154ce565b6146de81615501565b840191505092915050565b60006146f482615415565b6146fe818561543c565b935061470e8185602086016154ce565b80840191505092915050565b6000614727601e8361542b565b91507f43656e74617572537761703a2054524144455f4e4f545f414c4c4f57454400006000830152602082019050919050565b6000614767602a8361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f4c495155494460008301527f4954595f4d494e544544000000000000000000000000000000000000000000006020830152604082019050919050565b60006147cd60038361543c565b91507f43532d00000000000000000000000000000000000000000000000000000000006000830152600382019050919050565b600061480d60228361542b565b91507f43656e74617572537761703a204e4f5f50454e44494e475f534554544c454d4560008301527f4e540000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614873601b8361542b565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006148b360208361542b565b91507f43656e74617572537761703a204445504f5349545f4e4f545f414c4c4f5745446000830152602082019050919050565b60006148f360138361542b565b91507f43656e74617572537761703a204c4f434b4544000000000000000000000000006000830152602082019050919050565b6000614933601c8361542b565b91507f43656e74617572537761703a205452414e534645525f4641494c4544000000006000830152602082019050919050565b6000614973601f8361542b565b91507f43656e74617572537761703a2050454e44494e475f534554544c454d454e54006000830152602082019050919050565b60006149b3602a8361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f4c495155494460008301527f4954595f4255524e4544000000000000000000000000000000000000000000006020830152604082019050919050565b6000614a1960198361542b565b91507f43656e74617572537761703a20494e56414c49445f504f4f4c000000000000006000830152602082019050919050565b6000614a5960258361542b565b91507f43656e74617572537761703a20534554544c454d454e545f5354494c4c5f504560008301527f4e44494e470000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614abf60238361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f4c495155494460008301527f49545900000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614b25602e8361542b565b91507f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008301527f647920696e697469616c697a65640000000000000000000000000000000000006020830152604082019050919050565b6000614b8b60218361542b565b91507f43656e74617572537761703a2057495448445241575f4e4f545f414c4c4f574560008301527f44000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614bf160218361542b565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614c5760218361542b565b91507f43656e74617572537761703a204f4e4c595f464143544f52595f414c4c4f574560008301527f44000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614cbd601b8361542b565b91507f43656e74617572537761703a20504f4f4c5f4e4f545f464f554e4400000000006000830152602082019050919050565b6000614cfd60208361542b565b91507f43656e74617572537761703a204f4e4c595f524f555445525f414c4c4f5745446000830152602082019050919050565b6000614d3d60258361542b565b91507f43656e74617572537761703a20494e53554646494349454e545f535741505f4160008301527f4d4f554e540000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614da360228361542b565b91507f43656e74617572537761703a2057524f4e475f504f4f4c5f534554544c454d4560008301527f4e540000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61018082016000820151614e136000850182614652565b506020820151614e266020850182614ef2565b506040820151614e396040850182614ef2565b506060820151614e4c6060850182614ef2565b506080820151614e5f6080850182614ef2565b5060a0820151614e7260a0850182614652565b5060c0820151614e8560c0850182614ef2565b5060e0820151614e9860e0850182614ef2565b50610100820151614ead610100850182614ef2565b50610120820151614ec2610120850182614ef2565b50610140820151614ed7610140850182614652565b50610160820151614eec610160850182614ef2565b50505050565b614efb816154a1565b82525050565b614f0a816154a1565b82525050565b614f19816154a1565b82525050565b6000614f2b828461467f565b915081905092915050565b6000614f41826147c0565b9150614f4d82846146e9565b915081905092915050565b6000602082019050614f6d6000830184614661565b92915050565b6000604082019050614f886000830185614661565b614f956020830184614661565b9392505050565b6000606082019050614fb16000830186614661565b614fbe6020830185614661565b614fcb6040830184614661565b949350505050565b60006101a082019050614fe96000830185614661565b614ff66020830184614dfc565b9392505050565b60006040820190506150126000830185614661565b61501f6020830184614f01565b9392505050565b600060208201905061503b6000830184614670565b92915050565b6000602082019050818103600083015261505b81846146b0565b905092915050565b6000602082019050818103600083015261507c8161471a565b9050919050565b6000602082019050818103600083015261509c8161475a565b9050919050565b600060208201905081810360008301526150bc81614800565b9050919050565b600060208201905081810360008301526150dc81614866565b9050919050565b600060208201905081810360008301526150fc816148a6565b9050919050565b6000602082019050818103600083015261511c816148e6565b9050919050565b6000602082019050818103600083015261513c81614926565b9050919050565b6000602082019050818103600083015261515c81614966565b9050919050565b6000602082019050818103600083015261517c816149a6565b9050919050565b6000602082019050818103600083015261519c81614a0c565b9050919050565b600060208201905081810360008301526151bc81614a4c565b9050919050565b600060208201905081810360008301526151dc81614ab2565b9050919050565b600060208201905081810360008301526151fc81614b18565b9050919050565b6000602082019050818103600083015261521c81614b7e565b9050919050565b6000602082019050818103600083015261523c81614be4565b9050919050565b6000602082019050818103600083015261525c81614c4a565b9050919050565b6000602082019050818103600083015261527c81614cb0565b9050919050565b6000602082019050818103600083015261529c81614cf0565b9050919050565b600060208201905081810360008301526152bc81614d30565b9050919050565b600060208201905081810360008301526152dc81614d96565b9050919050565b60006020820190506152f86000830184614f01565b92915050565b60006040820190506153136000830185614f01565b6153206020830184614661565b9392505050565b600060408201905061533c6000830185614f01565b6153496020830184614f01565b9392505050565b600060c0820190506153656000830189614f10565b6153726020830188614f10565b61537f6040830187614f10565b61538c6060830186614f10565b6153996080830185614f10565b6153a660a0830184614f10565b979650505050505050565b6000604051905081810181811067ffffffffffffffff821117156153d457600080fd5b8060405250919050565b600067ffffffffffffffff8211156153f557600080fd5b601f19601f8301169050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061545282615481565b9050919050565b600061546482615481565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600069ffffffffffffffffffff82169050919050565b60005b838110156154ec5780820151818401526020810190506154d1565b838111156154fb576000848401525b50505050565b6000601f19601f8301169050919050565b61551b81615447565b811461552657600080fd5b50565b61553281615459565b811461553d57600080fd5b50565b6155498161546b565b811461555457600080fd5b50565b61556081615477565b811461556b57600080fd5b50565b615577816154a1565b811461558257600080fd5b50565b61558e816154ab565b811461559957600080fd5b50565b6155a5816154b8565b81146155b057600080fd5b5056fea2646970667358221220f3253a50ed510b03e15559f20b1cee541ccb572d2877250583f023c3cd34e26164736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.