Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- UniPieRecipe
- Optimization enabled
- false
- Compiler version
- v0.8.1+commit.df193b15
- EVM Version
- istanbul
- Verified at
- 2026-04-22T01:58:58.037921Z
Constructor Arguments
000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000e3a46f469eab5c5903ec3c9d577d455e92011d41
Arg [0] (address) : 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [1] (address) : 0x7a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [2] (address) : 0xe3a46f469eab5c5903ec3c9d577d455e92011d41
contracts/recipes/UniPieRecipe.sol
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
pragma experimental ABIEncoderV2;
import "../interfaces/IRecipe.sol";
import "../interfaces/IUniRouter.sol";
import "../interfaces/ILendingRegistry.sol";
import "../interfaces/ILendingLogic.sol";
import "../interfaces/IPieRegistry.sol";
import "../interfaces/IPie.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract UniPieRecipe is IRecipe, Ownable {
using SafeERC20 for IERC20;
IERC20 immutable WETH;
IUniRouter immutable uniRouter;
IPieRegistry immutable pieRegistry;
event Error(string text);
event HopUpdated(address indexed _token, address indexed _hop);
// Adds a custom hop before reaching the destination token
mapping(address => CustomHop) public customHops;
struct CustomHop {
address hop;
}
constructor(
address _weth,
address _uniRouter,
address _pieRegistry
) {
require(_weth != address(0), "WETH_ZERO");
require(_uniRouter != address(0), "UNI_ROUTER_ZERO");
require(_pieRegistry != address(0), "PIE_REGISTRY_ZERO");
WETH = IERC20(_weth);
uniRouter = IUniRouter(_uniRouter);
pieRegistry = IPieRegistry(_pieRegistry);
}
function bake(
address _inputToken,
address _outputToken,
uint256 _maxInput,
bytes memory _data
)
external
override
returns (uint256 inputAmountUsed, uint256 outputAmount)
{
IERC20 inputToken = IERC20(_inputToken);
IERC20 outputToken = IERC20(_outputToken);
inputToken.safeTransferFrom(_msgSender(), address(this), _maxInput);
uint256 mintAmount = abi.decode(_data, (uint256));
swap(_inputToken, _outputToken, mintAmount);
uint256 remainingInputBalance = inputToken.balanceOf(address(this));
if (remainingInputBalance > 0) {
inputToken.transfer(_msgSender(), remainingInputBalance);
}
outputAmount = outputToken.balanceOf(address(this));
outputToken.safeTransfer(_msgSender(), outputAmount);
inputAmountUsed = _maxInput - remainingInputBalance;
return (inputAmountUsed, outputAmount);
}
function swap(
address _inputToken,
address _outputToken,
uint256 _outputAmount
) internal {
if (_inputToken == _outputToken) {
return;
}
require(_inputToken == address(WETH), "NOT_WETH");
if (pieRegistry.inRegistry(_outputToken)) {
swapPie(_outputToken, _outputAmount);
return;
}
// else normal swap
swapUniswap(_inputToken, _outputToken, _outputAmount);
}
function swapPie(address _pie, uint256 _outputAmount) internal {
IPie pie = IPie(_pie);
(address[] memory tokens, uint256[] memory amounts) =
pie.calcTokensForAmount(_outputAmount);
for (uint256 i = 0; i < tokens.length; i++) {
swap(address(WETH), tokens[i], amounts[i]);
IERC20 token = IERC20(tokens[i]);
token.approve(_pie, 0);
token.approve(_pie, amounts[i]);
}
pie.joinPool(_outputAmount, 0); //Add referral
}
function swapUniswap(
address _inputToken,
address _outputToken,
uint256 _outputAmount
) internal {
address[] memory route = getRoute(_inputToken, _outputToken);
IERC20 _inputToken = IERC20(_inputToken);
_inputToken.approve(address(uniRouter), 0);
_inputToken.approve(address(uniRouter), type(uint256).max);
uniRouter.swapTokensForExactTokens(
_outputAmount,
type(uint256).max,
route,
address(this),
block.timestamp + 1
);
}
function uint2str(uint256 _i)
internal
pure
returns (string memory _uintAsString)
{
if (_i == 0) {
return "0";
}
uint256 j = _i;
uint256 len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint256 k = len;
while (_i != 0) {
k = k - 1;
uint8 temp = (48 + uint8(_i - (_i / 10) * 10));
bytes1 b1 = bytes1(temp);
bstr[k] = b1;
_i /= 10;
}
return string(bstr);
}
function toAsciiString(address x) internal view returns (string memory) {
bytes memory s = new bytes(40);
for (uint256 i = 0; i < 20; i++) {
bytes1 b = bytes1(uint8(uint256(uint160(x)) / (2**(8 * (19 - i)))));
bytes1 hi = bytes1(uint8(b) / 16);
bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi));
s[2 * i] = char(hi);
s[2 * i + 1] = char(lo);
}
return string(s);
}
function char(bytes1 b) internal view returns (bytes1 c) {
if (uint8(b) < 10) return bytes1(uint8(b) + 0x30);
else return bytes1(uint8(b) + 0x57);
}
function setCustomHop(address _token, address _hop) external onlyOwner {
customHops[_token] = CustomHop({
hop: _hop
// dex: _dex
});
}
function saveToken(
address _token,
address _to,
uint256 _amount
) external onlyOwner {
IERC20(_token).transfer(_to, _amount);
}
function saveEth(address payable _to, uint256 _amount) external onlyOwner {
_to.call{value: _amount}("");
}
function getPrice(
address _inputToken,
address _outputToken,
uint256 _outputAmount
) public returns (uint256) {
if (_inputToken == _outputToken) {
return _outputAmount;
}
CustomHop memory customHop = customHops[_outputToken];
if (customHop.hop != address(0)) {
//get price for hop
uint256 hopAmount =
getPrice(customHop.hop, _outputToken, _outputAmount);
return getPrice(_inputToken, _outputToken, hopAmount);
}
// check if token is pie
if (pieRegistry.inRegistry(_outputToken)) {
uint256 ethAmount = getPricePie(_outputToken, _outputAmount);
// if input was not WETH
if (_inputToken != address(WETH)) {
return getPrice(_inputToken, address(WETH), ethAmount);
}
return ethAmount;
}
// if input and output are not WETH (2 hop swap)
if (_inputToken != address(WETH) && _outputToken != address(WETH)) {
uint256 middleInputAmount =
getBestPriceUniswap(address(WETH), _outputToken, _outputAmount);
uint256 inputAmount =
getBestPriceUniswap(
_inputToken,
address(WETH),
middleInputAmount
);
return inputAmount;
}
// else single hop swap
uint256 inputAmount =
getBestPriceUniswap(_inputToken, _outputToken, _outputAmount);
return inputAmount;
}
function getBestPriceUniswap(
address _inputToken,
address _outputToken,
uint256 _outputAmount
) internal view returns (uint256) {
uint256 uniAmount =
getPriceUniLike(
_inputToken,
_outputToken,
_outputAmount,
uniRouter
);
return uniAmount;
}
function getRoute(address _inputToken, address _outputToken)
internal
view
returns (address[] memory route)
{
// if both input and output are not WETH
if (_inputToken != address(WETH) && _outputToken != address(WETH)) {
route = new address[](3);
route[0] = _inputToken;
route[1] = address(WETH);
route[2] = _outputToken;
return route;
}
route = new address[](2);
route[0] = _inputToken;
route[1] = _outputToken;
return route;
}
function getPriceUniLike(
address _inputToken,
address _outputToken,
uint256 _outputAmount,
IUniRouter _router
) internal view returns (uint256) {
if (_inputToken == _outputToken) {
return (_outputAmount);
}
// TODO this IS an external call but somehow the compiler does not recognize it as such :(
// try
uint256[] memory amounts =
_router.getAmountsIn(
_outputAmount,
getRoute(_inputToken, _outputToken)
);
return amounts[0];
}
// NOTE input token must be WETH
function getPricePie(address _pie, uint256 _pieAmount)
internal
returns (uint256)
{
IPie pie = IPie(_pie);
(address[] memory tokens, uint256[] memory amounts) =
pie.calcTokensForAmount(_pieAmount);
uint256 inputAmount = 0;
for (uint256 i = 0; i < tokens.length; i++) {
inputAmount += getPrice(address(WETH), tokens[i], amounts[i]);
}
return inputAmount;
}
function encodeData(uint256 _outputAmount)
external
pure
returns (bytes memory)
{
return abi.encode((_outputAmount));
}
}
/
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniRouter is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/
// SPDX-License-Identifier: MIT
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 () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
interface IPieRegistry {
function inRegistry(address _pool) external view returns(bool);
function entries(uint256 _index) external view returns(address);
function addSmartPool(address _smartPool) external;
function removeSmartPool(uint256 _index) external;
}
/
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
pragma experimental ABIEncoderV2;
interface ILendingRegistry {
// Maps wrapped token to protocol
function wrappedToProtocol(address _wrapped) external view returns(bytes32);
// Maps wrapped token to underlying
function wrappedToUnderlying(address _wrapped) external view returns(address);
function underlyingToProtocolWrapped(address _underlying, bytes32 protocol) external view returns (address);
function protocolToLogic(bytes32 _protocol) external view returns (address);
/**
@notice Set which protocl a wrapped token belongs to
@param _wrapped Address of the wrapped token
@param _protocol Bytes32 key of the protocol
*/
function setWrappedToProtocol(address _wrapped, bytes32 _protocol) external;
/**
@notice Set what is the underlying for a wrapped token
@param _wrapped Address of the wrapped token
@param _underlying Address of the underlying token
*/
function setWrappedToUnderlying(address _wrapped, address _underlying) external;
/**
@notice Set the logic contract for the protocol
@param _protocol Bytes32 key of the procol
@param _logic Address of the lending logic contract for that protocol
*/
function setProtocolToLogic(bytes32 _protocol, address _logic) external;
/**
@notice Set the wrapped token for the underlying deposited in this protocol
@param _underlying Address of the unerlying token
@param _protocol Bytes32 key of the protocol
@param _wrapped Address of the wrapped token
*/
function setUnderlyingToProtocolWrapped(address _underlying, bytes32 _protocol, address _wrapped) external;
/**
@notice Get tx data to lend the underlying amount in a specific protocol
@param _underlying Address of the underlying token
@param _amount Amount to lend
@param _protocol Bytes32 key of the protocol
@return targets Addresses of the contracts to call
@return data Calldata for the calls
*/
function getLendTXData(address _underlying, uint256 _amount, bytes32 _protocol) external view returns(address[] memory targets, bytes[] memory data);
/**
@notice Get the tx data to unlend the wrapped amount
@param _wrapped Address of the wrapped token
@param _amount Amount of wrapped token to unlend
@return targets Addresses of the contracts to call
@return data Calldata for the calls
*/
function getUnlendTXData(address _wrapped, uint256 _amount) external view returns(address[] memory targets, bytes[] memory data);
}
/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/
// SPDX-License-Identifier: MIT
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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IPie is IERC20 {
function joinPool(uint256 _amount, uint16 _referral) external;
function exitPool(uint256 _amount) external;
function calcTokensForAmount(uint256 _amount) external view returns(address[] memory tokens, uint256[] memory amounts);
}
/
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
pragma experimental ABIEncoderV2;
interface ILendingLogic {
/**
@notice Get the calls needed to lend.
@param _underlying Address of the underlying token
@param _amount Amount of the underlying token
@return targets Addresses of the contracts to call
@return data Calldata of the calls
*/
function lend(address _underlying, uint256 _amount) external view returns(address[] memory targets, bytes[] memory data);
/**
@notice Get the calls needed to unlend
@param _wrapped Address of the wrapped token
@param _amount Amount of the underlying tokens
@return targets Addresses of the contracts to call
@return data Calldata of the calls
*/
function unlend(address _wrapped, uint256 _amount) external view returns(address[] memory targets, bytes[] memory data);
/**
@notice Get the underlying wrapped exchange rate
@param _wrapped Address of the wrapped token
@return The exchange rate
*/
function exchangeRate(address _wrapped) external returns(uint256);
/**
@notice Get the underlying wrapped exchange rate in a view (non state changing) way
@param _wrapped Address of the wrapped token
@return The exchange rate
*/
function exchangeRateView(address _wrapped) external view returns(uint256);
}
/
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.1;
interface IRecipe {
function bake(
address _inputToken,
address _outputToken,
uint256 _maxInput,
bytes memory _data
) external returns (uint256 inputAmountUsed, uint256 outputAmount);
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":false},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"contracts/recipes/UniPieRecipe.sol":"UniPieRecipe"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_weth","internalType":"address"},{"type":"address","name":"_uniRouter","internalType":"address"},{"type":"address","name":"_pieRegistry","internalType":"address"}]},{"type":"event","name":"Error","inputs":[{"type":"string","name":"text","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"HopUpdated","inputs":[{"type":"address","name":"_token","internalType":"address","indexed":true},{"type":"address","name":"_hop","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"inputAmountUsed","internalType":"uint256"},{"type":"uint256","name":"outputAmount","internalType":"uint256"}],"name":"bake","inputs":[{"type":"address","name":"_inputToken","internalType":"address"},{"type":"address","name":"_outputToken","internalType":"address"},{"type":"uint256","name":"_maxInput","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"hop","internalType":"address"}],"name":"customHops","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"encodeData","inputs":[{"type":"uint256","name":"_outputAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPrice","inputs":[{"type":"address","name":"_inputToken","internalType":"address"},{"type":"address","name":"_outputToken","internalType":"address"},{"type":"uint256","name":"_outputAmount","internalType":"uint256"}]},{"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":"saveEth","inputs":[{"type":"address","name":"_to","internalType":"address payable"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"saveToken","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCustomHop","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_hop","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x60e06040523480156200001157600080fd5b50604051620035a8380380620035a883398181016040528101906200003791906200030d565b600062000049620002ee60201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000151906200041c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415620001cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001c490620003d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200023790620003fa565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff1660601b8152505050505062000518565b600033905090565b6000815190506200030781620004fe565b92915050565b6000806000606084860312156200032357600080fd5b60006200033386828701620002f6565b93505060206200034686828701620002f6565b92505060406200035986828701620002f6565b9150509250925092565b600062000372600f836200043e565b91506200037f8262000483565b602082019050919050565b6000620003996011836200043e565b9150620003a682620004ac565b602082019050919050565b6000620003c06009836200043e565b9150620003cd82620004d5565b602082019050919050565b60006020820190508181036000830152620003f38162000363565b9050919050565b6000602082019050818103600083015262000415816200038a565b9050919050565b600060208201905081810360008301526200043781620003b1565b9050919050565b600082825260208201905092915050565b60006200045c8262000463565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b7f554e495f524f555445525f5a45524f0000000000000000000000000000000000600082015250565b7f5049455f52454749535452595f5a45524f000000000000000000000000000000600082015250565b7f574554485f5a45524f0000000000000000000000000000000000000000000000600082015250565b62000509816200044f565b81146200051557600080fd5b50565b60805160601c60a05160601c60c05160601c612fee620005ba60003960008181610a5901526110170152600081816112f50152818161179b0152818161184a01526118fc015260008181610b1501528181610b6c01528181610ba601528181610bfd01528181610c5801528181610c8801528181610f89015281816112160152818161149801528181611b2b01528181611b820152611cbf0152612fee6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80639afdb2c2116100665780639afdb2c214610134578063a7521a8914610150578063a9dd14d614610180578063c1a5c7f1146101b0578063f2fde38b146101e05761009e565b806327726e7d146100a3578063412c9547146100bf5780634ec8f6ae146100f0578063715018a61461010c5780638da5cb5b14610116575b600080fd5b6100bd60048036038101906100b891906122f8565b6101fc565b005b6100d960048036038101906100d491906123bf565b6102e5565b6040516100e7929190612a03565b60405180910390f35b61010a60048036038101906101059190612334565b61054d565b005b61011461067b565b005b61011e6107b5565b60405161012b91906127e7565b60405180910390f35b61014e60048036038101906101499190612370565b6107de565b005b61016a60048036038101906101659190612510565b6108ed565b604051610177919061288b565b60405180910390f35b61019a60048036038101906101959190612370565b610916565b6040516101a7919061298f565b60405180910390f35b6101ca60048036038101906101c591906122cf565b610cd6565b6040516101d791906127e7565b60405180910390f35b6101fa60048036038101906101f591906122cf565b610d14565b005b610204610ebd565b73ffffffffffffffffffffffffffffffffffffffff166102226107b5565b73ffffffffffffffffffffffffffffffffffffffff1614610278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026f9061292f565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168160405161029c906127d2565b60006040518083038185875af1925050503d80600081146102d9576040519150601f19603f3d011682016040523d82523d6000602084013e6102de565b606091505b5050505050565b600080600086905060008690506103266102fd610ebd565b30888573ffffffffffffffffffffffffffffffffffffffff16610ec5909392919063ffffffff16565b60008580602001905181019061033c9190612539565b9050610349898983610f4e565b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161038491906127e7565b60206040518083038186803b15801561039c57600080fd5b505afa1580156103b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d49190612539565b90506000811115610475578373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610403610ebd565b836040518363ffffffff1660e01b8152600401610421929190612862565b602060405180830381600087803b15801561043b57600080fd5b505af115801561044f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047391906124e7565b505b8273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104ae91906127e7565b60206040518083038186803b1580156104c657600080fd5b505afa1580156104da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104fe9190612539565b945061053261050b610ebd565b868573ffffffffffffffffffffffffffffffffffffffff166110e39092919063ffffffff16565b808861053e9190612c06565b95505050505094509492505050565b610555610ebd565b73ffffffffffffffffffffffffffffffffffffffff166105736107b5565b73ffffffffffffffffffffffffffffffffffffffff16146105c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c09061292f565b60405180910390fd5b60405180602001604052808273ffffffffffffffffffffffffffffffffffffffff16815250600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505050565b610683610ebd565b73ffffffffffffffffffffffffffffffffffffffff166106a16107b5565b73ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee9061292f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6107e6610ebd565b73ffffffffffffffffffffffffffffffffffffffff166108046107b5565b73ffffffffffffffffffffffffffffffffffffffff161461085a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108519061292f565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401610895929190612862565b602060405180830381600087803b1580156108af57600080fd5b505af11580156108c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e791906124e7565b50505050565b606081604051602001610900919061298f565b6040516020818303038152906040529050919050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561095457819050610ccf565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060200160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614610a57576000610a4182600001518686610916565b9050610a4e868683610916565b92505050610ccf565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e4ec552b856040518263ffffffff1660e01b8152600401610ab091906127e7565b60206040518083038186803b158015610ac857600080fd5b505afa158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0091906124e7565b15610ba4576000610b118585611169565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610b9a57610b91867f000000000000000000000000000000000000000000000000000000000000000083610916565b92505050610ccf565b8092505050610ccf565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614158015610c4c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15610cba576000610c7e7f000000000000000000000000000000000000000000000000000000000000000086866112ea565b90506000610cad877f0000000000000000000000000000000000000000000000000000000000000000846112ea565b9050809350505050610ccf565b6000610cc78686866112ea565b905080925050505b9392505050565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081565b610d1c610ebd565b73ffffffffffffffffffffffffffffffffffffffff16610d3a6107b5565b73ffffffffffffffffffffffffffffffffffffffff1614610d90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d879061292f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df7906128ef565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b610f48846323b872dd60e01b858585604051602401610ee693929190612802565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611326565b50505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f87576110de565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c906128cf565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e4ec552b836040518263ffffffff1660e01b815260040161106e91906127e7565b60206040518083038186803b15801561108657600080fd5b505afa15801561109a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110be91906124e7565b156110d2576110cd82826113ed565b6110de565b6110dd83838361176a565b5b505050565b6111648363a9059cbb60e01b8484604051602401611102929190612862565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611326565b505050565b6000808390506000808273ffffffffffffffffffffffffffffffffffffffff1663371babdc866040518263ffffffff1660e01b81526004016111ab919061298f565b60006040518083038186803b1580156111c357600080fd5b505afa1580156111d7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611200919061243a565b915091506000805b83518110156112dc576112bc7f000000000000000000000000000000000000000000000000000000000000000085838151811061126e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518584815181106112af577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610916565b826112c79190612bb0565b915080806112d490612d39565b915050611208565b508094505050505092915050565b6000806113198585857f00000000000000000000000000000000000000000000000000000000000000006119e6565b9050809150509392505050565b6000611388826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b0f9092919063ffffffff16565b90506000815111156113e857808060200190518101906113a891906124e7565b6113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113de9061296f565b60405180910390fd5b5b505050565b60008290506000808273ffffffffffffffffffffffffffffffffffffffff1663371babdc856040518263ffffffff1660e01b815260040161142e919061298f565b60006040518083038186803b15801561144657600080fd5b505afa15801561145a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611483919061243a565b9150915060005b82518110156116f45761153e7f00000000000000000000000000000000000000000000000000000000000000008483815181106114f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151848481518110611531577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610f4e565b6000838281518110611579577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b38860006040518363ffffffff1660e01b81526004016115bf929190612839565b602060405180830381600087803b1580156115d957600080fd5b505af11580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161191906124e7565b508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b388858581518110611668577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b815260040161168d929190612862565b602060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df91906124e7565b505080806116ec90612d39565b91505061148a565b508273ffffffffffffffffffffffffffffffffffffffff1663bd4c25368560006040518363ffffffff1660e01b81526004016117319291906129da565b600060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b505050505050505050565b60006117768484611b27565b905060008490508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f000000000000000000000000000000000000000000000000000000000000000060006040518363ffffffff1660e01b81526004016117d9929190612839565b602060405180830381600087803b1580156117f357600080fd5b505af1158015611807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182b91906124e7565b508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f00000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118a7929190612862565b602060405180830381600087803b1580156118c157600080fd5b505af11580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f991906124e7565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16638803dbee847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85306001426119679190612bb0565b6040518663ffffffff1660e01b8152600401611987959493929190612a2c565b600060405180830381600087803b1580156119a157600080fd5b505af11580156119b5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119de91906124a6565b505050505050565b60008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611a2457829050611b07565b60008273ffffffffffffffffffffffffffffffffffffffff16631f00ca7485611a4d8989611b27565b6040518363ffffffff1660e01b8152600401611a6a9291906129aa565b60006040518083038186803b158015611a8257600080fd5b505afa158015611a96573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611abf91906124a6565b905080600081518110611afb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519150505b949350505050565b6060611b1e8484600085611f2f565b90509392505050565b60607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bd157507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611dcc57600367ffffffffffffffff811115611c17577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611c455781602001602082028036833780820191505090505b5090508281600081518110611c83577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000000000000000000000000000000000000000000081600181518110611d18577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508181600281518110611d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f29565b600267ffffffffffffffff811115611e0d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e3b5781602001602082028036833780820191505090505b5090508281600081518110611e79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508181600181518110611eee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b92915050565b606082471015611f74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6b9061290f565b60405180910390fd5b611f7d85612043565b611fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb39061294f565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611fe591906127bb565b60006040518083038185875af1925050503d8060008114612022576040519150601f19603f3d011682016040523d82523d6000602084013e612027565b606091505b5091509150612037828286612056565b92505050949350505050565b600080823b905060008111915050919050565b60608315612066578290506120b6565b6000835111156120795782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ad91906128ad565b60405180910390fd5b9392505050565b60006120d06120cb84612aab565b612a86565b905080838252602082019050828560208602820111156120ef57600080fd5b60005b8581101561211f578161210588826121e8565b8452602084019350602083019250506001810190506120f2565b5050509392505050565b600061213c61213784612ad7565b612a86565b9050808382526020820190508285602086028201111561215b57600080fd5b60005b8581101561218b578161217188826122ba565b84526020840193506020830192505060018101905061215e565b5050509392505050565b60006121a86121a384612b03565b612a86565b9050828152602081018484840111156121c057600080fd5b6121cb848285612cc6565b509392505050565b6000813590506121e281612f5c565b92915050565b6000815190506121f781612f5c565b92915050565b60008135905061220c81612f73565b92915050565b600082601f83011261222357600080fd5b81516122338482602086016120bd565b91505092915050565b600082601f83011261224d57600080fd5b815161225d848260208601612129565b91505092915050565b60008151905061227581612f8a565b92915050565b600082601f83011261228c57600080fd5b813561229c848260208601612195565b91505092915050565b6000813590506122b481612fa1565b92915050565b6000815190506122c981612fa1565b92915050565b6000602082840312156122e157600080fd5b60006122ef848285016121d3565b91505092915050565b6000806040838503121561230b57600080fd5b6000612319858286016121fd565b925050602061232a858286016122a5565b9150509250929050565b6000806040838503121561234757600080fd5b6000612355858286016121d3565b9250506020612366858286016121d3565b9150509250929050565b60008060006060848603121561238557600080fd5b6000612393868287016121d3565b93505060206123a4868287016121d3565b92505060406123b5868287016122a5565b9150509250925092565b600080600080608085870312156123d557600080fd5b60006123e3878288016121d3565b94505060206123f4878288016121d3565b9350506040612405878288016122a5565b925050606085013567ffffffffffffffff81111561242257600080fd5b61242e8782880161227b565b91505092959194509250565b6000806040838503121561244d57600080fd5b600083015167ffffffffffffffff81111561246757600080fd5b61247385828601612212565b925050602083015167ffffffffffffffff81111561249057600080fd5b61249c8582860161223c565b9150509250929050565b6000602082840312156124b857600080fd5b600082015167ffffffffffffffff8111156124d257600080fd5b6124de8482850161223c565b91505092915050565b6000602082840312156124f957600080fd5b600061250784828501612266565b91505092915050565b60006020828403121561252257600080fd5b6000612530848285016122a5565b91505092915050565b60006020828403121561254b57600080fd5b6000612559848285016122ba565b91505092915050565b600061256e838361257a565b60208301905092915050565b61258381612c3a565b82525050565b61259281612c3a565b82525050565b60006125a382612b44565b6125ad8185612b72565b93506125b883612b34565b8060005b838110156125e95781516125d08882612562565b97506125db83612b65565b9250506001810190506125bc565b5085935050505092915050565b600061260182612b4f565b61260b8185612b83565b935061261b818560208601612cd5565b61262481612de0565b840191505092915050565b600061263a82612b4f565b6126448185612b94565b9350612654818560208601612cd5565b80840191505092915050565b61266981612ca2565b82525050565b61267881612cb4565b82525050565b600061268982612b5a565b6126938185612b9f565b93506126a3818560208601612cd5565b6126ac81612de0565b840191505092915050565b60006126c4600883612b9f565b91506126cf82612df1565b602082019050919050565b60006126e7602683612b9f565b91506126f282612e1a565b604082019050919050565b600061270a602683612b9f565b915061271582612e69565b604082019050919050565b600061272d602083612b9f565b915061273882612eb8565b602082019050919050565b6000612750600083612b94565b915061275b82612ee1565b600082019050919050565b6000612773601d83612b9f565b915061277e82612ee4565b602082019050919050565b6000612796602a83612b9f565b91506127a182612f0d565b604082019050919050565b6127b581612c98565b82525050565b60006127c7828461262f565b915081905092915050565b60006127dd82612743565b9150819050919050565b60006020820190506127fc6000830184612589565b92915050565b60006060820190506128176000830186612589565b6128246020830185612589565b61283160408301846127ac565b949350505050565b600060408201905061284e6000830185612589565b61285b602083018461266f565b9392505050565b60006040820190506128776000830185612589565b61288460208301846127ac565b9392505050565b600060208201905081810360008301526128a581846125f6565b905092915050565b600060208201905081810360008301526128c7818461267e565b905092915050565b600060208201905081810360008301526128e8816126b7565b9050919050565b60006020820190508181036000830152612908816126da565b9050919050565b60006020820190508181036000830152612928816126fd565b9050919050565b6000602082019050818103600083015261294881612720565b9050919050565b6000602082019050818103600083015261296881612766565b9050919050565b6000602082019050818103600083015261298881612789565b9050919050565b60006020820190506129a460008301846127ac565b92915050565b60006040820190506129bf60008301856127ac565b81810360208301526129d18184612598565b90509392505050565b60006040820190506129ef60008301856127ac565b6129fc6020830184612660565b9392505050565b6000604082019050612a1860008301856127ac565b612a2560208301846127ac565b9392505050565b600060a082019050612a4160008301886127ac565b612a4e60208301876127ac565b8181036040830152612a608186612598565b9050612a6f6060830185612589565b612a7c60808301846127ac565b9695505050505050565b6000612a90612aa1565b9050612a9c8282612d08565b919050565b6000604051905090565b600067ffffffffffffffff821115612ac657612ac5612db1565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612af257612af1612db1565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612b1e57612b1d612db1565b5b612b2782612de0565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612bbb82612c98565b9150612bc683612c98565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612bfb57612bfa612d82565b5b828201905092915050565b6000612c1182612c98565b9150612c1c83612c98565b925082821015612c2f57612c2e612d82565b5b828203905092915050565b6000612c4582612c78565b9050919050565b6000612c5782612c78565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612cad82612c6a565b9050919050565b6000612cbf82612c98565b9050919050565b82818337600083830152505050565b60005b83811015612cf3578082015181840152602081019050612cd8565b83811115612d02576000848401525b50505050565b612d1182612de0565b810181811067ffffffffffffffff82111715612d3057612d2f612db1565b5b80604052505050565b6000612d4482612c98565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d7757612d76612d82565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4e4f545f57455448000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b50565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b612f6581612c3a565b8114612f7057600080fd5b50565b612f7c81612c4c565b8114612f8757600080fd5b50565b612f9381612c5e565b8114612f9e57600080fd5b50565b612faa81612c98565b8114612fb557600080fd5b5056fea264697066735822122048591e3e1f2e49ebc86bdc3ab88d2b04eed19bc05ddd788004a5f7dfc88b029364736f6c63430008010033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000e3a46f469eab5c5903ec3c9d577d455e92011d41
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80639afdb2c2116100665780639afdb2c214610134578063a7521a8914610150578063a9dd14d614610180578063c1a5c7f1146101b0578063f2fde38b146101e05761009e565b806327726e7d146100a3578063412c9547146100bf5780634ec8f6ae146100f0578063715018a61461010c5780638da5cb5b14610116575b600080fd5b6100bd60048036038101906100b891906122f8565b6101fc565b005b6100d960048036038101906100d491906123bf565b6102e5565b6040516100e7929190612a03565b60405180910390f35b61010a60048036038101906101059190612334565b61054d565b005b61011461067b565b005b61011e6107b5565b60405161012b91906127e7565b60405180910390f35b61014e60048036038101906101499190612370565b6107de565b005b61016a60048036038101906101659190612510565b6108ed565b604051610177919061288b565b60405180910390f35b61019a60048036038101906101959190612370565b610916565b6040516101a7919061298f565b60405180910390f35b6101ca60048036038101906101c591906122cf565b610cd6565b6040516101d791906127e7565b60405180910390f35b6101fa60048036038101906101f591906122cf565b610d14565b005b610204610ebd565b73ffffffffffffffffffffffffffffffffffffffff166102226107b5565b73ffffffffffffffffffffffffffffffffffffffff1614610278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026f9061292f565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168160405161029c906127d2565b60006040518083038185875af1925050503d80600081146102d9576040519150601f19603f3d011682016040523d82523d6000602084013e6102de565b606091505b5050505050565b600080600086905060008690506103266102fd610ebd565b30888573ffffffffffffffffffffffffffffffffffffffff16610ec5909392919063ffffffff16565b60008580602001905181019061033c9190612539565b9050610349898983610f4e565b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161038491906127e7565b60206040518083038186803b15801561039c57600080fd5b505afa1580156103b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d49190612539565b90506000811115610475578373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610403610ebd565b836040518363ffffffff1660e01b8152600401610421929190612862565b602060405180830381600087803b15801561043b57600080fd5b505af115801561044f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047391906124e7565b505b8273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016104ae91906127e7565b60206040518083038186803b1580156104c657600080fd5b505afa1580156104da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104fe9190612539565b945061053261050b610ebd565b868573ffffffffffffffffffffffffffffffffffffffff166110e39092919063ffffffff16565b808861053e9190612c06565b95505050505094509492505050565b610555610ebd565b73ffffffffffffffffffffffffffffffffffffffff166105736107b5565b73ffffffffffffffffffffffffffffffffffffffff16146105c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c09061292f565b60405180910390fd5b60405180602001604052808273ffffffffffffffffffffffffffffffffffffffff16815250600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505050565b610683610ebd565b73ffffffffffffffffffffffffffffffffffffffff166106a16107b5565b73ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee9061292f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6107e6610ebd565b73ffffffffffffffffffffffffffffffffffffffff166108046107b5565b73ffffffffffffffffffffffffffffffffffffffff161461085a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108519061292f565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401610895929190612862565b602060405180830381600087803b1580156108af57600080fd5b505af11580156108c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e791906124e7565b50505050565b606081604051602001610900919061298f565b6040516020818303038152906040529050919050565b60008273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561095457819050610ccf565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060200160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614610a57576000610a4182600001518686610916565b9050610a4e868683610916565b92505050610ccf565b7f000000000000000000000000e3a46f469eab5c5903ec3c9d577d455e92011d4173ffffffffffffffffffffffffffffffffffffffff1663e4ec552b856040518263ffffffff1660e01b8152600401610ab091906127e7565b60206040518083038186803b158015610ac857600080fd5b505afa158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0091906124e7565b15610ba4576000610b118585611169565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610b9a57610b91867f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc283610916565b92505050610ccf565b8092505050610ccf565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614158015610c4c57507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15610cba576000610c7e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc286866112ea565b90506000610cad877f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2846112ea565b9050809350505050610ccf565b6000610cc78686866112ea565b905080925050505b9392505050565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081565b610d1c610ebd565b73ffffffffffffffffffffffffffffffffffffffff16610d3a6107b5565b73ffffffffffffffffffffffffffffffffffffffff1614610d90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d879061292f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df7906128ef565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b610f48846323b872dd60e01b858585604051602401610ee693929190612802565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611326565b50505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f87576110de565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c906128cf565b60405180910390fd5b7f000000000000000000000000e3a46f469eab5c5903ec3c9d577d455e92011d4173ffffffffffffffffffffffffffffffffffffffff1663e4ec552b836040518263ffffffff1660e01b815260040161106e91906127e7565b60206040518083038186803b15801561108657600080fd5b505afa15801561109a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110be91906124e7565b156110d2576110cd82826113ed565b6110de565b6110dd83838361176a565b5b505050565b6111648363a9059cbb60e01b8484604051602401611102929190612862565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611326565b505050565b6000808390506000808273ffffffffffffffffffffffffffffffffffffffff1663371babdc866040518263ffffffff1660e01b81526004016111ab919061298f565b60006040518083038186803b1580156111c357600080fd5b505afa1580156111d7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611200919061243a565b915091506000805b83518110156112dc576112bc7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc285838151811061126e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518584815181106112af577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610916565b826112c79190612bb0565b915080806112d490612d39565b915050611208565b508094505050505092915050565b6000806113198585857f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6119e6565b9050809150509392505050565b6000611388826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b0f9092919063ffffffff16565b90506000815111156113e857808060200190518101906113a891906124e7565b6113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113de9061296f565b60405180910390fd5b5b505050565b60008290506000808273ffffffffffffffffffffffffffffffffffffffff1663371babdc856040518263ffffffff1660e01b815260040161142e919061298f565b60006040518083038186803b15801561144657600080fd5b505afa15801561145a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611483919061243a565b9150915060005b82518110156116f45761153e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28483815181106114f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151848481518110611531577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610f4e565b6000838281518110611579577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b38860006040518363ffffffff1660e01b81526004016115bf929190612839565b602060405180830381600087803b1580156115d957600080fd5b505af11580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161191906124e7565b508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b388858581518110611668577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b815260040161168d929190612862565b602060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df91906124e7565b505080806116ec90612d39565b91505061148a565b508273ffffffffffffffffffffffffffffffffffffffff1663bd4c25368560006040518363ffffffff1660e01b81526004016117319291906129da565b600060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b505050505050505050565b60006117768484611b27565b905060008490508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d60006040518363ffffffff1660e01b81526004016117d9929190612839565b602060405180830381600087803b1580156117f357600080fd5b505af1158015611807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182b91906124e7565b508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118a7929190612862565b602060405180830381600087803b1580156118c157600080fd5b505af11580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f991906124e7565b507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff16638803dbee847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85306001426119679190612bb0565b6040518663ffffffff1660e01b8152600401611987959493929190612a2c565b600060405180830381600087803b1580156119a157600080fd5b505af11580156119b5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119de91906124a6565b505050505050565b60008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611a2457829050611b07565b60008273ffffffffffffffffffffffffffffffffffffffff16631f00ca7485611a4d8989611b27565b6040518363ffffffff1660e01b8152600401611a6a9291906129aa565b60006040518083038186803b158015611a8257600080fd5b505afa158015611a96573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611abf91906124a6565b905080600081518110611afb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519150505b949350505050565b6060611b1e8484600085611f2f565b90509392505050565b60607f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bd157507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611dcc57600367ffffffffffffffff811115611c17577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611c455781602001602082028036833780820191505090505b5090508281600081518110611c83577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611d18577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508181600281518110611d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f29565b600267ffffffffffffffff811115611e0d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e3b5781602001602082028036833780820191505090505b5090508281600081518110611e79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508181600181518110611eee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b92915050565b606082471015611f74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6b9061290f565b60405180910390fd5b611f7d85612043565b611fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb39061294f565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611fe591906127bb565b60006040518083038185875af1925050503d8060008114612022576040519150601f19603f3d011682016040523d82523d6000602084013e612027565b606091505b5091509150612037828286612056565b92505050949350505050565b600080823b905060008111915050919050565b60608315612066578290506120b6565b6000835111156120795782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ad91906128ad565b60405180910390fd5b9392505050565b60006120d06120cb84612aab565b612a86565b905080838252602082019050828560208602820111156120ef57600080fd5b60005b8581101561211f578161210588826121e8565b8452602084019350602083019250506001810190506120f2565b5050509392505050565b600061213c61213784612ad7565b612a86565b9050808382526020820190508285602086028201111561215b57600080fd5b60005b8581101561218b578161217188826122ba565b84526020840193506020830192505060018101905061215e565b5050509392505050565b60006121a86121a384612b03565b612a86565b9050828152602081018484840111156121c057600080fd5b6121cb848285612cc6565b509392505050565b6000813590506121e281612f5c565b92915050565b6000815190506121f781612f5c565b92915050565b60008135905061220c81612f73565b92915050565b600082601f83011261222357600080fd5b81516122338482602086016120bd565b91505092915050565b600082601f83011261224d57600080fd5b815161225d848260208601612129565b91505092915050565b60008151905061227581612f8a565b92915050565b600082601f83011261228c57600080fd5b813561229c848260208601612195565b91505092915050565b6000813590506122b481612fa1565b92915050565b6000815190506122c981612fa1565b92915050565b6000602082840312156122e157600080fd5b60006122ef848285016121d3565b91505092915050565b6000806040838503121561230b57600080fd5b6000612319858286016121fd565b925050602061232a858286016122a5565b9150509250929050565b6000806040838503121561234757600080fd5b6000612355858286016121d3565b9250506020612366858286016121d3565b9150509250929050565b60008060006060848603121561238557600080fd5b6000612393868287016121d3565b93505060206123a4868287016121d3565b92505060406123b5868287016122a5565b9150509250925092565b600080600080608085870312156123d557600080fd5b60006123e3878288016121d3565b94505060206123f4878288016121d3565b9350506040612405878288016122a5565b925050606085013567ffffffffffffffff81111561242257600080fd5b61242e8782880161227b565b91505092959194509250565b6000806040838503121561244d57600080fd5b600083015167ffffffffffffffff81111561246757600080fd5b61247385828601612212565b925050602083015167ffffffffffffffff81111561249057600080fd5b61249c8582860161223c565b9150509250929050565b6000602082840312156124b857600080fd5b600082015167ffffffffffffffff8111156124d257600080fd5b6124de8482850161223c565b91505092915050565b6000602082840312156124f957600080fd5b600061250784828501612266565b91505092915050565b60006020828403121561252257600080fd5b6000612530848285016122a5565b91505092915050565b60006020828403121561254b57600080fd5b6000612559848285016122ba565b91505092915050565b600061256e838361257a565b60208301905092915050565b61258381612c3a565b82525050565b61259281612c3a565b82525050565b60006125a382612b44565b6125ad8185612b72565b93506125b883612b34565b8060005b838110156125e95781516125d08882612562565b97506125db83612b65565b9250506001810190506125bc565b5085935050505092915050565b600061260182612b4f565b61260b8185612b83565b935061261b818560208601612cd5565b61262481612de0565b840191505092915050565b600061263a82612b4f565b6126448185612b94565b9350612654818560208601612cd5565b80840191505092915050565b61266981612ca2565b82525050565b61267881612cb4565b82525050565b600061268982612b5a565b6126938185612b9f565b93506126a3818560208601612cd5565b6126ac81612de0565b840191505092915050565b60006126c4600883612b9f565b91506126cf82612df1565b602082019050919050565b60006126e7602683612b9f565b91506126f282612e1a565b604082019050919050565b600061270a602683612b9f565b915061271582612e69565b604082019050919050565b600061272d602083612b9f565b915061273882612eb8565b602082019050919050565b6000612750600083612b94565b915061275b82612ee1565b600082019050919050565b6000612773601d83612b9f565b915061277e82612ee4565b602082019050919050565b6000612796602a83612b9f565b91506127a182612f0d565b604082019050919050565b6127b581612c98565b82525050565b60006127c7828461262f565b915081905092915050565b60006127dd82612743565b9150819050919050565b60006020820190506127fc6000830184612589565b92915050565b60006060820190506128176000830186612589565b6128246020830185612589565b61283160408301846127ac565b949350505050565b600060408201905061284e6000830185612589565b61285b602083018461266f565b9392505050565b60006040820190506128776000830185612589565b61288460208301846127ac565b9392505050565b600060208201905081810360008301526128a581846125f6565b905092915050565b600060208201905081810360008301526128c7818461267e565b905092915050565b600060208201905081810360008301526128e8816126b7565b9050919050565b60006020820190508181036000830152612908816126da565b9050919050565b60006020820190508181036000830152612928816126fd565b9050919050565b6000602082019050818103600083015261294881612720565b9050919050565b6000602082019050818103600083015261296881612766565b9050919050565b6000602082019050818103600083015261298881612789565b9050919050565b60006020820190506129a460008301846127ac565b92915050565b60006040820190506129bf60008301856127ac565b81810360208301526129d18184612598565b90509392505050565b60006040820190506129ef60008301856127ac565b6129fc6020830184612660565b9392505050565b6000604082019050612a1860008301856127ac565b612a2560208301846127ac565b9392505050565b600060a082019050612a4160008301886127ac565b612a4e60208301876127ac565b8181036040830152612a608186612598565b9050612a6f6060830185612589565b612a7c60808301846127ac565b9695505050505050565b6000612a90612aa1565b9050612a9c8282612d08565b919050565b6000604051905090565b600067ffffffffffffffff821115612ac657612ac5612db1565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612af257612af1612db1565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612b1e57612b1d612db1565b5b612b2782612de0565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612bbb82612c98565b9150612bc683612c98565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612bfb57612bfa612d82565b5b828201905092915050565b6000612c1182612c98565b9150612c1c83612c98565b925082821015612c2f57612c2e612d82565b5b828203905092915050565b6000612c4582612c78565b9050919050565b6000612c5782612c78565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612cad82612c6a565b9050919050565b6000612cbf82612c98565b9050919050565b82818337600083830152505050565b60005b83811015612cf3578082015181840152602081019050612cd8565b83811115612d02576000848401525b50505050565b612d1182612de0565b810181811067ffffffffffffffff82111715612d3057612d2f612db1565b5b80604052505050565b6000612d4482612c98565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d7757612d76612d82565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4e4f545f57455448000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b50565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b612f6581612c3a565b8114612f7057600080fd5b50565b612f7c81612c4c565b8114612f8757600080fd5b50565b612f9381612c5e565b8114612f9e57600080fd5b50565b612faa81612c98565b8114612fb557600080fd5b5056fea264697066735822122048591e3e1f2e49ebc86bdc3ab88d2b04eed19bc05ddd788004a5f7dfc88b029364736f6c63430008010033