Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Contract Name:
WooracleV2_1_ZKSync
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 20000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity =0.8.14; interface AggregatorV3Interface { 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: MIT pragma solidity =0.8.14; /* ░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗ ░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║ ░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║ ░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║ ░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║ ░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝ * * MIT License * =========== * * Copyright (c) 2020 WooTrade * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /// @title The oracle V2 interface by Woo.Network. /// @notice update and posted the latest price info by Woo. interface IWooracleV2 { struct State { uint128 price; uint64 spread; uint64 coeff; bool woFeasible; } /// @notice Wooracle spread value function woSpread(address base) external view returns (uint64); /// @notice Wooracle coeff value function woCoeff(address base) external view returns (uint64); /// @notice Wooracle state for the specified base token function woState(address base) external view returns (State memory); /// @notice Chainlink oracle address for the specified base token function cloAddress(address base) external view returns (address clo); /// @notice ChainLink price of the base token / quote token function cloPrice(address base) external view returns (uint256 price, uint256 timestamp); /// @notice Wooracle price of the base token function woPrice(address base) external view returns (uint128 price, uint256 timestamp); /// @notice Returns Woooracle price if available, otherwise fallback to ChainLink function price(address base) external view returns (uint256 priceNow, bool feasible); /// @notice Updates the Wooracle price for the specified base token function postPrice(address base, uint128 newPrice) external; function postState( address base, uint128 newPrice, uint64 newSpread, uint64 newCoeff ) external; /// @notice State of the specified base token. function state(address base) external view returns (State memory); /// @notice The price decimal for the specified base token (e.g. 8) function decimals(address base) external view returns (uint8); /// @notice The quote token for calculating WooPP query price function quoteToken() external view returns (address); /// @notice last updated timestamp function timestamp() external view returns (uint256); /// @notice Flag for Wooracle price feasible function isWoFeasible(address base) external view returns (bool); /// @notice Flag for account admin function isAdmin(address account) external view returns (bool); }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper::safeApprove: approve failed" ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper::safeTransfer: transfer failed" ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper::transferFrom: transferFrom failed" ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, "TransferHelper::safeTransferETH: ETH transfer failed"); } }
// SPDX-License-Identifier: MIT pragma solidity =0.8.14; /* ░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗ ░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║ ░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║ ░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║ ░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║ ░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝ * * MIT License * =========== * * Copyright (c) 2020 WooTrade * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import "../interfaces/IWooracleV2.sol"; import "../interfaces/AggregatorV3Interface.sol"; import "../libraries/TransferHelper.sol"; // OpenZeppelin contracts import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /// @title Wooracle V2.1 contract for ZKSync /// subversion 1 change: no timestamp update for posting price from WooPP. contract WooracleV2_1_ZKSync is Ownable, IWooracleV2 { /* ----- State variables ----- */ // 128 + 64 + 64 = 256 bits (slot size) struct TokenInfo { uint128 price; // as chainlink oracle (e.g. decimal = 8) zip: 32 bits = (27, 5) uint64 coeff; // k: decimal = 18. 18.4 * 1e18 zip: 16 bits = (11, 5), 2^11 = 2048 uint64 spread; // s: decimal = 18. spread <= 2e18 18.4 * 1e18 zip: 16 bits = (11, 5) } struct CLOracle { address oracle; uint8 decimal; bool cloPreferred; } mapping(address => TokenInfo) public infos; mapping(address => CLOracle) public clOracles; address public override quoteToken; uint256 public override timestamp; uint256 public staleDuration; uint64 public bound; address public wooPP; mapping(address => bool) public isAdmin; mapping(uint8 => address) public basesMap; constructor() { staleDuration = uint256(120); // default: 2 mins bound = uint64(1e16); // 1% } modifier onlyAdmin() { require(owner() == msg.sender || isAdmin[msg.sender], "Wooracle: !Admin"); _; } /* ----- External Functions ----- */ function setWooPP(address _wooPP) external onlyAdmin { wooPP = _wooPP; } function setAdmin(address addr, bool flag) external onlyOwner { isAdmin[addr] = flag; } /// @dev Set the quote token address. /// @param _oracle the token address function setQuoteToken(address _quote, address _oracle) external onlyAdmin { quoteToken = _quote; CLOracle storage cloRef = clOracles[_quote]; cloRef.oracle = _oracle; cloRef.decimal = AggregatorV3Interface(_oracle).decimals(); } function setBound(uint64 _bound) external onlyOwner { bound = _bound; } function setCLOracle( address token, address _oracle, bool _cloPreferred ) external onlyAdmin { CLOracle storage cloRef = clOracles[token]; cloRef.oracle = _oracle; cloRef.decimal = AggregatorV3Interface(_oracle).decimals(); cloRef.cloPreferred = _cloPreferred; } function setCloPreferred(address token, bool _cloPreferred) external onlyAdmin { CLOracle storage cloRef = clOracles[token]; cloRef.cloPreferred = _cloPreferred; } /// @dev Set the staleDuration. /// @param newStaleDuration the new stale duration function setStaleDuration(uint256 newStaleDuration) external onlyAdmin { staleDuration = newStaleDuration; } /// @dev Update the base token prices. /// @param base the baseToken address /// @param newPrice the new prices for the base token function postPrice(address base, uint128 newPrice) external onlyAdmin { infos[base].price = newPrice; if (msg.sender != wooPP) { timestamp = block.timestamp; } } /// @dev Update the base token prices. /// @param base the baseToken address /// @param newPrice the new prices for the base token function postPrice( address base, uint128 newPrice, uint256 _ts ) external onlyAdmin { infos[base].price = newPrice; timestamp = _ts; } /// @dev batch update baseTokens prices /// @param bases list of baseToken address /// @param newPrices the updated prices list function postPriceList( address[] calldata bases, uint128[] calldata newPrices, uint256 _ts ) external onlyAdmin { uint256 length = bases.length; require(length == newPrices.length, "Wooracle: length_INVALID"); // TODO: gas optimization: // https://ethereum.stackexchange.com/questions/113221/what-is-the-purpose-of-unchecked-in-solidity // https://forum.openzeppelin.com/t/a-collection-of-gas-optimisation-tricks/19966 unchecked { for (uint256 i = 0; i < length; i++) { infos[bases[i]].price = newPrices[i]; } } timestamp = _ts; } function postState( address, /* base */ uint128, /* newPrice */ uint64, /* newSpread */ uint64 /* newCoeff */ ) external onlyAdmin { revert("NOT SUPPORTED IN ZKSYNC"); } /// @dev update the state of the given base token. /// @param base baseToken address /// @param newPrice the new prices /// @param newSpread the new spreads /// @param newCoeff the new slippage coefficent function postState( address base, uint128 newPrice, uint64 newSpread, uint64 newCoeff, uint256 _ts ) external onlyAdmin { _setState(base, newPrice, newSpread, newCoeff); timestamp = _ts; } /// @dev batch update the prices, spreads and slipagge coeffs info. /// @param bases list of baseToken address /// @param newPrices the prices list /// @param newSpreads the spreads list /// @param newCoeffs the slippage coefficent list function postStateList( address[] calldata bases, uint128[] calldata newPrices, uint64[] calldata newSpreads, uint64[] calldata newCoeffs, uint256 _ts ) external onlyAdmin { uint256 length = bases.length; unchecked { for (uint256 i = 0; i < length; i++) { _setState(bases[i], newPrices[i], newSpreads[i], newCoeffs[i]); } } timestamp = _ts; } /* Price logic: - woPrice: wooracle price - cloPrice: chainlink price woFeasible is, price > 0 and price timestamp NOT stale when woFeasible && priceWithinBound -> woPrice, feasible when woFeasible && !priceWithinBound -> woPrice, infeasible when !woFeasible && clo_preferred -> cloPrice, feasible when !woFeasible && !clo_preferred -> cloPrice, infeasible */ function price(address base) public view override returns (uint256 priceOut, bool feasible) { uint256 woPrice_ = uint256(infos[base].price); uint256 woPriceTimestamp = timestamp; (uint256 cloPrice_, ) = _cloPriceInQuote(base, quoteToken); bool woFeasible = woPrice_ != 0 && block.timestamp <= (woPriceTimestamp + staleDuration); bool woPriceInBound = cloPrice_ == 0 || ((cloPrice_ * (1e18 - bound)) / 1e18 <= woPrice_ && woPrice_ <= (cloPrice_ * (1e18 + bound)) / 1e18); if (woFeasible) { priceOut = woPrice_; feasible = woPriceInBound; } else { priceOut = clOracles[base].cloPreferred ? cloPrice_ : 0; feasible = priceOut != 0; } } /// @notice the price decimal for the specified base token function decimals(address base) external view override returns (uint8) { uint8 d = clOracles[base].decimal; return d != 0 ? d : 8; // why 8 for default? } function cloPrice(address base) external view override returns (uint256 refPrice, uint256 refTimestamp) { return _cloPriceInQuote(base, quoteToken); } function isWoFeasible(address base) external view override returns (bool) { return infos[base].price != 0 && block.timestamp <= (timestamp + staleDuration); } function syncTS() external onlyAdmin { timestamp = block.timestamp; } function syncTS(uint256 _ts) external onlyAdmin { timestamp = _ts; } function debugTS() external view returns ( uint256 n, uint256 bs, uint256 ts, bool f ) { n = block.number; bs = block.timestamp; ts = timestamp; f = block.timestamp <= (timestamp + staleDuration); } function woSpread(address base) external view override returns (uint64) { return infos[base].spread; } function woCoeff(address base) external view override returns (uint64) { return infos[base].coeff; } // Wooracle price of the base token function woPrice(address base) external view override returns (uint128 priceOut, uint256 priceTimestampOut) { priceOut = infos[base].price; priceTimestampOut = timestamp; } function woState(address base) external view override returns (State memory) { TokenInfo memory info = infos[base]; return State({ price: info.price, spread: info.spread, coeff: info.coeff, woFeasible: (info.price != 0 && block.timestamp <= (timestamp + staleDuration)) }); } function state(address base) external view override returns (State memory) { TokenInfo memory info = infos[base]; (uint256 basePrice, bool feasible) = price(base); return State({price: uint128(basePrice), spread: info.spread, coeff: info.coeff, woFeasible: feasible}); } function cloAddress(address base) external view override returns (address clo) { clo = clOracles[base].oracle; } /* ----- Private Functions ----- */ function _setState( address base, uint128 newPrice, uint64 newSpread, uint64 newCoeff ) private { TokenInfo storage info = infos[base]; info.price = newPrice; info.spread = newSpread; info.coeff = newCoeff; } function _cloPriceInQuote(address fromToken, address toToken) private view returns (uint256 refPrice, uint256 refTimestamp) { address baseOracle = clOracles[fromToken].oracle; if (baseOracle == address(0)) { return (0, 0); } address quoteOracle = clOracles[toToken].oracle; uint8 quoteDecimal = clOracles[toToken].decimal; (, int256 rawBaseRefPrice, , uint256 baseUpdatedAt, ) = AggregatorV3Interface(baseOracle).latestRoundData(); (, int256 rawQuoteRefPrice, , uint256 quoteUpdatedAt, ) = AggregatorV3Interface(quoteOracle).latestRoundData(); uint256 baseRefPrice = uint256(rawBaseRefPrice); uint256 quoteRefPrice = uint256(rawQuoteRefPrice); // NOTE: Assume wooracle token decimal is same as chainlink token decimal. uint256 ceoff = uint256(10)**quoteDecimal; refPrice = (baseRefPrice * ceoff) / quoteRefPrice; refTimestamp = baseUpdatedAt >= quoteUpdatedAt ? quoteUpdatedAt : baseUpdatedAt; } /* ----- Zip Related Functions ----- */ function setBase(uint8 _id, address _base) external onlyAdmin { require(getBase(_id) == address(0), "WooracleV2ZKSync: !id_SET_ALREADY"); basesMap[_id] = _base; } function getBase(uint8 _id) public view returns (address) { address[2] memory CONST_BASES = [ // mload // NOTE: Update token address for different chains 0x4200000000000000000000000000000000000006, // WETH 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA // USDC ]; return _id < CONST_BASES.length ? CONST_BASES[_id] : basesMap[_id]; } // https://docs.soliditylang.org/en/v0.8.12/contracts.html#fallback-function // prettier-ignore fallback (bytes calldata _input) external onlyAdmin returns (bytes memory _output) { /* 2 bit: 0: post prices, 1: post states, 2: post prices with local timestamp 3: post states with local timestamp 6 bits: length post prices: [price] --> base token: 8 bites (1 byte) price data: 32 bits = (27, 5) post states: [states] --> base token: 8 bites (1 byte) price: 32 bits (4 bytes) = (27, 5) k coeff: 16 bits (2 bytes) = (11, 5) s spread: 16 bits (2 bytes) = (11, 5) 4 bytes (32bits): timestamp MAX: 2^32-1 = 4,294,967,295 = Feb 7, 2106 6:28:15 AM (~83 years away) */ uint256 x = _input.length; require(x > 0, "WooracleV2Zip: !calldata"); uint8 firstByte = uint8(bytes1(_input[0])); uint8 op = firstByte >> 6; // 11000000 uint8 len = firstByte & 0x3F; // 00111111 if (op == 0 || op == 2) { // post prices list address base; uint128 p; for (uint256 i = 0; i < len; ++i) { base = getBase(uint8(bytes1(_input[1 + i * 5:1 + i * 5 + 1]))); p = _price(uint32(bytes4(_input[1 + i * 5 + 1:1 + i * 5 + 5]))); infos[base].price = p; } timestamp = (op == 0) ? block.timestamp : uint256(uint32(bytes4(_input[1 + len * 5:1 + len * 5 + 4]))); } else if (op == 1 || op == 3) { // post states list address base; uint128 p; uint64 s; uint64 k; for (uint256 i = 0; i < len; ++i) { base = getBase(uint8(bytes1(_input[1 + i * 9:1 + i * 9 + 1]))); p = _price(uint32(bytes4(_input[1 + i * 9 + 1:1 + i * 9 + 5]))); s = _ks(uint16(bytes2(_input[1 + i * 9 + 5:1 + i * 9 + 7]))); k = _ks(uint16(bytes2(_input[1 + i * 9 + 7:1 + i * 9 + 9]))); _setState(base, p, s, k); } timestamp = (op == 1) ? block.timestamp : uint256(uint32(bytes4(_input[1 + len * 9:1 + len * 9 + 4]))); } else { // not supported } } function _price(uint32 b) internal pure returns (uint128) { return uint128((b >> 5) * (10**(b & 0x1F))); // 0x1F = 00011111 } function _ks(uint16 b) internal pure returns (uint64) { return uint64((b >> 5) * (10**(b & 0x1F))); } function inCaseTokenGotStuck(address stuckToken) external onlyAdmin { if (stuckToken == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) { TransferHelper.safeTransferETH(msg.sender, address(this).balance); } else { uint256 amount = IERC20(stuckToken).balanceOf(address(this)); TransferHelper.safeTransfer(stuckToken, msg.sender, amount); } } }
{ "optimizer": { "enabled": true, "runs": 20000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"basesMap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bound","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"clOracles","outputs":[{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint8","name":"decimal","type":"uint8"},{"internalType":"bool","name":"cloPreferred","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"cloAddress","outputs":[{"internalType":"address","name":"clo","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"cloPrice","outputs":[{"internalType":"uint256","name":"refPrice","type":"uint256"},{"internalType":"uint256","name":"refTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debugTS","outputs":[{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"uint256","name":"bs","type":"uint256"},{"internalType":"uint256","name":"ts","type":"uint256"},{"internalType":"bool","name":"f","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_id","type":"uint8"}],"name":"getBase","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokenGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"infos","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"coeff","type":"uint64"},{"internalType":"uint64","name":"spread","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"isWoFeasible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"},{"internalType":"uint128","name":"newPrice","type":"uint128"},{"internalType":"uint256","name":"_ts","type":"uint256"}],"name":"postPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"},{"internalType":"uint128","name":"newPrice","type":"uint128"}],"name":"postPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"bases","type":"address[]"},{"internalType":"uint128[]","name":"newPrices","type":"uint128[]"},{"internalType":"uint256","name":"_ts","type":"uint256"}],"name":"postPriceList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"},{"internalType":"uint128","name":"newPrice","type":"uint128"},{"internalType":"uint64","name":"newSpread","type":"uint64"},{"internalType":"uint64","name":"newCoeff","type":"uint64"},{"internalType":"uint256","name":"_ts","type":"uint256"}],"name":"postState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint128","name":"","type":"uint128"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"postState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"bases","type":"address[]"},{"internalType":"uint128[]","name":"newPrices","type":"uint128[]"},{"internalType":"uint64[]","name":"newSpreads","type":"uint64[]"},{"internalType":"uint64[]","name":"newCoeffs","type":"uint64[]"},{"internalType":"uint256","name":"_ts","type":"uint256"}],"name":"postStateList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"price","outputs":[{"internalType":"uint256","name":"priceOut","type":"uint256"},{"internalType":"bool","name":"feasible","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_id","type":"uint8"},{"internalType":"address","name":"_base","type":"address"}],"name":"setBase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_bound","type":"uint64"}],"name":"setBound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"bool","name":"_cloPreferred","type":"bool"}],"name":"setCLOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"_cloPreferred","type":"bool"}],"name":"setCloPreferred","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_quote","type":"address"},{"internalType":"address","name":"_oracle","type":"address"}],"name":"setQuoteToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStaleDuration","type":"uint256"}],"name":"setStaleDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wooPP","type":"address"}],"name":"setWooPP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staleDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"state","outputs":[{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"spread","type":"uint64"},{"internalType":"uint64","name":"coeff","type":"uint64"},{"internalType":"bool","name":"woFeasible","type":"bool"}],"internalType":"struct IWooracleV2.State","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"syncTS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ts","type":"uint256"}],"name":"syncTS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"woCoeff","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"woPrice","outputs":[{"internalType":"uint128","name":"priceOut","type":"uint128"},{"internalType":"uint256","name":"priceTimestampOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"woSpread","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"woState","outputs":[{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"spread","type":"uint64"},{"internalType":"uint64","name":"coeff","type":"uint64"},{"internalType":"bool","name":"woFeasible","type":"bool"}],"internalType":"struct IWooracleV2.State","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wooPP","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001d3362000041565b6078600555600680546001600160401b031916662386f26fc1000017905562000091565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61377380620000a16000396000f3fe608060405234801561001057600080fd5b50600436106102d35760003560e01c806396bb520f11610186578063c3c0993b116100e3578063d5bade0711610097578063e52d06ab11610071578063e52d06ab14610df2578063f2030e7314610e28578063f2fde38b14610ecd576102d3565b8063d5bade0714610da0578063d736ce7c14610db3578063e1a4e72a14610ddf576102d3565b8063cc6864b1116100c8578063cc6864b114610d16578063d09a568d14610d1f578063d449a83214610d7b576102d3565b8063c3c0993b14610c18578063c6ddb64214610c6c576102d3565b8063aea910781161013a578063be4df7d61161011f578063be4df7d614610bc5578063c16116d414610bf2578063c32025a414610c05576102d3565b8063aea9107814610b86578063b80777ea14610bae576102d3565b80639d152ee91161016b5780639d152ee914610aeb578063a2c5d01a14610afe578063a4a2a8c514610b73576102d3565b806396bb520f14610a9f57806399235fd414610ad8576102d3565b8063447f3843116102345780635bc9f65d116101e8578063715018a6116101cd578063715018a614610a6657806371ea920514610a6e5780638da5cb5b14610a81576102d3565b80635bc9f65d14610a405780636e27fcd614610a53576102d3565b80634b0bddd2116102195780634b0bddd214610a075780634f1f199914610a1a5780635ab2566c14610a2d576102d3565b8063447f3843146109e15780634a502f39146109f4576102d3565b80631ffabeb81161028b57806324d7806c1161027057806324d7806c1461093257806331e658a51461096557806337e257fd146109ce576102d3565b80631ffabeb8146108da578063217a4b70146108ed576102d3565b80630975e6b0116102bc5780630975e6b0146108705780630b7841f51461089f5780631142e753146108c7576102d3565b80630369292d146108535780630925d4a31461085d575b6000366060336102f860005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16148061032957503360009081526007602052604090205460ff165b61037a5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e0000000000000000000000000000000060448201526064015b60405180910390fd5b81806103c85760405162461bcd60e51b815260206004820152601860248201527f576f6f7261636c6556325a69703a202163616c6c6461746100000000000000006044820152606401610371565b6000848460008181106103dd576103dd612dc6565b919091013560f881901c925060fe1c9050603f821681158061040257508160ff166002145b156105c15760008060005b8360ff1681101561054c576104738a8a610428846005612e24565b610433906001612e61565b9061043f856005612e24565b61044a906001612e61565b610455906001612e61565b9261046293929190612e79565b61046b91612ea3565b60f81c610ee0565b92506104db8a8a610485846005612e24565b610490906001612e61565b61049b906001612e61565b906104a7856005612e24565b6104b2906001612e61565b6104bd906005612e61565b926104ca93929190612e79565b6104d391612eeb565b60e01c610f79565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff8316179055915061054581612f31565b905061040d565b5060ff8416156105b4578888610563856005612f69565b61056e906001612f92565b60ff169061057d866005612f69565b610588906001612f92565b610593906004612f92565b60ff16926105a393929190612e79565b6105ac91612eeb565b60e01c6105b6565b425b600455506108449050565b8160ff16600114806105d657508160ff166003145b156108445760008060008060005b8560ff168110156107cb576106168c8c6105ff846009612e24565b61060a906001612e61565b9061043f856009612e24565b945061064a8c8c610628846009612e24565b610633906001612e61565b61063e906001612e61565b906104a7856009612e24565b93506106b28c8c61065c846009612e24565b610667906001612e61565b610672906005612e61565b9061067e856009612e24565b610689906001612e61565b610694906007612e61565b926106a193929190612e79565b6106aa91612fb7565b60f01c610fa3565b92506106fc8c8c6106c4846009612e24565b6106cf906001612e61565b6106da906007612e61565b906106e6856009612e24565b6106f1906001612e61565b610694906009612e61565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600160205260409020805467ffffffffffffffff838116700100000000000000000000000000000000027fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff91881678010000000000000000000000000000000000000000000000000277ffffffffffffffff000000000000000000000000000000009093166fffffffffffffffffffffffffffffffff8a1617929092171617905591506107c481612f31565b90506105e4565b508560ff16600114610835578a8a6107e4876009612f69565b6107ef906001612f92565b60ff16906107fe886009612f69565b610809906001612f92565b610814906004612f92565b60ff169261082493929190612e79565b61082d91612eeb565b60e01c610837565b425b6004555061084492505050565b50505050915050805190602001f35b61085b610fc5565b005b61085b61086b366004613046565b611068565b610878611170565b60408051948552602085019390935291830152151560608201526080015b60405180910390f35b6108b26108ad366004613082565b611192565b60408051928352602083019190915201610896565b61085b6108d53660046130b5565b6111c4565b61085b6108e83660046130de565b611207565b60035461090d9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610896565b610955610940366004613082565b60076020526000908152604090205460ff1681565b6040519015158152602001610896565b610978610973366004613082565b611313565b6040805182516fffffffffffffffffffffffffffffffff16815260208084015167ffffffffffffffff90811691830191909152838301511691810191909152606091820151151591810191909152608001610896565b6109556109dc366004613082565b611431565b61085b6109ef366004613115565b61148b565b61085b610a023660046131b6565b6115ee565b61085b610a153660046130de565b611814565b61085b610a28366004613282565b611872565b61090d610a3b3660046132aa565b610ee0565b61085b610a4e366004613082565b611914565b61085b610a613660046132c7565b611a04565b61085b611bc5565b61085b610a7c3660046132fa565b611bd9565b60005473ffffffffffffffffffffffffffffffffffffffff1661090d565b61090d610aad366004613082565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600260205260409020541690565b61085b610ae6366004613282565b611cbe565b61085b610af936600461334e565b611d60565b610b4b610b0c366004613082565b73ffffffffffffffffffffffffffffffffffffffff166000908152600160205260409020546004546fffffffffffffffffffffffffffffffff90911691565b604080516fffffffffffffffffffffffffffffffff9093168352602083019190915201610896565b61085b610b813660046133c2565b611f22565b610b99610b94366004613082565b612119565b60408051928352901515602083015201610896565b610bb760045481565b604051908152602001610896565b600654610bd99067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610896565b610978610c00366004613082565b61229a565b61085b610c13366004613409565b61239f565b610bd9610c26366004613082565b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020526040902054700100000000000000000000000000000000900467ffffffffffffffff1690565b610cdd610c7a366004613082565b6001602052600090815260409020546fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610896565b610bb760055481565b610bd9610d2d366004613082565b73ffffffffffffffffffffffffffffffffffffffff166000908152600160205260409020547801000000000000000000000000000000000000000000000000900467ffffffffffffffff1690565b610d8e610d89366004613082565b612528565b60405160ff9091168152602001610896565b61085b610dae366004613427565b612577565b60065461090d9068010000000000000000900473ffffffffffffffffffffffffffffffffffffffff1681565b61085b610ded366004613082565b612693565b61090d610e003660046132aa565b60086020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b610e97610e36366004613082565b60026020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff81169060ff740100000000000000000000000000000000000000008204811691750100000000000000000000000000000000000000000090041683565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845260ff9092166020840152151590820152606001610896565b61085b610edb366004613082565b61280c565b60408051808201909152734200000000000000000000000000000000000006815273d9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca6020820152600090600260ff841610610f575760ff831660009081526008602052604090205473ffffffffffffffffffffffffffffffffffffffff16610f72565b808360ff1660028110610f6c57610f6c612dc6565b60200201515b9392505050565b6000610f89601f8316600a613569565b610f9d906307ffffff600585901c16612e24565b92915050565b6000610fb3601f8316600a61357b565b610f9d906107ff600585901c16612e24565b33610fe560005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16148061101657503360009081526007602052604090205460ff165b6110625760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b42600455565b3361108860005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614806110b957503360009081526007602052604090205460ff165b6111055760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b73ffffffffffffffffffffffffffffffffffffffff909216600090815260016020526040902080546fffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909216919091179055600455565b600454600554439142916000906111879083612e61565b421115905090919293565b60035460009081906111bb90849073ffffffffffffffffffffffffffffffffffffffff166128a6565b91509150915091565b6111cc612a79565b600680547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff92909216919091179055565b3361122760005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16148061125857503360009081526007602052604090205460ff165b6112a45760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b73ffffffffffffffffffffffffffffffffffffffff909116600090815260026020526040902080549115157501000000000000000000000000000000000000000000027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b60408051608081018252600080825260208201819052918101829052606081019190915273ffffffffffffffffffffffffffffffffffffffff82166000908152600160209081526040808320815160608101835290546fffffffffffffffffffffffffffffffff8116825267ffffffffffffffff7001000000000000000000000000000000008204811694830194909452780100000000000000000000000000000000000000000000000090049092169082015290806113d285612119565b915091506040518060800160405280836fffffffffffffffffffffffffffffffff168152602001846040015167ffffffffffffffff168152602001846020015167ffffffffffffffff1681526020018215158152509350505050919050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600160205260408120546fffffffffffffffffffffffffffffffff1615801590610f9d57506005546004546114829190612e61565b42111592915050565b336114ab60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614806114dc57503360009081526007602052604090205460ff165b6115285760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600160205260409020805467ffffffffffffffff848116700100000000000000000000000000000000027fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff91871678010000000000000000000000000000000000000000000000000277ffffffffffffffff000000000000000000000000000000009093166fffffffffffffffffffffffffffffffff891617929092171617905560045550505050565b3361160e60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16148061163f57503360009081526007602052604090205460ff165b61168b5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b8760005b81811015611805576117fd8b8b838181106116ac576116ac612dc6565b90506020020160208101906116c19190613082565b8a8a848181106116d3576116d3612dc6565b90506020020160208101906116e8919061358b565b8989858181106116fa576116fa612dc6565b905060200201602081019061170f91906130b5565b88888681811061172157611721612dc6565b905060200201602081019061173691906130b5565b73ffffffffffffffffffffffffffffffffffffffff93909316600090815260016020526040902080546fffffffffffffffffffffffffffffffff9390931677ffffffffffffffff0000000000000000000000000000000090931692909217780100000000000000000000000000000000000000000000000067ffffffffffffffff92831602177fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000009190931602919091179055565b60010161168f565b50506004555050505050505050565b61181c612a79565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260076020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b3361189260005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614806118c357503360009081526007602052604090205460ff165b61190f5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b600455565b3361193460005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16148061196557503360009081526007602052604090205460ff165b6119b15760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b6006805473ffffffffffffffffffffffffffffffffffffffff90921668010000000000000000027fffffffff0000000000000000000000000000000000000000ffffffffffffffff909216919091179055565b33611a2460005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161480611a5557503360009081526007602052604090205460ff165b611aa15760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b6003805473ffffffffffffffffffffffffffffffffffffffff8085167fffffffffffffffffffffffff000000000000000000000000000000000000000092831681179093556000928352600260209081526040938490208054928616929093168217835583517f313ce56700000000000000000000000000000000000000000000000000000000815293519293919263313ce5679260048082019392918290030181865afa158015611b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7b91906135a6565b815460ff9190911674010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790555050565b611bcd612a79565b611bd76000612ae0565b565b33611bf960005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161480611c2a57503360009081526007602052604090205460ff165b611c765760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b60405162461bcd60e51b815260206004820152601760248201527f4e4f5420535550504f5254454420494e205a4b53594e430000000000000000006044820152606401610371565b33611cde60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161480611d0f57503360009081526007602052604090205460ff165b611d5b5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b600555565b33611d8060005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161480611db157503360009081526007602052604090205460ff165b611dfd5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b83828114611e4d5760405162461bcd60e51b815260206004820152601860248201527f576f6f7261636c653a206c656e6774685f494e56414c494400000000000000006044820152606401610371565b60005b81811015611f1757848482818110611e6a57611e6a612dc6565b9050602002016020810190611e7f919061358b565b60016000898985818110611e9557611e95612dc6565b9050602002016020810190611eaa9190613082565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff92909216919091179055600101611e50565b505060045550505050565b33611f4260005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff161480611f7357503360009081526007602052604090205460ff165b611fbf5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b73ffffffffffffffffffffffffffffffffffffffff83811660009081526002602090815260409182902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016938616938417815582517f313ce567000000000000000000000000000000000000000000000000000000008152925190939263313ce5679260048083019391928290030181865afa158015612066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208a91906135a6565b81547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000060ff92909216919091027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16177501000000000000000000000000000000000000000000921515929092029190911790555050565b73ffffffffffffffffffffffffffffffffffffffff808216600090815260016020526040812054600454600354929384936fffffffffffffffffffffffffffffffff90931692849161216d918891166128a6565b5090506000831580159061218d57506005546121899084612e61565b4211155b9050600082158061222657506006548590670de0b6b3a7640000906121bc9067ffffffffffffffff16826135c3565b6121d09067ffffffffffffffff1686612e24565b6121da91906135ec565b111580156122265750600654670de0b6b3a7640000906122049067ffffffffffffffff1682613627565b6122189067ffffffffffffffff1685612e24565b61222291906135ec565b8511155b9050811561223957849650809550612290565b73ffffffffffffffffffffffffffffffffffffffff88166000908152600260205260409020547501000000000000000000000000000000000000000000900460ff16612286576000612288565b825b965086151595505b5050505050915091565b604080516080808201835260008083526020808401829052838501829052606080850183905273ffffffffffffffffffffffffffffffffffffffff8716835260018252918590208551808401875290546fffffffffffffffffffffffffffffffff808216835267ffffffffffffffff7001000000000000000000000000000000008304811684860190815278010000000000000000000000000000000000000000000000009093048116848a0190815289519788018a5284518316885251811694870194909452905190921695840195909552845193949391830191161580159061239457506005546004546123909190612e61565b4211155b151590529392505050565b336123bf60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614806123f057503360009081526007602052604090205460ff165b61243c5760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b600061244783610ee0565b73ffffffffffffffffffffffffffffffffffffffff16146124d05760405162461bcd60e51b815260206004820152602160248201527f576f6f7261636c6556325a4b53796e633a202169645f5345545f414c5245414460448201527f59000000000000000000000000000000000000000000000000000000000000006064820152608401610371565b60ff91909116600090815260086020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604081205474010000000000000000000000000000000000000000900460ff16808203610f9d576008610f72565b3361259760005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614806125c857503360009081526007602052604090205460ff165b6126145760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b73ffffffffffffffffffffffffffffffffffffffff828116600090815260016020526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff841617905560065468010000000000000000900416331461268f57426004555b5050565b336126b360005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614806126e457503360009081526007602052604090205460ff165b6127305760405162461bcd60e51b815260206004820152601060248201527f576f6f7261636c653a202141646d696e000000000000000000000000000000006044820152606401610371565b73ffffffffffffffffffffffffffffffffffffffff811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0361276e5761276b3347612b55565b50565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156127db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ff9190613653565b905061268f823383612c4a565b612814612a79565b73ffffffffffffffffffffffffffffffffffffffff811661289d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610371565b61276b81612ae0565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600260205260408120549091829116806128e4576000809250925050612a72565b73ffffffffffffffffffffffffffffffffffffffff8481166000908152600260205260408082205481517ffeaf968c0000000000000000000000000000000000000000000000000000000081529151818516947401000000000000000000000000000000000000000090920460ff169392839287169163feaf968c9160048082019260a0929091908290030181865afa158015612985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a99190613686565b509350509250506000808573ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156129fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a229190613686565b509194509092508591508390506000612a3c88600a6136d6565b905081612a498285612e24565b612a5391906135ec565b9b5083861015612a635785612a65565b835b9a50505050505050505050505b9250929050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611bd75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610371565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051612b8c91906136e5565b60006040518083038185875af1925050503d8060008114612bc9576040519150601f19603f3d011682016040523d82523d6000602084013e612bce565b606091505b5050905080612c455760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610371565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691612ce191906136e5565b6000604051808303816000865af19150503d8060008114612d1e576040519150601f19603f3d011682016040523d82523d6000602084013e612d23565b606091505b5091509150818015612d4d575080511580612d4d575080806020019051810190612d4d9190613720565b612dbf5760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152608401610371565b5050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e5c57612e5c612df5565b500290565b60008219821115612e7457612e74612df5565b500190565b60008085851115612e8957600080fd5b83861115612e9657600080fd5b5050820193919092039150565b7fff000000000000000000000000000000000000000000000000000000000000008135818116916001851015612ee35780818660010360031b1b83161692505b505092915050565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015612ee35760049490940360031b84901b1690921692915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612f6257612f62612df5565b5060010190565b600060ff821660ff84168160ff0481118215151615612f8a57612f8a612df5565b029392505050565b600060ff821660ff84168060ff03821115612faf57612faf612df5565b019392505050565b7fffff0000000000000000000000000000000000000000000000000000000000008135818116916002851015612ee35760029490940360031b84901b1690921692915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461302157600080fd5b919050565b80356fffffffffffffffffffffffffffffffff8116811461302157600080fd5b60008060006060848603121561305b57600080fd5b61306484612ffd565b925061307260208501613026565b9150604084013590509250925092565b60006020828403121561309457600080fd5b610f7282612ffd565b803567ffffffffffffffff8116811461302157600080fd5b6000602082840312156130c757600080fd5b610f728261309d565b801515811461276b57600080fd5b600080604083850312156130f157600080fd5b6130fa83612ffd565b9150602083013561310a816130d0565b809150509250929050565b600080600080600060a0868803121561312d57600080fd5b61313686612ffd565b945061314460208701613026565b93506131526040870161309d565b92506131606060870161309d565b949793965091946080013592915050565b60008083601f84011261318357600080fd5b50813567ffffffffffffffff81111561319b57600080fd5b6020830191508360208260051b8501011115612a7257600080fd5b600080600080600080600080600060a08a8c0312156131d457600080fd5b893567ffffffffffffffff808211156131ec57600080fd5b6131f88d838e01613171565b909b50995060208c013591508082111561321157600080fd5b61321d8d838e01613171565b909950975060408c013591508082111561323657600080fd5b6132428d838e01613171565b909750955060608c013591508082111561325b57600080fd5b506132688c828d01613171565b9a9d999c50979a9699959894979660800135949350505050565b60006020828403121561329457600080fd5b5035919050565b60ff8116811461276b57600080fd5b6000602082840312156132bc57600080fd5b8135610f728161329b565b600080604083850312156132da57600080fd5b6132e383612ffd565b91506132f160208401612ffd565b90509250929050565b6000806000806080858703121561331057600080fd5b61331985612ffd565b935061332760208601613026565b92506133356040860161309d565b91506133436060860161309d565b905092959194509250565b60008060008060006060868803121561336657600080fd5b853567ffffffffffffffff8082111561337e57600080fd5b61338a89838a01613171565b909750955060208801359150808211156133a357600080fd5b506133b088828901613171565b96999598509660400135949350505050565b6000806000606084860312156133d757600080fd5b6133e084612ffd565b92506133ee60208501612ffd565b915060408401356133fe816130d0565b809150509250925092565b6000806040838503121561341c57600080fd5b82356132e38161329b565b6000806040838503121561343a57600080fd5b61344383612ffd565b91506132f160208401613026565b600181815b808511156134aa57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561349057613490612df5565b8085161561349d57918102915b93841c9390800290613456565b509250929050565b6000826134c157506001610f9d565b816134ce57506000610f9d565b81600181146134e457600281146134ee5761350a565b6001915050610f9d565b60ff8411156134ff576134ff612df5565b50506001821b610f9d565b5060208310610133831016604e8410600b841016171561352d575081810a610f9d565b6135378383613451565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612f8a57612f8a612df5565b6000610f7263ffffffff8416836134b2565b6000610f7261ffff8416836134b2565b60006020828403121561359d57600080fd5b610f7282613026565b6000602082840312156135b857600080fd5b8151610f728161329b565b600067ffffffffffffffff838116908316818110156135e4576135e4612df5565b039392505050565b600082613622577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600067ffffffffffffffff80831681851680830382111561364a5761364a612df5565b01949350505050565b60006020828403121561366557600080fd5b5051919050565b805169ffffffffffffffffffff8116811461302157600080fd5b600080600080600060a0868803121561369e57600080fd5b6136a78661366c565b94506020860151935060408601519250606086015191506136ca6080870161366c565b90509295509295909350565b6000610f7260ff8416836134b2565b6000825160005b8181101561370657602081860181015185830152016136ec565b81811115613715576000828501525b509190910192915050565b60006020828403121561373257600080fd5b8151610f72816130d056fea26469706673582212209f512568e83bb08cc8684e1217f6ecb5b37ea82b75e9b12d80b9740256b8e8d164736f6c634300080e0033
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.