Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- pDexPStableSwapThreePoolDeployer
- Optimization enabled
- true
- Compiler version
- v0.8.10+commit.fc410830
- Optimization runs
- 1000000
- EVM Version
- istanbul
- Verified at
- 2025-04-24T15:21:19.487950Z
contracts/PStable/pDexPStableSwapThreePoolDeployer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./pDexPStableSwapThreePool.sol";
contract pDexPStableSwapThreePoolDeployer is Ownable {
uint256 public constant N_COINS = 3;
/**
* @notice constructor
*/
constructor() {}
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(
address tokenA,
address tokenB,
address tokenC
)
internal
pure
returns (
address,
address,
address
)
{
require(tokenA != tokenB && tokenA != tokenC && tokenB != tokenC, "IDENTICAL_ADDRESSES");
address tmp;
if (tokenA > tokenB) {
tmp = tokenA;
tokenA = tokenB;
tokenB = tmp;
}
if (tokenB > tokenC) {
tmp = tokenB;
tokenB = tokenC;
tokenC = tmp;
if (tokenA > tokenB) {
tmp = tokenA;
tokenA = tokenB;
tokenB = tmp;
}
}
return (tokenA, tokenB, tokenC);
}
/**
* @notice createSwapPair
* @param _tokenA: Addresses of ERC20 conracts .
* @param _tokenB: Addresses of ERC20 conracts .
* @param _tokenC: Addresses of ERC20 conracts .
* @param _A: Amplification coefficient multiplied by n * (n - 1)
* @param _fee: Fee to charge for exchanges
* @param _admin_fee: Admin fee
* @param _admin: Admin
* @param _LP: LP
*/
function createSwapPair(
address _tokenA,
address _tokenB,
address _tokenC,
uint256 _A,
uint256 _fee,
uint256 _admin_fee,
address _admin,
address _LP
) external onlyOwner returns (address) {
require(_tokenA != address(0) && _tokenB != address(0) && _tokenA != _tokenB, "Illegal token");
(address t0, address t1, address t2) = sortTokens(_tokenA, _tokenB, _tokenC);
address[N_COINS] memory coins = [t0, t1, t2];
// create swap contract
bytes memory bytecode = type(pDexPStableSwapThreePool).creationCode;
bytes32 salt = keccak256(abi.encodePacked(t0, t1, t2, msg.sender, block.timestamp, block.chainid));
address swapContract;
assembly {
swapContract := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
pDexPStableSwapThreePool(swapContract).initialize(coins, _A, _fee, _admin_fee, _admin, _LP);
return swapContract;
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
@openzeppelin/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;
}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@openzeppelin/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;
}
}
contracts/PStable/pDexPStableSwapThreePool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../interfaces/PStable/IpUSD.sol";
contract pDexPStableSwapThreePool is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
uint256 public constant N_COINS = 3;
uint256 public constant MAX_DECIMAL = 18;
uint256 public constant FEE_DENOMINATOR = 1e10;
uint256 public constant PRECISION = 1e18;
uint256[N_COINS] public PRECISION_MUL;
uint256[N_COINS] public RATES;
uint256 public constant MAX_ADMIN_FEE = 1e10;
uint256 public constant MAX_FEE = 5e9;
uint256 public constant MAX_A = 1e6;
uint256 public constant MAX_A_CHANGE = 10;
uint256 public constant MIN_ETH_GAS = 2300;
uint256 public constant MAX_ETH_GAS = 23000;
uint256 public constant ADMIN_ACTIONS_DELAY = 3 days;
uint256 public constant MIN_RAMP_TIME = 1 days;
address[N_COINS] public coins;
uint256[N_COINS] public balances;
uint256 public fee; // fee * 1e10.
uint256 public admin_fee; // admin_fee * 1e10.
uint256 public eth_gas = 4029; // transfer eth gas.
IpUSD public token;
address constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
bool support_ETH;
uint256 public initial_A;
uint256 public future_A;
uint256 public initial_A_time;
uint256 public future_A_time;
uint256 public admin_actions_deadline;
uint256 public future_fee;
uint256 public future_admin_fee;
uint256 public kill_deadline;
uint256 public constant KILL_DEADLINE_DT = 2 * 30 days;
bool public is_killed;
address public immutable STABLESWAP_FACTORY;
bool public isInitialized;
event TokenExchange(
address indexed buyer,
uint256 sold_id,
uint256 tokens_sold,
uint256 bought_id,
uint256 tokens_bought
);
event AddLiquidity(
address indexed provider,
uint256[N_COINS] token_amounts,
uint256[N_COINS] fees,
uint256 invariant,
uint256 token_supply
);
event RemoveLiquidity(
address indexed provider,
uint256[N_COINS] token_amounts,
uint256[N_COINS] fees,
uint256 token_supply
);
event RemoveLiquidityOne(address indexed provider, uint256 index, uint256 token_amount, uint256 coin_amount);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[N_COINS] token_amounts,
uint256[N_COINS] fees,
uint256 invariant,
uint256 token_supply
);
event CommitNewFee(uint256 indexed deadline, uint256 fee, uint256 admin_fee);
event NewFee(uint256 fee, uint256 admin_fee);
event RampA(uint256 old_A, uint256 new_A, uint256 initial_time, uint256 future_time);
event StopRampA(uint256 A, uint256 t);
event SetETHGas(uint256 eth_gas);
event RevertParameters();
event DonateAdminFees();
event Kill();
event Unkill();
/**
* @notice constructor
*/
constructor() {
STABLESWAP_FACTORY = msg.sender;
}
/**
* @notice initialize
* @param _coins: Addresses of ERC20 conracts of coins (c-tokens) involved
* @param _A: Amplification coefficient multiplied by n * (n - 1)
* @param _fee: Fee to charge for exchanges
* @param _admin_fee: Admin fee
* @param _owner: Owner
* @param _LP: LP address
*/
function initialize(
address[N_COINS] memory _coins,
uint256 _A,
uint256 _fee,
uint256 _admin_fee,
address _owner,
address _LP
) external {
require(!isInitialized, "Operations: Already initialized");
require(msg.sender == STABLESWAP_FACTORY, "Operations: Not factory");
require(_A <= MAX_A, "_A exceeds maximum");
require(_fee <= MAX_FEE, "_fee exceeds maximum");
require(_admin_fee <= MAX_ADMIN_FEE, "_admin_fee exceeds maximum");
isInitialized = true;
for (uint256 i = 0; i < N_COINS; i++) {
require(_coins[i] != address(0), "ZERO Address");
uint256 coinDecimal;
if (_coins[i] == ETH_ADDRESS) {
coinDecimal = 18;
support_ETH = true;
} else {
coinDecimal = IERC20Metadata(_coins[i]).decimals();
}
require(coinDecimal <= MAX_DECIMAL, "The maximum decimal cannot exceed 18");
//set PRECISION_MUL and RATES
PRECISION_MUL[i] = 10**(MAX_DECIMAL - coinDecimal);
RATES[i] = PRECISION * PRECISION_MUL[i];
}
coins = _coins;
initial_A = _A;
future_A = _A;
fee = _fee;
admin_fee = _admin_fee;
kill_deadline = block.timestamp + KILL_DEADLINE_DT;
token = IpUSD(_LP);
transferOwnership(_owner);
}
function get_A() internal view returns (uint256) {
//Handle ramping A up or down
uint256 t1 = future_A_time;
uint256 A1 = future_A;
if (block.timestamp < t1) {
uint256 A0 = initial_A;
uint256 t0 = initial_A_time;
// Expressions in uint256 cannot have negative numbers, thus "if"
if (A1 > A0) {
return A0 + ((A1 - A0) * (block.timestamp - t0)) / (t1 - t0);
} else {
return A0 - ((A0 - A1) * (block.timestamp - t0)) / (t1 - t0);
}
} else {
// when t1 == 0 or block.timestamp >= t1
return A1;
}
}
function A() external view returns (uint256) {
return get_A();
}
function _xp() internal view returns (uint256[N_COINS] memory result) {
result = RATES;
for (uint256 i = 0; i < N_COINS; i++) {
result[i] = (result[i] * balances[i]) / PRECISION;
}
}
function _xp_mem(uint256[N_COINS] memory _balances) internal view returns (uint256[N_COINS] memory result) {
result = RATES;
for (uint256 i = 0; i < N_COINS; i++) {
result[i] = (result[i] * _balances[i]) / PRECISION;
}
}
function get_D(uint256[N_COINS] memory xp, uint256 amp) internal pure returns (uint256) {
uint256 S;
for (uint256 i = 0; i < N_COINS; i++) {
S += xp[i];
}
if (S == 0) {
return 0;
}
uint256 Dprev;
uint256 D = S;
uint256 Ann = amp * N_COINS;
for (uint256 j = 0; j < 255; j++) {
uint256 D_P = D;
for (uint256 k = 0; k < N_COINS; k++) {
D_P = (D_P * D) / (xp[k] * N_COINS); // If division by 0, this will be borked: only withdrawal will work. And that is good
}
Dprev = D;
D = ((Ann * S + D_P * N_COINS) * D) / ((Ann - 1) * D + (N_COINS + 1) * D_P);
// Equality with the precision of 1
if (D > Dprev) {
if (D - Dprev <= 1) {
break;
}
} else {
if (Dprev - D <= 1) {
break;
}
}
}
return D;
}
function get_D_mem(uint256[N_COINS] memory _balances, uint256 amp) internal view returns (uint256) {
return get_D(_xp_mem(_balances), amp);
}
function get_virtual_price() external view returns (uint256) {
/**
Returns portfolio virtual price (for calculating profit)
scaled up by 1e18
*/
uint256 D = get_D(_xp(), get_A());
/**
D is in the units similar to DAI (e.g. converted to precision 1e18)
When balanced, D = n * x_u - total virtual value of the portfolio
*/
uint256 token_supply = token.totalSupply();
return (D * PRECISION) / token_supply;
}
function calc_token_amount(uint256[N_COINS] memory amounts, bool deposit) external view returns (uint256) {
/**
Simplified method to calculate addition or reduction in token supply at
deposit or withdrawal without taking fees into account (but looking at
slippage).
Needed to prevent front-running, not for precise calculations!
*/
uint256[N_COINS] memory _balances = balances;
uint256 amp = get_A();
uint256 D0 = get_D_mem(_balances, amp);
for (uint256 i = 0; i < N_COINS; i++) {
if (deposit) {
_balances[i] += amounts[i];
} else {
_balances[i] -= amounts[i];
}
}
uint256 D1 = get_D_mem(_balances, amp);
uint256 token_amount = token.totalSupply();
uint256 difference;
if (deposit) {
difference = D1 - D0;
} else {
difference = D0 - D1;
}
return (difference * token_amount) / D0;
}
function add_liquidity(uint256[N_COINS] memory amounts, uint256 min_mint_amount) external payable nonReentrant {
//Amounts is amounts of c-tokens
require(!is_killed, "Killed");
if (!support_ETH) {
require(msg.value == 0, "Inconsistent quantity"); // Avoid sending ETH by mistake.
}
uint256[N_COINS] memory fees;
uint256 _fee = (fee * N_COINS) / (4 * (N_COINS - 1));
uint256 _admin_fee = admin_fee;
uint256 amp = get_A();
uint256 token_supply = token.totalSupply();
//Initial invariant
uint256 D0;
uint256[N_COINS] memory old_balances = balances;
if (token_supply > 0) {
D0 = get_D_mem(old_balances, amp);
}
uint256[N_COINS] memory new_balances = [old_balances[0], old_balances[1], old_balances[2]];
for (uint256 i = 0; i < N_COINS; i++) {
if (token_supply == 0) {
require(amounts[i] > 0, "Initial deposit requires all coins");
}
// balances store amounts of c-tokens
new_balances[i] = old_balances[i] + amounts[i];
}
// Invariant after change
uint256 D1 = get_D_mem(new_balances, amp);
require(D1 > D0, "D1 must be greater than D0");
// We need to recalculate the invariant accounting for fees
// to calculate fair user's share
uint256 D2 = D1;
if (token_supply > 0) {
// Only account for fees if we are not the first to deposit
for (uint256 i = 0; i < N_COINS; i++) {
uint256 ideal_balance = (D1 * old_balances[i]) / D0;
uint256 difference;
if (ideal_balance > new_balances[i]) {
difference = ideal_balance - new_balances[i];
} else {
difference = new_balances[i] - ideal_balance;
}
fees[i] = (_fee * difference) / FEE_DENOMINATOR;
balances[i] = new_balances[i] - ((fees[i] * _admin_fee) / FEE_DENOMINATOR);
new_balances[i] -= fees[i];
}
D2 = get_D_mem(new_balances, amp);
} else {
balances = new_balances;
}
// Calculate, how much pool tokens to mint
uint256 mint_amount;
if (token_supply == 0) {
mint_amount = D1; // Take the dust if there was any
} else {
mint_amount = (token_supply * (D2 - D0)) / D0;
}
require(mint_amount >= min_mint_amount, "Slippage screwed you");
// Take coins from the sender
for (uint256 i = 0; i < N_COINS; i++) {
uint256 amount = amounts[i];
address coin = coins[i];
transfer_in(coin, amount);
}
// Mint pool tokens
token.mint(msg.sender, mint_amount);
emit AddLiquidity(msg.sender, amounts, fees, D1, token_supply + mint_amount);
}
function get_y(
uint256 i,
uint256 j,
uint256 x,
uint256[N_COINS] memory xp_
) internal view returns (uint256) {
// x in the input is converted to the same price/precision
require((i != j) && (i < N_COINS) && (j < N_COINS), "Illegal parameter");
uint256 amp = get_A();
uint256 D = get_D(xp_, amp);
uint256 c = D;
uint256 S_;
uint256 Ann = amp * N_COINS;
uint256 _x;
for (uint256 k = 0; k < N_COINS; k++) {
if (k == i) {
_x = x;
} else if (k != j) {
_x = xp_[k];
} else {
continue;
}
S_ += _x;
c = (c * D) / (_x * N_COINS);
}
c = (c * D) / (Ann * N_COINS);
uint256 b = S_ + D / Ann; // - D
uint256 y_prev;
uint256 y = D;
for (uint256 m = 0; m < 255; m++) {
y_prev = y;
y = (y * y + c) / (2 * y + b - D);
// Equality with the precision of 1
if (y > y_prev) {
if (y - y_prev <= 1) {
break;
}
} else {
if (y_prev - y <= 1) {
break;
}
}
}
return y;
}
function get_dy(
uint256 i,
uint256 j,
uint256 dx
) external view returns (uint256) {
// dx and dy in c-units
uint256[N_COINS] memory rates = RATES;
uint256[N_COINS] memory xp = _xp();
uint256 x = xp[i] + ((dx * rates[i]) / PRECISION);
uint256 y = get_y(i, j, x, xp);
uint256 dy = ((xp[j] - y - 1) * PRECISION) / rates[j];
uint256 _fee = (fee * dy) / FEE_DENOMINATOR;
return dy - _fee;
}
function get_dy_underlying(
uint256 i,
uint256 j,
uint256 dx
) external view returns (uint256) {
// dx and dy in underlying units
uint256[N_COINS] memory xp = _xp();
uint256[N_COINS] memory precisions = PRECISION_MUL;
uint256 x = xp[i] + dx * precisions[i];
uint256 y = get_y(i, j, x, xp);
uint256 dy = (xp[j] - y - 1) / precisions[j];
uint256 _fee = (fee * dy) / FEE_DENOMINATOR;
return dy - _fee;
}
function exchange(
uint256 i,
uint256 j,
uint256 dx,
uint256 min_dy
) external payable nonReentrant {
require(!is_killed, "Killed");
if (!support_ETH) {
require(msg.value == 0, "Inconsistent quantity"); // Avoid sending ETH by mistake.
}
uint256[N_COINS] memory old_balances = balances;
uint256[N_COINS] memory xp = _xp_mem(old_balances);
uint256 x = xp[i] + (dx * RATES[i]) / PRECISION;
uint256 y = get_y(i, j, x, xp);
uint256 dy = xp[j] - y - 1; // -1 just in case there were some rounding errors
uint256 dy_fee = (dy * fee) / FEE_DENOMINATOR;
// Convert all to real units
dy = ((dy - dy_fee) * PRECISION) / RATES[j];
require(dy >= min_dy, "Exchange resulted in fewer coins than expected");
uint256 dy_admin_fee = (dy_fee * admin_fee) / FEE_DENOMINATOR;
dy_admin_fee = (dy_admin_fee * PRECISION) / RATES[j];
// Change balances exactly in same way as we change actual ERC20 coin amounts
balances[i] = old_balances[i] + dx;
// When rounding errors happen, we undercharge admin fee in favor of LP
balances[j] = old_balances[j] - dy - dy_admin_fee;
address iAddress = coins[i];
if (iAddress == ETH_ADDRESS) {
require(dx == msg.value, "Inconsistent quantity");
} else {
IERC20(iAddress).safeTransferFrom(msg.sender, address(this), dx);
}
address jAddress = coins[j];
transfer_out(jAddress, dy);
emit TokenExchange(msg.sender, i, dx, j, dy);
}
function remove_liquidity(uint256 _amount, uint256[N_COINS] memory min_amounts) external nonReentrant {
uint256 total_supply = token.totalSupply();
uint256[N_COINS] memory amounts;
uint256[N_COINS] memory fees; //Fees are unused but we've got them historically in event
for (uint256 i = 0; i < N_COINS; i++) {
uint256 value = (balances[i] * _amount) / total_supply;
require(value >= min_amounts[i], "Withdrawal resulted in fewer coins than expected");
balances[i] -= value;
amounts[i] = value;
transfer_out(coins[i], value);
}
token.burnFrom(msg.sender, _amount); // dev: insufficient funds
emit RemoveLiquidity(msg.sender, amounts, fees, total_supply - _amount);
}
function remove_liquidity_imbalance(uint256[N_COINS] memory amounts, uint256 max_burn_amount)
external
nonReentrant
{
require(!is_killed, "Killed");
uint256 token_supply = token.totalSupply();
require(token_supply > 0, "dev: zero total supply");
uint256 _fee = (fee * N_COINS) / (4 * (N_COINS - 1));
uint256 _admin_fee = admin_fee;
uint256 amp = get_A();
uint256[N_COINS] memory old_balances = balances;
uint256[N_COINS] memory new_balances = [old_balances[0], old_balances[1], old_balances[2]];
uint256 D0 = get_D_mem(old_balances, amp);
for (uint256 i = 0; i < N_COINS; i++) {
new_balances[i] -= amounts[i];
}
uint256 D1 = get_D_mem(new_balances, amp);
uint256[N_COINS] memory fees;
for (uint256 i = 0; i < N_COINS; i++) {
uint256 ideal_balance = (D1 * old_balances[i]) / D0;
uint256 difference;
if (ideal_balance > new_balances[i]) {
difference = ideal_balance - new_balances[i];
} else {
difference = new_balances[i] - ideal_balance;
}
fees[i] = (_fee * difference) / FEE_DENOMINATOR;
balances[i] = new_balances[i] - ((fees[i] * _admin_fee) / FEE_DENOMINATOR);
new_balances[i] -= fees[i];
}
uint256 D2 = get_D_mem(new_balances, amp);
uint256 token_amount = ((D0 - D2) * token_supply) / D0;
require(token_amount > 0, "token_amount must be greater than 0");
token_amount += 1; // In case of rounding errors - make it unfavorable for the "attacker"
require(token_amount <= max_burn_amount, "Slippage screwed you");
token.burnFrom(msg.sender, token_amount); // dev: insufficient funds
for (uint256 i = 0; i < N_COINS; i++) {
if (amounts[i] > 0) {
transfer_out(coins[i], amounts[i]);
}
}
token_supply -= token_amount;
emit RemoveLiquidityImbalance(msg.sender, amounts, fees, D1, token_supply);
}
function get_y_D(
uint256 A_,
uint256 i,
uint256[N_COINS] memory xp,
uint256 D
) internal pure returns (uint256) {
/**
Calculate x[i] if one reduces D from being calculated for xp to D
Done by solving quadratic equation iteratively.
x_1**2 + x1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)
x_1**2 + b*x_1 = c
x_1 = (x_1**2 + c) / (2*x_1 + b)
*/
// x in the input is converted to the same price/precision
require(i < N_COINS, "dev: i above N_COINS");
uint256 c = D;
uint256 S_;
uint256 Ann = A_ * N_COINS;
uint256 _x;
for (uint256 k = 0; k < N_COINS; k++) {
if (k != i) {
_x = xp[k];
} else {
continue;
}
S_ += _x;
c = (c * D) / (_x * N_COINS);
}
c = (c * D) / (Ann * N_COINS);
uint256 b = S_ + D / Ann;
uint256 y_prev;
uint256 y = D;
for (uint256 k = 0; k < 255; k++) {
y_prev = y;
y = (y * y + c) / (2 * y + b - D);
// Equality with the precision of 1
if (y > y_prev) {
if (y - y_prev <= 1) {
break;
}
} else {
if (y_prev - y <= 1) {
break;
}
}
}
return y;
}
function _calc_withdraw_one_coin(uint256 _token_amount, uint256 i) internal view returns (uint256, uint256) {
// First, need to calculate
// * Get current D
// * Solve Eqn against y_i for D - _token_amount
uint256 amp = get_A();
uint256 _fee = (fee * N_COINS) / (4 * (N_COINS - 1));
uint256[N_COINS] memory precisions = PRECISION_MUL;
uint256 total_supply = token.totalSupply();
uint256[N_COINS] memory xp = _xp();
uint256 D0 = get_D(xp, amp);
uint256 D1 = D0 - (_token_amount * D0) / total_supply;
uint256[N_COINS] memory xp_reduced = xp;
uint256 new_y = get_y_D(amp, i, xp, D1);
uint256 dy_0 = (xp[i] - new_y) / precisions[i]; // w/o fees
for (uint256 k = 0; k < N_COINS; k++) {
uint256 dx_expected;
if (k == i) {
dx_expected = (xp[k] * D1) / D0 - new_y;
} else {
dx_expected = xp[k] - (xp[k] * D1) / D0;
}
xp_reduced[k] -= (_fee * dx_expected) / FEE_DENOMINATOR;
}
uint256 dy = xp_reduced[i] - get_y_D(amp, i, xp_reduced, D1);
dy = (dy - 1) / precisions[i]; // Withdraw less to account for rounding errors
return (dy, dy_0 - dy);
}
function calc_withdraw_one_coin(uint256 _token_amount, uint256 i) external view returns (uint256) {
(uint256 dy, ) = _calc_withdraw_one_coin(_token_amount, i);
return dy;
}
function remove_liquidity_one_coin(
uint256 _token_amount,
uint256 i,
uint256 min_amount
) external nonReentrant {
// Remove _amount of liquidity all in a form of coin i
require(!is_killed, "Killed");
(uint256 dy, uint256 dy_fee) = _calc_withdraw_one_coin(_token_amount, i);
require(dy >= min_amount, "Not enough coins removed");
balances[i] -= (dy + (dy_fee * admin_fee) / FEE_DENOMINATOR);
token.burnFrom(msg.sender, _token_amount); // dev: insufficient funds
transfer_out(coins[i], dy);
emit RemoveLiquidityOne(msg.sender, i, _token_amount, dy);
}
function transfer_out(address coin_address, uint256 value) internal {
if (coin_address == ETH_ADDRESS) {
_safeTransferETH(msg.sender, value);
} else {
IERC20(coin_address).safeTransfer(msg.sender, value);
}
}
function transfer_in(address coin_address, uint256 value) internal {
if (coin_address == ETH_ADDRESS) {
require(value == msg.value, "Inconsistent quantity");
} else {
IERC20(coin_address).safeTransferFrom(msg.sender, address(this), value);
}
}
function _safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{gas: eth_gas, value: value}("");
require(success, "ETH transfer failed");
}
// Admin functions
function set_eth_gas(uint256 _eth_gas) external onlyOwner {
require(_eth_gas >= MIN_ETH_GAS && _eth_gas <= MAX_ETH_GAS, "Illegal gas");
eth_gas = _eth_gas;
emit SetETHGas(_eth_gas);
}
function ramp_A(uint256 _future_A, uint256 _future_time) external onlyOwner {
require(block.timestamp >= initial_A_time + MIN_RAMP_TIME, "dev : too early");
require(_future_time >= block.timestamp + MIN_RAMP_TIME, "dev: insufficient time");
uint256 _initial_A = get_A();
require(_future_A > 0 && _future_A < MAX_A, "_future_A must be between 0 and MAX_A");
require(
(_future_A >= _initial_A && _future_A <= _initial_A * MAX_A_CHANGE) ||
(_future_A < _initial_A && _future_A * MAX_A_CHANGE >= _initial_A),
"Illegal parameter _future_A"
);
initial_A = _initial_A;
future_A = _future_A;
initial_A_time = block.timestamp;
future_A_time = _future_time;
emit RampA(_initial_A, _future_A, block.timestamp, _future_time);
}
function stop_rampget_A() external onlyOwner {
uint256 current_A = get_A();
initial_A = current_A;
future_A = current_A;
initial_A_time = block.timestamp;
future_A_time = block.timestamp;
// now (block.timestamp < t1) is always False, so we return saved A
emit StopRampA(current_A, block.timestamp);
}
function commit_new_fee(uint256 new_fee, uint256 new_admin_fee) external onlyOwner {
require(admin_actions_deadline == 0, "admin_actions_deadline must be 0"); // dev: active action
require(new_fee <= MAX_FEE, "dev: fee exceeds maximum");
require(new_admin_fee <= MAX_ADMIN_FEE, "dev: admin fee exceeds maximum");
admin_actions_deadline = block.timestamp + ADMIN_ACTIONS_DELAY;
future_fee = new_fee;
future_admin_fee = new_admin_fee;
emit CommitNewFee(admin_actions_deadline, new_fee, new_admin_fee);
}
function apply_new_fee() external onlyOwner {
require(block.timestamp >= admin_actions_deadline, "dev: insufficient time");
require(admin_actions_deadline != 0, "admin_actions_deadline should not be 0");
admin_actions_deadline = 0;
fee = future_fee;
admin_fee = future_admin_fee;
emit NewFee(fee, admin_fee);
}
function revert_new_parameters() external onlyOwner {
admin_actions_deadline = 0;
emit RevertParameters();
}
function admin_balances(uint256 i) external view returns (uint256) {
if (coins[i] == ETH_ADDRESS) {
return address(this).balance - balances[i];
} else {
return IERC20(coins[i]).balanceOf(address(this)) - balances[i];
}
}
function withdraw_admin_fees() external onlyOwner {
for (uint256 i = 0; i < N_COINS; i++) {
uint256 value;
if (coins[i] == ETH_ADDRESS) {
value = address(this).balance - balances[i];
} else {
value = IERC20(coins[i]).balanceOf(address(this)) - balances[i];
}
if (value > 0) {
transfer_out(coins[i], value);
}
}
}
function donate_admin_fees() external onlyOwner {
for (uint256 i = 0; i < N_COINS; i++) {
if (coins[i] == ETH_ADDRESS) {
balances[i] = address(this).balance;
} else {
balances[i] = IERC20(coins[i]).balanceOf(address(this));
}
}
emit DonateAdminFees();
}
function kill_me() external onlyOwner {
require(kill_deadline > block.timestamp, "Exceeded deadline");
is_killed = true;
emit Kill();
}
function unkill_me() external onlyOwner {
is_killed = false;
emit Unkill();
}
}
contracts/interfaces/PStable/IpUSD.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface IpUSD {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function mint(address _to, uint256 _amount) external;
function burnFrom(address _to, uint256 _amount) external;
function setMinter(address _newMinter) external;
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":1000000,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{},"evmVersion":"istanbul"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"N_COINS","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"createSwapPair","inputs":[{"type":"address","name":"_tokenA","internalType":"address"},{"type":"address","name":"_tokenB","internalType":"address"},{"type":"address","name":"_tokenC","internalType":"address"},{"type":"uint256","name":"_A","internalType":"uint256"},{"type":"uint256","name":"_fee","internalType":"uint256"},{"type":"uint256","name":"_admin_fee","internalType":"uint256"},{"type":"address","name":"_admin","internalType":"address"},{"type":"address","name":"_LP","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b615def8061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100bf5780638da5cb5b146100c9578063f2fde38b146100e757600080fd5b8063293577501461006c5780634cedbfc714610087575b600080fd5b610074600381565b6040519081526020015b60405180910390f35b61009a610095366004610799565b6100fa565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161007e565b6100c76103ee565b005b60005473ffffffffffffffffffffffffffffffffffffffff1661009a565b6100c76100f536600461081b565b610402565b60006101046104b9565b73ffffffffffffffffffffffffffffffffffffffff89161580159061013e575073ffffffffffffffffffffffffffffffffffffffff881615155b801561017657508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6101e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496c6c6567616c20746f6b656e0000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008060006101f18c8c8c61053a565b925092509250600060405180606001604052808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525090506000604051806020016102ac90610763565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f9091011660408190527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088811b8216602084015287811b8216603484015286811b8216604884015233901b16605c82015242607082015246609082015290915060009060b0016040516020818303038152906040528051906020012090506000818351602085016000f590508073ffffffffffffffffffffffffffffffffffffffff16634eac4835858f8f8f8f8f6040518763ffffffff1660e01b81526004016103a79695949392919061083d565b600060405180830381600087803b1580156103c157600080fd5b505af11580156103d5573d6000803e3d6000fd5b5092995050505050505050505098975050505050505050565b6103f66104b9565b61040060006106ee565b565b61040a6104b9565b73ffffffffffffffffffffffffffffffffffffffff81166104ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101d8565b6104b6816106ee565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610400576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d8565b60008060008473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141580156105a757508373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b80156105df57508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b610645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4944454e544943414c5f4144445245535345530000000000000000000000000060448201526064016101d8565b60008573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1611156106815750939493845b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1611156106e157509293928373ffffffffffffffffffffffffffffffffffffffff80871690881611156106e15750939493845b5094959394509192915050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b615522806108c183390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461079457600080fd5b919050565b600080600080600080600080610100898b0312156107b657600080fd5b6107bf89610770565b97506107cd60208a01610770565b96506107db60408a01610770565b9550606089013594506080890135935060a089013592506107fe60c08a01610770565b915061080c60e08a01610770565b90509295985092959890939650565b60006020828403121561082d57600080fd5b61083682610770565b9392505050565b6101008101818860005b600381101561087c57815173ffffffffffffffffffffffffffffffffffffffff16835260209283019290910190600101610847565b5050506060820196909652608081019490945260a084019290925273ffffffffffffffffffffffffffffffffffffffff90811660c08401521660e09091015291905056fe60a0604052610fbd6010553480156200001757600080fd5b50620000233362000031565b600180553360805262000081565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805161547e620000a46000396000818161078401526118db015261547e6000f3fe6080604052600436106103815760003560e01c806375bacd56116101d1578063ca8ca15411610102578063ecb586a5116100a0578063f3de03621161006f578063f3de036214610850578063f446c1d014610958578063fc0c546a1461096d578063fee3f7f91461099a57600080fd5b8063ecb586a5146108e1578063edfb780114610901578063f1dc3cc914610918578063f2fde38b1461093857600080fd5b8063e2e7d264116100dc578063e2e7d2641461087f578063e36988531461089f578063e3824462146108b4578063e5d9e903146108ca57600080fd5b8063ca8ca1541461083b578063d73792a914610850578063ddca3f431461086957600080fd5b8063a6b0a7181161016f578063b4b577ad11610149578063b4b577ad146107d7578063bb7b8b80146107ed578063bc063e1a14610802578063c66106571461081b57600080fd5b8063a6b0a71814610772578063aaf5eb68146107a6578063ab5ac061146107c257600080fd5b80638da5cb5b116101ab5780638da5cb5b146106d6578063923e563c146107225780639c868ac0146107385780639fdaea0c1461075257600080fd5b806375bacd56146106805780637dafa3641461069657806385f11d1e146106b657600080fd5b80634903b0d1116102b657806358680d0b1161025457806362203d741161022357806362203d74146106205780636d4366b714610640578063715018a61461065557806373d459e41461066a57600080fd5b806358680d0b146105b75780635b41b908146105cd5780635b5a1467146105e0578063610358a91461060057600080fd5b80634fb08c5e116102905780634fb08c5e1461054c578063524c39011461056c5780635409491a14610581578063556d6e9f1461059757600080fd5b80634903b0d1146104f75780634eac4835146105175780634f12fe971461053757600080fd5b806330c540851161032357806339698415116102fd57806339698415146104975780633c157e64146104ae578063405e28f8146104ce5780634515cef3146104e457600080fd5b806330c54085146104335780633883e11914610448578063392e53cd1461046857600080fd5b8063226840fb1161035f578063226840fb146103dc57806329357750146103f35780632a426896146104085780633046f9721461041e57600080fd5b806306e9481c1461038657806314052288146103b05780632081066c146103c6575b600080fd5b34801561039257600080fd5b5061039d6201518081565b6040519081526020015b60405180910390f35b3480156103bc57600080fd5b5061039d60155481565b3480156103d257600080fd5b5061039d60145481565b3480156103e857600080fd5b506103f16109b0565b005b3480156103ff57600080fd5b5061039d600381565b34801561041457600080fd5b5061039d60195481565b34801561042a57600080fd5b506103f16109e8565b34801561043f57600080fd5b506103f1610a43565b34801561045457600080fd5b5061039d610463366004614e93565b610bdb565b34801561047457600080fd5b50601a5461048790610100900460ff1681565b60405190151581526020016103a7565b3480156104a357600080fd5b5061039d620f424081565b3480156104ba57600080fd5b506103f16104c9366004614ecb565b610dbc565b3480156104da57600080fd5b5061039d60165481565b6103f16104f2366004614eed565b611063565b34801561050357600080fd5b5061039d610512366004614f18565b61183a565b34801561052357600080fd5b506103f1610532366004614f55565b611851565b34801561054357600080fd5b506103f1611e26565b34801561055857600080fd5b5061039d610567366004614ecb565b611f7f565b34801561057857600080fd5b506103f1611f95565b34801561058d57600080fd5b5061039d60125481565b3480156105a357600080fd5b5061039d6105b2366004614ff5565b612102565b3480156105c357600080fd5b5061039d60175481565b6103f16105db366004615021565b61224c565b3480156105ec57600080fd5b506103f16105fb366004614ecb565b612757565b34801561060c57600080fd5b506103f161061b366004614f18565b612900565b34801561062c57600080fd5b5061039d61063b366004614f18565b6129be565b34801561064c57600080fd5b5061039d601281565b34801561066157600080fd5b506103f16129ce565b34801561067657600080fd5b5061039d6159d881565b34801561068c57600080fd5b5061039d60105481565b3480156106a257600080fd5b5061039d6106b1366004614f18565b6129e2565b3480156106c257600080fd5b5061039d6106d1366004614ff5565b6129f2565b3480156106e257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103a7565b34801561072e57600080fd5b5061039d6108fc81565b34801561074457600080fd5b50601a546104879060ff1681565b34801561075e57600080fd5b506103f161076d366004614eed565b612ad0565b34801561077e57600080fd5b506106fd7f000000000000000000000000000000000000000000000000000000000000000081565b3480156107b257600080fd5b5061039d670de0b6b3a764000081565b3480156107ce57600080fd5b5061039d600a81565b3480156107e357600080fd5b5061039d60135481565b3480156107f957600080fd5b5061039d6131d9565b34801561080e57600080fd5b5061039d64012a05f20081565b34801561082757600080fd5b506106fd610836366004614f18565b6132af565b34801561084757600080fd5b506103f16132dc565b34801561085c57600080fd5b5061039d6402540be40081565b34801561087557600080fd5b5061039d600e5481565b34801561088b57600080fd5b5061039d61089a366004614f18565b61333d565b3480156108ab57600080fd5b506103f161346c565b3480156108c057600080fd5b5061039d60185481565b3480156108d657600080fd5b5061039d6203f48081565b3480156108ed57600080fd5b506103f16108fc366004615053565b613535565b34801561090d57600080fd5b5061039d624f1a0081565b34801561092457600080fd5b506103f1610933366004614ff5565b61380e565b34801561094457600080fd5b506103f1610953366004615080565b613a5f565b34801561096457600080fd5b5061039d613b13565b34801561097957600080fd5b506011546106fd9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156109a657600080fd5b5061039d600f5481565b6109b8613b22565b600060168190556040517f1b4883af197c705114490f8d84f9ce30bef6a6199f7b7b649e845577cf0769a19190a1565b6109f0613b22565b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517f061284ffa2814ace135f62907c78a7cff0f070efe7e6a0a42740ea1da2c8bdc890600090a1565b610a4b613b22565b60005b6003811015610bd857600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60088360038110610a8157610a8161509b565b015473ffffffffffffffffffffffffffffffffffffffff161415610ac557600b8260038110610ab257610ab261509b565b0154610abe90476150f9565b9050610b8b565b600b8260038110610ad857610ad861509b565b015460088360038110610aed57610aed61509b565b01546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015610b5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7e9190615110565b610b8891906150f9565b90505b8015610bc557610bc560088360038110610ba757610ba761509b565b015473ffffffffffffffffffffffffffffffffffffffff1682613ba3565b5080610bd081615129565b915050610a4e565b50565b604080516060810191829052600091829190600b9060039082845b815481526020019060010190808311610bf657505050505090506000610c1a613c00565b90506000610c288383613ca1565b905060005b6003811015610cce578515610c7e57868160038110610c4e57610c4e61509b565b6020020151848260038110610c6557610c6561509b565b60200201818151610c769190615162565b905250610cbc565b868160038110610c9057610c9061509b565b6020020151848260038110610ca757610ca761509b565b60200201818151610cb891906150f9565b9052505b80610cc681615129565b915050610c2d565b506000610cdb8484613ca1565b90506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d709190615110565b905060008715610d8b57610d8484846150f9565b9050610d98565b610d9583856150f9565b90505b83610da3838361517a565b610dad91906151b7565b96505050505050505b92915050565b610dc4613b22565b62015180601454610dd59190615162565b421015610e43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f646576203a20746f6f206561726c79000000000000000000000000000000000060448201526064015b60405180910390fd5b610e506201518042615162565b811015610eb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6465763a20696e73756666696369656e742074696d65000000000000000000006044820152606401610e3a565b6000610ec3613c00565b9050600083118015610ed75750620f424083105b610f63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5f6675747572655f41206d757374206265206265747765656e203020616e642060448201527f4d41585f410000000000000000000000000000000000000000000000000000006064820152608401610e3a565b808310158015610f7d5750610f79600a8261517a565b8311155b80610f9c57508083108015610f9c575080610f99600a8561517a565b10155b611002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496c6c6567616c20706172616d65746572205f6675747572655f4100000000006044820152606401610e3a565b60128190556013839055426014819055601583905560408051838152602081018690528082019290925260608201849052517fa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c2549181900360800190a1505050565b61106b613cbc565b601a5460ff16156110d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b60115474010000000000000000000000000000000000000000900460ff16611162573415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b61116a614d0b565b6000611178600160036150f9565b61118390600461517a565b6003600e54611192919061517a565b61119c91906151b7565b600f5490915060006111ac613c00565b90506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190615110565b6040805160608101918290529192506000918291600b9060039082845b81548152602001906001019080831161125e5750505050509050600083111561128e5761128b8185613ca1565b91505b60006040518060600160405280836000600381106112ae576112ae61509b565b60200201518152602001836001600381106112cb576112cb61509b565b60200201518152602001836002600381106112e8576112e861509b565b60200201519052905060005b600381101561140957846113a85760008b82600381106113165761131661509b565b6020020151116113a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f496e697469616c206465706f73697420726571756972657320616c6c20636f6960448201527f6e730000000000000000000000000000000000000000000000000000000000006064820152608401610e3a565b8a81600381106113ba576113ba61509b565b60200201518382600381106113d1576113d161509b565b60200201516113e09190615162565b8282600381106113f2576113f261509b565b60200201528061140181615129565b9150506112f4565b5060006114168287613ca1565b9050838111611481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4431206d7573742062652067726561746572207468616e2044300000000000006044820152606401610e3a565b80851561162f5760005b600381101561161d576000868683600381106114a9576114a961509b565b60200201516114b8908661517a565b6114c291906151b7565b905060008583600381106114d8576114d861509b565b602002015182111561150c578583600381106114f6576114f661509b565b602002015161150590836150f9565b9050611531565b8186846003811061151f5761151f61509b565b602002015161152e91906150f9565b90505b6402540be400611541828e61517a565b61154b91906151b7565b8d846003811061155d5761155d61509b565b60200201526402540be4008b8e856003811061157b5761157b61509b565b602002015161158a919061517a565b61159491906151b7565b8684600381106115a6576115a661509b565b60200201516115b591906150f9565b600b84600381106115c8576115c861509b565b01558c83600381106115dc576115dc61509b565b60200201518684600381106115f3576115f361509b565b6020020181815161160491906150f9565b905250829150611615905081615129565b91505061148b565b506116288388613ca1565b905061163e565b61163c600b846003614d29565b505b60008661164c57508161166e565b8561165781846150f9565b611661908961517a565b61166b91906151b7565b90505b8b8110156116d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f536c697070616765207363726577656420796f750000000000000000000000006044820152606401610e3a565b60005b600381101561174d5760008e82600381106116f8576116f861509b565b602002015190506000600883600381106117145761171461509b565b015473ffffffffffffffffffffffffffffffffffffffff1690506117388183613d30565b5050808061174590615129565b9150506116db565b506011546040517f40c10f190000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff909116906340c10f1990604401600060405180830381600087803b1580156117c057600080fd5b505af11580156117d4573d6000803e3d6000fd5b503392507f423f6495a08fc652425cf4ed0d1f9e37e571d9b9529b1c1c23cce780b2e7df0d91508f90508d8661180a868d615162565b60405161181a9493929190615215565b60405180910390a2505050505050505050505061183660018055565b5050565b600b816003811061184a57600080fd5b0154905081565b601a54610100900460ff16156118c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f7065726174696f6e733a20416c726561647920696e697469616c697a6564006044820152606401610e3a565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4f7065726174696f6e733a204e6f7420666163746f72790000000000000000006044820152606401610e3a565b620f42408511156119cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5f412065786365656473206d6178696d756d00000000000000000000000000006044820152606401610e3a565b64012a05f200841115611a3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5f6665652065786365656473206d6178696d756d0000000000000000000000006044820152606401610e3a565b6402540be400831115611aad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5f61646d696e5f6665652065786365656473206d6178696d756d0000000000006044820152606401610e3a565b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905560005b6003811015611da2576000878260038110611af957611af961509b565b602002015173ffffffffffffffffffffffffffffffffffffffff161415611b7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f204164647265737300000000000000000000000000000000000000006044820152606401610e3a565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee888360038110611ba557611ba561509b565b602002015173ffffffffffffffffffffffffffffffffffffffff161415611c0d5750601180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556012611c98565b878260038110611c1f57611c1f61509b565b602002015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c929190615243565b60ff1690505b6012811115611d28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546865206d6178696d756d20646563696d616c2063616e6e6f7420657863656560448201527f64203138000000000000000000000000000000000000000000000000000000006064820152608401610e3a565b611d338160126150f9565b611d3e90600a615386565b60028360038110611d5157611d5161509b565b015560028260038110611d6657611d6661509b565b0154611d7a90670de0b6b3a764000061517a565b60058360038110611d8d57611d8d61509b565b01555080611d9a81615129565b915050611adc565b50611db06008876003614d63565b5060128590556013859055600e849055600f839055611dd2624f1a0042615162565b601955601180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055611e1e82613a5f565b505050505050565b611e2e613b22565b601654421015611e9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6465763a20696e73756666696369656e742074696d65000000000000000000006044820152606401610e3a565b601654611f29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f61646d696e5f616374696f6e735f646561646c696e652073686f756c64206e6f60448201527f74206265203000000000000000000000000000000000000000000000000000006064820152608401610e3a565b6000601655601754600e819055601854600f8190556040517fbe12859b636aed607d5230b2cc2711f68d70e51060e6cca1f575ef5d2fcc95d192611f7592908252602082015260400190565b60405180910390a1565b600080611f8c8484613ded565b50949350505050565b611f9d613b22565b60005b60038110156120d65773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60088260038110611fd157611fd161509b565b015473ffffffffffffffffffffffffffffffffffffffff16141561200a5747600b82600381106120035761200361509b565b01556120c4565b6008816003811061201d5761201d61509b565b01546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa15801561208a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ae9190615110565b600b82600381106120c1576120c161509b565b01555b806120ce81615129565b915050611fa0565b506040517f2c7203581ca666b8c5094c11c03f0b19b3750234a9d281bcbc88a260bcb006de90600090a1565b60408051606081019182905260009182919060059060039082845b81548152602001906001019080831161211d57505050505090506000612141614109565b90506000670de0b6b3a76400008388600381106121605761216061509b565b602002015161216f908761517a565b61217991906151b7565b82886003811061218b5761218b61509b565b602002015161219a9190615162565b905060006121aa888884866141c3565b905060008488600381106121c0576121c061509b565b6020020151670de0b6b3a7640000600184878c600381106121e3576121e361509b565b60200201516121f291906150f9565b6121fc91906150f9565b612206919061517a565b61221091906151b7565b905060006402540be40082600e54612228919061517a565b61223291906151b7565b905061223e81836150f9565b9a9950505050505050505050565b612254613cbc565b601a5460ff16156122c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b60115474010000000000000000000000000000000000000000900460ff1661234b57341561234b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b604080516060810191829052600091600b9060039082845b81548152602001906001019080831161236357505050505090506000612388826143e7565b90506000670de0b6b3a7640000600588600381106123a8576123a861509b565b01546123b4908761517a565b6123be91906151b7565b8288600381106123d0576123d061509b565b60200201516123df9190615162565b905060006123ef888884866141c3565b90506000600182858a600381106124085761240861509b565b602002015161241791906150f9565b61242191906150f9565b905060006402540be400600e5483612439919061517a565b61244391906151b7565b9050600589600381106124585761245861509b565b0154670de0b6b3a764000061246d83856150f9565b612477919061517a565b61248191906151b7565b915086821015612513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45786368616e676520726573756c74656420696e20666577657220636f696e7360448201527f207468616e2065787065637465640000000000000000000000000000000000006064820152608401610e3a565b60006402540be400600f5483612529919061517a565b61253391906151b7565b905060058a600381106125485761254861509b565b015461255c670de0b6b3a76400008361517a565b61256691906151b7565b905088878c6003811061257b5761257b61509b565b602002015161258a9190615162565b600b8c6003811061259d5761259d61509b565b01558083888c600381106125b3576125b361509b565b60200201516125c291906150f9565b6125cc91906150f9565b600b8b600381106125df576125df61509b565b0155600060088c600381106125f6576125f661509b565b015473ffffffffffffffffffffffffffffffffffffffff16905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81141561269a57348a14612695576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b6126bc565b6126bc73ffffffffffffffffffffffffffffffffffffffff821633308d6144a5565b600060088c600381106126d1576126d161509b565b015473ffffffffffffffffffffffffffffffffffffffff1690506126f58186613ba3565b604080518e8152602081018d90529081018d90526060810186905233907fb2e76ae99761dc136e598d4a629bb347eccb9532a5f8bbd72e18467c3c34cc989060800160405180910390a250505050505050505061275160018055565b50505050565b61275f613b22565b601654156127c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f61646d696e5f616374696f6e735f646561646c696e65206d75737420626520306044820152606401610e3a565b64012a05f200821115612838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6465763a206665652065786365656473206d6178696d756d00000000000000006044820152606401610e3a565b6402540be4008111156128a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f6465763a2061646d696e206665652065786365656473206d6178696d756d00006044820152606401610e3a565b6128b46203f48042615162565b60168190556017839055601882905560408051848152602081018490527f351fc5da2fbf480f2225debf3664a4bc90fa9923743aad58b4603f648e931fe0910160405180910390a25050565b612908613b22565b6108fc811015801561291c57506159d88111155b612982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f496c6c6567616c206761730000000000000000000000000000000000000000006044820152606401610e3a565b60108190556040518181527f2464fc1685c7ca97fc1e1c439a8d567d9ee1522118c0a0b3079220ca5f8fc3f6906020015b60405180910390a150565b6005816003811061184a57600080fd5b6129d6613b22565b6129e06000614581565b565b6002816003811061184a57600080fd5b6000806129fd614109565b6040805160608101918290529192506000919060029060039082845b815481526020019060010190808311612a1957505050505090506000818760038110612a4757612a4761509b565b6020020151612a56908661517a565b838860038110612a6857612a6861509b565b6020020151612a779190615162565b90506000612a87888884876141c3565b90506000838860038110612a9d57612a9d61509b565b6020020151600183878b60038110612ab757612ab761509b565b6020020151612ac691906150f9565b61220691906150f9565b612ad8613cbc565b601a5460ff1615612b45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b601154604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd9160048083019260209291908290030181865afa158015612bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd99190615110565b905060008111612c45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6465763a207a65726f20746f74616c20737570706c79000000000000000000006044820152606401610e3a565b6000612c53600160036150f9565b612c5e90600461517a565b6003600e54612c6d919061517a565b612c7791906151b7565b600f549091506000612c87613c00565b60408051606081019182905291925060009190600b9060039082845b815481526020019060010190808311612ca357505050505090506000604051806060016040528083600060038110612cdd57612cdd61509b565b6020020151815260200183600160038110612cfa57612cfa61509b565b6020020151815260200183600260038110612d1757612d1761509b565b6020020151905290506000612d2c8385613ca1565b905060005b6003811015612d8957898160038110612d4c57612d4c61509b565b6020020151838260038110612d6357612d6361509b565b60200201818151612d7491906150f9565b90525080612d8181615129565b915050612d31565b506000612d968386613ca1565b9050612da0614d0b565b60005b6003811015612f3557600084878360038110612dc157612dc161509b565b6020020151612dd0908661517a565b612dda91906151b7565b90506000868360038110612df057612df061509b565b6020020151821115612e2457868360038110612e0e57612e0e61509b565b6020020151612e1d90836150f9565b9050612e49565b81878460038110612e3757612e3761509b565b6020020151612e4691906150f9565b90505b6402540be400612e59828d61517a565b612e6391906151b7565b848460038110612e7557612e7561509b565b60200201526402540be4008a858560038110612e9357612e9361509b565b6020020151612ea2919061517a565b612eac91906151b7565b878460038110612ebe57612ebe61509b565b6020020151612ecd91906150f9565b600b8460038110612ee057612ee061509b565b0155838360038110612ef457612ef461509b565b6020020151878460038110612f0b57612f0b61509b565b60200201818151612f1c91906150f9565b905250829150612f2d905081615129565b915050612da3565b506000612f428588613ca1565b90506000848b612f5284836150f9565b612f5c919061517a565b612f6691906151b7565b905060008111612ff8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f746f6b656e5f616d6f756e74206d75737420626520677265617465722074686160448201527f6e203000000000000000000000000000000000000000000000000000000000006064820152608401610e3a565b613003600182615162565b90508b81111561306f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f536c697070616765207363726577656420796f750000000000000000000000006044820152606401610e3a565b6011546040517f79cc67900000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff909116906379cc679090604401600060405180830381600087803b1580156130e157600080fd5b505af11580156130f5573d6000803e3d6000fd5b5050505060005b60038110156131805760008e82600381106131195761311961509b565b6020020151111561316e5761316e6008826003811061313a5761313a61509b565b015473ffffffffffffffffffffffffffffffffffffffff168f83600381106131645761316461509b565b6020020151613ba3565b8061317881615129565b9150506130fc565b5061318b818c6150f9565b9a503373ffffffffffffffffffffffffffffffffffffffff167f173599dbf9c6ca6f7c3b590df07ae98a45d74ff54065505141e7de6c46a624c28e85878f60405161181a9493929190615215565b6000806131f46131e7614109565b6131ef613c00565b6145f6565b90506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613265573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132899190615110565b90508061329e670de0b6b3a76400008461517a565b6132a891906151b7565b9250505090565b600881600381106132bf57600080fd5b015473ffffffffffffffffffffffffffffffffffffffff16905081565b6132e4613b22565b60006132ee613c00565b6012819055601381905542601481905560158190556040519192507f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc201938916129b391848252602082015260400190565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600883600381106133675761336761509b565b015473ffffffffffffffffffffffffffffffffffffffff1614156133a457600b82600381106133985761339861509b565b0154610db690476150f9565b600b82600381106133b7576133b761509b565b0154600883600381106133cc576133cc61509b565b01546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015613439573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345d9190615110565b610db691906150f9565b919050565b613474613b22565b42601954116134df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f457863656564656420646561646c696e650000000000000000000000000000006044820152606401610e3a565b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040517fbe26733c2bf6ff3ea5ba8cfe744422bd49052ff9ed5685c9e81e6f9321dbaddd90600090a1565b61353d613cbc565b601154604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd9160048083019260209291908290030181865afa1580156135ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d19190615110565b90506135db614d0b565b6135e3614d0b565b60005b600381101561372f5760008487600b84600381106136065761360661509b565b0154613612919061517a565b61361c91906151b7565b90508582600381106136305761363061509b565b60200201518110156136c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f5769746864726177616c20726573756c74656420696e20666577657220636f6960448201527f6e73207468616e206578706563746564000000000000000000000000000000006064820152608401610e3a565b80600b83600381106136d8576136d861509b565b0160008282546136e891906150f9565b909155508190508483600381106137015761370161509b565b602002015261371c60088360038110610ba757610ba761509b565b508061372781615129565b9150506135e6565b506011546040517f79cc67900000000000000000000000000000000000000000000000000000000081523360048201526024810187905273ffffffffffffffffffffffffffffffffffffffff909116906379cc679090604401600060405180830381600087803b1580156137a257600080fd5b505af11580156137b6573d6000803e3d6000fd5b503392507fa49d4cf02656aebf8c771f5a8585638a2a15ee6c97cf7205d4208ed7c1df252d9150849050836137eb89886150f9565b6040516137fa93929190615392565b60405180910390a250505061183660018055565b613816613cbc565b601a5460ff1615613883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b6000806138908585613ded565b91509150828210156138fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420656e6f75676820636f696e732072656d6f76656400000000000000006044820152606401610e3a565b6402540be400600f5482613912919061517a565b61391c91906151b7565b6139269083615162565b600b85600381106139395761393961509b565b01600082825461394991906150f9565b90915550506011546040517f79cc67900000000000000000000000000000000000000000000000000000000081523360048201526024810187905273ffffffffffffffffffffffffffffffffffffffff909116906379cc679090604401600060405180830381600087803b1580156139c057600080fd5b505af11580156139d4573d6000803e3d6000fd5b50505050613a0c600885600381106139ee576139ee61509b565b015473ffffffffffffffffffffffffffffffffffffffff1683613ba3565b604080518581526020810187905290810183905233907f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a09060600160405180910390a25050613a5a60018055565b505050565b613a67613b22565b73ffffffffffffffffffffffffffffffffffffffff8116613b0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610e3a565b610bd881614581565b6000613b1d613c00565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146129e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e3a565b73ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415613bdf57611836338261478c565b61183673ffffffffffffffffffffffffffffffffffffffff8316338361485a565b6015546013546000919042821115610db65760125460145481831115613c6557613c2a81856150f9565b613c3482426150f9565b613c3e84866150f9565b613c48919061517a565b613c5291906151b7565b613c5c9083615162565b94505050505090565b613c6f81856150f9565b613c7982426150f9565b613c8385856150f9565b613c8d919061517a565b613c9791906151b7565b613c5c90836150f9565b6000613cb5613caf846143e7565b836145f6565b9392505050565b60026001541415613d29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e3a565b6002600155565b73ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415613dcb57348114611836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b61183673ffffffffffffffffffffffffffffffffffffffff83163330846144a5565b6000806000613dfa613c00565b90506000613e0a600160036150f9565b613e1590600461517a565b6003600e54613e24919061517a565b613e2e91906151b7565b6040805160608101918290529192506000919060029060039082845b815481526020019060010190808311613e4a57505050505090506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef79190615110565b90506000613f03614109565b90506000613f1182876145f6565b9050600083613f20838d61517a565b613f2a91906151b7565b613f3490836150f9565b9050826000613f45898d84866148b0565b90506000878d60038110613f5b57613f5b61509b565b602002015182878f60038110613f7357613f7361509b565b6020020151613f8291906150f9565b613f8c91906151b7565b905060005b60038110156140885760008e821415613fe3578387878a8560038110613fb957613fb961509b565b6020020151613fc8919061517a565b613fd291906151b7565b613fdc91906150f9565b9050614034565b8686898460038110613ff757613ff761509b565b6020020151614006919061517a565b61401091906151b7565b8883600381106140225761402261509b565b602002015161403191906150f9565b90505b6402540be400614044828d61517a565b61404e91906151b7565b8583600381106140605761406061509b565b6020020181815161407191906150f9565b90525081905061408081615129565b915050613f91565b5060006140978b8f86886148b0565b848f600381106140a9576140a961509b565b60200201516140b891906150f9565b9050888e600381106140cc576140cc61509b565b60200201516140dc6001836150f9565b6140e691906151b7565b9050806140f381846150f9565b9c509c5050505050505050505050509250929050565b614111614d0b565b6040805160608101918290529060059060039082845b815481526020019060010190808311614127575050505050905060005b60038110156141bf57670de0b6b3a7640000600b82600381106141695761416961509b565b015483836003811061417d5761417d61509b565b602002015161418c919061517a565b61419691906151b7565b8282600381106141a8576141a861509b565b6020020152806141b781615129565b915050614144565b5090565b60008385141580156141d55750600385105b80156141e15750600384105b614247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496c6c6567616c20706172616d657465720000000000000000000000000000006044820152606401610e3a565b6000614251613c00565b9050600061425f84836145f6565b90508060008061427060038661517a565b90506000805b60038110156142f9578b81141561428f578991506142b9565b8a81146142b4578881600381106142a8576142a861509b565b602002015191506142b9565b6142e7565b6142c38285615162565b93506142d060038361517a565b6142da878761517a565b6142e491906151b7565b94505b806142f181615129565b915050614276565b5061430560038361517a565b61430f868661517a565b61431991906151b7565b9350600061432783876151b7565b6143319085615162565b9050600086815b60ff8110156143d3578192508884836002614353919061517a565b61435d9190615162565b61436791906150f9565b88614372848061517a565b61437c9190615162565b61438691906151b7565b9150828211156143ab57600161439c84846150f9565b116143a6576143d3565b6143c1565b60016143b783856150f9565b116143c1576143d3565b806143cb81615129565b915050614338565b50985050505050505050505b949350505050565b6143ef614d0b565b6040805160608101918290529060059060039082845b815481526020019060010190808311614405575050505050905060005b600381101561449f57670de0b6b3a76400008382600381106144465761444661509b565b602002015183836003811061445d5761445d61509b565b602002015161446c919061517a565b61447691906151b7565b8282600381106144885761448861509b565b60200201528061449781615129565b915050614422565b50919050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526127519085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614a8e565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060005b600381101561463a578481600381106146175761461761509b565b60200201516146269083615162565b91508061463281615129565b9150506145fc565b508061464a576000915050610db6565b6000818161465960038761517a565b905060005b60ff811015614780578260005b60038110156146bf5760038a82600381106146885761468861509b565b6020020151614697919061517a565b6146a1868461517a565b6146ab91906151b7565b9150806146b781615129565b91505061466b565b5083945080600360016146d29190615162565b6146dc919061517a565b846146e86001866150f9565b6146f2919061517a565b6146fc9190615162565b8461470860038461517a565b614712898761517a565b61471c9190615162565b614726919061517a565b61473091906151b7565b93508484111561475657600161474686866150f9565b116147515750614780565b61476d565b600161476285876150f9565b1161476d5750614780565b508061477881615129565b91505061465e565b50909695505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff1660105483604051600060405180830381858888f193505050503d80600081146147ea576040519150601f19603f3d011682016040523d82523d6000602084013e6147ef565b606091505b5050905080613a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610e3a565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052613a5a9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016144ff565b60006003841061491c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6465763a20692061626f7665204e5f434f494e530000000000000000000000006044820152606401610e3a565b8160008061492b60038961517a565b90506000805b60038110156149a45788811461495f578781600381106149535761495361509b565b60200201519150614964565b614992565b61496e8285615162565b935061497b60038361517a565b614985888761517a565b61498f91906151b7565b94505b8061499c81615129565b915050614931565b506149b060038361517a565b6149ba878661517a565b6149c491906151b7565b935060006149d283886151b7565b6149dc9085615162565b9050600087815b60ff811015614a7e5781925089848360026149fe919061517a565b614a089190615162565b614a1291906150f9565b88614a1d848061517a565b614a279190615162565b614a3191906151b7565b915082821115614a56576001614a4784846150f9565b11614a5157614a7e565b614a6c565b6001614a6283856150f9565b11614a6c57614a7e565b80614a7681615129565b9150506149e3565b509b9a5050505050505050505050565b6000614af0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614b9d9092919063ffffffff16565b9050805160001480614b11575080806020019051810190614b1191906153bb565b613a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610e3a565b60606143df8484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051614bd19190615404565b60006040518083038185875af1925050503d8060008114614c0e576040519150601f19603f3d011682016040523d82523d6000602084013e614c13565b606091505b5091509150614c2487838387614c2f565b979650505050505050565b60608315614cc2578251614cbb5773ffffffffffffffffffffffffffffffffffffffff85163b614cbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e3a565b50816143df565b6143df8383815115614cd75781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3a9190615420565b60405180606001604052806003906020820280368337509192915050565b8260038101928215614d57579160200282015b82811115614d57578251825591602001919060010190614d3c565b506141bf929150614dd0565b8260038101928215614d57579160200282015b82811115614d5757825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614d76565b5b808211156141bf5760008155600101614dd1565b6040516060810167ffffffffffffffff81118282101715614e2f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b600082601f830112614e4657600080fd5b614e4e614de5565b806060840185811115614e6057600080fd5b845b81811015614e7a578035845260209384019301614e62565b509095945050505050565b8015158114610bd857600080fd5b60008060808385031215614ea657600080fd5b614eb08484614e35565b91506060830135614ec081614e85565b809150509250929050565b60008060408385031215614ede57600080fd5b50508035926020909101359150565b60008060808385031215614f0057600080fd5b614f0a8484614e35565b946060939093013593505050565b600060208284031215614f2a57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461346757600080fd5b6000806000806000806101008789031215614f6f57600080fd5b87601f880112614f7e57600080fd5b614f86614de5565b80606089018a811115614f9857600080fd5b895b81811015614fb957614fab81614f31565b845260209384019301614f9a565b50909750359550506080870135935060a08701359250614fdb60c08801614f31565b9150614fe960e08801614f31565b90509295509295509295565b60008060006060848603121561500a57600080fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561503757600080fd5b5050823594602084013594506040840135936060013592509050565b6000806080838503121561506657600080fd5b823591506150778460208501614e35565b90509250929050565b60006020828403121561509257600080fd5b613cb582614f31565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561510b5761510b6150ca565b500390565b60006020828403121561512257600080fd5b5051919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561515b5761515b6150ca565b5060010190565b60008219821115615175576151756150ca565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156151b2576151b26150ca565b500290565b6000826151ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8060005b60038110156127515781518452602093840193909101906001016151f6565b610100810161522482876151f2565b61523160608301866151f2565b60c082019390935260e0015292915050565b60006020828403121561525557600080fd5b815160ff81168114613cb557600080fd5b600181815b808511156152bf57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156152a5576152a56150ca565b808516156152b257918102915b93841c939080029061526b565b509250929050565b6000826152d657506001610db6565b816152e357506000610db6565b81600181146152f957600281146153035761531f565b6001915050610db6565b60ff841115615314576153146150ca565b50506001821b610db6565b5060208310610133831016604e8410600b8410161715615342575081810a610db6565b61534c8383615266565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561537e5761537e6150ca565b029392505050565b6000613cb583836152c7565b60e081016153a082866151f2565b6153ad60608301856151f2565b8260c0830152949350505050565b6000602082840312156153cd57600080fd5b8151613cb581614e85565b60005b838110156153f35781810151838201526020016153db565b838111156127515750506000910152565b600082516154168184602087016153d8565b9190910192915050565b602081526000825180602084015261543f8160408501602087016153d8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c634300080a000aa164736f6c634300080a000a
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100bf5780638da5cb5b146100c9578063f2fde38b146100e757600080fd5b8063293577501461006c5780634cedbfc714610087575b600080fd5b610074600381565b6040519081526020015b60405180910390f35b61009a610095366004610799565b6100fa565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161007e565b6100c76103ee565b005b60005473ffffffffffffffffffffffffffffffffffffffff1661009a565b6100c76100f536600461081b565b610402565b60006101046104b9565b73ffffffffffffffffffffffffffffffffffffffff89161580159061013e575073ffffffffffffffffffffffffffffffffffffffff881615155b801561017657508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6101e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496c6c6567616c20746f6b656e0000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008060006101f18c8c8c61053a565b925092509250600060405180606001604052808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525090506000604051806020016102ac90610763565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f9091011660408190527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088811b8216602084015287811b8216603484015286811b8216604884015233901b16605c82015242607082015246609082015290915060009060b0016040516020818303038152906040528051906020012090506000818351602085016000f590508073ffffffffffffffffffffffffffffffffffffffff16634eac4835858f8f8f8f8f6040518763ffffffff1660e01b81526004016103a79695949392919061083d565b600060405180830381600087803b1580156103c157600080fd5b505af11580156103d5573d6000803e3d6000fd5b5092995050505050505050505098975050505050505050565b6103f66104b9565b61040060006106ee565b565b61040a6104b9565b73ffffffffffffffffffffffffffffffffffffffff81166104ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101d8565b6104b6816106ee565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610400576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d8565b60008060008473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141580156105a757508373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b80156105df57508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b610645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4944454e544943414c5f4144445245535345530000000000000000000000000060448201526064016101d8565b60008573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1611156106815750939493845b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1611156106e157509293928373ffffffffffffffffffffffffffffffffffffffff80871690881611156106e15750939493845b5094959394509192915050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b615522806108c183390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461079457600080fd5b919050565b600080600080600080600080610100898b0312156107b657600080fd5b6107bf89610770565b97506107cd60208a01610770565b96506107db60408a01610770565b9550606089013594506080890135935060a089013592506107fe60c08a01610770565b915061080c60e08a01610770565b90509295985092959890939650565b60006020828403121561082d57600080fd5b61083682610770565b9392505050565b6101008101818860005b600381101561087c57815173ffffffffffffffffffffffffffffffffffffffff16835260209283019290910190600101610847565b5050506060820196909652608081019490945260a084019290925273ffffffffffffffffffffffffffffffffffffffff90811660c08401521660e09091015291905056fe60a0604052610fbd6010553480156200001757600080fd5b50620000233362000031565b600180553360805262000081565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805161547e620000a46000396000818161078401526118db015261547e6000f3fe6080604052600436106103815760003560e01c806375bacd56116101d1578063ca8ca15411610102578063ecb586a5116100a0578063f3de03621161006f578063f3de036214610850578063f446c1d014610958578063fc0c546a1461096d578063fee3f7f91461099a57600080fd5b8063ecb586a5146108e1578063edfb780114610901578063f1dc3cc914610918578063f2fde38b1461093857600080fd5b8063e2e7d264116100dc578063e2e7d2641461087f578063e36988531461089f578063e3824462146108b4578063e5d9e903146108ca57600080fd5b8063ca8ca1541461083b578063d73792a914610850578063ddca3f431461086957600080fd5b8063a6b0a7181161016f578063b4b577ad11610149578063b4b577ad146107d7578063bb7b8b80146107ed578063bc063e1a14610802578063c66106571461081b57600080fd5b8063a6b0a71814610772578063aaf5eb68146107a6578063ab5ac061146107c257600080fd5b80638da5cb5b116101ab5780638da5cb5b146106d6578063923e563c146107225780639c868ac0146107385780639fdaea0c1461075257600080fd5b806375bacd56146106805780637dafa3641461069657806385f11d1e146106b657600080fd5b80634903b0d1116102b657806358680d0b1161025457806362203d741161022357806362203d74146106205780636d4366b714610640578063715018a61461065557806373d459e41461066a57600080fd5b806358680d0b146105b75780635b41b908146105cd5780635b5a1467146105e0578063610358a91461060057600080fd5b80634fb08c5e116102905780634fb08c5e1461054c578063524c39011461056c5780635409491a14610581578063556d6e9f1461059757600080fd5b80634903b0d1146104f75780634eac4835146105175780634f12fe971461053757600080fd5b806330c540851161032357806339698415116102fd57806339698415146104975780633c157e64146104ae578063405e28f8146104ce5780634515cef3146104e457600080fd5b806330c54085146104335780633883e11914610448578063392e53cd1461046857600080fd5b8063226840fb1161035f578063226840fb146103dc57806329357750146103f35780632a426896146104085780633046f9721461041e57600080fd5b806306e9481c1461038657806314052288146103b05780632081066c146103c6575b600080fd5b34801561039257600080fd5b5061039d6201518081565b6040519081526020015b60405180910390f35b3480156103bc57600080fd5b5061039d60155481565b3480156103d257600080fd5b5061039d60145481565b3480156103e857600080fd5b506103f16109b0565b005b3480156103ff57600080fd5b5061039d600381565b34801561041457600080fd5b5061039d60195481565b34801561042a57600080fd5b506103f16109e8565b34801561043f57600080fd5b506103f1610a43565b34801561045457600080fd5b5061039d610463366004614e93565b610bdb565b34801561047457600080fd5b50601a5461048790610100900460ff1681565b60405190151581526020016103a7565b3480156104a357600080fd5b5061039d620f424081565b3480156104ba57600080fd5b506103f16104c9366004614ecb565b610dbc565b3480156104da57600080fd5b5061039d60165481565b6103f16104f2366004614eed565b611063565b34801561050357600080fd5b5061039d610512366004614f18565b61183a565b34801561052357600080fd5b506103f1610532366004614f55565b611851565b34801561054357600080fd5b506103f1611e26565b34801561055857600080fd5b5061039d610567366004614ecb565b611f7f565b34801561057857600080fd5b506103f1611f95565b34801561058d57600080fd5b5061039d60125481565b3480156105a357600080fd5b5061039d6105b2366004614ff5565b612102565b3480156105c357600080fd5b5061039d60175481565b6103f16105db366004615021565b61224c565b3480156105ec57600080fd5b506103f16105fb366004614ecb565b612757565b34801561060c57600080fd5b506103f161061b366004614f18565b612900565b34801561062c57600080fd5b5061039d61063b366004614f18565b6129be565b34801561064c57600080fd5b5061039d601281565b34801561066157600080fd5b506103f16129ce565b34801561067657600080fd5b5061039d6159d881565b34801561068c57600080fd5b5061039d60105481565b3480156106a257600080fd5b5061039d6106b1366004614f18565b6129e2565b3480156106c257600080fd5b5061039d6106d1366004614ff5565b6129f2565b3480156106e257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103a7565b34801561072e57600080fd5b5061039d6108fc81565b34801561074457600080fd5b50601a546104879060ff1681565b34801561075e57600080fd5b506103f161076d366004614eed565b612ad0565b34801561077e57600080fd5b506106fd7f000000000000000000000000000000000000000000000000000000000000000081565b3480156107b257600080fd5b5061039d670de0b6b3a764000081565b3480156107ce57600080fd5b5061039d600a81565b3480156107e357600080fd5b5061039d60135481565b3480156107f957600080fd5b5061039d6131d9565b34801561080e57600080fd5b5061039d64012a05f20081565b34801561082757600080fd5b506106fd610836366004614f18565b6132af565b34801561084757600080fd5b506103f16132dc565b34801561085c57600080fd5b5061039d6402540be40081565b34801561087557600080fd5b5061039d600e5481565b34801561088b57600080fd5b5061039d61089a366004614f18565b61333d565b3480156108ab57600080fd5b506103f161346c565b3480156108c057600080fd5b5061039d60185481565b3480156108d657600080fd5b5061039d6203f48081565b3480156108ed57600080fd5b506103f16108fc366004615053565b613535565b34801561090d57600080fd5b5061039d624f1a0081565b34801561092457600080fd5b506103f1610933366004614ff5565b61380e565b34801561094457600080fd5b506103f1610953366004615080565b613a5f565b34801561096457600080fd5b5061039d613b13565b34801561097957600080fd5b506011546106fd9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156109a657600080fd5b5061039d600f5481565b6109b8613b22565b600060168190556040517f1b4883af197c705114490f8d84f9ce30bef6a6199f7b7b649e845577cf0769a19190a1565b6109f0613b22565b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517f061284ffa2814ace135f62907c78a7cff0f070efe7e6a0a42740ea1da2c8bdc890600090a1565b610a4b613b22565b60005b6003811015610bd857600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60088360038110610a8157610a8161509b565b015473ffffffffffffffffffffffffffffffffffffffff161415610ac557600b8260038110610ab257610ab261509b565b0154610abe90476150f9565b9050610b8b565b600b8260038110610ad857610ad861509b565b015460088360038110610aed57610aed61509b565b01546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015610b5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7e9190615110565b610b8891906150f9565b90505b8015610bc557610bc560088360038110610ba757610ba761509b565b015473ffffffffffffffffffffffffffffffffffffffff1682613ba3565b5080610bd081615129565b915050610a4e565b50565b604080516060810191829052600091829190600b9060039082845b815481526020019060010190808311610bf657505050505090506000610c1a613c00565b90506000610c288383613ca1565b905060005b6003811015610cce578515610c7e57868160038110610c4e57610c4e61509b565b6020020151848260038110610c6557610c6561509b565b60200201818151610c769190615162565b905250610cbc565b868160038110610c9057610c9061509b565b6020020151848260038110610ca757610ca761509b565b60200201818151610cb891906150f9565b9052505b80610cc681615129565b915050610c2d565b506000610cdb8484613ca1565b90506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d709190615110565b905060008715610d8b57610d8484846150f9565b9050610d98565b610d9583856150f9565b90505b83610da3838361517a565b610dad91906151b7565b96505050505050505b92915050565b610dc4613b22565b62015180601454610dd59190615162565b421015610e43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f646576203a20746f6f206561726c79000000000000000000000000000000000060448201526064015b60405180910390fd5b610e506201518042615162565b811015610eb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6465763a20696e73756666696369656e742074696d65000000000000000000006044820152606401610e3a565b6000610ec3613c00565b9050600083118015610ed75750620f424083105b610f63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f5f6675747572655f41206d757374206265206265747765656e203020616e642060448201527f4d41585f410000000000000000000000000000000000000000000000000000006064820152608401610e3a565b808310158015610f7d5750610f79600a8261517a565b8311155b80610f9c57508083108015610f9c575080610f99600a8561517a565b10155b611002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496c6c6567616c20706172616d65746572205f6675747572655f4100000000006044820152606401610e3a565b60128190556013839055426014819055601583905560408051838152602081018690528082019290925260608201849052517fa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c2549181900360800190a1505050565b61106b613cbc565b601a5460ff16156110d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b60115474010000000000000000000000000000000000000000900460ff16611162573415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b61116a614d0b565b6000611178600160036150f9565b61118390600461517a565b6003600e54611192919061517a565b61119c91906151b7565b600f5490915060006111ac613c00565b90506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190615110565b6040805160608101918290529192506000918291600b9060039082845b81548152602001906001019080831161125e5750505050509050600083111561128e5761128b8185613ca1565b91505b60006040518060600160405280836000600381106112ae576112ae61509b565b60200201518152602001836001600381106112cb576112cb61509b565b60200201518152602001836002600381106112e8576112e861509b565b60200201519052905060005b600381101561140957846113a85760008b82600381106113165761131661509b565b6020020151116113a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f496e697469616c206465706f73697420726571756972657320616c6c20636f6960448201527f6e730000000000000000000000000000000000000000000000000000000000006064820152608401610e3a565b8a81600381106113ba576113ba61509b565b60200201518382600381106113d1576113d161509b565b60200201516113e09190615162565b8282600381106113f2576113f261509b565b60200201528061140181615129565b9150506112f4565b5060006114168287613ca1565b9050838111611481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4431206d7573742062652067726561746572207468616e2044300000000000006044820152606401610e3a565b80851561162f5760005b600381101561161d576000868683600381106114a9576114a961509b565b60200201516114b8908661517a565b6114c291906151b7565b905060008583600381106114d8576114d861509b565b602002015182111561150c578583600381106114f6576114f661509b565b602002015161150590836150f9565b9050611531565b8186846003811061151f5761151f61509b565b602002015161152e91906150f9565b90505b6402540be400611541828e61517a565b61154b91906151b7565b8d846003811061155d5761155d61509b565b60200201526402540be4008b8e856003811061157b5761157b61509b565b602002015161158a919061517a565b61159491906151b7565b8684600381106115a6576115a661509b565b60200201516115b591906150f9565b600b84600381106115c8576115c861509b565b01558c83600381106115dc576115dc61509b565b60200201518684600381106115f3576115f361509b565b6020020181815161160491906150f9565b905250829150611615905081615129565b91505061148b565b506116288388613ca1565b905061163e565b61163c600b846003614d29565b505b60008661164c57508161166e565b8561165781846150f9565b611661908961517a565b61166b91906151b7565b90505b8b8110156116d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f536c697070616765207363726577656420796f750000000000000000000000006044820152606401610e3a565b60005b600381101561174d5760008e82600381106116f8576116f861509b565b602002015190506000600883600381106117145761171461509b565b015473ffffffffffffffffffffffffffffffffffffffff1690506117388183613d30565b5050808061174590615129565b9150506116db565b506011546040517f40c10f190000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff909116906340c10f1990604401600060405180830381600087803b1580156117c057600080fd5b505af11580156117d4573d6000803e3d6000fd5b503392507f423f6495a08fc652425cf4ed0d1f9e37e571d9b9529b1c1c23cce780b2e7df0d91508f90508d8661180a868d615162565b60405161181a9493929190615215565b60405180910390a2505050505050505050505061183660018055565b5050565b600b816003811061184a57600080fd5b0154905081565b601a54610100900460ff16156118c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4f7065726174696f6e733a20416c726561647920696e697469616c697a6564006044820152606401610e3a565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4f7065726174696f6e733a204e6f7420666163746f72790000000000000000006044820152606401610e3a565b620f42408511156119cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5f412065786365656473206d6178696d756d00000000000000000000000000006044820152606401610e3a565b64012a05f200841115611a3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5f6665652065786365656473206d6178696d756d0000000000000000000000006044820152606401610e3a565b6402540be400831115611aad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5f61646d696e5f6665652065786365656473206d6178696d756d0000000000006044820152606401610e3a565b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905560005b6003811015611da2576000878260038110611af957611af961509b565b602002015173ffffffffffffffffffffffffffffffffffffffff161415611b7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f204164647265737300000000000000000000000000000000000000006044820152606401610e3a565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee888360038110611ba557611ba561509b565b602002015173ffffffffffffffffffffffffffffffffffffffff161415611c0d5750601180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556012611c98565b878260038110611c1f57611c1f61509b565b602002015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c929190615243565b60ff1690505b6012811115611d28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546865206d6178696d756d20646563696d616c2063616e6e6f7420657863656560448201527f64203138000000000000000000000000000000000000000000000000000000006064820152608401610e3a565b611d338160126150f9565b611d3e90600a615386565b60028360038110611d5157611d5161509b565b015560028260038110611d6657611d6661509b565b0154611d7a90670de0b6b3a764000061517a565b60058360038110611d8d57611d8d61509b565b01555080611d9a81615129565b915050611adc565b50611db06008876003614d63565b5060128590556013859055600e849055600f839055611dd2624f1a0042615162565b601955601180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055611e1e82613a5f565b505050505050565b611e2e613b22565b601654421015611e9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6465763a20696e73756666696369656e742074696d65000000000000000000006044820152606401610e3a565b601654611f29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f61646d696e5f616374696f6e735f646561646c696e652073686f756c64206e6f60448201527f74206265203000000000000000000000000000000000000000000000000000006064820152608401610e3a565b6000601655601754600e819055601854600f8190556040517fbe12859b636aed607d5230b2cc2711f68d70e51060e6cca1f575ef5d2fcc95d192611f7592908252602082015260400190565b60405180910390a1565b600080611f8c8484613ded565b50949350505050565b611f9d613b22565b60005b60038110156120d65773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60088260038110611fd157611fd161509b565b015473ffffffffffffffffffffffffffffffffffffffff16141561200a5747600b82600381106120035761200361509b565b01556120c4565b6008816003811061201d5761201d61509b565b01546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa15801561208a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ae9190615110565b600b82600381106120c1576120c161509b565b01555b806120ce81615129565b915050611fa0565b506040517f2c7203581ca666b8c5094c11c03f0b19b3750234a9d281bcbc88a260bcb006de90600090a1565b60408051606081019182905260009182919060059060039082845b81548152602001906001019080831161211d57505050505090506000612141614109565b90506000670de0b6b3a76400008388600381106121605761216061509b565b602002015161216f908761517a565b61217991906151b7565b82886003811061218b5761218b61509b565b602002015161219a9190615162565b905060006121aa888884866141c3565b905060008488600381106121c0576121c061509b565b6020020151670de0b6b3a7640000600184878c600381106121e3576121e361509b565b60200201516121f291906150f9565b6121fc91906150f9565b612206919061517a565b61221091906151b7565b905060006402540be40082600e54612228919061517a565b61223291906151b7565b905061223e81836150f9565b9a9950505050505050505050565b612254613cbc565b601a5460ff16156122c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b60115474010000000000000000000000000000000000000000900460ff1661234b57341561234b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b604080516060810191829052600091600b9060039082845b81548152602001906001019080831161236357505050505090506000612388826143e7565b90506000670de0b6b3a7640000600588600381106123a8576123a861509b565b01546123b4908761517a565b6123be91906151b7565b8288600381106123d0576123d061509b565b60200201516123df9190615162565b905060006123ef888884866141c3565b90506000600182858a600381106124085761240861509b565b602002015161241791906150f9565b61242191906150f9565b905060006402540be400600e5483612439919061517a565b61244391906151b7565b9050600589600381106124585761245861509b565b0154670de0b6b3a764000061246d83856150f9565b612477919061517a565b61248191906151b7565b915086821015612513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45786368616e676520726573756c74656420696e20666577657220636f696e7360448201527f207468616e2065787065637465640000000000000000000000000000000000006064820152608401610e3a565b60006402540be400600f5483612529919061517a565b61253391906151b7565b905060058a600381106125485761254861509b565b015461255c670de0b6b3a76400008361517a565b61256691906151b7565b905088878c6003811061257b5761257b61509b565b602002015161258a9190615162565b600b8c6003811061259d5761259d61509b565b01558083888c600381106125b3576125b361509b565b60200201516125c291906150f9565b6125cc91906150f9565b600b8b600381106125df576125df61509b565b0155600060088c600381106125f6576125f661509b565b015473ffffffffffffffffffffffffffffffffffffffff16905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81141561269a57348a14612695576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b6126bc565b6126bc73ffffffffffffffffffffffffffffffffffffffff821633308d6144a5565b600060088c600381106126d1576126d161509b565b015473ffffffffffffffffffffffffffffffffffffffff1690506126f58186613ba3565b604080518e8152602081018d90529081018d90526060810186905233907fb2e76ae99761dc136e598d4a629bb347eccb9532a5f8bbd72e18467c3c34cc989060800160405180910390a250505050505050505061275160018055565b50505050565b61275f613b22565b601654156127c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f61646d696e5f616374696f6e735f646561646c696e65206d75737420626520306044820152606401610e3a565b64012a05f200821115612838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6465763a206665652065786365656473206d6178696d756d00000000000000006044820152606401610e3a565b6402540be4008111156128a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f6465763a2061646d696e206665652065786365656473206d6178696d756d00006044820152606401610e3a565b6128b46203f48042615162565b60168190556017839055601882905560408051848152602081018490527f351fc5da2fbf480f2225debf3664a4bc90fa9923743aad58b4603f648e931fe0910160405180910390a25050565b612908613b22565b6108fc811015801561291c57506159d88111155b612982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f496c6c6567616c206761730000000000000000000000000000000000000000006044820152606401610e3a565b60108190556040518181527f2464fc1685c7ca97fc1e1c439a8d567d9ee1522118c0a0b3079220ca5f8fc3f6906020015b60405180910390a150565b6005816003811061184a57600080fd5b6129d6613b22565b6129e06000614581565b565b6002816003811061184a57600080fd5b6000806129fd614109565b6040805160608101918290529192506000919060029060039082845b815481526020019060010190808311612a1957505050505090506000818760038110612a4757612a4761509b565b6020020151612a56908661517a565b838860038110612a6857612a6861509b565b6020020151612a779190615162565b90506000612a87888884876141c3565b90506000838860038110612a9d57612a9d61509b565b6020020151600183878b60038110612ab757612ab761509b565b6020020151612ac691906150f9565b61220691906150f9565b612ad8613cbc565b601a5460ff1615612b45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b601154604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd9160048083019260209291908290030181865afa158015612bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd99190615110565b905060008111612c45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6465763a207a65726f20746f74616c20737570706c79000000000000000000006044820152606401610e3a565b6000612c53600160036150f9565b612c5e90600461517a565b6003600e54612c6d919061517a565b612c7791906151b7565b600f549091506000612c87613c00565b60408051606081019182905291925060009190600b9060039082845b815481526020019060010190808311612ca357505050505090506000604051806060016040528083600060038110612cdd57612cdd61509b565b6020020151815260200183600160038110612cfa57612cfa61509b565b6020020151815260200183600260038110612d1757612d1761509b565b6020020151905290506000612d2c8385613ca1565b905060005b6003811015612d8957898160038110612d4c57612d4c61509b565b6020020151838260038110612d6357612d6361509b565b60200201818151612d7491906150f9565b90525080612d8181615129565b915050612d31565b506000612d968386613ca1565b9050612da0614d0b565b60005b6003811015612f3557600084878360038110612dc157612dc161509b565b6020020151612dd0908661517a565b612dda91906151b7565b90506000868360038110612df057612df061509b565b6020020151821115612e2457868360038110612e0e57612e0e61509b565b6020020151612e1d90836150f9565b9050612e49565b81878460038110612e3757612e3761509b565b6020020151612e4691906150f9565b90505b6402540be400612e59828d61517a565b612e6391906151b7565b848460038110612e7557612e7561509b565b60200201526402540be4008a858560038110612e9357612e9361509b565b6020020151612ea2919061517a565b612eac91906151b7565b878460038110612ebe57612ebe61509b565b6020020151612ecd91906150f9565b600b8460038110612ee057612ee061509b565b0155838360038110612ef457612ef461509b565b6020020151878460038110612f0b57612f0b61509b565b60200201818151612f1c91906150f9565b905250829150612f2d905081615129565b915050612da3565b506000612f428588613ca1565b90506000848b612f5284836150f9565b612f5c919061517a565b612f6691906151b7565b905060008111612ff8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f746f6b656e5f616d6f756e74206d75737420626520677265617465722074686160448201527f6e203000000000000000000000000000000000000000000000000000000000006064820152608401610e3a565b613003600182615162565b90508b81111561306f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f536c697070616765207363726577656420796f750000000000000000000000006044820152606401610e3a565b6011546040517f79cc67900000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff909116906379cc679090604401600060405180830381600087803b1580156130e157600080fd5b505af11580156130f5573d6000803e3d6000fd5b5050505060005b60038110156131805760008e82600381106131195761311961509b565b6020020151111561316e5761316e6008826003811061313a5761313a61509b565b015473ffffffffffffffffffffffffffffffffffffffff168f83600381106131645761316461509b565b6020020151613ba3565b8061317881615129565b9150506130fc565b5061318b818c6150f9565b9a503373ffffffffffffffffffffffffffffffffffffffff167f173599dbf9c6ca6f7c3b590df07ae98a45d74ff54065505141e7de6c46a624c28e85878f60405161181a9493929190615215565b6000806131f46131e7614109565b6131ef613c00565b6145f6565b90506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613265573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132899190615110565b90508061329e670de0b6b3a76400008461517a565b6132a891906151b7565b9250505090565b600881600381106132bf57600080fd5b015473ffffffffffffffffffffffffffffffffffffffff16905081565b6132e4613b22565b60006132ee613c00565b6012819055601381905542601481905560158190556040519192507f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc201938916129b391848252602082015260400190565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600883600381106133675761336761509b565b015473ffffffffffffffffffffffffffffffffffffffff1614156133a457600b82600381106133985761339861509b565b0154610db690476150f9565b600b82600381106133b7576133b761509b565b0154600883600381106133cc576133cc61509b565b01546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015613439573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061345d9190615110565b610db691906150f9565b919050565b613474613b22565b42601954116134df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f457863656564656420646561646c696e650000000000000000000000000000006044820152606401610e3a565b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040517fbe26733c2bf6ff3ea5ba8cfe744422bd49052ff9ed5685c9e81e6f9321dbaddd90600090a1565b61353d613cbc565b601154604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd9160048083019260209291908290030181865afa1580156135ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d19190615110565b90506135db614d0b565b6135e3614d0b565b60005b600381101561372f5760008487600b84600381106136065761360661509b565b0154613612919061517a565b61361c91906151b7565b90508582600381106136305761363061509b565b60200201518110156136c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f5769746864726177616c20726573756c74656420696e20666577657220636f6960448201527f6e73207468616e206578706563746564000000000000000000000000000000006064820152608401610e3a565b80600b83600381106136d8576136d861509b565b0160008282546136e891906150f9565b909155508190508483600381106137015761370161509b565b602002015261371c60088360038110610ba757610ba761509b565b508061372781615129565b9150506135e6565b506011546040517f79cc67900000000000000000000000000000000000000000000000000000000081523360048201526024810187905273ffffffffffffffffffffffffffffffffffffffff909116906379cc679090604401600060405180830381600087803b1580156137a257600080fd5b505af11580156137b6573d6000803e3d6000fd5b503392507fa49d4cf02656aebf8c771f5a8585638a2a15ee6c97cf7205d4208ed7c1df252d9150849050836137eb89886150f9565b6040516137fa93929190615392565b60405180910390a250505061183660018055565b613816613cbc565b601a5460ff1615613883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4b696c6c656400000000000000000000000000000000000000000000000000006044820152606401610e3a565b6000806138908585613ded565b91509150828210156138fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420656e6f75676820636f696e732072656d6f76656400000000000000006044820152606401610e3a565b6402540be400600f5482613912919061517a565b61391c91906151b7565b6139269083615162565b600b85600381106139395761393961509b565b01600082825461394991906150f9565b90915550506011546040517f79cc67900000000000000000000000000000000000000000000000000000000081523360048201526024810187905273ffffffffffffffffffffffffffffffffffffffff909116906379cc679090604401600060405180830381600087803b1580156139c057600080fd5b505af11580156139d4573d6000803e3d6000fd5b50505050613a0c600885600381106139ee576139ee61509b565b015473ffffffffffffffffffffffffffffffffffffffff1683613ba3565b604080518581526020810187905290810183905233907f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a09060600160405180910390a25050613a5a60018055565b505050565b613a67613b22565b73ffffffffffffffffffffffffffffffffffffffff8116613b0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610e3a565b610bd881614581565b6000613b1d613c00565b905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146129e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e3a565b73ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415613bdf57611836338261478c565b61183673ffffffffffffffffffffffffffffffffffffffff8316338361485a565b6015546013546000919042821115610db65760125460145481831115613c6557613c2a81856150f9565b613c3482426150f9565b613c3e84866150f9565b613c48919061517a565b613c5291906151b7565b613c5c9083615162565b94505050505090565b613c6f81856150f9565b613c7982426150f9565b613c8385856150f9565b613c8d919061517a565b613c9791906151b7565b613c5c90836150f9565b6000613cb5613caf846143e7565b836145f6565b9392505050565b60026001541415613d29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e3a565b6002600155565b73ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415613dcb57348114611836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e636f6e73697374656e74207175616e7469747900000000000000000000006044820152606401610e3a565b61183673ffffffffffffffffffffffffffffffffffffffff83163330846144a5565b6000806000613dfa613c00565b90506000613e0a600160036150f9565b613e1590600461517a565b6003600e54613e24919061517a565b613e2e91906151b7565b6040805160608101918290529192506000919060029060039082845b815481526020019060010190808311613e4a57505050505090506000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef79190615110565b90506000613f03614109565b90506000613f1182876145f6565b9050600083613f20838d61517a565b613f2a91906151b7565b613f3490836150f9565b9050826000613f45898d84866148b0565b90506000878d60038110613f5b57613f5b61509b565b602002015182878f60038110613f7357613f7361509b565b6020020151613f8291906150f9565b613f8c91906151b7565b905060005b60038110156140885760008e821415613fe3578387878a8560038110613fb957613fb961509b565b6020020151613fc8919061517a565b613fd291906151b7565b613fdc91906150f9565b9050614034565b8686898460038110613ff757613ff761509b565b6020020151614006919061517a565b61401091906151b7565b8883600381106140225761402261509b565b602002015161403191906150f9565b90505b6402540be400614044828d61517a565b61404e91906151b7565b8583600381106140605761406061509b565b6020020181815161407191906150f9565b90525081905061408081615129565b915050613f91565b5060006140978b8f86886148b0565b848f600381106140a9576140a961509b565b60200201516140b891906150f9565b9050888e600381106140cc576140cc61509b565b60200201516140dc6001836150f9565b6140e691906151b7565b9050806140f381846150f9565b9c509c5050505050505050505050509250929050565b614111614d0b565b6040805160608101918290529060059060039082845b815481526020019060010190808311614127575050505050905060005b60038110156141bf57670de0b6b3a7640000600b82600381106141695761416961509b565b015483836003811061417d5761417d61509b565b602002015161418c919061517a565b61419691906151b7565b8282600381106141a8576141a861509b565b6020020152806141b781615129565b915050614144565b5090565b60008385141580156141d55750600385105b80156141e15750600384105b614247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496c6c6567616c20706172616d657465720000000000000000000000000000006044820152606401610e3a565b6000614251613c00565b9050600061425f84836145f6565b90508060008061427060038661517a565b90506000805b60038110156142f9578b81141561428f578991506142b9565b8a81146142b4578881600381106142a8576142a861509b565b602002015191506142b9565b6142e7565b6142c38285615162565b93506142d060038361517a565b6142da878761517a565b6142e491906151b7565b94505b806142f181615129565b915050614276565b5061430560038361517a565b61430f868661517a565b61431991906151b7565b9350600061432783876151b7565b6143319085615162565b9050600086815b60ff8110156143d3578192508884836002614353919061517a565b61435d9190615162565b61436791906150f9565b88614372848061517a565b61437c9190615162565b61438691906151b7565b9150828211156143ab57600161439c84846150f9565b116143a6576143d3565b6143c1565b60016143b783856150f9565b116143c1576143d3565b806143cb81615129565b915050614338565b50985050505050505050505b949350505050565b6143ef614d0b565b6040805160608101918290529060059060039082845b815481526020019060010190808311614405575050505050905060005b600381101561449f57670de0b6b3a76400008382600381106144465761444661509b565b602002015183836003811061445d5761445d61509b565b602002015161446c919061517a565b61447691906151b7565b8282600381106144885761448861509b565b60200201528061449781615129565b915050614422565b50919050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526127519085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614a8e565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060005b600381101561463a578481600381106146175761461761509b565b60200201516146269083615162565b91508061463281615129565b9150506145fc565b508061464a576000915050610db6565b6000818161465960038761517a565b905060005b60ff811015614780578260005b60038110156146bf5760038a82600381106146885761468861509b565b6020020151614697919061517a565b6146a1868461517a565b6146ab91906151b7565b9150806146b781615129565b91505061466b565b5083945080600360016146d29190615162565b6146dc919061517a565b846146e86001866150f9565b6146f2919061517a565b6146fc9190615162565b8461470860038461517a565b614712898761517a565b61471c9190615162565b614726919061517a565b61473091906151b7565b93508484111561475657600161474686866150f9565b116147515750614780565b61476d565b600161476285876150f9565b1161476d5750614780565b508061477881615129565b91505061465e565b50909695505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff1660105483604051600060405180830381858888f193505050503d80600081146147ea576040519150601f19603f3d011682016040523d82523d6000602084013e6147ef565b606091505b5050905080613a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610e3a565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052613a5a9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016144ff565b60006003841061491c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6465763a20692061626f7665204e5f434f494e530000000000000000000000006044820152606401610e3a565b8160008061492b60038961517a565b90506000805b60038110156149a45788811461495f578781600381106149535761495361509b565b60200201519150614964565b614992565b61496e8285615162565b935061497b60038361517a565b614985888761517a565b61498f91906151b7565b94505b8061499c81615129565b915050614931565b506149b060038361517a565b6149ba878661517a565b6149c491906151b7565b935060006149d283886151b7565b6149dc9085615162565b9050600087815b60ff811015614a7e5781925089848360026149fe919061517a565b614a089190615162565b614a1291906150f9565b88614a1d848061517a565b614a279190615162565b614a3191906151b7565b915082821115614a56576001614a4784846150f9565b11614a5157614a7e565b614a6c565b6001614a6283856150f9565b11614a6c57614a7e565b80614a7681615129565b9150506149e3565b509b9a5050505050505050505050565b6000614af0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614b9d9092919063ffffffff16565b9050805160001480614b11575080806020019051810190614b1191906153bb565b613a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610e3a565b60606143df8484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051614bd19190615404565b60006040518083038185875af1925050503d8060008114614c0e576040519150601f19603f3d011682016040523d82523d6000602084013e614c13565b606091505b5091509150614c2487838387614c2f565b979650505050505050565b60608315614cc2578251614cbb5773ffffffffffffffffffffffffffffffffffffffff85163b614cbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e3a565b50816143df565b6143df8383815115614cd75781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3a9190615420565b60405180606001604052806003906020820280368337509192915050565b8260038101928215614d57579160200282015b82811115614d57578251825591602001919060010190614d3c565b506141bf929150614dd0565b8260038101928215614d57579160200282015b82811115614d5757825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614d76565b5b808211156141bf5760008155600101614dd1565b6040516060810167ffffffffffffffff81118282101715614e2f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b600082601f830112614e4657600080fd5b614e4e614de5565b806060840185811115614e6057600080fd5b845b81811015614e7a578035845260209384019301614e62565b509095945050505050565b8015158114610bd857600080fd5b60008060808385031215614ea657600080fd5b614eb08484614e35565b91506060830135614ec081614e85565b809150509250929050565b60008060408385031215614ede57600080fd5b50508035926020909101359150565b60008060808385031215614f0057600080fd5b614f0a8484614e35565b946060939093013593505050565b600060208284031215614f2a57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461346757600080fd5b6000806000806000806101008789031215614f6f57600080fd5b87601f880112614f7e57600080fd5b614f86614de5565b80606089018a811115614f9857600080fd5b895b81811015614fb957614fab81614f31565b845260209384019301614f9a565b50909750359550506080870135935060a08701359250614fdb60c08801614f31565b9150614fe960e08801614f31565b90509295509295509295565b60008060006060848603121561500a57600080fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561503757600080fd5b5050823594602084013594506040840135936060013592509050565b6000806080838503121561506657600080fd5b823591506150778460208501614e35565b90509250929050565b60006020828403121561509257600080fd5b613cb582614f31565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561510b5761510b6150ca565b500390565b60006020828403121561512257600080fd5b5051919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561515b5761515b6150ca565b5060010190565b60008219821115615175576151756150ca565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156151b2576151b26150ca565b500290565b6000826151ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8060005b60038110156127515781518452602093840193909101906001016151f6565b610100810161522482876151f2565b61523160608301866151f2565b60c082019390935260e0015292915050565b60006020828403121561525557600080fd5b815160ff81168114613cb557600080fd5b600181815b808511156152bf57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156152a5576152a56150ca565b808516156152b257918102915b93841c939080029061526b565b509250929050565b6000826152d657506001610db6565b816152e357506000610db6565b81600181146152f957600281146153035761531f565b6001915050610db6565b60ff841115615314576153146150ca565b50506001821b610db6565b5060208310610133831016604e8410600b8410161715615342575081810a610db6565b61534c8383615266565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561537e5761537e6150ca565b029392505050565b6000613cb583836152c7565b60e081016153a082866151f2565b6153ad60608301856151f2565b8260c0830152949350505050565b6000602082840312156153cd57600080fd5b8151613cb581614e85565b60005b838110156153f35781810151838201526020016153db565b838111156127515750506000910152565b600082516154168184602087016153d8565b9190910192915050565b602081526000825180602084015261543f8160408501602087016153d8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c634300080a000aa164736f6c634300080a000a