Contract Address Details

0x56d0Ae52f33f7C2e38E92F6D20b8ccfD7Dc318Ce

Contract Name
UbeswapMoolaRouter
Creator
0x4a27c0–5f6ee3 at 0xc38f28–fe505c
Balance
0 CELO
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
10114161
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
UbeswapMoolaRouter




Optimization enabled
true
Compiler version
v0.8.3+commit.8d00100c




Optimization runs
999999
EVM Version
istanbul




Verified at
2021-07-30 14:49:10.495401Z

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "./UbeswapMoolaRouterBase.sol";
/// @notice Router for allowing conversion to/from Moola before swapping.
contract UbeswapMoolaRouter is UbeswapMoolaRouterBase, Ownable {
using SafeERC20 for IERC20;
/// @notice Emitted when tokens that were stuck in the router contract were recovered
event Recovered(address indexed token, uint256 amount);
/// @notice Referral code for the default Moola router
uint16 public constant MOOLA_ROUTER_REFERRAL_CODE = 0x0420;
constructor(address router_, address owner_)
UbeswapMoolaRouterBase(router_, MOOLA_ROUTER_REFERRAL_CODE)
{
transferOwnership(owner_);
}
/// @notice Added to support recovering tokens stuck in the contract
/// This is to ensure that tokens can't get lost
function recoverERC20(address tokenAddress, uint256 tokenAmount)
external
onlyOwner
{
IERC20(tokenAddress).safeTransfer(msg.sender, tokenAmount);
emit Recovered(tokenAddress, tokenAmount);
}
}

Context.sol

// 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;
}
}

Address.sol

// 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);
}
}
}
}

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");
}
}
}

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);
}

ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
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 make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}

Ownable.sol

// 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;
}
}

UbeswapMoolaRouterLibrary.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "../interfaces/IUbeswapRouter.sol";
import "../interfaces/IMoola.sol";
import "../lending/MoolaLibrary.sol";
/// @notice Library for computing various router functions
library UbeswapMoolaRouterLibrary {
/// @notice Plan for executing a swap on the router.
struct SwapPlan {
address reserveIn;
address reserveOut;
bool depositIn;
bool depositOut;
address[] nextPath;
}
/// @notice Computes the swap that will take place based on the path
function computeSwap(ILendingPoolCore _core, address[] calldata _path)
internal
view
returns (SwapPlan memory _plan)
{
uint256 startIndex;
uint256 endIndex = _path.length;
// cAsset -> mcAsset (deposit)
if (
_core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_path[0])
) == _path[1]
) {
_plan.reserveIn = _path[0];
_plan.depositIn = true;
startIndex += 1;
}
// mcAsset -> cAsset (withdraw)
else if (
_path[0] ==
_core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_path[1])
)
) {
_plan.reserveIn = _path[1];
_plan.depositIn = false;
startIndex += 1;
}
// only handle out path swap if the path is long enough
if (
_path.length >= 3 &&
// if we already did a conversion and path length is 3, skip.
!(_path.length == 3 && startIndex > 0)
) {
// cAsset -> mcAsset (deposit)
if (
_core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_path[_path.length - 2])
) == _path[_path.length - 1]
) {
_plan.reserveOut = _path[_path.length - 2];
_plan.depositOut = true;
endIndex -= 1;
}
// mcAsset -> cAsset (withdraw)
else if (
_path[_path.length - 2] ==
_core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_path[_path.length - 1])
)
) {
_plan.reserveOut = _path[_path.length - 1];
endIndex -= 1;
// not needed
// _depositOut = false;
}
}
_plan.nextPath = _path[startIndex:endIndex];
}
/// @notice Computes the amounts given the amounts returned by the router
function computeAmountsFromRouterAmounts(
uint256[] memory _routerAmounts,
address _reserveIn,
address _reserveOut
) internal pure returns (uint256[] memory amounts) {
uint256 startOffset = _reserveIn != address(0) ? 1 : 0;
uint256 endOffset = _reserveOut != address(0) ? 1 : 0;
uint256 length = _routerAmounts.length + startOffset + endOffset;
amounts = new uint256[](length);
if (startOffset > 0) {
amounts[0] = _routerAmounts[0];
}
if (endOffset > 0) {
amounts[length - 1] = _routerAmounts[_routerAmounts.length - 1];
}
for (uint256 i = 0; i < _routerAmounts.length; i++) {
amounts[i + startOffset] = _routerAmounts[i];
}
}
function getAmountsOut(
ILendingPoolCore core,
IUbeswapRouter router,
uint256 amountIn,
address[] calldata path
) internal view returns (uint256[] memory amounts) {
SwapPlan memory plan = computeSwap(core, path);
amounts = computeAmountsFromRouterAmounts(
router.getAmountsOut(amountIn, plan.nextPath),
plan.reserveIn,
plan.reserveOut
);
}
function getAmountsIn(
ILendingPoolCore core,
IUbeswapRouter router,
uint256 amountOut,
address[] calldata path
) internal view returns (uint256[] memory amounts) {
SwapPlan memory plan = computeSwap(core, path);
amounts = computeAmountsFromRouterAmounts(
router.getAmountsIn(amountOut, plan.nextPath),
plan.reserveIn,
plan.reserveOut
);
}
}

