Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x416962ab423d2d1e107983fec377c93b45474692.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
- Contract name:
- PancakeV3Adapter
- Optimization enabled
- true
- Compiler version
- v0.8.20+commit.a1b79de6
- Optimization runs
- 999
- Verified at
- 2025-10-12T05:19:52.044354Z
src/adapters/PancakeV3Adapter.sol
// SPDX-License-Identifier: GPL-3.0-only
/*
++++++++++++++++++
+++++++++++++++++++++++++
++++++++++++++++++++++++++++++ +++++++++
+=++++++++++++++++++++++++++++++=++ ++=+++++===++++++++
+++++++++++++++++++++++++++++++++++++++ ++++=++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==
+=+++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++=++
+++++++++++++++ ++=+++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++ +++++++++++++++++++++++++ ++++++++++++++++++
++++++++++++++ ++++++++++++++++++++ =++++++++++++++++
+++++++++++++++ ++++++++++++++++++ ++++++++++++++++
+++++++++++++++ ++++++++++++++ +++++++++++++=++
+++++++++++++++ +++++++++++ ++++++++++++++++
++++++++++++++ ++++++++ +++++++++++++++
+++++++++++++++ ++++++ ++=++++++++++++
+++++++++++++++ ++++ +++++++++++++++
++++++++++++++++ += +++++++++++++++
+++++++++++++++ ++++++++++++++++
++++++++++++++++ ++++++++++++++++++++
++++++++++++++++ ++++++++++++++++++++++++
++++++++++++++++ +++++++++++++++++++++++++++
+=++++++++++++++ ++++++++++++++++++++++++++++
+=++++++++++++++ +++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++++++++++++++
+++++++++++++++++ +++++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++
++=++++++++++++++ =++++++++++++++++
+++++++++++++++++ ++++++++++++++++
++++++++++++++++++ +++++++++++++++
++++++++++++++++++ ++++++++++++++
+++++++++++++++++++ ++++++++++++++
+++++++++++++++==+ ++++++++++++++
+++++++++++++++++++ .. ++++++++++++++
++++++++++++++++++ ......... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
+==+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ... ++++++++++++++
++++++++++++++++ .. ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
*++**++*******++ ++++++++++++++
*++************* ++++++++++++++
**+************* **************
**************** **************
*************** ***************
**************** ***************
*****************# *****************
******************* ******************
*****************************************************************************
***************************************************************************
*************************************************************************
#################*****************************************************
##########################################################***#####*
###############################################################
###*######################################################
###################################################
Switch.win
https://Switch.win
Built by: BuildTheTech.com
*/
pragma solidity ^0.8.0;
import "./UniswapV3AdapterBase.sol";
contract PancakeV3Adapter is UniswapV3AdapterBase {
constructor(
string memory _name,
uint256 _swapGasEstimate,
uint256 _quoterGasLimit,
address _quoter,
address _factory,
uint24[] memory _defaultFees
) UniswapV3AdapterBase(_name, _swapGasEstimate, _quoterGasLimit, _quoter, _factory, _defaultFees) {
}
function pancakeV3SwapCallback (
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external {
_handleSwapCallback(amount0Delta, amount1Delta, data);
}
}
src/SwitchAdapter.sol
// SPDX-License-Identifier: GPL-3.0-only
/*
++++++++++++++++++
+++++++++++++++++++++++++
++++++++++++++++++++++++++++++ +++++++++
+=++++++++++++++++++++++++++++++=++ ++=+++++===++++++++
+++++++++++++++++++++++++++++++++++++++ ++++=++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==
+=+++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++=++
+++++++++++++++ ++=+++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++ +++++++++++++++++++++++++ ++++++++++++++++++
++++++++++++++ ++++++++++++++++++++ =++++++++++++++++
+++++++++++++++ ++++++++++++++++++ ++++++++++++++++
+++++++++++++++ ++++++++++++++ +++++++++++++=++
+++++++++++++++ +++++++++++ ++++++++++++++++
++++++++++++++ ++++++++ +++++++++++++++
+++++++++++++++ ++++++ ++=++++++++++++
+++++++++++++++ ++++ +++++++++++++++
++++++++++++++++ += +++++++++++++++
+++++++++++++++ ++++++++++++++++
++++++++++++++++ ++++++++++++++++++++
++++++++++++++++ ++++++++++++++++++++++++
++++++++++++++++ +++++++++++++++++++++++++++
+=++++++++++++++ ++++++++++++++++++++++++++++
+=++++++++++++++ +++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++++++++++++++
+++++++++++++++++ +++++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++
++=++++++++++++++ =++++++++++++++++
+++++++++++++++++ ++++++++++++++++
++++++++++++++++++ +++++++++++++++
++++++++++++++++++ ++++++++++++++
+++++++++++++++++++ ++++++++++++++
+++++++++++++++==+ ++++++++++++++
+++++++++++++++++++ .. ++++++++++++++
++++++++++++++++++ ......... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
+==+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ... ++++++++++++++
++++++++++++++++ .. ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
*++**++*******++ ++++++++++++++
*++************* ++++++++++++++
**+************* **************
**************** **************
*************** ***************
**************** ***************
*****************# *****************
******************* ******************
*****************************************************************************
***************************************************************************
*************************************************************************
#################*****************************************************
##########################################################***#####*
###############################################################
###*######################################################
###################################################
Switch.win
https://Switch.win
Built by: BuildTheTech.com
*/
pragma solidity ^0.8.0;
import "./interface/IERC20.sol";
import "./lib/SafeERC20.sol";
import "./lib/Maintainable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
abstract contract SwitchAdapter is Maintainable, ReentrancyGuard {
using SafeERC20 for IERC20;
event SwitchAdapterSwap(address indexed _tokenFrom, address indexed _tokenTo, uint256 _amountIn, uint256 _amountOut);
event UpdatedGasEstimate(address indexed _adapter, uint256 _newEstimate);
event Recovered(address indexed _asset, uint256 amount);
uint256 internal constant UINT_MAX = type(uint256).max;
uint256 public swapGasEstimate;
string public name;
constructor(string memory _name, uint256 _gasEstimate) {
setName(_name);
setSwapGasEstimate(_gasEstimate);
}
function setName(string memory _name) internal {
require(bytes(_name).length != 0, "Invalid adapter name");
name = _name;
}
function setSwapGasEstimate(uint256 _estimate) public onlyMaintainer {
require(_estimate != 0, "Invalid gas-estimate");
swapGasEstimate = _estimate;
emit UpdatedGasEstimate(address(this), _estimate);
}
function revokeAllowance(address _token, address _spender) external onlyMaintainer {
IERC20(_token).safeApprove(_spender, 0);
}
function recoverERC20(address _tokenAddress, uint256 _tokenAmount) external onlyMaintainer {
require(_tokenAmount > 0, "SwitchAdapter: Nothing to recover");
IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
emit Recovered(_tokenAddress, _tokenAmount);
}
function recoverPLS(uint256 _amount) external onlyMaintainer {
require(_amount > 0, "SwitchAdapter: Nothing to recover");
(bool ok, ) = payable(msg.sender).call{value: _amount}("");
require(ok, "SwitchAdapter: PLS transfer failed");
emit Recovered(address(0), _amount);
}
function query(
uint256 _amountIn,
address _tokenIn,
address _tokenOut
) external view returns (uint256) {
return _query(_amountIn, _tokenIn, _tokenOut);
}
function swap(
uint256 _amountIn,
uint256 _amountOut,
address _fromToken,
address _toToken,
address _to
) external virtual nonReentrant {
uint256 toBal0 = IERC20(_toToken).balanceOf(_to);
_swap(_amountIn, _amountOut, _fromToken, _toToken, _to);
uint256 diff = IERC20(_toToken).balanceOf(_to) - toBal0;
require(diff >= _amountOut, "Insufficient amount-out");
emit SwitchAdapterSwap(_fromToken, _toToken, _amountIn, _amountOut);
}
function _returnTo(
address _token,
uint256 _amount,
address _to
) internal {
if (address(this) != _to) IERC20(_token).safeTransfer(_to, _amount);
}
function _swap(
uint256 _amountIn,
uint256 _amountOut,
address _fromToken,
address _toToken,
address _to
) internal virtual;
function _query(
uint256 _amountIn,
address _tokenIn,
address _tokenOut
) internal view virtual returns (uint256);
receive() external payable {}
}
dependencies/openzeppelin-contracts/contracts/access/AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
dependencies/openzeppelin-contracts/contracts/access/IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
dependencies/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
dependencies/openzeppelin-contracts/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
dependencies/openzeppelin-contracts/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
dependencies/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
dependencies/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
dependencies/openzeppelin-contracts/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
dependencies/openzeppelin-contracts/contracts/utils/math/SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
src/adapters/UniswapV3AdapterBase.sol
// SPDX-License-Identifier: GPL-3.0-only
/*
++++++++++++++++++
+++++++++++++++++++++++++
++++++++++++++++++++++++++++++ +++++++++
+=++++++++++++++++++++++++++++++=++ ++=+++++===++++++++
+++++++++++++++++++++++++++++++++++++++ ++++=++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==
+=+++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++=++
+++++++++++++++ ++=+++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++ +++++++++++++++++++++++++ ++++++++++++++++++
++++++++++++++ ++++++++++++++++++++ =++++++++++++++++
+++++++++++++++ ++++++++++++++++++ ++++++++++++++++
+++++++++++++++ ++++++++++++++ +++++++++++++=++
+++++++++++++++ +++++++++++ ++++++++++++++++
++++++++++++++ ++++++++ +++++++++++++++
+++++++++++++++ ++++++ ++=++++++++++++
+++++++++++++++ ++++ +++++++++++++++
++++++++++++++++ += +++++++++++++++
+++++++++++++++ ++++++++++++++++
++++++++++++++++ ++++++++++++++++++++
++++++++++++++++ ++++++++++++++++++++++++
++++++++++++++++ +++++++++++++++++++++++++++
+=++++++++++++++ ++++++++++++++++++++++++++++
+=++++++++++++++ +++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++++++++++++++
+++++++++++++++++ +++++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++
++=++++++++++++++ =++++++++++++++++
+++++++++++++++++ ++++++++++++++++
++++++++++++++++++ +++++++++++++++
++++++++++++++++++ ++++++++++++++
+++++++++++++++++++ ++++++++++++++
+++++++++++++++==+ ++++++++++++++
+++++++++++++++++++ .. ++++++++++++++
++++++++++++++++++ ......... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
+==+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ... ++++++++++++++
++++++++++++++++ .. ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
*++**++*******++ ++++++++++++++
*++************* ++++++++++++++
**+************* **************
**************** **************
*************** ***************
**************** ***************
*****************# *****************
******************* ******************
*****************************************************************************
***************************************************************************
*************************************************************************
#################*****************************************************
##########################################################***#####*
###############################################################
###*######################################################
###################################################
Switch.win
https://Switch.win
Built by: BuildTheTech.com
*/
pragma solidity ^0.8.0;
import "./UniswapV3likeAdapter.sol";
interface IUniV3Factory {
function feeAmountTickSpacing(uint24) external view returns (int24);
function getPool(
address,
address,
uint24
) external view returns (address);
}
contract UniswapV3AdapterBase is UniswapV3likeAdapter {
using SafeERC20 for IERC20;
address immutable FACTORY;
mapping(uint24 => bool) public isFeeAmountEnabled;
uint24[] public feeAmounts;
constructor(
string memory _name,
uint256 _swapGasEstimate,
uint256 _quoterGasLimit,
address _quoter,
address _factory,
uint24[] memory _defaultFees
) UniswapV3likeAdapter(_name, _swapGasEstimate, _quoter, _quoterGasLimit) {
FACTORY = _factory;
for (uint i = 0; i < _defaultFees.length; i++) {
addFeeAmount(_defaultFees[i]);
}
}
function enableFeeAmounts(uint24[] calldata _amounts) external onlyMaintainer {
for (uint256 i; i < _amounts.length; ++i) enableFeeAmount(_amounts[i]);
}
function enableFeeAmount(uint24 _fee) internal {
require(!isFeeAmountEnabled[_fee], "Fee already enabled");
if (IUniV3Factory(FACTORY).feeAmountTickSpacing(_fee) == 0)
revert("Factory doesn't support fee");
addFeeAmount(_fee);
}
function addFeeAmount(uint24 _fee) internal {
isFeeAmountEnabled[_fee] = true;
feeAmounts.push(_fee);
}
function getBestPool(
address token0,
address token1
) internal view override returns (address mostLiquid) {
uint128 deepestLiquidity;
for (uint256 i; i < feeAmounts.length; ++i) {
address pool = IUniV3Factory(FACTORY).getPool(token0, token1, feeAmounts[i]);
if (pool == address(0))
continue;
uint128 liquidity = IUniV3Pool(pool).liquidity();
if (liquidity > deepestLiquidity) {
deepestLiquidity = liquidity;
mostLiquid = pool;
}
}
}
}
src/adapters/UniswapV3likeAdapter.sol
// SPDX-License-Identifier: GPL-3.0-only
/*
++++++++++++++++++
+++++++++++++++++++++++++
++++++++++++++++++++++++++++++ +++++++++
+=++++++++++++++++++++++++++++++=++ ++=+++++===++++++++
+++++++++++++++++++++++++++++++++++++++ ++++=++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+=+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==
+=+++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++=++
+++++++++++++++ ++=+++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++ +++++++++++++++++++++++++ ++++++++++++++++++
++++++++++++++ ++++++++++++++++++++ =++++++++++++++++
+++++++++++++++ ++++++++++++++++++ ++++++++++++++++
+++++++++++++++ ++++++++++++++ +++++++++++++=++
+++++++++++++++ +++++++++++ ++++++++++++++++
++++++++++++++ ++++++++ +++++++++++++++
+++++++++++++++ ++++++ ++=++++++++++++
+++++++++++++++ ++++ +++++++++++++++
++++++++++++++++ += +++++++++++++++
+++++++++++++++ ++++++++++++++++
++++++++++++++++ ++++++++++++++++++++
++++++++++++++++ ++++++++++++++++++++++++
++++++++++++++++ +++++++++++++++++++++++++++
+=++++++++++++++ ++++++++++++++++++++++++++++
+=++++++++++++++ +++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++++++++++++++
+++++++++++++++++ +++++++++++++++++++++++++++++++++
+++++++++++++++++ ++++++++++++++++++++
++=++++++++++++++ =++++++++++++++++
+++++++++++++++++ ++++++++++++++++
++++++++++++++++++ +++++++++++++++
++++++++++++++++++ ++++++++++++++
+++++++++++++++++++ ++++++++++++++
+++++++++++++++==+ ++++++++++++++
+++++++++++++++++++ .. ++++++++++++++
++++++++++++++++++ ......... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
+==+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ....... ++++++++++++++
++=+++++++++++++ ... ++++++++++++++
++++++++++++++++ .. ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
++++++++++++++++ ++++++++++++++
*++**++*******++ ++++++++++++++
*++************* ++++++++++++++
**+************* **************
**************** **************
*************** ***************
**************** ***************
*****************# *****************
******************* ******************
*****************************************************************************
***************************************************************************
*************************************************************************
#################*****************************************************
##########################################################***#####*
###############################################################
###*######################################################
###################################################
Switch.win
https://Switch.win
Built by: BuildTheTech.com
*/
pragma solidity ^0.8.0;
import "../interface/IERC20.sol";
import "../lib/SafeERC20.sol";
import "../SwitchAdapter.sol";
struct QParams {
address tokenIn;
address tokenOut;
int256 amountIn;
uint24 fee;
}
struct V3CallbackData {
address pool;
address tokenIn;
address tokenOut;
bytes extra;
}
interface IUniV3Pool {
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
function token0() external view returns (address);
function token1() external view returns (address);
function liquidity() external view returns (uint128);
}
interface IUniV3Quoter {
function quoteExactInputSingle(
QParams memory params
) external view returns (uint256);
function quote(
address,
bool,
int256,
uint160
) external view returns (int256, int256);
}
abstract contract UniswapV3likeAdapter is SwitchAdapter {
using SafeERC20 for IERC20;
uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
uint160 internal constant MIN_SQRT_RATIO = 4295128739;
uint256 public quoterGasLimit;
address public quoter;
constructor(
string memory _name,
uint256 _swapGasEstimate,
address _quoter,
uint256 _quoterGasLimit
) SwitchAdapter(_name, _swapGasEstimate) {
setQuoterGasLimit(_quoterGasLimit);
setQuoter(_quoter);
}
function setQuoter(address newQuoter) public onlyMaintainer {
quoter = newQuoter;
}
function setQuoterGasLimit(uint256 newLimit) public onlyMaintainer {
require(newLimit != 0, "queryGasLimit can't be zero");
quoterGasLimit = newLimit;
}
function getQuoteForPool(
address pool,
int256 amountIn,
address tokenIn,
address tokenOut
) external view returns (uint256) {
QParams memory params;
params.amountIn = amountIn;
params.tokenIn = tokenIn;
params.tokenOut = tokenOut;
return getQuoteForPool(pool, params);
}
function _query(
uint256 _amountIn,
address _tokenIn,
address _tokenOut
) internal view override returns (uint256 quote) {
QParams memory params = getQParams(_amountIn, _tokenIn, _tokenOut);
quote = getQuoteForBestPool(params);
}
function _swap(
uint256 _amountIn,
uint256 _amountOut,
address _tokenIn,
address _tokenOut,
address _to
) internal override {
QParams memory params = getQParams(_amountIn, _tokenIn, _tokenOut);
uint256 amountOut = _underlyingSwap(params, new bytes(0));
require(amountOut >= _amountOut, "Insufficient amountOut");
_returnTo(_tokenOut, amountOut, _to);
}
function getQParams(
uint256 amountIn,
address tokenIn,
address tokenOut
) internal pure returns (QParams memory params) {
params = QParams({
amountIn: int256(amountIn),
tokenIn: tokenIn,
tokenOut: tokenOut,
fee: 0
});
}
function _underlyingSwap(
QParams memory params,
bytes memory callbackData
) internal virtual returns (uint256) {
address pool = getBestPool(params.tokenIn, params.tokenOut);
require(pool != address(0), "Pool not found");
(bool zeroForOne, uint160 priceLimit) = getZeroOneAndSqrtPriceLimitX96(
params.tokenIn,
params.tokenOut
);
bytes memory payload = _encodeSwapCallbackData(pool, params.tokenIn, params.tokenOut, callbackData);
(int256 amount0, int256 amount1) = IUniV3Pool(pool).swap(
address(this),
zeroForOne,
int256(params.amountIn),
priceLimit,
payload
);
return zeroForOne ? uint256(-amount1) : uint256(-amount0);
}
function getQuoteForBestPool(
QParams memory params
) internal view returns (uint256 quote) {
address bestPool = getBestPool(params.tokenIn, params.tokenOut);
if (bestPool != address(0)) quote = getQuoteForPool(bestPool, params);
}
function getBestPool(
address token0,
address token1
) internal view virtual returns (address mostLiquid);
function getQuoteForPool(
address pool,
QParams memory params
) internal view returns (uint256) {
(bool zeroForOne, uint160 priceLimit) = getZeroOneAndSqrtPriceLimitX96(
params.tokenIn,
params.tokenOut
);
(int256 amount0, int256 amount1) = getQuoteSafe(
pool,
zeroForOne,
params.amountIn,
priceLimit
);
return zeroForOne ? uint256(-amount1) : uint256(-amount0);
}
function getQuoteSafe(
address pool,
bool zeroForOne,
int256 amountIn,
uint160 priceLimit
) internal view returns (int256 amount0, int256 amount1) {
bytes memory calldata_ = abi.encodeWithSignature(
"quote(address,bool,int256,uint160)",
pool,
zeroForOne,
amountIn,
priceLimit
);
(bool success, bytes memory data) = staticCallQuoterRaw(calldata_);
if (success)
(amount0, amount1) = abi.decode(data, (int256, int256));
}
function staticCallQuoterRaw(
bytes memory calldata_
) internal view returns (bool success, bytes memory data) {
(success, data) = quoter.staticcall{gas: quoterGasLimit}(calldata_);
}
function getZeroOneAndSqrtPriceLimitX96(address tokenIn, address tokenOut)
internal
pure
returns (bool zeroForOne, uint160 sqrtPriceLimitX96)
{
zeroForOne = tokenIn < tokenOut;
sqrtPriceLimitX96 = zeroForOne ? MIN_SQRT_RATIO+1 : MAX_SQRT_RATIO-1;
}
function _encodeSwapCallbackData(
address pool,
address tokenIn,
address tokenOut,
bytes memory extra
) internal pure returns (bytes memory) {
return abi.encode(V3CallbackData({
pool: pool,
tokenIn: tokenIn,
tokenOut: tokenOut,
extra: extra
}));
}
function _decodeAndValidateSwapCallback(
bytes calldata rawData
) internal view returns (V3CallbackData memory info, address token0, address token1) {
require(rawData.length >= 128, "Callback data too short");
info = abi.decode(rawData, (V3CallbackData));
require(msg.sender == info.pool, "Unauthorized callback");
token0 = IUniV3Pool(info.pool).token0();
token1 = IUniV3Pool(info.pool).token1();
require(
(info.tokenIn == token0 || info.tokenIn == token1) &&
(info.tokenOut == token0 || info.tokenOut == token1),
"Token mismatch"
);
}
function _settleSwapCallback(
int256 amount0Delta,
int256 amount1Delta,
address token0,
address token1,
address pool
) internal {
bool pay0 = amount0Delta > 0;
bool pay1 = amount1Delta > 0;
require(pay0 != pay1, "Invalid deltas");
if (pay0) {
IERC20(token0).safeTransfer(pool, uint256(amount0Delta));
} else {
IERC20(token1).safeTransfer(pool, uint256(amount1Delta));
}
}
function _handleSwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata rawData
) internal {
(V3CallbackData memory info, address token0, address token1) = _decodeAndValidateSwapCallback(rawData);
_settleSwapCallback(amount0Delta, amount1Delta, token0, token1, info.pool);
}
}
src/interface/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
event Approval(address, address, uint256);
event Transfer(address, address, uint256);
function name() external view returns (string memory);
function decimals() external view returns (uint8);
function transferFrom(
address,
address,
uint256
) external returns (bool);
function allowance(address, address) external view returns (uint256);
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function nonces(address) external view returns (uint256); // Only tokens that support permit
function permit(
address,
address,
uint256,
uint256,
uint8,
bytes32,
bytes32
) external; // Only tokens that support permit
function swap(address, uint256) external; // Only Avalanche bridge tokens
function swapSupply(address) external view returns (uint256); // Only Avalanche bridge tokens
function totalSupply() external view returns (uint256);
}
src/lib/Maintainable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControl.sol";
/**
* @dev Contract module which extends the basic access control mechanism of Ownable
* to include many maintainers, whom only the owner (DEFAULT_ADMIN_ROLE) may add and
* remove.
*
* 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 this modifier:
* `onlyMaintainer`, which can be applied to your functions to restrict their use to
* the accounts with the role of maintainer.
*/
abstract contract Maintainable is Context, AccessControl {
bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");
constructor() {
address msgSender = _msgSender();
// members of the DEFAULT_ADMIN_ROLE alone may revoke and grant role membership
_setupRole(DEFAULT_ADMIN_ROLE, msgSender);
_setupRole(MAINTAINER_ROLE, msgSender);
}
function addMaintainer(address addedMaintainer) public virtual {
grantRole(MAINTAINER_ROLE, addedMaintainer);
}
function removeMaintainer(address removedMaintainer) public virtual {
revokeRole(MAINTAINER_ROLE, removedMaintainer);
}
function renounceRole(bytes32 role) public virtual {
address msgSender = _msgSender();
renounceRole(role, msgSender);
}
function transferOwnership(address newOwner) public virtual {
address msgSender = _msgSender();
grantRole(DEFAULT_ADMIN_ROLE, newOwner);
renounceRole(DEFAULT_ADMIN_ROLE, msgSender);
}
modifier onlyMaintainer() {
address msgSender = _msgSender();
require(hasRole(MAINTAINER_ROLE, msgSender), "Maintainable: Caller is not a maintainer");
_;
}
}
src/lib/SafeERC20.sol
// This is a simplified version of OpenZepplin's SafeERC20 library
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "../interface/IERC20.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
Compiler Settings
{"viaIR":false,"remappings":["@openzeppelin/contracts/=dependencies/openzeppelin-contracts/contracts/","forge-std/=dependencies/forge-std/src/","ds-test/=dependencies/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/","erc4626-tests/=dependencies/openzeppelin-contracts/lib/erc4626-tests/","openzeppelin-contracts/=dependencies/openzeppelin-contracts/","openzeppelin/=dependencies/openzeppelin-contracts/contracts/"],"outputSelection":{"*":{"*":["abi","evm.bytecode.object","evm.bytecode.sourceMap","evm.bytecode.linkReferences","evm.deployedBytecode.object","evm.deployedBytecode.sourceMap","evm.deployedBytecode.linkReferences","evm.deployedBytecode.immutableReferences","evm.methodIdentifiers","metadata"]}},"optimizer":{"runs":999,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"shanghai"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"uint256","name":"_swapGasEstimate","internalType":"uint256"},{"type":"uint256","name":"_quoterGasLimit","internalType":"uint256"},{"type":"address","name":"_quoter","internalType":"address"},{"type":"address","name":"_factory","internalType":"address"},{"type":"uint24[]","name":"_defaultFees","internalType":"uint24[]"}]},{"type":"event","name":"Recovered","inputs":[{"type":"address","name":"_asset","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SwitchAdapterSwap","inputs":[{"type":"address","name":"_tokenFrom","internalType":"address","indexed":true},{"type":"address","name":"_tokenTo","internalType":"address","indexed":true},{"type":"uint256","name":"_amountIn","internalType":"uint256","indexed":false},{"type":"uint256","name":"_amountOut","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UpdatedGasEstimate","inputs":[{"type":"address","name":"_adapter","internalType":"address","indexed":true},{"type":"uint256","name":"_newEstimate","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"MAINTAINER_ROLE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMaintainer","inputs":[{"type":"address","name":"addedMaintainer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"enableFeeAmounts","inputs":[{"type":"uint24[]","name":"_amounts","internalType":"uint24[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint24","name":"","internalType":"uint24"}],"name":"feeAmounts","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getQuoteForPool","inputs":[{"type":"address","name":"pool","internalType":"address"},{"type":"int256","name":"amountIn","internalType":"int256"},{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isFeeAmountEnabled","inputs":[{"type":"uint24","name":"","internalType":"uint24"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pancakeV3SwapCallback","inputs":[{"type":"int256","name":"amount0Delta","internalType":"int256"},{"type":"int256","name":"amount1Delta","internalType":"int256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"query","inputs":[{"type":"uint256","name":"_amountIn","internalType":"uint256"},{"type":"address","name":"_tokenIn","internalType":"address"},{"type":"address","name":"_tokenOut","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"quoter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"quoterGasLimit","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"address","name":"_tokenAddress","internalType":"address"},{"type":"uint256","name":"_tokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverPLS","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMaintainer","inputs":[{"type":"address","name":"removedMaintainer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeAllowance","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setQuoter","inputs":[{"type":"address","name":"newQuoter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setQuoterGasLimit","inputs":[{"type":"uint256","name":"newLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapGasEstimate","inputs":[{"type":"uint256","name":"_estimate","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"uint256","name":"_amountIn","internalType":"uint256"},{"type":"uint256","name":"_amountOut","internalType":"uint256"},{"type":"address","name":"_fromToken","internalType":"address"},{"type":"address","name":"_toToken","internalType":"address"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"swapGasEstimate","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x60a060405234801562000010575f80fd5b5060405162003531380380620035318339810160408190526200003391620005ea565b858585858585858584868383336200004c5f826200011e565b620000787f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab95826200011e565b506001805562000088826200012e565b620000938162000192565b50620000a19050816200028d565b620000ac8262000350565b5050506001600160a01b038316608052505f5b81518110156200010b57620000f6828281518110620000e257620000e2620006f3565b6020026020010151620003df60201b60201c565b80620001028162000707565b915050620000bf565b5050505050505050505050505062000880565b6200012a828262000452565b5050565b80515f03620001845760405162461bcd60e51b815260206004820152601460248201527f496e76616c69642061646170746572206e616d6500000000000000000000000060448201526064015b60405180910390fd5b60036200012a8282620007b8565b335f8181525f80516020620034f1833981519152602052604090205460ff16620001fe5760405162461bcd60e51b815260206004820152602860248201525f805160206200351183398151915260448201526734b73a30b4b732b960c11b60648201526084016200017b565b815f036200024f5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206761732d657374696d61746500000000000000000000000060448201526064016200017b565b600282905560405182815230907ff43f23b7a28e6f8ce6843a21bd7b48bce778aa913b8c8cf459edf7d770e8d38a9060200160405180910390a25050565b335f8181525f80516020620034f1833981519152602052604090205460ff16620002f95760405162461bcd60e51b815260206004820152602860248201525f805160206200351183398151915260448201526734b73a30b4b732b960c11b60648201526084016200017b565b815f036200034a5760405162461bcd60e51b815260206004820152601b60248201527f71756572794761734c696d69742063616e2774206265207a65726f000000000060448201526064016200017b565b50600455565b335f8181525f80516020620034f1833981519152602052604090205460ff16620003bc5760405162461bcd60e51b815260206004820152602860248201525f805160206200351183398151915260448201526734b73a30b4b732b960c11b60648201526084016200017b565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b62ffffff9081165f818152600660205260408120805460ff19166001908117909155600780549182018155909152600a8082047fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018054600392909306919091026101000a928302929093021916179055565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166200012a575f828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620004ac3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156200052f576200052f620004f0565b604052919050565b80516001600160a01b03811681146200054e575f80fd5b919050565b5f82601f83011262000563575f80fd5b815160206001600160401b03821115620005815762000581620004f0565b8160051b6200059282820162000504565b9283528481018201928281019087851115620005ac575f80fd5b83870192505b84831015620005df57825162ffffff81168114620005cf575f8081fd5b82529183019190830190620005b2565b979650505050505050565b5f805f805f8060c0878903121562000600575f80fd5b86516001600160401b038082111562000617575f80fd5b818901915089601f8301126200062b575f80fd5b815181811115620006405762000640620004f0565b602062000656601f8301601f1916820162000504565b8281528c828487010111156200066a575f80fd5b5f5b83811015620006895785810183015182820184015282016200066c565b505f9281018201929092528a015160408b015191995097509550620006b160608a0162000537565b9450620006c160808a0162000537565b935060a0890151915080821115620006d7575f80fd5b50620006e689828a0162000553565b9150509295509295509295565b634e487b7160e01b5f52603260045260245ffd5b5f600182016200072557634e487b7160e01b5f52601160045260245ffd5b5060010190565b600181811c908216806200074157607f821691505b6020821081036200076057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620007b3575f81815260208120601f850160051c810160208610156200078e5750805b601f850160051c820191505b81811015620007af578281556001016200079a565b5050505b505050565b81516001600160401b03811115620007d457620007d4620004f0565b620007ec81620007e584546200072c565b8462000766565b602080601f83116001811462000822575f84156200080a5750858301515b5f19600386901b1c1916600185901b178555620007af565b5f85815260208120601f198616915b82811015620008525788860151825594840194600190910190840162000831565b50858210156200087057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b608051612c51620008a05f395f81816113fc01526122520152612c515ff3fe6080604052600436106101bd575f3560e01c80638bb9c5bf116100f2578063d547741f11610092578063f2fde38b11610062578063f2fde38b14610543578063f35c4d4514610562578063f874225414610581578063f912c64b146105b4575f80fd5b8063d547741f146104c7578063d8baf7cf146104e6578063eab90da614610505578063ef99893a14610524575f80fd5b8063a2e64137116100cd578063a2e6413714610410578063c6bbd5a714610443578063ce62f6c41461047a578063d3a43ac3146104a8575f80fd5b80638bb9c5bf1461039c57806391d14854146103bb578063a217fddf146103fd575f80fd5b806336568abe1161015d57806373ec15661161013857806373ec1566146103205780637ae267731461033f57806384a33e631461035e5780638980f11f1461037d575f80fd5b806336568abe146102cd57806369cff80d146102ec5780636b453c1f14610301575f80fd5b806323a69e751161019857806323a69e751461024a578063248a9ca31461026b5780632bc857a0146102995780632f2ff15d146102ae575f80fd5b806301ffc9a7146101c857806305e3f4dc146101fc57806306fdde0314610229575f80fd5b366101c457005b5f80fd5b3480156101d3575f80fd5b506101e76101e2366004612459565b6105d3565b60405190151581526020015b60405180910390f35b348015610207575f80fd5b5061021b610216366004612494565b61063b565b6040519081526020016101f3565b348015610234575f80fd5b5061023d61067b565b6040516101f39190612531565b348015610255575f80fd5b50610269610264366004612543565b610707565b005b348015610276575f80fd5b5061021b6102853660046125bc565b5f9081526020819052604090206001015490565b3480156102a4575f80fd5b5061021b60045481565b3480156102b9575f80fd5b506102696102c83660046125d3565b610719565b3480156102d8575f80fd5b506102696102e73660046125d3565b610742565b3480156102f7575f80fd5b5061021b60025481565b34801561030c575f80fd5b5061026961031b366004612601565b6107d3565b34801561032b575f80fd5b5061026961033a36600461261c565b610800565b34801561034a575f80fd5b5061026961035936600461268b565b6108d7565b348015610369575f80fd5b506102696103783660046125bc565b610979565b348015610388575f80fd5b506102696103973660046126b7565b610a94565b3480156103a7575f80fd5b506102696103b63660046125bc565b610bd7565b3480156103c6575f80fd5b506101e76103d53660046125d3565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b348015610408575f80fd5b5061021b5f81565b34801561041b575f80fd5b5061042f61042a3660046125bc565b610be2565b60405162ffffff90911681526020016101f3565b34801561044e575f80fd5b50600554610462906001600160a01b031681565b6040516001600160a01b0390911681526020016101f3565b348015610485575f80fd5b506101e76104943660046126e1565b60066020525f908152604090205460ff1681565b3480156104b3575f80fd5b506102696104c23660046125bc565b610c18565b3480156104d2575f80fd5b506102696104e13660046125d3565b610dec565b3480156104f1575f80fd5b50610269610500366004612601565b610e10565b348015610510575f80fd5b5061026961051f366004612703565b610e3a565b34801561052f575f80fd5b5061021b61053e36600461275e565b610fec565b34801561054e575f80fd5b5061026961055d366004612601565b611000565b34801561056d575f80fd5b5061026961057c3660046125bc565b611015565b34801561058c575f80fd5b5061021b7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b3480156105bf575f80fd5b506102696105ce366004612601565b6110f8565b5f6001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061063557507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b604080516080810182525f606082018190529181018590526001600160a01b0384811682528316602082015261067186826111c1565b9695505050505050565b600380546106889061279d565b80601f01602080910402602001604051908101604052809291908181526020018280546106b49061279d565b80156106ff5780601f106106d6576101008083540402835291602001916106ff565b820191905f5260205f20905b8154815290600101906020018083116106e257829003601f168201915b505050505081565b61071384848484611216565b50505050565b5f8281526020819052604090206001015461073381611242565b61073d838361124c565b505050565b6001600160a01b03811633146107c55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107cf82826112e8565b5050565b6107fd7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582610719565b50565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff1661088e5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b5f5b82811015610713576108c78484838181106108ad576108ad6127cf565b90506020020160208101906108c291906126e1565b611365565b6108d0816127f7565b9050610890565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166109655760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b61073d6001600160a01b038416835f611535565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610a075760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b815f03610a565760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206761732d657374696d61746500000000000000000000000060448201526064016107bc565b600282905560405182815230907ff43f23b7a28e6f8ce6843a21bd7b48bce778aa913b8c8cf459edf7d770e8d38a9060200160405180910390a25050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610b225760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b5f8211610b7b5760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b60648201526084016107bc565b610b8f6001600160a01b03841633846116c9565b826001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2883604051610bca91815260200190565b60405180910390a2505050565b336107cf8282610742565b60078181548110610bf1575f80fd5b905f5260205f2090600a9182820401919006600302915054906101000a900462ffffff1681565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610ca65760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b5f8211610cff5760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b60648201526084016107bc565b6040515f90339084908381818185875af1925050503d805f8114610d3e576040519150601f19603f3d011682016040523d82523d5f602084013e610d43565b606091505b5050905080610dba5760405162461bcd60e51b815260206004820152602260248201527f537769746368416461707465723a20504c53207472616e73666572206661696c60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016107bc565b6040518381525f907f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2890602001610bca565b5f82815260208190526040902060010154610e0681611242565b61073d83836112e8565b6107fd7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582610dec565b610e42611712565b6040516370a0823160e01b81526001600160a01b0382811660048301525f91908416906370a0823190602401602060405180830381865afa158015610e89573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ead919061280f565b9050610ebc868686868661176b565b6040516370a0823160e01b81526001600160a01b0383811660048301525f9183918616906370a0823190602401602060405180830381865afa158015610f04573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f28919061280f565b610f329190612826565b905085811015610f845760405162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e7420616d6f756e742d6f757400000000000000000060448201526064016107bc565b836001600160a01b0316856001600160a01b03167f6be2041a75d9463d869b72bbf3525008cdb98c69774b368f54504594fe722f138989604051610fd2929190918252602082015260400190565b60405180910390a35050610fe560018055565b5050505050565b5f610ff884848461182b565b949350505050565b3361100b5f83610719565b6107cf5f82610742565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166110a35760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b815f036110f25760405162461bcd60e51b815260206004820152601b60248201527f71756572794761734c696d69742063616e2774206265207a65726f000000000060448201526064016107bc565b50600455565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166111865760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b50600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b5f805f6111d5845f01518560200151611888565b915091505f806111eb87858860400151866118da565b9150915083611202576111fd82612839565b61120b565b61120b81612839565b979650505050505050565b5f805f61122385856119a1565b92509250925061123987878484875f0151611c14565b50505050505050565b6107fd8133611c9d565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166107cf575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112a43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16156107cf575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b62ffffff81165f9081526006602052604090205460ff16156113c95760405162461bcd60e51b815260206004820152601360248201527f46656520616c726561647920656e61626c65640000000000000000000000000060448201526064016107bc565b6040517f22afcccb00000000000000000000000000000000000000000000000000000000815262ffffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906322afcccb90602401602060405180830381865afa158015611449573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061146d919061286f565b60020b5f036114be5760405162461bcd60e51b815260206004820152601b60248201527f466163746f727920646f65736e277420737570706f727420666565000000000060448201526064016107bc565b6107fd8162ffffff9081165f818152600660205260408120805460ff19166001908117909155600780549182018155909152600a8082047fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018054600392909306919091026101000a928302929093021916179055565b8015806115c657506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156115a0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c4919061280f565b155b6116385760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016107bc565b6040516001600160a01b03831660248201526044810182905261073d9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152611d0f565b6040516001600160a01b03831660248201526044810182905261073d9084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640161167d565b6002600154036117645760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bc565b6002600155565b60408051608080820183525f80835260208084018290528385018290526060938401829052845192830185526001600160a01b0388811684528716838201528285018a9052928201819052835181815292830190935291906117ce908390611e46565b9050858110156118205760405162461bcd60e51b815260206004820152601660248201527f496e73756666696369656e7420616d6f756e744f75740000000000000000000060448201526064016107bc565b611239848285611f84565b60408051608080820183525f80835260208084018290528385018290526060938401829052845192830185526001600160a01b03808816845286169083015292810186905290810182905261187f81611fa8565b95945050505050565b6001600160a01b03808216908316105f816118c1576118bc600173fffd8963efd1fc6a506488495d951d5263988d266128a3565b6118d1565b6118d16401000276a360016128ca565b90509250929050565b6040516001600160a01b038086166024830152841515604483015260648201849052821660848201525f908190819060a40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f90405d360000000000000000000000000000000000000000000000000000000017905290505f8061197183611fdf565b915091508115611995578080602001905181019061198f91906128ea565b90955093505b50505094509492505050565b604080516080810182525f80825260208201819052918101919091526060808201525f806080841015611a165760405162461bcd60e51b815260206004820152601760248201527f43616c6c6261636b206461746120746f6f2073686f727400000000000000000060448201526064016107bc565b611a2284860186612966565b80519093506001600160a01b03163314611a7e5760405162461bcd60e51b815260206004820152601560248201527f556e617574686f72697a65642063616c6c6261636b000000000000000000000060448201526064016107bc565b825f01516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611abd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ae19190612a58565b9150825f01516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b22573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b469190612a58565b9050816001600160a01b031683602001516001600160a01b03161480611b815750806001600160a01b031683602001516001600160a01b0316145b8015611bc15750816001600160a01b031683604001516001600160a01b03161480611bc15750806001600160a01b031683604001516001600160a01b0316145b611c0d5760405162461bcd60e51b815260206004820152600e60248201527f546f6b656e206d69736d6174636800000000000000000000000000000000000060448201526064016107bc565b9250925092565b5f808613908513808203611c6a5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642064656c74617300000000000000000000000000000000000060448201526064016107bc565b8115611c8957611c846001600160a01b03861684896116c9565b611239565b6112396001600160a01b03851684886116c9565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166107cf57611ccd8161204d565b611cd883602061205f565b604051602001611ce9929190612a73565b60408051601f198184030181529082905262461bcd60e51b82526107bc91600401612531565b5f80836001600160a01b031683604051611d299190612af3565b5f604051808303815f865af19150503d805f8114611d62576040519150601f19603f3d011682016040523d82523d5f602084013e611d67565b606091505b509150915081611db95760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460448201526064016107bc565b8051156107135780806020019051810190611dd49190612b0e565b6107135760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107bc565b5f80611e59845f01518560200151612241565b90506001600160a01b038116611eb15760405162461bcd60e51b815260206004820152600e60248201527f506f6f6c206e6f7420666f756e6400000000000000000000000000000000000060448201526064016107bc565b5f80611ec4865f01518760200151611888565b915091505f611edc84885f01518960200151896123f2565b90505f80856001600160a01b031663128acb0830878c6040015188886040518663ffffffff1660e01b8152600401611f18959493929190612b2d565b60408051808303815f875af1158015611f33573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f5791906128ea565b9150915084611f6e57611f6982612839565b611f77565b611f7781612839565b9998505050505050505050565b306001600160a01b0382161461073d5761073d6001600160a01b03841682846116c9565b5f80611fbb835f01518460200151612241565b90506001600160a01b03811615611fd957611fd681846111c1565b91505b50919050565b6005546004546040515f926060926001600160a01b0390911691612004908690612af3565b5f604051808303818686fa925050503d805f811461203d576040519150601f19603f3d011682016040523d82523d5f602084013e612042565b606091505b509094909350915050565b60606106356001600160a01b03831660145b60605f61206d836002612b66565b612078906002612b7d565b67ffffffffffffffff8111156120905761209061288f565b6040519080825280601f01601f1916602001820160405280156120ba576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f815181106120f0576120f06127cf565b60200101906001600160f81b03191690815f1a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061213a5761213a6127cf565b60200101906001600160f81b03191690815f1a9053505f61215c846002612b66565b612167906001612b7d565b90505b60018111156121eb577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121a8576121a86127cf565b1a60f81b8282815181106121be576121be6127cf565b60200101906001600160f81b03191690815f1a90535060049490941c936121e481612b90565b905061216a565b50831561223a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107bc565b9392505050565b5f805f5b6007548110156123ea575f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631698ee82878760078681548110612294576122946127cf565b5f9182526020909120600a8083049091015460405160e087901b6001600160e01b03191681526001600160a01b03958616600482015293909416602484015290066003026101000a90910462ffffff166044820152606401602060405180830381865afa158015612307573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061232b9190612a58565b90506001600160a01b03811661234157506123da565b5f816001600160a01b0316631a6865026040518163ffffffff1660e01b8152600401602060405180830381865afa15801561237e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123a29190612ba5565b9050836fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611156123d7578093508194505b50505b6123e3816127f7565b9050612245565b505092915050565b60606040518060800160405280866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b03168152602001838152506040516020016124409190612bd4565b6040516020818303038152906040529050949350505050565b5f60208284031215612469575f80fd5b81356001600160e01b03198116811461223a575f80fd5b6001600160a01b03811681146107fd575f80fd5b5f805f80608085870312156124a7575f80fd5b84356124b281612480565b93506020850135925060408501356124c981612480565b915060608501356124d981612480565b939692955090935050565b5f5b838110156124fe5781810151838201526020016124e6565b50505f910152565b5f815180845261251d8160208601602086016124e4565b601f01601f19169290920160200192915050565b602081525f61223a6020830184612506565b5f805f8060608587031215612556575f80fd5b8435935060208501359250604085013567ffffffffffffffff8082111561257b575f80fd5b818701915087601f83011261258e575f80fd5b81358181111561259c575f80fd5b8860208285010111156125ad575f80fd5b95989497505060200194505050565b5f602082840312156125cc575f80fd5b5035919050565b5f80604083850312156125e4575f80fd5b8235915060208301356125f681612480565b809150509250929050565b5f60208284031215612611575f80fd5b813561223a81612480565b5f806020838503121561262d575f80fd5b823567ffffffffffffffff80821115612644575f80fd5b818501915085601f830112612657575f80fd5b813581811115612665575f80fd5b8660208260051b8501011115612679575f80fd5b60209290920196919550909350505050565b5f806040838503121561269c575f80fd5b82356126a781612480565b915060208301356125f681612480565b5f80604083850312156126c8575f80fd5b82356126d381612480565b946020939093013593505050565b5f602082840312156126f1575f80fd5b813562ffffff8116811461223a575f80fd5b5f805f805f60a08688031215612717575f80fd5b8535945060208601359350604086013561273081612480565b9250606086013561274081612480565b9150608086013561275081612480565b809150509295509295909350565b5f805f60608486031215612770575f80fd5b83359250602084013561278281612480565b9150604084013561279281612480565b809150509250925092565b600181811c908216806127b157607f821691505b602082108103611fd957634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f60018201612808576128086127e3565b5060010190565b5f6020828403121561281f575f80fd5b5051919050565b81810381811115610635576106356127e3565b5f7f80000000000000000000000000000000000000000000000000000000000000008203612869576128696127e3565b505f0390565b5f6020828403121561287f575f80fd5b81518060020b811461223a575f80fd5b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b038281168282160390808211156128c3576128c36127e3565b5092915050565b6001600160a01b038181168382160190808211156128c3576128c36127e3565b5f80604083850312156128fb575f80fd5b505080516020909101519092909150565b6040516080810167ffffffffffffffff8111828210171561292f5761292f61288f565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561295e5761295e61288f565b604052919050565b5f6020808385031215612977575f80fd5b823567ffffffffffffffff8082111561298e575f80fd5b90840190608082870312156129a1575f80fd5b6129a961290c565b82356129b481612480565b8152828401356129c381612480565b8185015260408301356129d581612480565b60408201526060830135828111156129eb575f80fd5b80840193505086601f8401126129ff575f80fd5b823582811115612a1157612a1161288f565b612a23601f8201601f19168601612935565b92508083528785828601011115612a38575f80fd5b80858501868501375f908301909401939093526060830152509392505050565b5f60208284031215612a68575f80fd5b815161223a81612480565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351612aaa8160178501602088016124e4565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612ae78160288401602088016124e4565b01602801949350505050565b5f8251612b048184602087016124e4565b9190910192915050565b5f60208284031215612b1e575f80fd5b8151801515811461223a575f80fd5b5f6001600160a01b038088168352861515602084015285604084015280851660608401525060a0608083015261120b60a0830184612506565b8082028115828204841417610635576106356127e3565b80820180821115610635576106356127e3565b5f81612b9e57612b9e6127e3565b505f190190565b5f60208284031215612bb5575f80fd5b81516fffffffffffffffffffffffffffffffff8116811461223a575f80fd5b602081525f6001600160a01b03808451166020840152806020850151166040840152806040850151166060840152506060830151608080840152610ff860a084018261250656fea264697066735822122081c3b9840be10ae8b8d5f5e545f2c673b6a8d792aa931cccfcc9226a26cc592264736f6c63430008140033a54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d394d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000002848800000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000e774f329228672962853873965d798adc8f86379000000000000000000000000e50dbdc88e87a2c92984d794bcf3d1d76f619c680000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000f4e696e654d4d56334164617074657200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000009c400000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000004e20
Deployed ByteCode
0x6080604052600436106101bd575f3560e01c80638bb9c5bf116100f2578063d547741f11610092578063f2fde38b11610062578063f2fde38b14610543578063f35c4d4514610562578063f874225414610581578063f912c64b146105b4575f80fd5b8063d547741f146104c7578063d8baf7cf146104e6578063eab90da614610505578063ef99893a14610524575f80fd5b8063a2e64137116100cd578063a2e6413714610410578063c6bbd5a714610443578063ce62f6c41461047a578063d3a43ac3146104a8575f80fd5b80638bb9c5bf1461039c57806391d14854146103bb578063a217fddf146103fd575f80fd5b806336568abe1161015d57806373ec15661161013857806373ec1566146103205780637ae267731461033f57806384a33e631461035e5780638980f11f1461037d575f80fd5b806336568abe146102cd57806369cff80d146102ec5780636b453c1f14610301575f80fd5b806323a69e751161019857806323a69e751461024a578063248a9ca31461026b5780632bc857a0146102995780632f2ff15d146102ae575f80fd5b806301ffc9a7146101c857806305e3f4dc146101fc57806306fdde0314610229575f80fd5b366101c457005b5f80fd5b3480156101d3575f80fd5b506101e76101e2366004612459565b6105d3565b60405190151581526020015b60405180910390f35b348015610207575f80fd5b5061021b610216366004612494565b61063b565b6040519081526020016101f3565b348015610234575f80fd5b5061023d61067b565b6040516101f39190612531565b348015610255575f80fd5b50610269610264366004612543565b610707565b005b348015610276575f80fd5b5061021b6102853660046125bc565b5f9081526020819052604090206001015490565b3480156102a4575f80fd5b5061021b60045481565b3480156102b9575f80fd5b506102696102c83660046125d3565b610719565b3480156102d8575f80fd5b506102696102e73660046125d3565b610742565b3480156102f7575f80fd5b5061021b60025481565b34801561030c575f80fd5b5061026961031b366004612601565b6107d3565b34801561032b575f80fd5b5061026961033a36600461261c565b610800565b34801561034a575f80fd5b5061026961035936600461268b565b6108d7565b348015610369575f80fd5b506102696103783660046125bc565b610979565b348015610388575f80fd5b506102696103973660046126b7565b610a94565b3480156103a7575f80fd5b506102696103b63660046125bc565b610bd7565b3480156103c6575f80fd5b506101e76103d53660046125d3565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b348015610408575f80fd5b5061021b5f81565b34801561041b575f80fd5b5061042f61042a3660046125bc565b610be2565b60405162ffffff90911681526020016101f3565b34801561044e575f80fd5b50600554610462906001600160a01b031681565b6040516001600160a01b0390911681526020016101f3565b348015610485575f80fd5b506101e76104943660046126e1565b60066020525f908152604090205460ff1681565b3480156104b3575f80fd5b506102696104c23660046125bc565b610c18565b3480156104d2575f80fd5b506102696104e13660046125d3565b610dec565b3480156104f1575f80fd5b50610269610500366004612601565b610e10565b348015610510575f80fd5b5061026961051f366004612703565b610e3a565b34801561052f575f80fd5b5061021b61053e36600461275e565b610fec565b34801561054e575f80fd5b5061026961055d366004612601565b611000565b34801561056d575f80fd5b5061026961057c3660046125bc565b611015565b34801561058c575f80fd5b5061021b7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b3480156105bf575f80fd5b506102696105ce366004612601565b6110f8565b5f6001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061063557507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b604080516080810182525f606082018190529181018590526001600160a01b0384811682528316602082015261067186826111c1565b9695505050505050565b600380546106889061279d565b80601f01602080910402602001604051908101604052809291908181526020018280546106b49061279d565b80156106ff5780601f106106d6576101008083540402835291602001916106ff565b820191905f5260205f20905b8154815290600101906020018083116106e257829003601f168201915b505050505081565b61071384848484611216565b50505050565b5f8281526020819052604090206001015461073381611242565b61073d838361124c565b505050565b6001600160a01b03811633146107c55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107cf82826112e8565b5050565b6107fd7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582610719565b50565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff1661088e5760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b5f5b82811015610713576108c78484838181106108ad576108ad6127cf565b90506020020160208101906108c291906126e1565b611365565b6108d0816127f7565b9050610890565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166109655760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b61073d6001600160a01b038416835f611535565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610a075760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b815f03610a565760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206761732d657374696d61746500000000000000000000000060448201526064016107bc565b600282905560405182815230907ff43f23b7a28e6f8ce6843a21bd7b48bce778aa913b8c8cf459edf7d770e8d38a9060200160405180910390a25050565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610b225760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b5f8211610b7b5760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b60648201526084016107bc565b610b8f6001600160a01b03841633846116c9565b826001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2883604051610bca91815260200190565b60405180910390a2505050565b336107cf8282610742565b60078181548110610bf1575f80fd5b905f5260205f2090600a9182820401919006600302915054906101000a900462ffffff1681565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff16610ca65760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b5f8211610cff5760405162461bcd60e51b815260206004820152602160248201527f537769746368416461707465723a204e6f7468696e6720746f207265636f76656044820152603960f91b60648201526084016107bc565b6040515f90339084908381818185875af1925050503d805f8114610d3e576040519150601f19603f3d011682016040523d82523d5f602084013e610d43565b606091505b5050905080610dba5760405162461bcd60e51b815260206004820152602260248201527f537769746368416461707465723a20504c53207472616e73666572206661696c60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016107bc565b6040518381525f907f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2890602001610bca565b5f82815260208190526040902060010154610e0681611242565b61073d83836112e8565b6107fd7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582610dec565b610e42611712565b6040516370a0823160e01b81526001600160a01b0382811660048301525f91908416906370a0823190602401602060405180830381865afa158015610e89573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ead919061280f565b9050610ebc868686868661176b565b6040516370a0823160e01b81526001600160a01b0383811660048301525f9183918616906370a0823190602401602060405180830381865afa158015610f04573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f28919061280f565b610f329190612826565b905085811015610f845760405162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e7420616d6f756e742d6f757400000000000000000060448201526064016107bc565b836001600160a01b0316856001600160a01b03167f6be2041a75d9463d869b72bbf3525008cdb98c69774b368f54504594fe722f138989604051610fd2929190918252602082015260400190565b60405180910390a35050610fe560018055565b5050505050565b5f610ff884848461182b565b949350505050565b3361100b5f83610719565b6107cf5f82610742565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166110a35760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b815f036110f25760405162461bcd60e51b815260206004820152601b60248201527f71756572794761734c696d69742063616e2774206265207a65726f000000000060448201526064016107bc565b50600455565b335f8181527fa54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d39602052604090205460ff166111865760405162461bcd60e51b815260206004820152602860248201527f4d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d6160448201526734b73a30b4b732b960c11b60648201526084016107bc565b50600580547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b5f805f6111d5845f01518560200151611888565b915091505f806111eb87858860400151866118da565b9150915083611202576111fd82612839565b61120b565b61120b81612839565b979650505050505050565b5f805f61122385856119a1565b92509250925061123987878484875f0151611c14565b50505050505050565b6107fd8133611c9d565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166107cf575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112a43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16156107cf575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b62ffffff81165f9081526006602052604090205460ff16156113c95760405162461bcd60e51b815260206004820152601360248201527f46656520616c726561647920656e61626c65640000000000000000000000000060448201526064016107bc565b6040517f22afcccb00000000000000000000000000000000000000000000000000000000815262ffffff821660048201527f000000000000000000000000e50dbdc88e87a2c92984d794bcf3d1d76f619c686001600160a01b0316906322afcccb90602401602060405180830381865afa158015611449573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061146d919061286f565b60020b5f036114be5760405162461bcd60e51b815260206004820152601b60248201527f466163746f727920646f65736e277420737570706f727420666565000000000060448201526064016107bc565b6107fd8162ffffff9081165f818152600660205260408120805460ff19166001908117909155600780549182018155909152600a8082047fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018054600392909306919091026101000a928302929093021916179055565b8015806115c657506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156115a0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c4919061280f565b155b6116385760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016107bc565b6040516001600160a01b03831660248201526044810182905261073d9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152611d0f565b6040516001600160a01b03831660248201526044810182905261073d9084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640161167d565b6002600154036117645760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bc565b6002600155565b60408051608080820183525f80835260208084018290528385018290526060938401829052845192830185526001600160a01b0388811684528716838201528285018a9052928201819052835181815292830190935291906117ce908390611e46565b9050858110156118205760405162461bcd60e51b815260206004820152601660248201527f496e73756666696369656e7420616d6f756e744f75740000000000000000000060448201526064016107bc565b611239848285611f84565b60408051608080820183525f80835260208084018290528385018290526060938401829052845192830185526001600160a01b03808816845286169083015292810186905290810182905261187f81611fa8565b95945050505050565b6001600160a01b03808216908316105f816118c1576118bc600173fffd8963efd1fc6a506488495d951d5263988d266128a3565b6118d1565b6118d16401000276a360016128ca565b90509250929050565b6040516001600160a01b038086166024830152841515604483015260648201849052821660848201525f908190819060a40160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f90405d360000000000000000000000000000000000000000000000000000000017905290505f8061197183611fdf565b915091508115611995578080602001905181019061198f91906128ea565b90955093505b50505094509492505050565b604080516080810182525f80825260208201819052918101919091526060808201525f806080841015611a165760405162461bcd60e51b815260206004820152601760248201527f43616c6c6261636b206461746120746f6f2073686f727400000000000000000060448201526064016107bc565b611a2284860186612966565b80519093506001600160a01b03163314611a7e5760405162461bcd60e51b815260206004820152601560248201527f556e617574686f72697a65642063616c6c6261636b000000000000000000000060448201526064016107bc565b825f01516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611abd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ae19190612a58565b9150825f01516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b22573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b469190612a58565b9050816001600160a01b031683602001516001600160a01b03161480611b815750806001600160a01b031683602001516001600160a01b0316145b8015611bc15750816001600160a01b031683604001516001600160a01b03161480611bc15750806001600160a01b031683604001516001600160a01b0316145b611c0d5760405162461bcd60e51b815260206004820152600e60248201527f546f6b656e206d69736d6174636800000000000000000000000000000000000060448201526064016107bc565b9250925092565b5f808613908513808203611c6a5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c69642064656c74617300000000000000000000000000000000000060448201526064016107bc565b8115611c8957611c846001600160a01b03861684896116c9565b611239565b6112396001600160a01b03851684886116c9565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166107cf57611ccd8161204d565b611cd883602061205f565b604051602001611ce9929190612a73565b60408051601f198184030181529082905262461bcd60e51b82526107bc91600401612531565b5f80836001600160a01b031683604051611d299190612af3565b5f604051808303815f865af19150503d805f8114611d62576040519150601f19603f3d011682016040523d82523d5f602084013e611d67565b606091505b509150915081611db95760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460448201526064016107bc565b8051156107135780806020019051810190611dd49190612b0e565b6107135760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107bc565b5f80611e59845f01518560200151612241565b90506001600160a01b038116611eb15760405162461bcd60e51b815260206004820152600e60248201527f506f6f6c206e6f7420666f756e6400000000000000000000000000000000000060448201526064016107bc565b5f80611ec4865f01518760200151611888565b915091505f611edc84885f01518960200151896123f2565b90505f80856001600160a01b031663128acb0830878c6040015188886040518663ffffffff1660e01b8152600401611f18959493929190612b2d565b60408051808303815f875af1158015611f33573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f5791906128ea565b9150915084611f6e57611f6982612839565b611f77565b611f7781612839565b9998505050505050505050565b306001600160a01b0382161461073d5761073d6001600160a01b03841682846116c9565b5f80611fbb835f01518460200151612241565b90506001600160a01b03811615611fd957611fd681846111c1565b91505b50919050565b6005546004546040515f926060926001600160a01b0390911691612004908690612af3565b5f604051808303818686fa925050503d805f811461203d576040519150601f19603f3d011682016040523d82523d5f602084013e612042565b606091505b509094909350915050565b60606106356001600160a01b03831660145b60605f61206d836002612b66565b612078906002612b7d565b67ffffffffffffffff8111156120905761209061288f565b6040519080825280601f01601f1916602001820160405280156120ba576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f815181106120f0576120f06127cf565b60200101906001600160f81b03191690815f1a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061213a5761213a6127cf565b60200101906001600160f81b03191690815f1a9053505f61215c846002612b66565b612167906001612b7d565b90505b60018111156121eb577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121a8576121a86127cf565b1a60f81b8282815181106121be576121be6127cf565b60200101906001600160f81b03191690815f1a90535060049490941c936121e481612b90565b905061216a565b50831561223a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107bc565b9392505050565b5f805f5b6007548110156123ea575f7f000000000000000000000000e50dbdc88e87a2c92984d794bcf3d1d76f619c686001600160a01b0316631698ee82878760078681548110612294576122946127cf565b5f9182526020909120600a8083049091015460405160e087901b6001600160e01b03191681526001600160a01b03958616600482015293909416602484015290066003026101000a90910462ffffff166044820152606401602060405180830381865afa158015612307573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061232b9190612a58565b90506001600160a01b03811661234157506123da565b5f816001600160a01b0316631a6865026040518163ffffffff1660e01b8152600401602060405180830381865afa15801561237e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123a29190612ba5565b9050836fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611156123d7578093508194505b50505b6123e3816127f7565b9050612245565b505092915050565b60606040518060800160405280866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b03168152602001838152506040516020016124409190612bd4565b6040516020818303038152906040529050949350505050565b5f60208284031215612469575f80fd5b81356001600160e01b03198116811461223a575f80fd5b6001600160a01b03811681146107fd575f80fd5b5f805f80608085870312156124a7575f80fd5b84356124b281612480565b93506020850135925060408501356124c981612480565b915060608501356124d981612480565b939692955090935050565b5f5b838110156124fe5781810151838201526020016124e6565b50505f910152565b5f815180845261251d8160208601602086016124e4565b601f01601f19169290920160200192915050565b602081525f61223a6020830184612506565b5f805f8060608587031215612556575f80fd5b8435935060208501359250604085013567ffffffffffffffff8082111561257b575f80fd5b818701915087601f83011261258e575f80fd5b81358181111561259c575f80fd5b8860208285010111156125ad575f80fd5b95989497505060200194505050565b5f602082840312156125cc575f80fd5b5035919050565b5f80604083850312156125e4575f80fd5b8235915060208301356125f681612480565b809150509250929050565b5f60208284031215612611575f80fd5b813561223a81612480565b5f806020838503121561262d575f80fd5b823567ffffffffffffffff80821115612644575f80fd5b818501915085601f830112612657575f80fd5b813581811115612665575f80fd5b8660208260051b8501011115612679575f80fd5b60209290920196919550909350505050565b5f806040838503121561269c575f80fd5b82356126a781612480565b915060208301356125f681612480565b5f80604083850312156126c8575f80fd5b82356126d381612480565b946020939093013593505050565b5f602082840312156126f1575f80fd5b813562ffffff8116811461223a575f80fd5b5f805f805f60a08688031215612717575f80fd5b8535945060208601359350604086013561273081612480565b9250606086013561274081612480565b9150608086013561275081612480565b809150509295509295909350565b5f805f60608486031215612770575f80fd5b83359250602084013561278281612480565b9150604084013561279281612480565b809150509250925092565b600181811c908216806127b157607f821691505b602082108103611fd957634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f60018201612808576128086127e3565b5060010190565b5f6020828403121561281f575f80fd5b5051919050565b81810381811115610635576106356127e3565b5f7f80000000000000000000000000000000000000000000000000000000000000008203612869576128696127e3565b505f0390565b5f6020828403121561287f575f80fd5b81518060020b811461223a575f80fd5b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b038281168282160390808211156128c3576128c36127e3565b5092915050565b6001600160a01b038181168382160190808211156128c3576128c36127e3565b5f80604083850312156128fb575f80fd5b505080516020909101519092909150565b6040516080810167ffffffffffffffff8111828210171561292f5761292f61288f565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561295e5761295e61288f565b604052919050565b5f6020808385031215612977575f80fd5b823567ffffffffffffffff8082111561298e575f80fd5b90840190608082870312156129a1575f80fd5b6129a961290c565b82356129b481612480565b8152828401356129c381612480565b8185015260408301356129d581612480565b60408201526060830135828111156129eb575f80fd5b80840193505086601f8401126129ff575f80fd5b823582811115612a1157612a1161288f565b612a23601f8201601f19168601612935565b92508083528785828601011115612a38575f80fd5b80858501868501375f908301909401939093526060830152509392505050565b5f60208284031215612a68575f80fd5b815161223a81612480565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351612aaa8160178501602088016124e4565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612ae78160288401602088016124e4565b01602801949350505050565b5f8251612b048184602087016124e4565b9190910192915050565b5f60208284031215612b1e575f80fd5b8151801515811461223a575f80fd5b5f6001600160a01b038088168352861515602084015285604084015280851660608401525060a0608083015261120b60a0830184612506565b8082028115828204841417610635576106356127e3565b80820180821115610635576106356127e3565b5f81612b9e57612b9e6127e3565b505f190190565b5f60208284031215612bb5575f80fd5b81516fffffffffffffffffffffffffffffffff8116811461223a575f80fd5b602081525f6001600160a01b03808451166020840152806020850151166040840152806040850151166060840152506060830151608080840152610ff860a084018261250656fea264697066735822122081c3b9840be10ae8b8d5f5e545f2c673b6a8d792aa931cccfcc9226a26cc592264736f6c63430008140033