UbeswapMoolaRouterBase.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "../lending/LendingPoolWrapper.sol";
import "../interfaces/IUbeswapRouter.sol";
import "./UbeswapMoolaRouterLibrary.sol";
/**
* Router for allowing conversion to/from Moola before swapping.
*/
abstract contract UbeswapMoolaRouterBase is LendingPoolWrapper, IUbeswapRouter {
using SafeERC20 for IERC20;
/// @notice Ubeswap router
IUbeswapRouter public immutable router;
/// @notice Emitted when tokens are swapped
event TokensSwapped(
address indexed account,
address[] indexed path,
address indexed to,
uint256 amountIn,
uint256 amountOut
);
constructor(address router_, uint16 moolaReferralCode_)
LendingPoolWrapper(moolaReferralCode_)
{
router = IUbeswapRouter(router_);
}
function _initSwap(
address[] calldata _path,
uint256 _inAmount,
uint256 _outAmount
) internal returns (UbeswapMoolaRouterLibrary.SwapPlan memory _plan) {
_plan = UbeswapMoolaRouterLibrary.computeSwap(core, _path);
// if we have a path, approve the router to be able to trade
if (_plan.nextPath.length > 0) {
// if out amount is specified, compute the in amount from it
if (_outAmount != 0) {
_inAmount = router.getAmountsIn(_outAmount, _plan.nextPath)[0];
}
IERC20(_plan.nextPath[0]).safeApprove(address(router), _inAmount);
}
// Handle pulling the initial amount from the contract caller
IERC20(_path[0]).safeTransferFrom(msg.sender, address(this), _inAmount);
// If in reserve is specified, we must convert
if (_plan.reserveIn != address(0)) {
_convert(
_plan.reserveIn,
_inAmount,
_plan.depositIn,
Reason.CONVERT_IN
);
}
}
/// @dev Ensures that the ERC20 token balances of this contract before and after
/// the swap are equal
/// TODO(igm): remove this once we get an audit
/// This should NEVER get triggered, but it's better to be safe than sorry
modifier balanceUnchanged(address[] calldata _path, address _to) {
// Populate initial balances for comparison later
uint256[] memory _initialBalances = new uint256[](_path.length);
for (uint256 i = 0; i < _path.length; i++) {
_initialBalances[i] = IERC20(_path[i]).balanceOf(address(this));
}
_;
for (uint256 i = 0; i < _path.length - 1; i++) {
uint256 newBalance = IERC20(_path[i]).balanceOf(address(this));
require(
// if triangular arb, ignore
_path[i] == _path[0] ||
_path[i] == _path[_path.length - 1] ||
// ensure tokens balances haven't changed
newBalance == _initialBalances[i],
"UbeswapMoolaRouter: tokens left over after swap"
);
}
// sends the final tokens to `_to` address
address lastAddress = _path[_path.length - 1];
IERC20(lastAddress).safeTransfer(
_to,
// subtract the initial balance from this token
IERC20(lastAddress).balanceOf(address(this)) -
_initialBalances[_initialBalances.length - 1]
);
}
/// @dev Handles the swap after the plan is executed
function _swapConvertOut(
UbeswapMoolaRouterLibrary.SwapPlan memory _plan,
uint256[] memory _routerAmounts,
address[] calldata _path,
address _to
) internal returns (uint256[] memory amounts) {
amounts = UbeswapMoolaRouterLibrary.computeAmountsFromRouterAmounts(
_routerAmounts,
_plan.reserveIn,
_plan.reserveOut
);
if (_plan.reserveOut != address(0)) {
_convert(
_plan.reserveOut,
amounts[amounts.length - 1],
_plan.depositOut,
Reason.CONVERT_OUT
);
}
emit TokensSwapped(
msg.sender,
_path,
_to,
amounts[0],
amounts[amounts.length - 1]
);
}
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
)
external
override
balanceUnchanged(path, to)
returns (uint256[] memory amounts)
{
UbeswapMoolaRouterLibrary.SwapPlan memory plan =
_initSwap(path, amountIn, 0);
if (plan.nextPath.length > 0) {
amounts = router.swapExactTokensForTokens(
amountIn,
amountOutMin,
plan.nextPath,
address(this),
deadline
);
}
amounts = _swapConvertOut(plan, amounts, path, to);
}
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
)
external
override
balanceUnchanged(path, to)
returns (uint256[] memory amounts)
{
UbeswapMoolaRouterLibrary.SwapPlan memory plan =
_initSwap(path, 0, amountOut);
if (plan.nextPath.length > 0) {
amounts = router.swapTokensForExactTokens(
amountOut,
amountInMax,
plan.nextPath,
address(this),
deadline
);
}
amounts = _swapConvertOut(plan, amounts, path, to);
}
function getAmountsOut(uint256 _amountIn, address[] calldata _path)
external
view
override
returns (uint256[] memory)
{
return
UbeswapMoolaRouterLibrary.getAmountsOut(
core,
router,
_amountIn,
_path
);
}
function getAmountsIn(uint256 _amountOut, address[] calldata _path)
external
view
override
returns (uint256[] memory)
{
return
UbeswapMoolaRouterLibrary.getAmountsIn(
core,
router,
_amountOut,
_path
);
}
function computeSwap(address[] calldata _path)
external
view
returns (UbeswapMoolaRouterLibrary.SwapPlan memory)
{
return UbeswapMoolaRouterLibrary.computeSwap(core, _path);
}
function computeAmountsFromRouterAmounts(
uint256[] memory _routerAmounts,
address _reserveIn,
address _reserveOut
) external pure returns (uint256[] memory) {
return
UbeswapMoolaRouterLibrary.computeAmountsFromRouterAmounts(
_routerAmounts,
_reserveIn,
_reserveOut
);
}
}

MoolaLibrary.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "openzeppelin-solidity/contracts/token/ERC20/utils/SafeERC20.sol";
interface IRegistry {
function getAddressForOrDie(bytes32) external view returns (address);
}
/**
* Library for interacting with Moola.
*/
library MoolaLibrary {
/// @dev Mock CELO address to represent raw CELO tokens
address internal constant CELO_MAGIC_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
/// @dev Address of the Celo registry
address internal constant CELO_REGISTRY =
0x000000000000000000000000000000000000ce10;
bytes32 internal constant GOLD_TOKEN_REGISTRY_ID =
keccak256(abi.encodePacked("GoldToken"));
/// @notice Gets the address of CGLD
function getGoldToken() internal view returns (address) {
if (block.chainid == 31337) {
// deployed via create2 in tests
return
IRegistry(0xCde5a0dC96d0ecEaee6fFfA84a6d9a6343f2c8E2)
.getAddressForOrDie(GOLD_TOKEN_REGISTRY_ID);
}
return
IRegistry(CELO_REGISTRY).getAddressForOrDie(GOLD_TOKEN_REGISTRY_ID);
}
/// @notice Gets the token that Moola requests, supporting the gold token.
function getMoolaReserveToken(address _reserve)
internal
view
returns (address)
{
if (_reserve == getGoldToken()) {
_reserve = CELO_MAGIC_ADDRESS;
}
return _reserve;
}
}

LendingPoolWrapper.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "openzeppelin-solidity/contracts/security/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/token/ERC20/utils/SafeERC20.sol";
import "../interfaces/ILendingPoolWrapper.sol";
import "../interfaces/IMoola.sol";
import "./MoolaLibrary.sol";
interface IWrappedTestingGold {
function unwrapTestingOnly(uint256 _amount) external;
function wrap() external payable;
}
/**
* @notice Wrapper to deposit and withdraw into a lending pool.
*/
contract LendingPoolWrapper is ILendingPoolWrapper, ReentrancyGuard {
using SafeERC20 for IERC20;
/// @notice Lending pool
ILendingPool public pool;
/// @notice Lending core
ILendingPoolCore public core;
/// @notice Referral code to allow tracking Moola volume originating from Ubeswap.
uint16 public immutable moolaReferralCode;
/// @notice Celo Gold token
address public immutable goldToken = MoolaLibrary.getGoldToken();
constructor(uint16 moolaReferralCode_) {
moolaReferralCode = moolaReferralCode_;
}
/// @notice initializes the pool (only used for deployment)
function initialize(address _pool, address _core) external {
require(
address(pool) == address(0),
"LendingPoolWrapper: pool already set"
);
require(
address(core) == address(0),
"LendingPoolWrapper: core already set"
);
pool = ILendingPool(_pool);
core = ILendingPoolCore(_core);
}
function deposit(address _reserve, uint256 _amount) external override {
IERC20(_reserve).safeTransferFrom(msg.sender, address(this), _amount);
_convert(_reserve, _amount, true, Reason.DIRECT);
IERC20(
core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_reserve)
)
)
.safeTransfer(msg.sender, _amount);
}
function withdraw(address _reserve, uint256 _amount) external override {
IERC20(
core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_reserve)
)
)
.safeTransferFrom(msg.sender, address(this), _amount);
_convert(_reserve, _amount, false, Reason.DIRECT);
IERC20(_reserve).safeTransfer(msg.sender, _amount);
}
/**
* @notice Converts tokens to/from their Moola representation.
* @param _reserve The token to deposit or withdraw.
* @param _amount The total amount of tokens to deposit or withdraw.
* @param _deposit If true, deposit the token for aTokens. Otherwise, withdraw aTokens to tokens.
* @param _reason Reason for why the conversion happened.
*/
function _convert(
address _reserve,
uint256 _amount,
bool _deposit,
Reason _reason
) internal nonReentrant {
if (_deposit) {
if (
MoolaLibrary.getMoolaReserveToken(_reserve) ==
MoolaLibrary.CELO_MAGIC_ADDRESS
) {
// hardhat -- doesn't have celo erc20 so we need to handle it differently
if (block.chainid == 31337) {
IWrappedTestingGold(goldToken).unwrapTestingOnly(_amount);
}
pool.deposit{value: _amount}(
MoolaLibrary.CELO_MAGIC_ADDRESS,
_amount,
moolaReferralCode
);
} else {
IERC20(_reserve).safeApprove(address(core), _amount);
pool.deposit(_reserve, _amount, moolaReferralCode);
}
emit Deposited(_reserve, msg.sender, _reason, _amount);
} else {
IAToken(
core.getReserveATokenAddress(
MoolaLibrary.getMoolaReserveToken(_reserve)
)
)
.redeem(_amount);
emit Withdrawn(_reserve, msg.sender, _reason, _amount);
}
}
/// @notice This is used to receive CELO direct payments
receive() external payable {
// mock gold token can send tokens here on Hardhat
if (block.chainid == 31337 && msg.sender == address(goldToken)) {
return;
}
require(
msg.sender == address(core),
"LendingPoolWrapper: Must be LendingPoolCore to send CELO"
);
// if hardhat, wrap the token so we can send it back to the user
if (block.chainid == 31337) {
IWrappedTestingGold(goldToken).wrap{value: msg.value}();
}
}
}

IUbeswapRouter.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
/// @notice Swaps tokens
interface IUbeswapRouter {
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function getAmountsOut(uint256 amountIn, address[] memory path)
external
view
returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] memory path)
external
view
returns (uint256[] memory amounts);
}

IMoola.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
// Interfaces in this file come from Moola.
interface IAToken {
function redeem(uint256 _amount) external;
}
interface ILendingPoolCore {
function getReserveATokenAddress(address _reserve)
external
view
returns (address);
}
interface ILendingPool {
function deposit(
address _reserve,
uint256 _amount,
uint16 _referralCode
) external payable;
}

ILendingPoolWrapper.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
/// @notice Wraps the Moola lending pool
interface ILendingPoolWrapper {
enum Reason {DIRECT, CONVERT_IN, CONVERT_OUT}
event Deposited(
address indexed reserve,
address indexed account,
Reason indexed reason,
uint256 amount
);
event Withdrawn(
address indexed reserve,
address indexed account,
Reason indexed reason,
uint256 amount
);
/**
* @notice Deposits tokens into the lending pool.
* @param _reserve The token to deposit.
* @param _amount The total amount of tokens to deposit.
*/
function deposit(address _reserve, uint256 _amount) external;
/**
* @notice Withdraws tokens from the lending pool.
* @param _reserve The token to withdraw.
* @param _amount The total amount of tokens to withdraw.
*/
function withdraw(address _reserve, uint256 _amount) external;
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"router_","internalType":"address"},{"type":"address","name":"owner_","internalType":"address"}]},{"type":"event","name":"Deposited","inputs":[{"type":"address","name":"reserve","internalType":"address","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint8","name":"reason","internalType":"enum ILendingPoolWrapper.Reason","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"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":"event","name":"Recovered","inputs":[{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokensSwapped","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address[]","name":"path","internalType":"address[]","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amountIn","internalType":"uint256","indexed":false},{"type":"uint256","name":"amountOut","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdrawn","inputs":[{"type":"address","name":"reserve","internalType":"address","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint8","name":"reason","internalType":"enum ILendingPoolWrapper.Reason","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"","internalType":"uint16"}],"name":"MOOLA_ROUTER_REFERRAL_CODE","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"computeAmountsFromRouterAmounts","inputs":[{"type":"uint256[]","name":"_routerAmounts","internalType":"uint256[]"},{"type":"address","name":"_reserveIn","internalType":"address"},{"type":"address","name":"_reserveOut","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct UbeswapMoolaRouterLibrary.SwapPlan","components":[{"type":"address","name":"reserveIn","internalType":"address"},{"type":"address","name":"reserveOut","internalType":"address"},{"type":"bool","name":"depositIn","internalType":"bool"},{"type":"bool","name":"depositOut","internalType":"bool"},{"type":"address[]","name":"nextPath","internalType":"address[]"}]}],"name":"computeSwap","inputs":[{"type":"address[]","name":"_path","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ILendingPoolCore"}],"name":"core","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"address","name":"_reserve","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getAmountsIn","inputs":[{"type":"uint256","name":"_amountOut","internalType":"uint256"},{"type":"address[]","name":"_path","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getAmountsOut","inputs":[{"type":"uint256","name":"_amountIn","internalType":"uint256"},{"type":"address[]","name":"_path","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"goldToken","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_pool","internalType":"address"},{"type":"address","name":"_core","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"","internalType":"uint16"}],"name":"moolaReferralCode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ILendingPool"}],"name":"pool","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"tokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IUbeswapRouter"}],"name":"router","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactTokensForTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapTokensForExactTokens","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"address","name":"_reserve","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"receive","stateMutability":"payable"}]
            

Deployed ByteCode

0x6080604052600436106101485760003560e01c80638803dbee116100c0578063e02f7d1a11610074578063f2fde38b11610059578063f2fde38b14610555578063f3fef3a314610575578063f887ea4014610595576102d7565b8063e02f7d1a14610512578063f2f4eb2614610528576102d7565b80638da5cb5b116100a55780638da5cb5b146104a957806394002b57146104be578063d06ca61f146104f2576102d7565b80638803dbee146104695780638980f11f14610489576102d7565b806347e7ef2411610117578063715018a6116100fc578063715018a6146104075780637574bb7c1461041c578063809d877214610449576102d7565b806347e7ef24146103c7578063485cc955146103e7576102d7565b806316f0115b146102dc5780631f00ca7414610333578063241e60061461036057806338ed1739146103a7576102d7565b366102d75746617a6914801561019357503373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000471ece3750da237f93b8e339c536989b8978a43816145b1561019d576102d5565b60025473ffffffffffffffffffffffffffffffffffffffff163314610249576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c656e64696e67506f6f6c577261707065723a204d757374206265204c656e6460448201527f696e67506f6f6c436f726520746f2073656e642043454c4f000000000000000060648201526084015b60405180910390fd5b46617a6914156102d5577f000000000000000000000000471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663d46eb119346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156102bb57600080fd5b505af11580156102cf573d6000803e3d6000fd5b50505050505b005b600080fd5b3480156102e857600080fd5b506001546103099073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561033f57600080fd5b5061035361034e366004613cc7565b6105c9565b60405161032a9190613e3d565b34801561036c57600080fd5b506103947f000000000000000000000000000000000000000000000000000000000000042081565b60405161ffff909116815260200161032a565b3480156103b357600080fd5b506103536103c2366004613d11565b61061c565b3480156103d357600080fd5b506102d56103e2366004613ad7565b610e00565b3480156103f357600080fd5b506102d5610402366004613a9f565b610f1c565b34801561041357600080fd5b506102d56110b9565b34801561042857600080fd5b5061043c610437366004613b02565b6111ae565b60405161032a9190613ed2565b34801561045557600080fd5b50610353610464366004613bda565b6111ff565b34801561047557600080fd5b50610353610484366004613d11565b61120c565b34801561049557600080fd5b506102d56104a4366004613ad7565b61186a565b3480156104b557600080fd5b50610309611965565b3480156104ca57600080fd5b506103097f000000000000000000000000471ece3750da237f93b8e339c536989b8978a43881565b3480156104fe57600080fd5b5061035361050d366004613cc7565b611982565b34801561051e57600080fd5b5061039461042081565b34801561053457600080fd5b506002546103099073ffffffffffffffffffffffffffffffffffffffff1681565b34801561056157600080fd5b506102d5610570366004613a67565b6119cb565b34801561058157600080fd5b506102d5610590366004613ad7565b611b82565b3480156105a157600080fd5b506103097f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f9612181565b6002546060906106129073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f96121868686611e39565b90505b9392505050565b606084848460008267ffffffffffffffff811115610663577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561068c578160200160208202803683370190505b50905060005b838110156107dd578484828181106106d3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906106e89190613a67565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a082319060240160206040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190613caf565b8282815181106107c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020908102919091010152806107d58161408f565b915050610692565b5060006107ed8a8a8e6000611f2f565b608081015151909150156108d7577f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398d8d8460800151308c6040518663ffffffff1660e01b8152600401610860959493929190613f4c565b600060405180830381600087803b15801561087a57600080fd5b505af115801561088e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526108d49190810190613b42565b95505b6108e481878c8c8c6121e0565b95505060005b6108f560018561404c565b811015610c7a576000858583818110610937577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061094c9190613a67565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a082319060240160206040518083038186803b1580156109b357600080fd5b505afa1580156109c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109eb9190613caf565b905085856000818110610a27577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610a3c9190613a67565b73ffffffffffffffffffffffffffffffffffffffff16868684818110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610aa09190613a67565b73ffffffffffffffffffffffffffffffffffffffff161480610b9157508585610aca60018261404c565b818110610b00577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610b159190613a67565b73ffffffffffffffffffffffffffffffffffffffff16868684818110610b64577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610b799190613a67565b73ffffffffffffffffffffffffffffffffffffffff16145b80610bdb5750828281518110610bd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015181145b610c67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f556265737761704d6f6f6c61526f757465723a20746f6b656e73206c6566742060448201527f6f766572206166746572207377617000000000000000000000000000000000006064820152608401610240565b5080610c728161408f565b9150506108ea565b5060008484610c8a60018261404c565b818110610cc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610cd59190613a67565b9050610df1838360018551610cea919061404c565b81518110610d21577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8516906370a082319060240160206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc99190613caf565b610dd3919061404c565b73ffffffffffffffffffffffffffffffffffffffff84169190612399565b50505050509695505050505050565b610e2273ffffffffffffffffffffffffffffffffffffffff8316333084612472565b610e308282600160006124d6565b600254610f18903390839073ffffffffffffffffffffffffffffffffffffffff166334b3beee610e5f87612a2c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b158015610ec357600080fd5b505afa158015610ed7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efb9190613a83565b73ffffffffffffffffffffffffffffffffffffffff169190612399565b5050565b60015473ffffffffffffffffffffffffffffffffffffffff1615610fc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4c656e64696e67506f6f6c577261707065723a20706f6f6c20616c726561647960448201527f20736574000000000000000000000000000000000000000000000000000000006064820152608401610240565b60025473ffffffffffffffffffffffffffffffffffffffff1615611066576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4c656e64696e67506f6f6c577261707065723a20636f726520616c726561647960448201527f20736574000000000000000000000000000000000000000000000000000000006064820152608401610240565b6001805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560028054929093169116179055565b336110c2611965565b73ffffffffffffffffffffffffffffffffffffffff161461113f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610240565b60035460405160009173ffffffffffffffffffffffffffffffffffffffff16907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6040805160a08101825260008082526020820181905291810182905260608082019290925260808101919091526002546106159073ffffffffffffffffffffffffffffffffffffffff168484612a89565b60606106128484846132fc565b606084848460008267ffffffffffffffff811115611253577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561127c578160200160208202803683370190505b50905060005b838110156113cd578484828181106112c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112d89190613a67565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a082319060240160206040518083038186803b15801561133f57600080fd5b505afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113779190613caf565b8282815181106113b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020908102919091010152806113c58161408f565b915050611282565b5060006113dd8a8a60008f611f2f565b608081015151909150156114c7577f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff16638803dbee8d8d8460800151308c6040518663ffffffff1660e01b8152600401611450959493929190613f4c565b600060405180830381600087803b15801561146a57600080fd5b505af115801561147e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526114c49190810190613b42565b95505b6114d481878c8c8c6121e0565b95505060005b6114e560018561404c565b811015610c7a576000858583818110611527577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061153c9190613a67565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a082319060240160206040518083038186803b1580156115a357600080fd5b505afa1580156115b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115db9190613caf565b905085856000818110611617577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061162c9190613a67565b73ffffffffffffffffffffffffffffffffffffffff1686868481811061167b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906116909190613a67565b73ffffffffffffffffffffffffffffffffffffffff161480611781575085856116ba60018261404c565b8181106116f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906117059190613a67565b73ffffffffffffffffffffffffffffffffffffffff16868684818110611754577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906117699190613a67565b73ffffffffffffffffffffffffffffffffffffffff16145b806117cb57508282815181106117c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015181145b611857576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f556265737761704d6f6f6c61526f757465723a20746f6b656e73206c6566742060448201527f6f766572206166746572207377617000000000000000000000000000000000006064820152608401610240565b50806118628161408f565b9150506114da565b33611873611965565b73ffffffffffffffffffffffffffffffffffffffff16146118f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610240565b61191173ffffffffffffffffffffffffffffffffffffffff83163383612399565b8173ffffffffffffffffffffffffffffffffffffffff167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288260405161195991815260200190565b60405180910390a25050565b60035473ffffffffffffffffffffffffffffffffffffffff165b90565b6002546060906106129073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f961218686866135cc565b336119d4611965565b73ffffffffffffffffffffffffffffffffffffffff1614611a51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610240565b73ffffffffffffffffffffffffffffffffffffffff8116611af4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610240565b60035460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600254611c6d9033903090849073ffffffffffffffffffffffffffffffffffffffff166334b3beee611bb388612a2c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b158015611c1757600080fd5b505afa158015611c2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4f9190613a83565b73ffffffffffffffffffffffffffffffffffffffff16929190612472565b611c7a82826000806124d6565b610f1873ffffffffffffffffffffffffffffffffffffffff83163383612399565b600046617a691415611d7a576040517f476f6c64546f6b656e0000000000000000000000000000000000000000000000602082015273cde5a0dc96d0eceaee6fffa84a6d9a6343f2c8e29063dcf0aaed90602901604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611d2391815260200190565b60206040518083038186803b158015611d3b57600080fd5b505afa158015611d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d739190613a83565b905061197f565b6040517f476f6c64546f6b656e0000000000000000000000000000000000000000000000602082015261ce109063dcf0aaed90602901604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611de491815260200190565b60206040518083038186803b158015611dfc57600080fd5b505afa158015611e10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e349190613a83565b905090565b60606000611e48878585612a89565b60808101516040517f1f00ca74000000000000000000000000000000000000000000000000000000008152919250611f249173ffffffffffffffffffffffffffffffffffffffff891691631f00ca7491611ea6918a91600401613f33565b60006040518083038186803b158015611ebe57600080fd5b505afa158015611ed2573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611f189190810190613b42565b825160208401516132fc565b979650505050505050565b6040805160a0810182526000808252602082018190529181018290526060808201929092526080810191909152600254611f809073ffffffffffffffffffffffffffffffffffffffff168686612a89565b608081015151909150156121515781156120c15760808101516040517f1f00ca7400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f961211691631f00ca749161200b918691600401613f33565b60006040518083038186803b15801561202357600080fd5b505afa158015612037573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261207d9190810190613b42565b6000815181106120b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015192505b6121517f000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f96121848360800151600081518110612124577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166136399092919063ffffffff16565b6121a633308588886000818110612191577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611c4f9190613a67565b805173ffffffffffffffffffffffffffffffffffffffff16156121d8576121d8816000015184836040015160016124d6565b949350505050565b60606121f585876000015188602001516132fc565b602087015190915073ffffffffffffffffffffffffffffffffffffffff161561227a5761227a8660200151826001845161222f919061404c565b81518110612266577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151886060015160026124d6565b8173ffffffffffffffffffffffffffffffffffffffff1684846040516122a1929190613dd2565b60405180910390203373ffffffffffffffffffffffffffffffffffffffff167f04b3119c7a3ee7004ce67e131cc44caf400a354bd8c1f9ef0a1b0e630e11c9b98460008151811061231b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518560018751612332919061404c565b81518110612369577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151604051612388929190918252602082015260400190565b60405180910390a495945050505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261246d9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526137ca565b505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526124d09085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016123eb565b50505050565b60026000541415612543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610240565b6002600055811561286b5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61256c85612a2c565b73ffffffffffffffffffffffffffffffffffffffff1614156127025746617a691415612633576040517fcb6117a9000000000000000000000000000000000000000000000000000000008152600481018490527f000000000000000000000000471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff169063cb6117a990602401600060405180830381600087803b15801561261a57600080fd5b505af115801561262e573d6000803e3d6000fd5b505050505b6001546040517fd2d0e06600000000000000000000000000000000000000000000000000000000815273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee60048201526024810185905261ffff7f000000000000000000000000000000000000000000000000000000000000042016604482015273ffffffffffffffffffffffffffffffffffffffff9091169063d2d0e0669085906064016000604051808303818588803b1580156126e457600080fd5b505af11580156126f8573d6000803e3d6000fd5b50505050506127e0565b6002546127299073ffffffffffffffffffffffffffffffffffffffff868116911685613639565b6001546040517fd2d0e06600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820186905261ffff7f00000000000000000000000000000000000000000000000000000000000004201660448301529091169063d2d0e06690606401600060405180830381600087803b1580156127c757600080fd5b505af11580156127db573d6000803e3d6000fd5b505050505b806002811115612819577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b604051848152339073ffffffffffffffffffffffffffffffffffffffff8716907fa2deda57a8a9061bddc1027447650c7fe8c083de66b011362866e2549e3355eb9060200160405180910390a4612a21565b60025473ffffffffffffffffffffffffffffffffffffffff166334b3beee61289286612a2c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b1580156128f657600080fd5b505afa15801561290a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061292e9190613a83565b73ffffffffffffffffffffffffffffffffffffffff1663db006a75846040518263ffffffff1660e01b815260040161296891815260200190565b600060405180830381600087803b15801561298257600080fd5b505af1158015612996573d6000803e3d6000fd5b505050508060028111156129d3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b604051848152339073ffffffffffffffffffffffffffffffffffffffff8716907f64ce55deefd7ff36f31fd31f72ebc3a95f6db721a6d39ca12ce5269f4b8811949060200160405180910390a45b505060016000555050565b6000612a36611c9b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a815773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee91505b50805b919050565b6040805160a08101825260008082526020820181905291810182905260608082018390526080820152908284816001818110612aee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190612b039190613a67565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff166334b3beee612b8c88886000818110612b72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190612b879190613a67565b612a2c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b158015612bf057600080fd5b505afa158015612c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c289190613a83565b73ffffffffffffffffffffffffffffffffffffffff161415612cc55784846000818110612c7e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190612c939190613a67565b73ffffffffffffffffffffffffffffffffffffffff168352600160408401819052612cbe9083614034565b9150612eb7565b8573ffffffffffffffffffffffffffffffffffffffff166334b3beee612d1e87876001818110612b72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b158015612d8257600080fd5b505afa158015612d96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dba9190613a83565b73ffffffffffffffffffffffffffffffffffffffff1685856000818110612e0a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190612e1f9190613a67565b73ffffffffffffffffffffffffffffffffffffffff161415612eb75784846001818110612e75577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190612e8a9190613a67565b73ffffffffffffffffffffffffffffffffffffffff16835260006040840152612eb4600183614034565b91505b60038410801590612ed55750600384148015612ed35750600082115b155b156132b0578484612ee760018261404c565b818110612f1d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190612f329190613a67565b73ffffffffffffffffffffffffffffffffffffffff9081169087166334b3beee612f988888612f6260028261404c565b818110612b72577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b158015612ffc57600080fd5b505afa158015613010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130349190613a83565b73ffffffffffffffffffffffffffffffffffffffff1614156130dd57848461305d60028261404c565b818110613093577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906130a89190613a67565b73ffffffffffffffffffffffffffffffffffffffff1660208401526001606084018190526130d6908261404c565b90506132b0565b73ffffffffffffffffffffffffffffffffffffffff86166334b3beee6131098787612f6260018261404c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240160206040518083038186803b15801561316d57600080fd5b505afa158015613181573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a59190613a83565b73ffffffffffffffffffffffffffffffffffffffff1685856131c860028261404c565b8181106131fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906132139190613a67565b73ffffffffffffffffffffffffffffffffffffffff1614156132b057848461323c60018261404c565b818110613272577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906132879190613a67565b73ffffffffffffffffffffffffffffffffffffffff1660208401526132ad60018261404c565b90505b6132bc81838688614008565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060808401525090949350505050565b6060600073ffffffffffffffffffffffffffffffffffffffff8416613322576000613325565b60015b60ff169050600073ffffffffffffffffffffffffffffffffffffffff841661334e576000613351565b60015b60ff1690506000818388516133669190614034565b6133709190614034565b90508067ffffffffffffffff8111156133b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156133db578160200160208202803683370190505b509350821561346d578660008151811061341e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015184600081518110613460577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250505b8115613513578660018851613482919061404c565b815181106134b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151846001836134cf919061404c565b81518110613506577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250505b60005b87518110156135c157878181518110613558577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015185858361356d9190614034565b815181106135a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020908102919091010152806135b98161408f565b915050613516565b505050509392505050565b606060006135db878585612a89565b60808101516040517fd06ca61f000000000000000000000000000000000000000000000000000000008152919250611f249173ffffffffffffffffffffffffffffffffffffffff89169163d06ca61f91611ea6918a91600401613f33565b8015806136e857506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156136ae57600080fd5b505afa1580156136c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136e69190613caf565b155b613774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610240565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261246d9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064016123eb565b600061382c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166138d69092919063ffffffff16565b80519091501561246d578080602001905181019061384a9190613c8f565b61246d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610240565b6060610612848460008585843b613949576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610240565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516139729190613e21565b60006040518083038185875af1925050503d80600081146139af576040519150601f19603f3d011682016040523d82523d6000602084013e6139b4565b606091505b5091509150611f24828286606083156139ce575081610615565b8251156139de5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102409190613e81565b8035612a8481614126565b60008083601f840112613a2e578182fd5b50813567ffffffffffffffff811115613a45578182fd5b6020830191508360208260051b8501011115613a6057600080fd5b9250929050565b600060208284031215613a78578081fd5b813561061581614126565b600060208284031215613a94578081fd5b815161061581614126565b60008060408385031215613ab1578081fd5b8235613abc81614126565b91506020830135613acc81614126565b809150509250929050565b60008060408385031215613ae9578182fd5b8235613af481614126565b946020939093013593505050565b60008060208385031215613b14578182fd5b823567ffffffffffffffff811115613b2a578283fd5b613b3685828601613a1d565b90969095509350505050565b60006020808385031215613b54578182fd5b825167ffffffffffffffff811115613b6a578283fd5b8301601f81018513613b7a578283fd5b8051613b8d613b8882613fe4565b613f95565b80828252848201915084840188868560051b8701011115613bac578687fd5b8694505b83851015613bce578051835260019490940193918501918501613bb0565b50979650505050505050565b600080600060608486031215613bee578081fd5b833567ffffffffffffffff811115613c04578182fd5b8401601f81018613613c14578182fd5b80356020613c24613b8883613fe4565b8083825282820191508285018a848660051b8801011115613c43578687fd5b8695505b84861015613c65578035835260019590950194918301918301613c47565b509650613c759050878201613a12565b9450505050613c8660408501613a12565b90509250925092565b600060208284031215613ca0578081fd5b81518015158114610615578182fd5b600060208284031215613cc0578081fd5b5051919050565b600080600060408486031215613cdb578283fd5b83359250602084013567ffffffffffffffff811115613cf8578283fd5b613d0486828701613a1d565b9497909650939450505050565b60008060008060008060a08789031215613d29578182fd5b8635955060208701359450604087013567ffffffffffffffff811115613d4d578283fd5b613d5989828a01613a1d565b9095509350506060870135613d6d81614126565b80925050608087013590509295509295509295565b6000815180845260208085019450808401835b83811015613dc757815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101613d95565b509495945050505050565b60008184825b85811015613e16578135613deb81614126565b73ffffffffffffffffffffffffffffffffffffffff1683526020928301929190910190600101613dd8565b509095945050505050565b60008251613e33818460208701614063565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b81811015613e7557835183529284019291840191600101613e59565b50909695505050505050565b6000602082528251806020840152613ea0816040850160208701614063565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020825273ffffffffffffffffffffffffffffffffffffffff80845116602084015280602085015116604084015250604083015115156060830152606083015115156080830152608083015160a0808401526121d860c0840182613d82565b6000838252604060208301526106126040830184613d82565b600086825285602083015260a06040830152613f6b60a0830186613d82565b73ffffffffffffffffffffffffffffffffffffffff94909416606083015250608001529392505050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613fdc57613fdc6140f7565b604052919050565b600067ffffffffffffffff821115613ffe57613ffe6140f7565b5060051b60200190565b60008085851115614017578182fd5b83861115614023578182fd5b5050600583901b0193919092039150565b60008219821115614047576140476140c8565b500190565b60008282101561405e5761405e6140c8565b500390565b60005b8381101561407e578181015183820152602001614066565b838111156124d05750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156140c1576140c16140c8565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461414857600080fd5b5056fea2646970667358221220d377e67c554259c6f433b89047459a705346b64f90ba32b8889960bd33d077a864736f6c63430008030033