Source Code
Latest 25 from a total of 918 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Unstake And Remo... | 61056736 | 2 days ago | IN | 0 S | 0.0278394 | ||||
| Unstake And Remo... | 60984471 | 3 days ago | IN | 0 S | 0.02825097 | ||||
| Unstake And Remo... | 60984320 | 3 days ago | IN | 0 S | 0.30796452 | ||||
| Unstake And Remo... | 60984263 | 3 days ago | IN | 0 S | 0.49134701 | ||||
| Unstake And Remo... | 59653252 | 21 days ago | IN | 0 S | 0.48460857 | ||||
| Unstake And Remo... | 58992177 | 31 days ago | IN | 0 S | 0.02703035 | ||||
| Unstake And Remo... | 58504552 | 36 days ago | IN | 0 S | 0.56255395 | ||||
| Unstake And Remo... | 58063095 | 41 days ago | IN | 0 S | 0.84828381 | ||||
| Unstake And Remo... | 57921993 | 43 days ago | IN | 0 S | 0.53976242 | ||||
| Unstake And Remo... | 57921820 | 43 days ago | IN | 0 S | 0.5522837 | ||||
| Unstake And Remo... | 57419702 | 49 days ago | IN | 0 S | 0.02489569 | ||||
| Unstake And Remo... | 56841677 | 56 days ago | IN | 0 S | 0.02456704 | ||||
| Unstake And Remo... | 56841672 | 56 days ago | IN | 0 S | 0.02462281 | ||||
| Unstake And Remo... | 56841557 | 56 days ago | IN | 0 S | 0.02530411 | ||||
| Unstake And Remo... | 56841359 | 56 days ago | IN | 0 S | 0.02388173 | ||||
| Unstake And Remo... | 56507379 | 60 days ago | IN | 0 S | 0.02530405 | ||||
| Unstake And Remo... | 55705995 | 68 days ago | IN | 0 S | 0.02688774 | ||||
| Unstake And Remo... | 53999017 | 81 days ago | IN | 0 S | 0.02395349 | ||||
| Unstake And Remo... | 53312033 | 84 days ago | IN | 0 S | 0.02766555 | ||||
| Unstake And Remo... | 53237723 | 84 days ago | IN | 0 S | 0.29874493 | ||||
| Unstake And Remo... | 52781744 | 87 days ago | IN | 0 S | 0.02328039 | ||||
| Unstake And Remo... | 52403157 | 89 days ago | IN | 0 S | 0.30377336 | ||||
| Unstake And Remo... | 52401639 | 89 days ago | IN | 0 S | 0.0290733 | ||||
| Unstake And Remo... | 50992959 | 101 days ago | IN | 0 S | 0.0244806 | ||||
| Unstake And Remo... | 50657090 | 103 days ago | IN | 0 S | 0.02688972 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
IndexUtils
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 0 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol';
import '@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol';
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';
import './interfaces/IDecentralizedIndex.sol';
import './interfaces/IERC20Metadata.sol';
import './interfaces/IStakingPoolToken.sol';
import './interfaces/ITokenRewards.sol';
import './interfaces/IUniswapV2Factory.sol';
import './interfaces/IUniswapV3Pool.sol';
import './interfaces/IUniswapV2Router02.sol';
import './interfaces/IWETH.sol';
import './Zapper.sol';
contract IndexUtils is Context, Zapper {
using SafeERC20 for IERC20;
constructor(
address _v2Router,
address _v3Router,
IV3TwapUtilities _v3TwapUtilities
) Zapper(_v2Router, _v3TwapUtilities, _v3Router) {}
function bond(
IDecentralizedIndex _indexFund,
address _token,
uint256 _amount,
uint256 _amountMintMin
) external {
if (_indexFund.indexType() == IDecentralizedIndex.IndexType.WEIGHTED) {
IDecentralizedIndex.IndexAssetInfo[] memory _assets = _indexFund
.getAllAssets();
uint256[] memory _balsBefore = new uint256[](_assets.length);
uint256 _tokenCurSupply = IERC20(_token).balanceOf(address(_indexFund));
uint256 _tokenAmtSupplyRatioX96 = _indexFund.totalSupply() == 0
? FixedPoint96.Q96
: (_amount * FixedPoint96.Q96) / _tokenCurSupply;
for (uint256 _i; _i < _assets.length; _i++) {
uint256 _amountNeeded = _indexFund.totalSupply() == 0
? _indexFund.getInitialAmount(_token, _amount, _assets[_i].token)
: (IERC20(_assets[_i].token).balanceOf(address(_indexFund)) *
_tokenAmtSupplyRatioX96) / FixedPoint96.Q96;
_balsBefore[_i] = IERC20(_assets[_i].token).balanceOf(address(this));
IERC20(_assets[_i].token).transferFrom(
_msgSender(),
address(this),
_amountNeeded
);
IERC20(_assets[_i].token).safeIncreaseAllowance(
address(_indexFund),
_amountNeeded
);
}
uint256 _idxBalBefore = IERC20(_indexFund).balanceOf(address(this));
_indexFund.bond(_token, _amount, _amountMintMin);
IERC20(_indexFund).transfer(
_msgSender(),
IERC20(_indexFund).balanceOf(address(this)) - _idxBalBefore
);
// refund any excess tokens to user we didn't use to bond
for (uint256 _i; _i < _assets.length; _i++) {
_checkAndRefundERC20(_msgSender(), _assets[_i].token, _balsBefore[_i]);
}
} else {
require(
_indexFund.indexType() == IDecentralizedIndex.IndexType.UNWEIGHTED,
'UW'
);
IERC20(_token).transferFrom(_msgSender(), address(this), _amount);
IERC20(_token).safeIncreaseAllowance(address(_indexFund), _amount);
uint256 _idxBalBefore = IERC20(_indexFund).balanceOf(address(this));
_indexFund.bond(_token, _amount, _amountMintMin);
IERC20(_indexFund).transfer(
_msgSender(),
IERC20(_indexFund).balanceOf(address(this)) - _idxBalBefore
);
}
}
function bondWeightedFromNative(
IDecentralizedIndex _indexFund,
uint256 _assetIdx,
uint256 _amountTokensForAssetIdx,
uint256 _amountMintMin,
uint256 _amountPairedLpTokenMin,
uint256 _slippage, // 1 == 0.1%, 10 == 1%, 1000 == 100%
uint256 _deadline,
bool _stakeAsWell
) external payable {
require(msg.value > 0, 'NATIVE');
uint256 _ethBalBefore = address(this).balance - msg.value;
IDecentralizedIndex.IndexAssetInfo[] memory _assets = _indexFund
.getAllAssets();
(
uint256[] memory _balancesBefore,
uint256[] memory _amountsReceived
) = _swapNativeForTokensWeightedV2(
_indexFund,
_stakeAsWell ? msg.value / 2 : msg.value,
_assets,
_assetIdx,
_amountTokensForAssetIdx
);
// allowance for _assetIdx is increased in _bondToRecipient below,
// we just need to increase allowance for any other index tokens here first
for (uint256 _i; _i < _assets.length; _i++) {
if (_i == _assetIdx) {
continue;
}
IERC20(_assets[_i].token).safeIncreaseAllowance(
address(_indexFund),
_amountsReceived[_i]
);
}
uint256 _idxTokensGained = _bondToRecipient(
_indexFund,
_assets[_assetIdx].token,
_amountsReceived[_assetIdx],
_amountMintMin,
_stakeAsWell ? address(this) : _msgSender()
);
if (_stakeAsWell) {
_zapIndexTokensAndNative(
_msgSender(),
_indexFund,
_idxTokensGained,
msg.value / 2,
_amountPairedLpTokenMin,
_slippage,
_deadline
);
}
// refund any excess tokens to user we didn't use to bond
for (uint256 _i; _i < _assets.length; _i++) {
_checkAndRefundERC20(
_msgSender(),
_assets[_i].token,
_balancesBefore[_i]
);
}
// refund excess ETH
if (address(this).balance > _ethBalBefore) {
(bool _s, ) = payable(_msgSender()).call{
value: address(this).balance - _ethBalBefore
}('');
require(_s, 'ETHREFUND');
}
}
function addLPAndStake(
IDecentralizedIndex _indexFund,
uint256 _amountIdxTokens,
address _pairedLpTokenProvided,
uint256 _amtPairedLpTokenProvided,
uint256 _amountPairedLpTokenMin,
uint256 _slippage,
uint256 _deadline
) external payable {
address _v2Pool = IUniswapV2Factory(IUniswapV2Router02(V2_ROUTER).factory())
.getPair(address(_indexFund), _indexFund.PAIRED_LP_TOKEN());
uint256 _idxTokensBefore = IERC20(address(_indexFund)).balanceOf(
address(this)
);
uint256 _pairedLpTokenBefore = IERC20(_indexFund.PAIRED_LP_TOKEN())
.balanceOf(address(this));
uint256 _ethBefore = address(this).balance - msg.value;
uint256 _v2PoolBefore = IERC20(_v2Pool).balanceOf(address(this));
IERC20(address(_indexFund)).transferFrom(
_msgSender(),
address(this),
_amountIdxTokens
);
if (_pairedLpTokenProvided == address(0)) {
require(msg.value > 0, 'NEEDETH');
_amtPairedLpTokenProvided = msg.value;
} else {
IERC20(_pairedLpTokenProvided).transferFrom(
_msgSender(),
address(this),
_amtPairedLpTokenProvided
);
}
if (_pairedLpTokenProvided != _indexFund.PAIRED_LP_TOKEN()) {
_zap(
_pairedLpTokenProvided,
_indexFund.PAIRED_LP_TOKEN(),
_amtPairedLpTokenProvided,
_amountPairedLpTokenMin
);
}
IERC20(_indexFund.PAIRED_LP_TOKEN()).safeIncreaseAllowance(
address(_indexFund),
IERC20(_indexFund.PAIRED_LP_TOKEN()).balanceOf(address(this)) -
_pairedLpTokenBefore
);
_indexFund.addLiquidityV2(
IERC20(address(_indexFund)).balanceOf(address(this)) - _idxTokensBefore,
IERC20(_indexFund.PAIRED_LP_TOKEN()).balanceOf(address(this)) -
_pairedLpTokenBefore,
_slippage,
_deadline
);
IERC20(_v2Pool).safeIncreaseAllowance(
_indexFund.lpStakingPool(),
IERC20(_v2Pool).balanceOf(address(this)) - _v2PoolBefore
);
IStakingPoolToken(_indexFund.lpStakingPool()).stake(
_msgSender(),
IERC20(_v2Pool).balanceOf(address(this)) - _v2PoolBefore
);
// refunds if needed for index tokens and pairedLpToken
if (address(this).balance > _ethBefore) {
(bool _s, ) = payable(_msgSender()).call{
value: address(this).balance - _ethBefore
}('');
require(_s && address(this).balance >= _ethBefore, 'TOOMUCH');
}
_checkAndRefundERC20(_msgSender(), address(_indexFund), _idxTokensBefore);
_checkAndRefundERC20(
_msgSender(),
_indexFund.PAIRED_LP_TOKEN(),
_pairedLpTokenBefore
);
}
function unstakeAndRemoveLP(
IDecentralizedIndex _indexFund,
uint256 _amountStakedTokens,
uint256 _minLPTokens,
uint256 _minPairedLpToken,
uint256 _deadline
) external {
address _stakingPool = _indexFund.lpStakingPool();
address _pairedLpToken = _indexFund.PAIRED_LP_TOKEN();
uint256 _stakingBalBefore = IERC20(_stakingPool).balanceOf(address(this));
uint256 _pairedLpTokenBefore = IERC20(_pairedLpToken).balanceOf(
address(this)
);
IERC20(_stakingPool).transferFrom(
_msgSender(),
address(this),
_amountStakedTokens
);
uint256 _indexBalBefore = _unstakeAndRemoveLP(
_indexFund,
_stakingPool,
IERC20(_stakingPool).balanceOf(address(this)) - _stakingBalBefore,
_minLPTokens,
_minPairedLpToken,
_deadline
);
if (
IERC20(address(_indexFund)).balanceOf(address(this)) > _indexBalBefore
) {
IERC20(address(_indexFund)).transfer(
_msgSender(),
IERC20(address(_indexFund)).balanceOf(address(this)) - _indexBalBefore
);
}
if (
IERC20(_pairedLpToken).balanceOf(address(this)) > _pairedLpTokenBefore
) {
IERC20(_pairedLpToken).transfer(
_msgSender(),
IERC20(_pairedLpToken).balanceOf(address(this)) - _pairedLpTokenBefore
);
}
}
function claimRewardsMulti(address[] memory _rewards) external {
for (uint256 _i; _i < _rewards.length; _i++) {
ITokenRewards(_rewards[_i]).claimReward(_msgSender());
}
}
function _swapNativeForTokensWeightedV2(
IDecentralizedIndex _indexFund,
uint256 _amountNative,
IDecentralizedIndex.IndexAssetInfo[] memory _assets,
uint256 _poolIdx,
uint256 _amountForPoolIdx
) internal returns (uint256[] memory, uint256[] memory) {
uint256[] memory _amountBefore = new uint256[](_assets.length);
uint256[] memory _amountReceived = new uint256[](_assets.length);
uint256 _tokenCurSupply = IERC20(_assets[_poolIdx].token).balanceOf(
address(_indexFund)
);
uint256 _tokenAmtSupplyRatioX96 = _indexFund.totalSupply() == 0
? FixedPoint96.Q96
: (_amountForPoolIdx * FixedPoint96.Q96) / _tokenCurSupply;
uint256 _nativeLeft = _amountNative;
for (uint256 _i; _i < _assets.length; _i++) {
(_nativeLeft, _amountBefore[_i], _amountReceived[_i]) = _swapForIdxToken(
_indexFund,
_assets[_poolIdx].token,
_amountForPoolIdx,
_assets[_i].token,
_tokenAmtSupplyRatioX96,
_nativeLeft
);
}
return (_amountBefore, _amountReceived);
}
function _swapForIdxToken(
IDecentralizedIndex _indexFund,
address _initToken,
uint256 _initTokenAmount,
address _outToken,
uint256 _tokenAmtSupplyRatioX96,
uint256 _nativeLeft
)
internal
returns (
uint256 _newNativeLeft,
uint256 _amountBefore,
uint256 _amountReceived
)
{
uint256 _nativeBefore = address(this).balance;
_amountBefore = IERC20(_outToken).balanceOf(address(this));
uint256 _amountOut = _indexFund.totalSupply() == 0
? _indexFund.getInitialAmount(_initToken, _initTokenAmount, _outToken)
: (IERC20(_outToken).balanceOf(address(_indexFund)) *
_tokenAmtSupplyRatioX96) / FixedPoint96.Q96;
address[] memory _path = new address[](2);
_path[0] = IUniswapV2Router02(V2_ROUTER).WETH();
_path[1] = _outToken;
IUniswapV2Router02(V2_ROUTER).swapETHForExactTokens{ value: _nativeLeft }(
_amountOut,
_path,
address(this),
block.timestamp
);
_newNativeLeft = _nativeLeft - (_nativeBefore - address(this).balance);
_amountReceived =
IERC20(_outToken).balanceOf(address(this)) -
_amountBefore;
}
function _unstakeAndRemoveLP(
IDecentralizedIndex _indexFund,
address _stakingPool,
uint256 _unstakeAmount,
uint256 _minLPTokens,
uint256 _minPairedLpTokens,
uint256 _deadline
) internal returns (uint256 _fundTokensBefore) {
address _pairedLpToken = _indexFund.PAIRED_LP_TOKEN();
address _v2Pool = IUniswapV2Factory(IUniswapV2Router02(V2_ROUTER).factory())
.getPair(address(_indexFund), _pairedLpToken);
uint256 _v2TokensBefore = IERC20(_v2Pool).balanceOf(address(this));
IStakingPoolToken(_stakingPool).unstake(_unstakeAmount);
_fundTokensBefore = _indexFund.balanceOf(address(this));
IERC20(_v2Pool).safeIncreaseAllowance(
address(_indexFund),
IERC20(_v2Pool).balanceOf(address(this)) - _v2TokensBefore
);
_indexFund.removeLiquidityV2(
IERC20(_v2Pool).balanceOf(address(this)) - _v2TokensBefore,
_minLPTokens,
_minPairedLpTokens,
_deadline
);
}
function _bondToRecipient(
IDecentralizedIndex _indexFund,
address _indexToken,
uint256 _bondTokens,
uint256 _amountMintMin,
address _recipient
) internal returns (uint256) {
uint256 _idxTokensBefore = IERC20(address(_indexFund)).balanceOf(
address(this)
);
IERC20(_indexToken).safeIncreaseAllowance(address(_indexFund), _bondTokens);
_indexFund.bond(_indexToken, _bondTokens, _amountMintMin);
uint256 _idxTokensGained = IERC20(address(_indexFund)).balanceOf(
address(this)
) - _idxTokensBefore;
if (_recipient != address(this)) {
IERC20(address(_indexFund)).transfer(_recipient, _idxTokensGained);
}
return _idxTokensGained;
}
function _zapIndexTokensAndNative(
address _user,
IDecentralizedIndex _indexFund,
uint256 _amountTokens,
uint256 _amountETH,
uint256 _amtPairedLpTokenMin,
uint256 _slippage,
uint256 _deadline
) internal {
address _pairedLpToken = _indexFund.PAIRED_LP_TOKEN();
uint256 _tokensBefore = IERC20(address(_indexFund)).balanceOf(
address(this)
) - _amountTokens;
uint256 _pairedLpTokenBefore = IERC20(_pairedLpToken).balanceOf(
address(this)
);
address _stakingPool = _indexFund.lpStakingPool();
_zap(address(0), _pairedLpToken, _amountETH, _amtPairedLpTokenMin);
address _v2Pool = IUniswapV2Factory(IUniswapV2Router02(V2_ROUTER).factory())
.getPair(address(_indexFund), _pairedLpToken);
uint256 _lpTokensBefore = IERC20(_v2Pool).balanceOf(address(this));
IERC20(_pairedLpToken).safeIncreaseAllowance(
address(_indexFund),
IERC20(_pairedLpToken).balanceOf(address(this)) - _pairedLpTokenBefore
);
_indexFund.addLiquidityV2(
_amountTokens,
IERC20(_pairedLpToken).balanceOf(address(this)) - _pairedLpTokenBefore,
_slippage,
_deadline
);
IERC20(_v2Pool).safeIncreaseAllowance(
_stakingPool,
IERC20(_v2Pool).balanceOf(address(this)) - _lpTokensBefore
);
IStakingPoolToken(_stakingPool).stake(
_user,
IERC20(_v2Pool).balanceOf(address(this)) - _lpTokensBefore
);
// check & refund excess tokens from LPing as needed
if (IERC20(address(_indexFund)).balanceOf(address(this)) > _tokensBefore) {
IERC20(address(_indexFund)).transfer(
_user,
IERC20(address(_indexFund)).balanceOf(address(this)) - _tokensBefore
);
}
if (
IERC20(_pairedLpToken).balanceOf(address(this)) > _pairedLpTokenBefore
) {
IERC20(_pairedLpToken).transfer(
_user,
IERC20(_pairedLpToken).balanceOf(address(this)) - _pairedLpTokenBefore
);
}
}
function _checkAndRefundERC20(
address _user,
address _asset,
uint256 _beforeBal
) internal {
uint256 _curBal = IERC20(_asset).balanceOf(address(this));
if (_curBal > _beforeBal) {
IERC20(_asset).transfer(_user, _curBal - _beforeBal);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
/// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
/// @dev In the implementation you must pay the pool tokens owed for the swap.
/// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
/// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
/// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
/// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
/// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
function uniswapV3SwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.4.0;
/// @title FixedPoint96
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
/// @dev Used in SqrtPriceMath.sol
library FixedPoint96 {
uint8 internal constant RESOLUTION = 96;
uint256 internal constant Q96 = 0x1000000000000000000000000;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
/// @return Returns the address of the Uniswap V3 factory
function factory() external view returns (address);
/// @return Returns the address of WETH9
function WETH9() external view returns (address);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';
/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
/// @return amountOut The amount of the received token
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another token
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
/// @return amountIn The amount of the input token
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
struct ExactOutputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
/// @return amountIn The amount of the input token
function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface ICurvePool {
function coins(uint256 _idx) external returns (address);
function exchange(
int128 i,
int128 j,
uint256 dx,
uint256 minDy,
address receiver
) external returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IDecentralizedIndex is IERC20 {
enum IndexType {
WEIGHTED,
UNWEIGHTED
}
// all fees: 1 == 0.01%, 10 == 0.1%, 100 == 1%
struct Fees {
uint256 burn;
uint256 bond;
uint256 debond;
uint256 buy;
uint256 sell;
uint256 partner;
}
struct IndexAssetInfo {
address token;
uint256 weighting;
uint256 basePriceUSDX96;
address c1; // arbitrary contract/address field we can use for an index
uint256 q1; // arbitrary quantity/number field we can use for an index
}
event Create(address indexed newIdx, address indexed wallet);
event Bond(
address indexed wallet,
address indexed token,
uint256 amountTokensBonded,
uint256 amountTokensMinted,
uint256 indexed feesBond
);
event Debond(
address indexed wallet,
uint256 amountDebonded,
uint256 indexed feesDebond
);
event AddLiquidity(
address indexed wallet,
uint256 amountTokens,
uint256 amountDAI
);
event RemoveLiquidity(address indexed wallet, uint256 amountLiquidity);
function BOND_FEE() external view returns (uint256);
function DEBOND_FEE() external view returns (uint256);
function STABLECOIN() external view returns (address);
function FLASH_FEE() external view returns (uint256);
function PAIRED_LP_TOKEN() external view returns (address);
function indexType() external view returns (IndexType);
function created() external view returns (uint256);
function lpStakingPool() external view returns (address);
function lpRewardsToken() external view returns (address);
function partner() external view returns (address);
function isAsset(address token) external view returns (bool);
function getAllAssets() external view returns (IndexAssetInfo[] memory);
function getInitialAmount(
address sToken,
uint256 sAmount,
address tToken
) external view returns (uint256);
function processPreSwapFeesAndSwap() external;
function bond(
address token,
uint256 amount,
uint256 amountMintMin
) external;
function debond(
uint256 amount,
address[] memory token,
uint8[] memory percentage
) external;
function addLiquidityV2(
uint256 idxTokens,
uint256 daiTokens,
uint256 slippage,
uint256 deadline
) external;
function removeLiquidityV2(
uint256 lpTokens,
uint256 minTokens,
uint256 minDAI,
uint256 deadline
) external;
function flash(
address recipient,
address token,
uint256 amount,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IERC20Metadata {
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IERC4626 {
function deposit(
uint256 yETHAmount,
address receiver
) external returns (uint256 styETHAmount);
function withdraw(
uint256 styETHAmount,
address receiver
) external returns (uint256 yETHAmount);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IStakingPoolToken {
event Stake(address indexed executor, address indexed user, uint256 amount);
event Unstake(address indexed user, uint256 amount);
function indexFund() external view returns (address);
function stakingToken() external view returns (address);
function poolRewards() external view returns (address);
function stakeUserRestriction() external view returns (address);
function stake(address user, uint256 amount) external;
function unstake(uint256 amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface ITokenRewards {
event AddShares(address indexed wallet, uint256 amount);
event RemoveShares(address indexed wallet, uint256 amount);
event ClaimReward(address indexed wallet);
event DistributeReward(address indexed wallet, uint256 amount);
event DepositRewards(address indexed wallet, uint256 amount);
function totalShares() external view returns (uint256);
function totalStakers() external view returns (uint256);
function rewardsToken() external view returns (address);
function trackingToken() external view returns (address);
function depositFromPairedLpToken(
uint256 amount,
uint256 slippageOverride
) external;
function depositRewards(uint256 amount) external;
function claimReward(address wallet) external;
function setShares(
address wallet,
uint256 amount,
bool sharesRemoving
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IUniswapV2Factory {
function feeTo() external view returns (address owner);
function yieldTo() external view returns (address owner);
function yieldCut() external view returns (uint);
function WETH() external view returns (address);
function ws() external view returns (address);
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function balanceOf(address user) external view returns (uint);
function totalSupply() external view returns (uint);
function kLast() external view returns (uint);
function getReserves()
external
view
returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IUniswapV2Router02 {
function factory() external view returns (address);
function WETH() external view returns (address);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
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);
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 removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint256 amountOutMin, address[] calldata path, address to, uint256 deadline)
external
payable
returns (uint256[] memory amounts);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) external view returns (uint256 amountB);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IUniswapV3Pool {
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
/// you must call it with secondsAgos = [3600, 0].
/// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
/// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
/// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
/// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
/// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
/// timestamp
function observe(
uint32[] calldata secondsAgos
)
external
view
returns (
int56[] memory tickCumulatives,
uint160[] memory secondsPerLiquidityCumulativeX128s
);
/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
/// tick The current tick of the pool, i.e. according to the last tick transition that was run.
/// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// observationIndex The index of the last oracle observation that was written,
/// observationCardinality The current maximum number of observations stored in the pool,
/// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
/// feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IV3TwapUtilities {
function getV3Pool(
address v3Factory,
address token0,
address token1,
uint24 poolFee
) external view returns (address);
function getPoolPriceUSDX96(
address pricePool,
address nativeStablePool,
address WETH9
) external view returns (uint256);
function sqrtPriceX96FromPoolAndInterval(
address pool
) external view returns (uint160);
function priceX96FromSqrtPriceX96(
uint160 sqrtPriceX96
) external pure returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IWETH {
function deposit() external payable;
function withdraw(uint256 _amount) external;
function approve(address to, uint256 _amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface IZapper {
enum PoolType {
CURVE,
V2,
V3
}
struct Pools {
PoolType poolType; // assume same for both pool1 and pool2
address pool1;
address pool2;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol';
import '@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol';
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';
import './interfaces/ICurvePool.sol';
import './interfaces/IDecentralizedIndex.sol';
import './interfaces/IERC4626.sol';
import './interfaces/IUniswapV2Pair.sol';
import './interfaces/IUniswapV3Pool.sol';
import './interfaces/IUniswapV2Router02.sol';
import './interfaces/IV3TwapUtilities.sol';
import './interfaces/IWETH.sol';
import './interfaces/IZapper.sol';
contract Zapper is IZapper, Context, Ownable {
using SafeERC20 for IERC20;
address immutable V3_ROUTER;
address immutable V2_ROUTER;
address immutable WETH;
IV3TwapUtilities immutable V3_TWAP_UTILS;
uint256 _slippage = 30; // 3%
// token in => token out => swap pool(s)
mapping(address => mapping(address => Pools)) public zapMap;
// curve pool => token => idx
mapping(address => mapping(address => int128)) public curveTokenIdx;
mapping(address => address) public second_liqs;
constructor(address _v2Router, IV3TwapUtilities _v3TwapUtilities, address _v3Router) {
V2_ROUTER = _v2Router;
V3_TWAP_UTILS = _v3TwapUtilities;
WETH = IUniswapV2Router02(V2_ROUTER).WETH();
V3_ROUTER = _v3Router;
}
function _zap(
address _in,
address _out,
uint256 _amountIn,
uint256 _amountOutMin
) internal returns (uint256 _amountOut) {
if (_in == address(0)) {
_amountIn = _ethToWETH(_amountIn);
_in = WETH;
}
// handle secondLiqToken separately through potion, modularize later
bool _isOutsecondLiqToken;
address secondLiqToken;
if (second_liqs[_out] != address(0)) {
secondLiqToken = _out; //Here it's wRap token wArb
_isOutsecondLiqToken = true;
_out = second_liqs[_out]; //Here is unWrap token Arb
}
Pools memory _poolInfo = zapMap[_in][_out];
// no pool so just try to swap over one path univ2
if (_poolInfo.pool1 == address(0)) {
address[] memory _path = new address[](2);
_path[0] = _in;
_path[1] = _out;
if(_in != _out) {
_amountOut = _swapV2(_path, _amountIn, _amountOutMin);
} else {
_amountOut = _amountIn;
}
} else {
bool _twoHops = _poolInfo.pool2 != address(0);
if (_poolInfo.poolType == PoolType.CURVE) {
// curve
_amountOut = _swapCurve(
_poolInfo.pool1,
curveTokenIdx[_poolInfo.pool1][_in],
curveTokenIdx[_poolInfo.pool1][_out],
_amountIn,
_amountOutMin
);
} else if (_poolInfo.poolType == PoolType.V2) {
// univ2
address _token0 = IUniswapV2Pair(_poolInfo.pool1).token0();
address[] memory _path = new address[](_twoHops ? 3 : 2);
_path[0] = _in;
_path[1] = !_twoHops ? _out : _token0 == _in
? IUniswapV2Pair(_poolInfo.pool1).token1()
: _token0;
if (_twoHops) {
_path[2] = _out;
}
_amountOut = _swapV2(_path, _amountIn, _amountOutMin);
} else {
// univ3
if (_twoHops) {
address _t0 = IUniswapV3Pool(_poolInfo.pool1).token0();
_amountOut = _swapV3Multi(
_in,
IUniswapV3Pool(_poolInfo.pool1).fee(),
_t0 == _in ? IUniswapV3Pool(_poolInfo.pool1).token0() : _t0,
IUniswapV3Pool(_poolInfo.pool2).fee(),
_out,
_amountIn,
_amountOutMin
);
} else {
_amountOut = _swapV3Single(
_in,
IUniswapV3Pool(_poolInfo.pool1).fee(),
_out,
_amountIn,
_amountOutMin
);
}
}
}
if (!_isOutsecondLiqToken) {
return _amountOut;
}
uint256 _secondLiqTokenBefore = IERC20(secondLiqToken).balanceOf(
address(this)
);
IERC20(_out).safeIncreaseAllowance(
secondLiqToken,
_amountOut
);
IDecentralizedIndex(secondLiqToken).bond(
_out,
_amountOut,
0
);
return
IERC20(secondLiqToken).balanceOf(address(this)) -
_secondLiqTokenBefore;
}
function _ethToWETH(uint256 _amountETH) internal returns (uint256) {
uint256 _wethBal = IERC20(WETH).balanceOf(address(this));
IWETH(WETH).deposit{ value: _amountETH }();
return IERC20(WETH).balanceOf(address(this)) - _wethBal;
}
function _swapV3Single(
address _in,
uint24 _fee,
address _out,
uint256 _amountIn,
uint256 _amountOutMin
) internal returns (uint256 _amountOut) {
if (_amountOutMin == 0) {
address _v3Pool = V3_TWAP_UTILS.getV3Pool(
IPeripheryImmutableState(V3_ROUTER).factory(),
_in,
_out,
_fee
);
address _token0 = _in < _out ? _in : _out;
uint256 _poolPriceX96 = V3_TWAP_UTILS.priceX96FromSqrtPriceX96(
V3_TWAP_UTILS.sqrtPriceX96FromPoolAndInterval(_v3Pool)
);
_amountOutMin = _in == _token0
? (_poolPriceX96 * _amountIn) / FixedPoint96.Q96
: (_amountIn * FixedPoint96.Q96) / _poolPriceX96;
}
uint256 _outBefore = IERC20(_out).balanceOf(address(this));
IERC20(_in).safeIncreaseAllowance(V3_ROUTER, _amountIn);
ISwapRouter(V3_ROUTER).exactInputSingle(
ISwapRouter.ExactInputSingleParams({
tokenIn: _in,
tokenOut: _out,
fee: _fee,
recipient: address(this),
deadline: block.timestamp,
amountIn: _amountIn,
amountOutMinimum: (_amountOutMin * (1000 - _slippage)) / 1000,
sqrtPriceLimitX96: 0
})
);
return IERC20(_out).balanceOf(address(this)) - _outBefore;
}
function _swapV3Multi(
address _in,
uint24 _fee1,
address _in2,
uint24 _fee2,
address _out,
uint256 _amountIn,
uint256 _amountOutMin
) internal returns (uint256) {
uint256 _outBefore = IERC20(_out).balanceOf(address(this));
IERC20(_in).safeIncreaseAllowance(V3_ROUTER, _amountIn);
bytes memory _path = abi.encodePacked(_in, _fee1, _in2, _fee2, _out);
ISwapRouter(V3_ROUTER).exactInput(
ISwapRouter.ExactInputParams({
path: _path,
recipient: address(this),
deadline: block.timestamp,
amountIn: _amountIn,
amountOutMinimum: _amountOutMin
})
);
return IERC20(_out).balanceOf(address(this)) - _outBefore;
}
function _swapV2(
address[] memory _path,
uint256 _amountIn,
uint256 _amountOutMin
) internal returns (uint256) {
address _out = _path.length == 3 ? _path[2] : _path[1];
uint256 _outBefore = IERC20(_out).balanceOf(address(this));
IERC20(_path[0]).safeIncreaseAllowance(V2_ROUTER, _amountIn);
IUniswapV2Router02(V2_ROUTER)
.swapExactTokensForTokensSupportingFeeOnTransferTokens(
_amountIn,
_amountOutMin,
_path,
address(this),
block.timestamp
);
return IERC20(_out).balanceOf(address(this)) - _outBefore;
}
function _swapCurve(
address _pool,
int128 _i,
int128 _j,
uint256 _amountIn,
uint256 _amountOutMin
) internal returns (uint256) {
return
ICurvePool(_pool).exchange(
_i,
_j,
_amountIn,
_amountOutMin,
address(this)
);
}
function _setZapMapFromPoolSingle(PoolType _type, address _pool) internal {
address _t0;
address _t1;
if (_type == PoolType.CURVE) {
_t0 = ICurvePool(_pool).coins(0);
_t1 = ICurvePool(_pool).coins(1);
curveTokenIdx[_pool][_t0] = 0;
curveTokenIdx[_pool][_t1] = 1;
} else {
_t0 = IUniswapV3Pool(_pool).token0();
_t1 = IUniswapV3Pool(_pool).token1();
}
Pools memory _poolConf = Pools({
poolType: _type,
pool1: _pool,
pool2: address(0)
});
zapMap[_t0][_t1] = _poolConf;
zapMap[_t1][_t0] = _poolConf;
}
function setSlippage(uint256 _slip) external onlyOwner {
_slippage = _slip;
}
function setZapMap(
address _in,
address _out,
Pools memory _pools
) external onlyOwner {
zapMap[_in][_out] = _pools;
}
function setZapMapFromPoolSingle(
PoolType _type,
address _pool
) external onlyOwner {
_setZapMapFromPoolSingle(_type, _pool);
}
function rescueETH() external onlyOwner {
(bool _sent, ) = payable(owner()).call{ value: address(this).balance }('');
require(_sent);
}
function rescueERC20(IERC20 _token) external onlyOwner {
require(_token.balanceOf(address(this)) > 0);
_token.transfer(owner(), _token.balanceOf(address(this)));
}
function setsecondLiqToken(address _wrapper, address _secondLiqToken) external onlyOwner {
second_liqs[_wrapper] = _secondLiqToken;
}
receive() external payable {}
}{
"optimizer": {
"enabled": true,
"runs": 0,
"details": {
"yul": true,
"yulDetails": {
"optimizerSteps": "dhfoDgvulfnTUtnIf [xa[r]scLM cCTUtTOntnfDIul Lcul Vcul [j] Tpeul xa[rul] xa[r]cL gvif CTUca[r]LsTOtfDnca[r]Iulc] jmul[jul] VcTOcul jmul"
}
}
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_v2Router","type":"address"},{"internalType":"address","name":"_v3Router","type":"address"},{"internalType":"contract IV3TwapUtilities","name":"_v3TwapUtilities","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"contract IDecentralizedIndex","name":"_indexFund","type":"address"},{"internalType":"uint256","name":"_amountIdxTokens","type":"uint256"},{"internalType":"address","name":"_pairedLpTokenProvided","type":"address"},{"internalType":"uint256","name":"_amtPairedLpTokenProvided","type":"uint256"},{"internalType":"uint256","name":"_amountPairedLpTokenMin","type":"uint256"},{"internalType":"uint256","name":"_slippage","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"addLPAndStake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IDecentralizedIndex","name":"_indexFund","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_amountMintMin","type":"uint256"}],"name":"bond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDecentralizedIndex","name":"_indexFund","type":"address"},{"internalType":"uint256","name":"_assetIdx","type":"uint256"},{"internalType":"uint256","name":"_amountTokensForAssetIdx","type":"uint256"},{"internalType":"uint256","name":"_amountMintMin","type":"uint256"},{"internalType":"uint256","name":"_amountPairedLpTokenMin","type":"uint256"},{"internalType":"uint256","name":"_slippage","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bool","name":"_stakeAsWell","type":"bool"}],"name":"bondWeightedFromNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_rewards","type":"address[]"}],"name":"claimRewardsMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"curveTokenIdx","outputs":[{"internalType":"int128","name":"","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"second_liqs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slip","type":"uint256"}],"name":"setSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_in","type":"address"},{"internalType":"address","name":"_out","type":"address"},{"components":[{"internalType":"enum IZapper.PoolType","name":"poolType","type":"uint8"},{"internalType":"address","name":"pool1","type":"address"},{"internalType":"address","name":"pool2","type":"address"}],"internalType":"struct IZapper.Pools","name":"_pools","type":"tuple"}],"name":"setZapMap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IZapper.PoolType","name":"_type","type":"uint8"},{"internalType":"address","name":"_pool","type":"address"}],"name":"setZapMapFromPoolSingle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wrapper","type":"address"},{"internalType":"address","name":"_secondLiqToken","type":"address"}],"name":"setsecondLiqToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDecentralizedIndex","name":"_indexFund","type":"address"},{"internalType":"uint256","name":"_amountStakedTokens","type":"uint256"},{"internalType":"uint256","name":"_minLPTokens","type":"uint256"},{"internalType":"uint256","name":"_minPairedLpToken","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"unstakeAndRemoveLP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"zapMap","outputs":[{"internalType":"enum IZapper.PoolType","name":"poolType","type":"uint8"},{"internalType":"address","name":"pool1","type":"address"},{"internalType":"address","name":"pool2","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
610100604052601e6001553480156200001757600080fd5b5060405162006205380380620062058339810160408190526200003a9162000147565b8281836200004833620000de565b6001600160a01b0380841660a081905290831660e052604080516315ab88c960e31b8152905163ad5c4648916004808201926020929091908290030181865afa1580156200009a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000c091906200019b565b6001600160a01b0390811660c0521660805250620001c29350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200014457600080fd5b50565b6000806000606084860312156200015d57600080fd5b83516200016a816200012e565b60208501519093506200017d816200012e565b604085015190925062000190816200012e565b809150509250925092565b600060208284031215620001ae57600080fd5b8151620001bb816200012e565b9392505050565b60805160a05160c05160e051615fa06200026560003960008181614b2b01528181614c880152614cb7015260008181612d9a015281816144970152818161452601526145af015260008181610a13015281816125c501528181613e05015281816146f80152818161476201528181615361015261544d01526000818161496201528181614a1e01528181614b5a01528181614e780152614e9f0152615fa06000f3fe6080604052600436106100d25760003560e01c80631fd8ecd9146100de57806320800a001461010057806338e781111461011557806353eedc6714610135578063715018a614610155578063816846c81461016a57806384614e1a146101bd5780638da5cb5b146101d0578063a1879d90146101f2578063ccec371614610212578063d71f11fb14610232578063e2a3bd6914610252578063e42f534314610288578063e679daf5146102ed578063f0fa55a914610300578063f2fde38b14610320578063fc173e3d1461034057600080fd5b366100d957005b600080fd5b3480156100ea57600080fd5b506100fe6100f936600461569b565b610360565b005b34801561010c57600080fd5b506100fe6108d7565b34801561012157600080fd5b506100fe6101303660046156f3565b610949565b34801561014157600080fd5b506100fe610150366004615770565b61095f565b34801561016157600080fd5b506100fe6109fb565b34801561017657600080fd5b506101a5610185366004615800565b6003602090815260009283526040808420909152908252902054600f0b81565b604051600f9190910b81526020015b60405180910390f35b6100fe6101cb36600461581e565b610a0f565b3480156101dc57600080fd5b506101e5611595565b6040516101b49190615883565b3480156101fe57600080fd5b506100fe61020d3660046158ba565b6115a4565b34801561021e57600080fd5b506100fe61022d36600461594d565b611639565b34801561023e57600080fd5b506100fe61024d36600461596a565b61179f565b34801561025e57600080fd5b506101e561026d36600461594d565b6004602052600090815260409020546001600160a01b031681565b34801561029457600080fd5b506102de6102a3366004615800565b60026020908152600092835260408084209091529082529020805460019091015460ff8216916001600160a01b036101009091048116911683565b6040516101b4939291906159c6565b6100fe6102fb366004615a14565b61221d565b34801561030c57600080fd5b506100fe61031b366004615a87565b6124a1565b34801561032c57600080fd5b506100fe61033b36600461594d565b6124ae565b34801561034c57600080fd5b506100fe61035b366004615800565b612524565b6000856001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c49190615aa0565b90506000866001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190615aa0565b90506000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161045a9190615883565b602060405180830381865afa158015610477573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049b9190615abd565b90506000826001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016104cb9190615883565b602060405180830381865afa1580156104e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050c9190615abd565b6040516323b872dd60e01b81529091506001600160a01b038516906323b872dd9061053f90339030908d90600401615ad6565b6020604051808303816000875af115801561055e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105829190615afa565b50600061060a8a8685886001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016105b79190615883565b602060405180830381865afa1580156105d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f89190615abd565b6106029190615b2d565b8b8b8b61255a565b9050808a6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016106399190615883565b602060405180830381865afa158015610656573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067a9190615abd565b111561076b576001600160a01b038a1663a9059cbb336040516370a0823160e01b815284906001600160a01b038f16906370a08231906106be903090600401615883565b602060405180830381865afa1580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff9190615abd565b6107099190615b2d565b6040518363ffffffff1660e01b8152600401610726929190615b46565b6020604051808303816000875af1158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190615afa565b505b6040516370a0823160e01b815282906001600160a01b038616906370a0823190610799903090600401615883565b602060405180830381865afa1580156107b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107da9190615abd565b11156108cb576001600160a01b03841663a9059cbb336040516370a0823160e01b815285906001600160a01b038916906370a082319061081e903090600401615883565b602060405180830381865afa15801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190615abd565b6108699190615b2d565b6040518363ffffffff1660e01b8152600401610886929190615b46565b6020604051808303816000875af11580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c99190615afa565b505b50505050505050505050565b6108df612965565b60006108e9611595565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114610933576040519150601f19603f3d011682016040523d82523d6000602084013e610938565b606091505b505090508061094657600080fd5b50565b610951612965565b61095b82826129c4565b5050565b610967612965565b6001600160a01b0380841660009081526002602081815260408084209487168452939052919020825181548493839160ff19169060019084908111156109af576109af6159b0565b021790555060208201518154610100600160a81b0319166101006001600160a01b0392831602178255604090920151600190910180546001600160a01b03191691909216179055505050565b610a03612965565b610a0d6000612d2d565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a939190615aa0565b6001600160a01b031663e6a43905898a6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190615aa0565b6040518363ffffffff1660e01b8152600401610b21929190615b5f565b602060405180830381865afa158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b629190615aa0565b90506000886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b929190615883565b602060405180830381865afa158015610baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd39190615abd565b90506000896001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190615aa0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610c649190615883565b602060405180830381865afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190615abd565b90506000610cb33447615b2d565b90506000846001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ce39190615883565b602060405180830381865afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d249190615abd565b90506001600160a01b038c166323b872dd33308e6040518463ffffffff1660e01b8152600401610d5693929190615ad6565b6020604051808303816000875af1158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190615afa565b506001600160a01b038a16610def5760003411610de75760405162461bcd60e51b815260206004820152600760248201526609c8a8a888aa8960cb1b60448201526064015b60405180910390fd5b349850610e64565b6040516323b872dd60e01b81526001600160a01b038b16906323b872dd90610e1f90339030908e90600401615ad6565b6020604051808303816000875af1158015610e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e629190615afa565b505b8b6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190615aa0565b6001600160a01b03168a6001600160a01b031614610f4d57610f4b8a8d6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f449190615aa0565b8b8b612d7d565b505b61109c8c848e6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb49190615aa0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610fdf9190615883565b602060405180830381865afa158015610ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110209190615abd565b61102a9190615b2d565b8e6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c9190615aa0565b6001600160a01b03169190613620565b6040516370a0823160e01b81526001600160a01b038d169063a9e9c8bc90869083906370a08231906110d2903090600401615883565b602060405180830381865afa1580156110ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111139190615abd565b61111d9190615b2d565b858f6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111809190615aa0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016111ab9190615883565b602060405180830381865afa1580156111c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ec9190615abd565b6111f69190615b2d565b8a8a6040518563ffffffff1660e01b81526004016112179493929190615b79565b600060405180830381600087803b15801561123157600080fd5b505af1158015611245573d6000803e3d6000fd5b505050506113388c6001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561128a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ae9190615aa0565b6040516370a0823160e01b815283906001600160a01b038916906370a08231906112dc903090600401615883565b602060405180830381865afa1580156112f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131d9190615abd565b6113279190615b2d565b6001600160a01b0388169190613620565b8b6001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139a9190615aa0565b6001600160a01b031663adc9772e336040516370a0823160e01b815284906001600160a01b038a16906370a08231906113d7903090600401615883565b602060405180830381865afa1580156113f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114189190615abd565b6114229190615b2d565b6040518363ffffffff1660e01b815260040161143f929190615b46565b600060405180830381600087803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b5050505081471115611510576000336114868447615b2d565b604051600081818185875af1925050503d80600081146114c2576040519150601f19603f3d011682016040523d82523d6000602084013e6114c7565b606091505b505090508080156114d85750824710155b61150e5760405162461bcd60e51b81526020600482015260076024820152660a89e9e9aaa86960cb1b6044820152606401610dde565b505b61151b338d866136f3565b611587338d6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561155d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115819190615aa0565b856136f3565b505050505050505050505050565b6000546001600160a01b031690565b60005b815181101561095b578181815181106115c2576115c2615b94565b60200260200101516001600160a01b031663d279c1916115df3390565b6040518263ffffffff1660e01b81526004016115fb9190615883565b600060405180830381600087803b15801561161557600080fd5b505af1158015611629573d6000803e3d6000fd5b5050600190920191506115a79050565b611641612965565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190611670903090600401615883565b602060405180830381865afa15801561168d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b19190615abd565b116116bb57600080fd5b806001600160a01b031663a9059cbb6116d2611595565b6040516370a0823160e01b81526001600160a01b038516906370a08231906116fe903090600401615883565b602060405180830381865afa15801561171b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173f9190615abd565b6040518363ffffffff1660e01b815260040161175c929190615b46565b6020604051808303816000875af115801561177b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190615afa565b6000846001600160a01b03166353f504476040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118039190615baa565b6001811115611814576118146159b0565b03611f21576000846001600160a01b0316632acada4d6040518163ffffffff1660e01b8152600401600060405180830381865afa158015611859573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118819190810190615bcb565b9050600081516001600160401b0381111561189e5761189e61572a565b6040519080825280602002602001820160405280156118c7578160200160208202803683370190505b5090506000856001600160a01b03166370a08231886040518263ffffffff1660e01b81526004016118f89190615883565b602060405180830381865afa158015611915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119399190615abd565b90506000876001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561197b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199f9190615abd565b156119c257816119b3600160601b88615ca3565b6119bd9190615cba565b6119c8565b600160601b5b905060005b8451811015611cfb576000896001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3a9190615abd565b15611ae857600160601b83878481518110611a5757611a57615b94565b6020026020010151600001516001600160a01b03166370a082318d6040518263ffffffff1660e01b8152600401611a8e9190615883565b602060405180830381865afa158015611aab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acf9190615abd565b611ad99190615ca3565b611ae39190615cba565b611b76565b896001600160a01b031663e4b549578a8a898681518110611b0b57611b0b615b94565b6020026020010151600001516040518463ffffffff1660e01b8152600401611b3593929190615cdc565b602060405180830381865afa158015611b52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b769190615abd565b9050858281518110611b8a57611b8a615b94565b6020026020010151600001516001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611bc19190615883565b602060405180830381865afa158015611bde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c029190615abd565b858381518110611c1457611c14615b94565b602002602001018181525050858281518110611c3257611c32615b94565b6020026020010151600001516001600160a01b03166323b872dd611c533390565b30846040518463ffffffff1660e01b8152600401611c7393929190615ad6565b6020604051808303816000875af1158015611c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb69190615afa565b50611cf28a82888581518110611cce57611cce615b94565b6020026020010151600001516001600160a01b03166136209092919063ffffffff16565b506001016119cd565b506040516370a0823160e01b81526000906001600160a01b038a16906370a0823190611d2b903090600401615883565b602060405180830381865afa158015611d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6c9190615abd565b60405163b08d033360e01b81529091506001600160a01b038a169063b08d033390611d9f908b908b908b90600401615cff565b600060405180830381600087803b158015611db957600080fd5b505af1158015611dcd573d6000803e3d6000fd5b50505050886001600160a01b031663a9059cbb611de73390565b6040516370a0823160e01b815284906001600160a01b038e16906370a0823190611e15903090600401615883565b602060405180830381865afa158015611e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e569190615abd565b611e609190615b2d565b6040518363ffffffff1660e01b8152600401611e7d929190615b46565b6020604051808303816000875af1158015611e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec09190615afa565b5060005b8551811015611f1657611f0e33878381518110611ee357611ee3615b94565b602002602001015160000151878481518110611f0157611f01615b94565b60200260200101516136f3565b600101611ec4565b505050505050612217565b6001846001600160a01b03166353f504476040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f859190615baa565b6001811115611f9657611f966159b0565b14611fc85760405162461bcd60e51b8152602060048201526002602482015261555760f01b6044820152606401610dde565b6040516323b872dd60e01b81526001600160a01b038416906323b872dd90611ff890339030908790600401615ad6565b6020604051808303816000875af1158015612017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203b9190615afa565b506120506001600160a01b0384168584613620565b6040516370a0823160e01b81526000906001600160a01b038616906370a082319061207f903090600401615883565b602060405180830381865afa15801561209c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c09190615abd565b60405163b08d033360e01b81529091506001600160a01b0386169063b08d0333906120f390879087908790600401615cff565b600060405180830381600087803b15801561210d57600080fd5b505af1158015612121573d6000803e3d6000fd5b50505050846001600160a01b031663a9059cbb61213b3390565b6040516370a0823160e01b815284906001600160a01b038a16906370a0823190612169903090600401615883565b602060405180830381865afa158015612186573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121aa9190615abd565b6121b49190615b2d565b6040518363ffffffff1660e01b81526004016121d1929190615b46565b6020604051808303816000875af11580156121f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122149190615afa565b50505b50505050565b600034116122565760405162461bcd60e51b81526020600482015260066024820152654e415449564560d01b6044820152606401610dde565b60006122623447615b2d565b90506000896001600160a01b0316632acada4d6040518163ffffffff1660e01b8152600401600060405180830381865afa1580156122a4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122cc9190810190615bcb565b90506000806122f38c866122e057346122eb565b6122eb600234615cba565b858e8e6137ee565b9150915060005b835181101561234257808c1461233a5761233a8d83838151811061232057612320615b94565b6020026020010151868481518110611cce57611cce615b94565b6001016122fa565b5060006123938d858e8151811061235b5761235b615b94565b602002602001015160000151848f8151811061237957612379615b94565b60200260200101518d8a61238d5733613a48565b30613a48565b905085156123b4576123b4338e836123ac600234615cba565b8d8d8d613c3a565b60005b84518110156123fc576123f4338683815181106123d6576123d6615b94565b602002602001015160000151868481518110611f0157611f01615b94565b6001016123b7565b5084471115612492576000336124128747615b2d565b604051600081818185875af1925050503d806000811461244e576040519150601f19603f3d011682016040523d82523d6000602084013e612453565b606091505b50509050806124905760405162461bcd60e51b815260206004820152600960248201526811551214915195539160ba1b6044820152606401610dde565b505b50505050505050505050505050565b6124a9612965565b600155565b6124b6612965565b6001600160a01b03811661251b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dde565b61094681612d2d565b61252c612965565b6001600160a01b03918216600090815260046020526040902080546001600160a01b03191691909216179055565b600080876001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561259b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125bf9190615aa0565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015612621573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126459190615aa0565b6001600160a01b031663e6a439058a846040518363ffffffff1660e01b8152600401612672929190615b5f565b602060405180830381865afa15801561268f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b39190615aa0565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016126e39190615883565b602060405180830381865afa158015612700573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127249190615abd565b6040516305c2fbcf60e31b8152600481018a90529091506001600160a01b038a1690632e17de7890602401600060405180830381600087803b15801561276957600080fd5b505af115801561277d573d6000803e3d6000fd5b50506040516370a0823160e01b81526001600160a01b038d1692506370a0823191506127ad903090600401615883565b602060405180830381865afa1580156127ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ee9190615abd565b935061287d8a82846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016128219190615883565b602060405180830381865afa15801561283e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128629190615abd565b61286c9190615b2d565b6001600160a01b0385169190613620565b896001600160a01b031663f682399682846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016128b99190615883565b602060405180830381865afa1580156128d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128fa9190615abd565b6129049190615b2d565b8989896040518563ffffffff1660e01b81526004016129269493929190615b79565b600060405180830381600087803b15801561294057600080fd5b505af1158015612954573d6000803e3d6000fd5b505050505050509695505050505050565b3361296e611595565b6001600160a01b031614610a0d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dde565b600080808460028111156129da576129da6159b0565b03612b085760405163c661065760e01b8152600060048201526001600160a01b0384169063c6610657906024016020604051808303816000875af1158015612a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a4a9190615aa0565b60405163c661065760e01b8152600160048201529092506001600160a01b0384169063c6610657906024016020604051808303816000875af1158015612a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ab89190615aa0565b6001600160a01b038481166000908152600360209081526040808320878516845290915280822080546001600160801b031990811690915592841682529020805490911660011790559050612bd1565b826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6a9190615aa0565b9150826001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612baa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bce9190615aa0565b90505b60006040518060600160405280866002811115612bf057612bf06159b0565b81526001600160a01b0380871660208084019190915260006040938401819052878316815260028083528482209388168252929091529190912082518154939450849391929091839160ff19909116906001908490811115612c5457612c546159b0565b02179055506020828101518254610100600160a81b0319166101006001600160a01b0392831602178355604093840151600193840180546001600160a01b0319169183169190911790558581166000908152600280845285822092891682529190925292902083518154859492939192849260ff1990921691908490811115612cdf57612cdf6159b0565b021790555060208201518154610100600160a81b0319166101006001600160a01b0392831602178255604090920151600190910180546001600160a01b031916919092161790555050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b038516612dbc57612d9683614492565b92507f000000000000000000000000000000000000000000000000000000000000000094505b6001600160a01b03848116600090815260046020526040812054909182911615612e025750506001600160a01b0380851660009081526004602052604090205416936001905b6001600160a01b038088166000908152600260208181526040808420948b16845293905282822083516060810190945280549293929091839160ff1690811115612e4e57612e4e6159b0565b6002811115612e5f57612e5f6159b0565b815281546001600160a01b03610100909104811660208084019190915260019093015481166040909201919091529082015191925016612f3f576040805160028082526060820183526000926020830190803683370190505090508881600081518110612ece57612ece615b94565b60200260200101906001600160a01b031690816001600160a01b0316815250508781600181518110612f0257612f02615b94565b6001600160a01b03928316602091820292909201015289811690891614612f3557612f2e818888614638565b9450612f39565b8694505b506134a2565b60408101516001600160a01b03161515600082516002811115612f6457612f646159b0565b036130335761302c82602001516003600085602001516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a9004600f0b6003600086602001516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a9004600f0b8a8a614854565b94506134a0565b600182516002811115613048576130486159b0565b0361325657600082602001516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130b59190615aa0565b90506000826130c55760026130c8565b60035b60ff166001600160401b038111156130e2576130e261572a565b60405190808252806020026020018201604052801561310b578160200160208202803683370190505b5090508a8160008151811061312257613122615b94565b60200260200101906001600160a01b031690816001600160a01b03168152505082156131d2578a6001600160a01b0316826001600160a01b03161461316757816131d4565b83602001516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131cd9190615aa0565b6131d4565b895b816001815181106131e7576131e7615b94565b60200260200101906001600160a01b031690816001600160a01b031681525050821561324257898160028151811061322157613221615b94565b60200260200101906001600160a01b031690816001600160a01b0316815250505b61324d818a8a614638565b965050506134a0565b801561342b57600082602001516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c49190615aa0565b90506134238a84602001516001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa15801561330c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133309190615d20565b8c6001600160a01b0316846001600160a01b03161461334f57836133b5565b85602001516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b59190615aa0565b86604001516001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa1580156133f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061341b9190615d20565b8d8d8d6148e1565b9550506134a0565b61349d8983602001516001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015613471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134959190615d20565b8a8a8a614b1d565b94505b505b826134af57505050613618565b6040516370a0823160e01b81526000906001600160a01b038416906370a08231906134de903090600401615883565b602060405180830381865afa1580156134fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351f9190615abd565b90506135356001600160a01b0389168487613620565b60405163b08d033360e01b81526001600160a01b0384169063b08d033390613566908b908990600090600401615cff565b600060405180830381600087803b15801561358057600080fd5b505af1158015613594573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b03861691506370a08231906135c6903090600401615883565b602060405180830381865afa1580156135e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136079190615abd565b6136119190615b2d565b9450505050505b949350505050565b604051636eb1769f60e11b81526000906001600160a01b0385169063dd62ed3e906136519030908790600401615b5f565b602060405180830381865afa15801561366e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136929190615abd565b90506122178463095ea7b360e01b856136ab8686615d45565b6040516024016136bc929190615b46565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152615081565b6040516370a0823160e01b81526000906001600160a01b038416906370a0823190613722903090600401615883565b602060405180830381865afa15801561373f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137639190615abd565b905081811115612217576001600160a01b03831663a9059cbb856137878585615b2d565b6040518363ffffffff1660e01b81526004016137a4929190615b46565b6020604051808303816000875af11580156137c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137e79190615afa565b5050505050565b606080600085516001600160401b0381111561380c5761380c61572a565b604051908082528060200260200182016040528015613835578160200160208202803683370190505b509050600086516001600160401b038111156138535761385361572a565b60405190808252806020026020018201604052801561387c578160200160208202803683370190505b509050600087878151811061389357613893615b94565b6020026020010151600001516001600160a01b03166370a082318b6040518263ffffffff1660e01b81526004016138ca9190615883565b602060405180830381865afa1580156138e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061390b9190615abd565b905060008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561394d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139719190615abd565b156139945781613985600160601b89615ca3565b61398f9190615cba565b61399a565b600160601b5b90508960005b8a51811015613a35576139f18d8c8c815181106139bf576139bf615b94565b6020026020010151600001518b8e85815181106139de576139de615b94565b602002602001015160000151878761515b565b888481518110613a0357613a03615b94565b60200260200101888581518110613a1c57613a1c615b94565b60209081029190910101919091525291506001016139a0565b50939b929a509198505050505050505050565b600080866001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613a779190615883565b602060405180830381865afa158015613a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab89190615abd565b9050613ace6001600160a01b0387168887613620565b60405163b08d033360e01b81526001600160a01b0388169063b08d033390613afe90899089908990600401615cff565b600060405180830381600087803b158015613b1857600080fd5b505af1158015613b2c573d6000803e3d6000fd5b50505050600081886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613b5f9190615883565b602060405180830381865afa158015613b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ba09190615abd565b613baa9190615b2d565b90506001600160a01b0384163014613c2f5760405163a9059cbb60e01b81526001600160a01b0389169063a9059cbb90613bea9087908590600401615b46565b6020604051808303816000875af1158015613c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c2d9190615afa565b505b979650505050505050565b6000866001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9e9190615aa0565b9050600086886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613ccf9190615883565b602060405180830381865afa158015613cec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d109190615abd565b613d1a9190615b2d565b90506000826001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613d4a9190615883565b602060405180830381865afa158015613d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d8b9190615abd565b90506000896001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613df19190615aa0565b9050613e006000858a8a612d7d565b5060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015613e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e859190615aa0565b6001600160a01b031663e6a439058c876040518363ffffffff1660e01b8152600401613eb2929190615b5f565b602060405180830381865afa158015613ecf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef39190615aa0565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613f239190615883565b602060405180830381865afa158015613f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f649190615abd565b9050613ff38c85886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613f979190615883565b602060405180830381865afa158015613fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fd89190615abd565b613fe29190615b2d565b6001600160a01b0389169190613620565b8b6001600160a01b031663a9e9c8bc8c86896001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016140309190615883565b602060405180830381865afa15801561404d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140719190615abd565b61407b9190615b2d565b8b8b6040518563ffffffff1660e01b815260040161409c9493929190615b79565b600060405180830381600087803b1580156140b657600080fd5b505af11580156140ca573d6000803e3d6000fd5b505050506140ff8382846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016128219190615883565b826001600160a01b031663adc9772e8e83856001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161413c9190615883565b602060405180830381865afa158015614159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061417d9190615abd565b6141879190615b2d565b6040518363ffffffff1660e01b81526004016141a4929190615b46565b600060405180830381600087803b1580156141be57600080fd5b505af11580156141d2573d6000803e3d6000fd5b50506040516370a0823160e01b81528792506001600160a01b038f1691506370a0823190614204903090600401615883565b602060405180830381865afa158015614221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142459190615abd565b1115614335578b6001600160a01b031663a9059cbb8e878f6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016142889190615883565b602060405180830381865afa1580156142a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142c99190615abd565b6142d39190615b2d565b6040518363ffffffff1660e01b81526004016142f0929190615b46565b6020604051808303816000875af115801561430f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143339190615afa565b505b6040516370a0823160e01b815284906001600160a01b038816906370a0823190614363903090600401615883565b602060405180830381865afa158015614380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143a49190615abd565b111561249257856001600160a01b031663a9059cbb8e86896001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016143e79190615883565b602060405180830381865afa158015614404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144289190615abd565b6144329190615b2d565b6040518363ffffffff1660e01b815260040161444f929190615b46565b6020604051808303816000875af115801561446e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124909190615afa565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016144e19190615883565b602060405180830381865afa1580156144fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145229190615abd565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561457f57600080fd5b505af1158015614593573d6000803e3d6000fd5b50506040516370a0823160e01b81528493506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692506370a0823191506145e6903090600401615883565b602060405180830381865afa158015614603573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146279190615abd565b6146319190615b2d565b9392505050565b6000808451600314614664578460018151811061465757614657615b94565b6020026020010151614680565b8460028151811061467757614677615b94565b60200260200101515b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016146b09190615883565b602060405180830381865afa1580156146cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146f19190615abd565b905061474b7f0000000000000000000000000000000000000000000000000000000000000000868860008151811061472b5761472b615b94565b60200260200101516001600160a01b03166136209092919063ffffffff16565b604051635c11d79560e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635c11d7959061479f90889088908b9030904290600401615d9d565b600060405180830381600087803b1580156147b957600080fd5b505af11580156147cd573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b03851691506370a08231906147ff903090600401615883565b602060405180830381865afa15801561481c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148409190615abd565b61484a9190615b2d565b9695505050505050565b60405163ddc1f59d60e01b8152600f85810b600483015284900b602482015260448101839052606481018290523060848201526000906001600160a01b0387169063ddc1f59d9060a4016020604051808303816000875af11580156148bd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061484a9190615abd565b600080846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016149109190615883565b602060405180830381865afa15801561492d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149519190615abd565b90506149876001600160a01b038a167f000000000000000000000000000000000000000000000000000000000000000086613620565b6040516001600160601b031960608b811b821660208401526001600160e81b031960e88c811b821660348601528b831b841660378601528a901b16604b84015287901b16604e82015260009060620160408051601f1981840301815260a08301825280835230602084015242838301526060830188905260808301879052905163c04b8d5960e01b81529092506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163c04b8d5991614a529190600401615e29565b6020604051808303816000875af1158015614a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a959190615abd565b506040516370a0823160e01b815282906001600160a01b038816906370a0823190614ac4903090600401615883565b602060405180830381865afa158015614ae1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b059190615abd565b614b0f9190615b2d565b9a9950505050505050505050565b600081600003614df75760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634556bd207f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015614bb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bda9190615aa0565b6040516001600160e01b031960e084901b1681526001600160a01b039182166004820152818b166024820152908816604482015262ffffff89166064820152608401602060405180830381865afa158015614c39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c5d9190615aa0565b90506000856001600160a01b0316886001600160a01b031610614c805785614c82565b875b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d4bf13347f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637fb4f79d866040518263ffffffff1660e01b8152600401614d019190615883565b602060405180830381865afa158015614d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d429190615aa0565b6040518263ffffffff1660e01b8152600401614d5e9190615883565b602060405180830381865afa158015614d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d9f9190615abd565b9050816001600160a01b0316896001600160a01b031614614dd85780614dc9600160601b88615ca3565b614dd39190615cba565b614df1565b600160601b614de78783615ca3565b614df19190615cba565b94505050505b6040516370a0823160e01b81526000906001600160a01b038616906370a0823190614e26903090600401615883565b602060405180830381865afa158015614e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614e679190615abd565b9050614e9d6001600160a01b0388167f000000000000000000000000000000000000000000000000000000000000000086613620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663414bf3896040518061010001604052808a6001600160a01b03168152602001886001600160a01b031681526020018962ffffff168152602001306001600160a01b031681526020014281526020018781526020016103e86001546103e8614f2f9190615b2d565b614f399089615ca3565b614f439190615cba565b815260006020918201526040805160e085811b6001600160e01b031916825284516001600160a01b03908116600484015293850151841660248301529184015162ffffff1660448201526060840151831660648201526080840151608482015260a084015160a482015260c084015160c48201529201511660e4820152610104016020604051808303816000875af1158015614fe3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150079190615abd565b506040516370a0823160e01b815281906001600160a01b038716906370a0823190615036903090600401615883565b602060405180830381865afa158015615053573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150779190615abd565b613c2f9190615b2d565b60006150d6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166155739092919063ffffffff16565b90508051600014806150f75750808060200190518101906150f79190615afa565b6151565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610dde565b505050565b6040516370a0823160e01b81526000908190819047906001600160a01b038816906370a0823190615190903090600401615883565b602060405180830381865afa1580156151ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906151d19190615abd565b925060008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015615213573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906152379190615abd565b156152c857600160601b87896001600160a01b03166370a082318e6040518263ffffffff1660e01b815260040161526e9190615883565b602060405180830381865afa15801561528b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906152af9190615abd565b6152b99190615ca3565b6152c39190615cba565b615339565b60405163e4b5495760e01b81526001600160a01b038c169063e4b54957906152f8908d908d908d90600401615cdc565b602060405180830381865afa158015615315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906153399190615abd565b60408051600280825260608201835292935060009290916020830190803683370190505090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156153bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906153e19190615aa0565b816000815181106153f4576153f4615b94565b60200260200101906001600160a01b031690816001600160a01b031681525050888160018151811061542857615428615b94565b6001600160a01b03928316602091820292909201015260405163fb3bdb4160e01b81527f00000000000000000000000000000000000000000000000000000000000000009091169063fb3bdb4190899061548c908690869030904290600401615e81565b60006040518083038185885af11580156154aa573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526154d39190810190615eb6565b506154de4784615b2d565b6154e89088615b2d565b955084896001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016155179190615883565b602060405180830381865afa158015615534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906155589190615abd565b6155629190615b2d565b935050505096509650969350505050565b6060613618848460008585600080866001600160a01b0316858760405161559a9190615f3b565b60006040518083038185875af1925050503d80600081146155d7576040519150601f19603f3d011682016040523d82523d6000602084013e6155dc565b606091505b5091509150613c2f8783838760608315615657578251600003615650576001600160a01b0385163b6156505760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610dde565b5081613618565b613618838381511561566c5781518083602001fd5b8060405162461bcd60e51b8152600401610dde9190615f57565b6001600160a01b038116811461094657600080fd5b600080600080600060a086880312156156b357600080fd5b85356156be81615686565b97602087013597506040870135966060810135965060800135945092505050565b8035600381106156ee57600080fd5b919050565b6000806040838503121561570657600080fd5b61570f836156df565b9150602083013561571f81615686565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156157685761576861572a565b604052919050565b600080600083850360a081121561578657600080fd5b843561579181615686565b935060208501356157a181615686565b92506060603f19820112156157b557600080fd5b506157c06060615740565b6157cc604086016156df565b815260608501356157dc81615686565b602082015260808501356157ef81615686565b604082015292959194509192509050565b6000806040838503121561581357600080fd5b823561570f81615686565b600080600080600080600060e0888a03121561583957600080fd5b873561584481615686565b965060208801359550604088013561585b81615686565b969995985095966060810135965060808101359560a0820135955060c0909101359350915050565b6001600160a01b0391909116815260200190565b60006001600160401b038211156158b0576158b061572a565b5060051b60200190565b600060208083850312156158cd57600080fd5b82356001600160401b038111156158e357600080fd5b8301601f810185136158f457600080fd5b803561590761590282615897565b615740565b81815260059190911b8201830190838101908783111561592657600080fd5b928401925b82841015613c2f57833561593e81615686565b8252928401929084019061592b565b60006020828403121561595f57600080fd5b813561463181615686565b6000806000806080858703121561598057600080fd5b843561598b81615686565b9350602085013561599b81615686565b93969395505050506040820135916060013590565b634e487b7160e01b600052602160045260246000fd5b60608101600385106159e857634e487b7160e01b600052602160045260246000fd5b9381526001600160a01b039283166020820152911660409091015290565b801515811461094657600080fd5b600080600080600080600080610100898b031215615a3157600080fd5b8835615a3c81615686565b97506020890135965060408901359550606089013594506080890135935060a0890135925060c0890135915060e0890135615a7681615a06565b809150509295985092959890939650565b600060208284031215615a9957600080fd5b5035919050565b600060208284031215615ab257600080fd5b815161463181615686565b600060208284031215615acf57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615b0c57600080fd5b815161463181615a06565b634e487b7160e01b600052601160045260246000fd5b81810381811115615b4057615b40615b17565b92915050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b93845260208401929092526040830152606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215615bbc57600080fd5b81516002811061463157600080fd5b60006020808385031215615bde57600080fd5b82516001600160401b03811115615bf457600080fd5b8301601f81018513615c0557600080fd5b8051615c1361590282615897565b81815260a09182028301840191848201919088841115615c3257600080fd5b938501935b83851015613c2d5780858a031215615c4f5760008081fd5b615c5881615740565b8551615c6381615686565b8152858701518782015260408087015190820152606080870151615c8681615686565b908201526080868101519082015283529384019391850191615c37565b8082028115828204841417615b4057615b40615b17565b600082615cd757634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6001600160a01b039390931683526020830191909152604082015260600190565b600060208284031215615d3257600080fd5b815162ffffff8116811461463157600080fd5b80820180821115615b4057615b40615b17565b60008151808452602080850194506020840160005b83811015615d925781516001600160a01b031687529582019590820190600101615d6d565b509495945050505050565b85815284602082015260a060408201526000615dbc60a0830186615d58565b6001600160a01b0394909416606083015250608001529392505050565b60005b83811015615df4578181015183820152602001615ddc565b50506000910152565b60008151808452615e15816020860160208601615dd9565b601f01601f19169290920160200192915050565b602081526000825160a06020840152615e4560c0840182615dfd565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b848152608060208201526000615e9a6080830186615d58565b6001600160a01b03949094166040830152506060015292915050565b60006020808385031215615ec957600080fd5b82516001600160401b03811115615edf57600080fd5b8301601f81018513615ef057600080fd5b8051615efe61590282615897565b81815260059190911b82018301908381019087831115615f1d57600080fd5b928401925b82841015613c2f57835182529284019290840190615f22565b60008251615f4d818460208701615dd9565b9190910192915050565b6020815260006146316020830184615dfd56fea2646970667358221220bd27f367dbaa5490007c2fcc4b6fb5dde5187a58cc084b9d3e6ecd2c53d80c5f64736f6c63430008180033000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b94883000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e70000000000000000000000007ed6fd046ef71e2a71092d1597bcebe578a57a76
Deployed Bytecode
0x6080604052600436106100d25760003560e01c80631fd8ecd9146100de57806320800a001461010057806338e781111461011557806353eedc6714610135578063715018a614610155578063816846c81461016a57806384614e1a146101bd5780638da5cb5b146101d0578063a1879d90146101f2578063ccec371614610212578063d71f11fb14610232578063e2a3bd6914610252578063e42f534314610288578063e679daf5146102ed578063f0fa55a914610300578063f2fde38b14610320578063fc173e3d1461034057600080fd5b366100d957005b600080fd5b3480156100ea57600080fd5b506100fe6100f936600461569b565b610360565b005b34801561010c57600080fd5b506100fe6108d7565b34801561012157600080fd5b506100fe6101303660046156f3565b610949565b34801561014157600080fd5b506100fe610150366004615770565b61095f565b34801561016157600080fd5b506100fe6109fb565b34801561017657600080fd5b506101a5610185366004615800565b6003602090815260009283526040808420909152908252902054600f0b81565b604051600f9190910b81526020015b60405180910390f35b6100fe6101cb36600461581e565b610a0f565b3480156101dc57600080fd5b506101e5611595565b6040516101b49190615883565b3480156101fe57600080fd5b506100fe61020d3660046158ba565b6115a4565b34801561021e57600080fd5b506100fe61022d36600461594d565b611639565b34801561023e57600080fd5b506100fe61024d36600461596a565b61179f565b34801561025e57600080fd5b506101e561026d36600461594d565b6004602052600090815260409020546001600160a01b031681565b34801561029457600080fd5b506102de6102a3366004615800565b60026020908152600092835260408084209091529082529020805460019091015460ff8216916001600160a01b036101009091048116911683565b6040516101b4939291906159c6565b6100fe6102fb366004615a14565b61221d565b34801561030c57600080fd5b506100fe61031b366004615a87565b6124a1565b34801561032c57600080fd5b506100fe61033b36600461594d565b6124ae565b34801561034c57600080fd5b506100fe61035b366004615800565b612524565b6000856001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c49190615aa0565b90506000866001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190615aa0565b90506000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161045a9190615883565b602060405180830381865afa158015610477573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049b9190615abd565b90506000826001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016104cb9190615883565b602060405180830381865afa1580156104e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050c9190615abd565b6040516323b872dd60e01b81529091506001600160a01b038516906323b872dd9061053f90339030908d90600401615ad6565b6020604051808303816000875af115801561055e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105829190615afa565b50600061060a8a8685886001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016105b79190615883565b602060405180830381865afa1580156105d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f89190615abd565b6106029190615b2d565b8b8b8b61255a565b9050808a6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016106399190615883565b602060405180830381865afa158015610656573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067a9190615abd565b111561076b576001600160a01b038a1663a9059cbb336040516370a0823160e01b815284906001600160a01b038f16906370a08231906106be903090600401615883565b602060405180830381865afa1580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff9190615abd565b6107099190615b2d565b6040518363ffffffff1660e01b8152600401610726929190615b46565b6020604051808303816000875af1158015610745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107699190615afa565b505b6040516370a0823160e01b815282906001600160a01b038616906370a0823190610799903090600401615883565b602060405180830381865afa1580156107b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107da9190615abd565b11156108cb576001600160a01b03841663a9059cbb336040516370a0823160e01b815285906001600160a01b038916906370a082319061081e903090600401615883565b602060405180830381865afa15801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190615abd565b6108699190615b2d565b6040518363ffffffff1660e01b8152600401610886929190615b46565b6020604051808303816000875af11580156108a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c99190615afa565b505b50505050505050505050565b6108df612965565b60006108e9611595565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114610933576040519150601f19603f3d011682016040523d82523d6000602084013e610938565b606091505b505090508061094657600080fd5b50565b610951612965565b61095b82826129c4565b5050565b610967612965565b6001600160a01b0380841660009081526002602081815260408084209487168452939052919020825181548493839160ff19169060019084908111156109af576109af6159b0565b021790555060208201518154610100600160a81b0319166101006001600160a01b0392831602178255604090920151600190910180546001600160a01b03191691909216179055505050565b610a03612965565b610a0d6000612d2d565b565b60007f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b948836001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a939190615aa0565b6001600160a01b031663e6a43905898a6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190615aa0565b6040518363ffffffff1660e01b8152600401610b21929190615b5f565b602060405180830381865afa158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b629190615aa0565b90506000886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b929190615883565b602060405180830381865afa158015610baf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd39190615abd565b90506000896001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190615aa0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610c649190615883565b602060405180830381865afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190615abd565b90506000610cb33447615b2d565b90506000846001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610ce39190615883565b602060405180830381865afa158015610d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d249190615abd565b90506001600160a01b038c166323b872dd33308e6040518463ffffffff1660e01b8152600401610d5693929190615ad6565b6020604051808303816000875af1158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190615afa565b506001600160a01b038a16610def5760003411610de75760405162461bcd60e51b815260206004820152600760248201526609c8a8a888aa8960cb1b60448201526064015b60405180910390fd5b349850610e64565b6040516323b872dd60e01b81526001600160a01b038b16906323b872dd90610e1f90339030908e90600401615ad6565b6020604051808303816000875af1158015610e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e629190615afa565b505b8b6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190615aa0565b6001600160a01b03168a6001600160a01b031614610f4d57610f4b8a8d6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f449190615aa0565b8b8b612d7d565b505b61109c8c848e6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb49190615aa0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610fdf9190615883565b602060405180830381865afa158015610ffc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110209190615abd565b61102a9190615b2d565b8e6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c9190615aa0565b6001600160a01b03169190613620565b6040516370a0823160e01b81526001600160a01b038d169063a9e9c8bc90869083906370a08231906110d2903090600401615883565b602060405180830381865afa1580156110ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111139190615abd565b61111d9190615b2d565b858f6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111809190615aa0565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016111ab9190615883565b602060405180830381865afa1580156111c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ec9190615abd565b6111f69190615b2d565b8a8a6040518563ffffffff1660e01b81526004016112179493929190615b79565b600060405180830381600087803b15801561123157600080fd5b505af1158015611245573d6000803e3d6000fd5b505050506113388c6001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561128a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ae9190615aa0565b6040516370a0823160e01b815283906001600160a01b038916906370a08231906112dc903090600401615883565b602060405180830381865afa1580156112f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131d9190615abd565b6113279190615b2d565b6001600160a01b0388169190613620565b8b6001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139a9190615aa0565b6001600160a01b031663adc9772e336040516370a0823160e01b815284906001600160a01b038a16906370a08231906113d7903090600401615883565b602060405180830381865afa1580156113f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114189190615abd565b6114229190615b2d565b6040518363ffffffff1660e01b815260040161143f929190615b46565b600060405180830381600087803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b5050505081471115611510576000336114868447615b2d565b604051600081818185875af1925050503d80600081146114c2576040519150601f19603f3d011682016040523d82523d6000602084013e6114c7565b606091505b505090508080156114d85750824710155b61150e5760405162461bcd60e51b81526020600482015260076024820152660a89e9e9aaa86960cb1b6044820152606401610dde565b505b61151b338d866136f3565b611587338d6001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561155d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115819190615aa0565b856136f3565b505050505050505050505050565b6000546001600160a01b031690565b60005b815181101561095b578181815181106115c2576115c2615b94565b60200260200101516001600160a01b031663d279c1916115df3390565b6040518263ffffffff1660e01b81526004016115fb9190615883565b600060405180830381600087803b15801561161557600080fd5b505af1158015611629573d6000803e3d6000fd5b5050600190920191506115a79050565b611641612965565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190611670903090600401615883565b602060405180830381865afa15801561168d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b19190615abd565b116116bb57600080fd5b806001600160a01b031663a9059cbb6116d2611595565b6040516370a0823160e01b81526001600160a01b038516906370a08231906116fe903090600401615883565b602060405180830381865afa15801561171b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173f9190615abd565b6040518363ffffffff1660e01b815260040161175c929190615b46565b6020604051808303816000875af115801561177b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190615afa565b6000846001600160a01b03166353f504476040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118039190615baa565b6001811115611814576118146159b0565b03611f21576000846001600160a01b0316632acada4d6040518163ffffffff1660e01b8152600401600060405180830381865afa158015611859573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118819190810190615bcb565b9050600081516001600160401b0381111561189e5761189e61572a565b6040519080825280602002602001820160405280156118c7578160200160208202803683370190505b5090506000856001600160a01b03166370a08231886040518263ffffffff1660e01b81526004016118f89190615883565b602060405180830381865afa158015611915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119399190615abd565b90506000876001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561197b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199f9190615abd565b156119c257816119b3600160601b88615ca3565b6119bd9190615cba565b6119c8565b600160601b5b905060005b8451811015611cfb576000896001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3a9190615abd565b15611ae857600160601b83878481518110611a5757611a57615b94565b6020026020010151600001516001600160a01b03166370a082318d6040518263ffffffff1660e01b8152600401611a8e9190615883565b602060405180830381865afa158015611aab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acf9190615abd565b611ad99190615ca3565b611ae39190615cba565b611b76565b896001600160a01b031663e4b549578a8a898681518110611b0b57611b0b615b94565b6020026020010151600001516040518463ffffffff1660e01b8152600401611b3593929190615cdc565b602060405180830381865afa158015611b52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b769190615abd565b9050858281518110611b8a57611b8a615b94565b6020026020010151600001516001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611bc19190615883565b602060405180830381865afa158015611bde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c029190615abd565b858381518110611c1457611c14615b94565b602002602001018181525050858281518110611c3257611c32615b94565b6020026020010151600001516001600160a01b03166323b872dd611c533390565b30846040518463ffffffff1660e01b8152600401611c7393929190615ad6565b6020604051808303816000875af1158015611c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb69190615afa565b50611cf28a82888581518110611cce57611cce615b94565b6020026020010151600001516001600160a01b03166136209092919063ffffffff16565b506001016119cd565b506040516370a0823160e01b81526000906001600160a01b038a16906370a0823190611d2b903090600401615883565b602060405180830381865afa158015611d48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6c9190615abd565b60405163b08d033360e01b81529091506001600160a01b038a169063b08d033390611d9f908b908b908b90600401615cff565b600060405180830381600087803b158015611db957600080fd5b505af1158015611dcd573d6000803e3d6000fd5b50505050886001600160a01b031663a9059cbb611de73390565b6040516370a0823160e01b815284906001600160a01b038e16906370a0823190611e15903090600401615883565b602060405180830381865afa158015611e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e569190615abd565b611e609190615b2d565b6040518363ffffffff1660e01b8152600401611e7d929190615b46565b6020604051808303816000875af1158015611e9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec09190615afa565b5060005b8551811015611f1657611f0e33878381518110611ee357611ee3615b94565b602002602001015160000151878481518110611f0157611f01615b94565b60200260200101516136f3565b600101611ec4565b505050505050612217565b6001846001600160a01b03166353f504476040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f859190615baa565b6001811115611f9657611f966159b0565b14611fc85760405162461bcd60e51b8152602060048201526002602482015261555760f01b6044820152606401610dde565b6040516323b872dd60e01b81526001600160a01b038416906323b872dd90611ff890339030908790600401615ad6565b6020604051808303816000875af1158015612017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203b9190615afa565b506120506001600160a01b0384168584613620565b6040516370a0823160e01b81526000906001600160a01b038616906370a082319061207f903090600401615883565b602060405180830381865afa15801561209c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c09190615abd565b60405163b08d033360e01b81529091506001600160a01b0386169063b08d0333906120f390879087908790600401615cff565b600060405180830381600087803b15801561210d57600080fd5b505af1158015612121573d6000803e3d6000fd5b50505050846001600160a01b031663a9059cbb61213b3390565b6040516370a0823160e01b815284906001600160a01b038a16906370a0823190612169903090600401615883565b602060405180830381865afa158015612186573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121aa9190615abd565b6121b49190615b2d565b6040518363ffffffff1660e01b81526004016121d1929190615b46565b6020604051808303816000875af11580156121f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122149190615afa565b50505b50505050565b600034116122565760405162461bcd60e51b81526020600482015260066024820152654e415449564560d01b6044820152606401610dde565b60006122623447615b2d565b90506000896001600160a01b0316632acada4d6040518163ffffffff1660e01b8152600401600060405180830381865afa1580156122a4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122cc9190810190615bcb565b90506000806122f38c866122e057346122eb565b6122eb600234615cba565b858e8e6137ee565b9150915060005b835181101561234257808c1461233a5761233a8d83838151811061232057612320615b94565b6020026020010151868481518110611cce57611cce615b94565b6001016122fa565b5060006123938d858e8151811061235b5761235b615b94565b602002602001015160000151848f8151811061237957612379615b94565b60200260200101518d8a61238d5733613a48565b30613a48565b905085156123b4576123b4338e836123ac600234615cba565b8d8d8d613c3a565b60005b84518110156123fc576123f4338683815181106123d6576123d6615b94565b602002602001015160000151868481518110611f0157611f01615b94565b6001016123b7565b5084471115612492576000336124128747615b2d565b604051600081818185875af1925050503d806000811461244e576040519150601f19603f3d011682016040523d82523d6000602084013e612453565b606091505b50509050806124905760405162461bcd60e51b815260206004820152600960248201526811551214915195539160ba1b6044820152606401610dde565b505b50505050505050505050505050565b6124a9612965565b600155565b6124b6612965565b6001600160a01b03811661251b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dde565b61094681612d2d565b61252c612965565b6001600160a01b03918216600090815260046020526040902080546001600160a01b03191691909216179055565b600080876001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561259b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125bf9190615aa0565b905060007f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b948836001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015612621573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126459190615aa0565b6001600160a01b031663e6a439058a846040518363ffffffff1660e01b8152600401612672929190615b5f565b602060405180830381865afa15801561268f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b39190615aa0565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016126e39190615883565b602060405180830381865afa158015612700573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127249190615abd565b6040516305c2fbcf60e31b8152600481018a90529091506001600160a01b038a1690632e17de7890602401600060405180830381600087803b15801561276957600080fd5b505af115801561277d573d6000803e3d6000fd5b50506040516370a0823160e01b81526001600160a01b038d1692506370a0823191506127ad903090600401615883565b602060405180830381865afa1580156127ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ee9190615abd565b935061287d8a82846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016128219190615883565b602060405180830381865afa15801561283e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128629190615abd565b61286c9190615b2d565b6001600160a01b0385169190613620565b896001600160a01b031663f682399682846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016128b99190615883565b602060405180830381865afa1580156128d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128fa9190615abd565b6129049190615b2d565b8989896040518563ffffffff1660e01b81526004016129269493929190615b79565b600060405180830381600087803b15801561294057600080fd5b505af1158015612954573d6000803e3d6000fd5b505050505050509695505050505050565b3361296e611595565b6001600160a01b031614610a0d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dde565b600080808460028111156129da576129da6159b0565b03612b085760405163c661065760e01b8152600060048201526001600160a01b0384169063c6610657906024016020604051808303816000875af1158015612a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a4a9190615aa0565b60405163c661065760e01b8152600160048201529092506001600160a01b0384169063c6610657906024016020604051808303816000875af1158015612a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ab89190615aa0565b6001600160a01b038481166000908152600360209081526040808320878516845290915280822080546001600160801b031990811690915592841682529020805490911660011790559050612bd1565b826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6a9190615aa0565b9150826001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612baa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bce9190615aa0565b90505b60006040518060600160405280866002811115612bf057612bf06159b0565b81526001600160a01b0380871660208084019190915260006040938401819052878316815260028083528482209388168252929091529190912082518154939450849391929091839160ff19909116906001908490811115612c5457612c546159b0565b02179055506020828101518254610100600160a81b0319166101006001600160a01b0392831602178355604093840151600193840180546001600160a01b0319169183169190911790558581166000908152600280845285822092891682529190925292902083518154859492939192849260ff1990921691908490811115612cdf57612cdf6159b0565b021790555060208201518154610100600160a81b0319166101006001600160a01b0392831602178255604090920151600190910180546001600160a01b031916919092161790555050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b038516612dbc57612d9683614492565b92507f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3894505b6001600160a01b03848116600090815260046020526040812054909182911615612e025750506001600160a01b0380851660009081526004602052604090205416936001905b6001600160a01b038088166000908152600260208181526040808420948b16845293905282822083516060810190945280549293929091839160ff1690811115612e4e57612e4e6159b0565b6002811115612e5f57612e5f6159b0565b815281546001600160a01b03610100909104811660208084019190915260019093015481166040909201919091529082015191925016612f3f576040805160028082526060820183526000926020830190803683370190505090508881600081518110612ece57612ece615b94565b60200260200101906001600160a01b031690816001600160a01b0316815250508781600181518110612f0257612f02615b94565b6001600160a01b03928316602091820292909201015289811690891614612f3557612f2e818888614638565b9450612f39565b8694505b506134a2565b60408101516001600160a01b03161515600082516002811115612f6457612f646159b0565b036130335761302c82602001516003600085602001516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a9004600f0b6003600086602001516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a9004600f0b8a8a614854565b94506134a0565b600182516002811115613048576130486159b0565b0361325657600082602001516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130b59190615aa0565b90506000826130c55760026130c8565b60035b60ff166001600160401b038111156130e2576130e261572a565b60405190808252806020026020018201604052801561310b578160200160208202803683370190505b5090508a8160008151811061312257613122615b94565b60200260200101906001600160a01b031690816001600160a01b03168152505082156131d2578a6001600160a01b0316826001600160a01b03161461316757816131d4565b83602001516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131cd9190615aa0565b6131d4565b895b816001815181106131e7576131e7615b94565b60200260200101906001600160a01b031690816001600160a01b031681525050821561324257898160028151811061322157613221615b94565b60200260200101906001600160a01b031690816001600160a01b0316815250505b61324d818a8a614638565b965050506134a0565b801561342b57600082602001516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c49190615aa0565b90506134238a84602001516001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa15801561330c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133309190615d20565b8c6001600160a01b0316846001600160a01b03161461334f57836133b5565b85602001516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b59190615aa0565b86604001516001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa1580156133f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061341b9190615d20565b8d8d8d6148e1565b9550506134a0565b61349d8983602001516001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015613471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134959190615d20565b8a8a8a614b1d565b94505b505b826134af57505050613618565b6040516370a0823160e01b81526000906001600160a01b038416906370a08231906134de903090600401615883565b602060405180830381865afa1580156134fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351f9190615abd565b90506135356001600160a01b0389168487613620565b60405163b08d033360e01b81526001600160a01b0384169063b08d033390613566908b908990600090600401615cff565b600060405180830381600087803b15801561358057600080fd5b505af1158015613594573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b03861691506370a08231906135c6903090600401615883565b602060405180830381865afa1580156135e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136079190615abd565b6136119190615b2d565b9450505050505b949350505050565b604051636eb1769f60e11b81526000906001600160a01b0385169063dd62ed3e906136519030908790600401615b5f565b602060405180830381865afa15801561366e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136929190615abd565b90506122178463095ea7b360e01b856136ab8686615d45565b6040516024016136bc929190615b46565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152615081565b6040516370a0823160e01b81526000906001600160a01b038416906370a0823190613722903090600401615883565b602060405180830381865afa15801561373f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137639190615abd565b905081811115612217576001600160a01b03831663a9059cbb856137878585615b2d565b6040518363ffffffff1660e01b81526004016137a4929190615b46565b6020604051808303816000875af11580156137c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137e79190615afa565b5050505050565b606080600085516001600160401b0381111561380c5761380c61572a565b604051908082528060200260200182016040528015613835578160200160208202803683370190505b509050600086516001600160401b038111156138535761385361572a565b60405190808252806020026020018201604052801561387c578160200160208202803683370190505b509050600087878151811061389357613893615b94565b6020026020010151600001516001600160a01b03166370a082318b6040518263ffffffff1660e01b81526004016138ca9190615883565b602060405180830381865afa1580156138e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061390b9190615abd565b905060008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561394d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139719190615abd565b156139945781613985600160601b89615ca3565b61398f9190615cba565b61399a565b600160601b5b90508960005b8a51811015613a35576139f18d8c8c815181106139bf576139bf615b94565b6020026020010151600001518b8e85815181106139de576139de615b94565b602002602001015160000151878761515b565b888481518110613a0357613a03615b94565b60200260200101888581518110613a1c57613a1c615b94565b60209081029190910101919091525291506001016139a0565b50939b929a509198505050505050505050565b600080866001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613a779190615883565b602060405180830381865afa158015613a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab89190615abd565b9050613ace6001600160a01b0387168887613620565b60405163b08d033360e01b81526001600160a01b0388169063b08d033390613afe90899089908990600401615cff565b600060405180830381600087803b158015613b1857600080fd5b505af1158015613b2c573d6000803e3d6000fd5b50505050600081886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613b5f9190615883565b602060405180830381865afa158015613b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ba09190615abd565b613baa9190615b2d565b90506001600160a01b0384163014613c2f5760405163a9059cbb60e01b81526001600160a01b0389169063a9059cbb90613bea9087908590600401615b46565b6020604051808303816000875af1158015613c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c2d9190615afa565b505b979650505050505050565b6000866001600160a01b0316634f4ce61d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c9e9190615aa0565b9050600086886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613ccf9190615883565b602060405180830381865afa158015613cec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d109190615abd565b613d1a9190615b2d565b90506000826001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613d4a9190615883565b602060405180830381865afa158015613d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d8b9190615abd565b90506000896001600160a01b03166394cc699e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613df19190615aa0565b9050613e006000858a8a612d7d565b5060007f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b948836001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015613e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e859190615aa0565b6001600160a01b031663e6a439058c876040518363ffffffff1660e01b8152600401613eb2929190615b5f565b602060405180830381865afa158015613ecf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef39190615aa0565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613f239190615883565b602060405180830381865afa158015613f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f649190615abd565b9050613ff38c85886001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613f979190615883565b602060405180830381865afa158015613fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fd89190615abd565b613fe29190615b2d565b6001600160a01b0389169190613620565b8b6001600160a01b031663a9e9c8bc8c86896001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016140309190615883565b602060405180830381865afa15801561404d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140719190615abd565b61407b9190615b2d565b8b8b6040518563ffffffff1660e01b815260040161409c9493929190615b79565b600060405180830381600087803b1580156140b657600080fd5b505af11580156140ca573d6000803e3d6000fd5b505050506140ff8382846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016128219190615883565b826001600160a01b031663adc9772e8e83856001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161413c9190615883565b602060405180830381865afa158015614159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061417d9190615abd565b6141879190615b2d565b6040518363ffffffff1660e01b81526004016141a4929190615b46565b600060405180830381600087803b1580156141be57600080fd5b505af11580156141d2573d6000803e3d6000fd5b50506040516370a0823160e01b81528792506001600160a01b038f1691506370a0823190614204903090600401615883565b602060405180830381865afa158015614221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142459190615abd565b1115614335578b6001600160a01b031663a9059cbb8e878f6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016142889190615883565b602060405180830381865afa1580156142a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142c99190615abd565b6142d39190615b2d565b6040518363ffffffff1660e01b81526004016142f0929190615b46565b6020604051808303816000875af115801561430f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143339190615afa565b505b6040516370a0823160e01b815284906001600160a01b038816906370a0823190614363903090600401615883565b602060405180830381865afa158015614380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143a49190615abd565b111561249257856001600160a01b031663a9059cbb8e86896001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016143e79190615883565b602060405180830381865afa158015614404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144289190615abd565b6144329190615b2d565b6040518363ffffffff1660e01b815260040161444f929190615b46565b6020604051808303816000875af115801561446e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124909190615afa565b6000807f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad386001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016144e19190615883565b602060405180830381865afa1580156144fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145229190615abd565b90507f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad386001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561457f57600080fd5b505af1158015614593573d6000803e3d6000fd5b50506040516370a0823160e01b81528493506001600160a01b037f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad381692506370a0823191506145e6903090600401615883565b602060405180830381865afa158015614603573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146279190615abd565b6146319190615b2d565b9392505050565b6000808451600314614664578460018151811061465757614657615b94565b6020026020010151614680565b8460028151811061467757614677615b94565b60200260200101515b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016146b09190615883565b602060405180830381865afa1580156146cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146f19190615abd565b905061474b7f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b94883868860008151811061472b5761472b615b94565b60200260200101516001600160a01b03166136209092919063ffffffff16565b604051635c11d79560e01b81526001600160a01b037f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b948831690635c11d7959061479f90889088908b9030904290600401615d9d565b600060405180830381600087803b1580156147b957600080fd5b505af11580156147cd573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b03851691506370a08231906147ff903090600401615883565b602060405180830381865afa15801561481c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148409190615abd565b61484a9190615b2d565b9695505050505050565b60405163ddc1f59d60e01b8152600f85810b600483015284900b602482015260448101839052606481018290523060848201526000906001600160a01b0387169063ddc1f59d9060a4016020604051808303816000875af11580156148bd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061484a9190615abd565b600080846001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016149109190615883565b602060405180830381865afa15801561492d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906149519190615abd565b90506149876001600160a01b038a167f000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e786613620565b6040516001600160601b031960608b811b821660208401526001600160e81b031960e88c811b821660348601528b831b841660378601528a901b16604b84015287901b16604e82015260009060620160408051601f1981840301815260a08301825280835230602084015242838301526060830188905260808301879052905163c04b8d5960e01b81529092506001600160a01b037f000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e7169163c04b8d5991614a529190600401615e29565b6020604051808303816000875af1158015614a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a959190615abd565b506040516370a0823160e01b815282906001600160a01b038816906370a0823190614ac4903090600401615883565b602060405180830381865afa158015614ae1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b059190615abd565b614b0f9190615b2d565b9a9950505050505050505050565b600081600003614df75760007f0000000000000000000000007ed6fd046ef71e2a71092d1597bcebe578a57a766001600160a01b0316634556bd207f000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e76001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015614bb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bda9190615aa0565b6040516001600160e01b031960e084901b1681526001600160a01b039182166004820152818b166024820152908816604482015262ffffff89166064820152608401602060405180830381865afa158015614c39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c5d9190615aa0565b90506000856001600160a01b0316886001600160a01b031610614c805785614c82565b875b905060007f0000000000000000000000007ed6fd046ef71e2a71092d1597bcebe578a57a766001600160a01b031663d4bf13347f0000000000000000000000007ed6fd046ef71e2a71092d1597bcebe578a57a766001600160a01b0316637fb4f79d866040518263ffffffff1660e01b8152600401614d019190615883565b602060405180830381865afa158015614d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d429190615aa0565b6040518263ffffffff1660e01b8152600401614d5e9190615883565b602060405180830381865afa158015614d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d9f9190615abd565b9050816001600160a01b0316896001600160a01b031614614dd85780614dc9600160601b88615ca3565b614dd39190615cba565b614df1565b600160601b614de78783615ca3565b614df19190615cba565b94505050505b6040516370a0823160e01b81526000906001600160a01b038616906370a0823190614e26903090600401615883565b602060405180830381865afa158015614e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614e679190615abd565b9050614e9d6001600160a01b0388167f000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e786613620565b7f000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e76001600160a01b031663414bf3896040518061010001604052808a6001600160a01b03168152602001886001600160a01b031681526020018962ffffff168152602001306001600160a01b031681526020014281526020018781526020016103e86001546103e8614f2f9190615b2d565b614f399089615ca3565b614f439190615cba565b815260006020918201526040805160e085811b6001600160e01b031916825284516001600160a01b03908116600484015293850151841660248301529184015162ffffff1660448201526060840151831660648201526080840151608482015260a084015160a482015260c084015160c48201529201511660e4820152610104016020604051808303816000875af1158015614fe3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150079190615abd565b506040516370a0823160e01b815281906001600160a01b038716906370a0823190615036903090600401615883565b602060405180830381865afa158015615053573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150779190615abd565b613c2f9190615b2d565b60006150d6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166155739092919063ffffffff16565b90508051600014806150f75750808060200190518101906150f79190615afa565b6151565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610dde565b505050565b6040516370a0823160e01b81526000908190819047906001600160a01b038816906370a0823190615190903090600401615883565b602060405180830381865afa1580156151ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906151d19190615abd565b925060008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015615213573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906152379190615abd565b156152c857600160601b87896001600160a01b03166370a082318e6040518263ffffffff1660e01b815260040161526e9190615883565b602060405180830381865afa15801561528b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906152af9190615abd565b6152b99190615ca3565b6152c39190615cba565b615339565b60405163e4b5495760e01b81526001600160a01b038c169063e4b54957906152f8908d908d908d90600401615cdc565b602060405180830381865afa158015615315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906153399190615abd565b60408051600280825260608201835292935060009290916020830190803683370190505090507f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b948836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156153bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906153e19190615aa0565b816000815181106153f4576153f4615b94565b60200260200101906001600160a01b031690816001600160a01b031681525050888160018151811061542857615428615b94565b6001600160a01b03928316602091820292909201015260405163fb3bdb4160e01b81527f000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b948839091169063fb3bdb4190899061548c908690869030904290600401615e81565b60006040518083038185885af11580156154aa573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526154d39190810190615eb6565b506154de4784615b2d565b6154e89088615b2d565b955084896001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016155179190615883565b602060405180830381865afa158015615534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906155589190615abd565b6155629190615b2d565b935050505096509650969350505050565b6060613618848460008585600080866001600160a01b0316858760405161559a9190615f3b565b60006040518083038185875af1925050503d80600081146155d7576040519150601f19603f3d011682016040523d82523d6000602084013e6155dc565b606091505b5091509150613c2f8783838760608315615657578251600003615650576001600160a01b0385163b6156505760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610dde565b5081613618565b613618838381511561566c5781518083602001fd5b8060405162461bcd60e51b8152600401610dde9190615f57565b6001600160a01b038116811461094657600080fd5b600080600080600060a086880312156156b357600080fd5b85356156be81615686565b97602087013597506040870135966060810135965060800135945092505050565b8035600381106156ee57600080fd5b919050565b6000806040838503121561570657600080fd5b61570f836156df565b9150602083013561571f81615686565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156157685761576861572a565b604052919050565b600080600083850360a081121561578657600080fd5b843561579181615686565b935060208501356157a181615686565b92506060603f19820112156157b557600080fd5b506157c06060615740565b6157cc604086016156df565b815260608501356157dc81615686565b602082015260808501356157ef81615686565b604082015292959194509192509050565b6000806040838503121561581357600080fd5b823561570f81615686565b600080600080600080600060e0888a03121561583957600080fd5b873561584481615686565b965060208801359550604088013561585b81615686565b969995985095966060810135965060808101359560a0820135955060c0909101359350915050565b6001600160a01b0391909116815260200190565b60006001600160401b038211156158b0576158b061572a565b5060051b60200190565b600060208083850312156158cd57600080fd5b82356001600160401b038111156158e357600080fd5b8301601f810185136158f457600080fd5b803561590761590282615897565b615740565b81815260059190911b8201830190838101908783111561592657600080fd5b928401925b82841015613c2f57833561593e81615686565b8252928401929084019061592b565b60006020828403121561595f57600080fd5b813561463181615686565b6000806000806080858703121561598057600080fd5b843561598b81615686565b9350602085013561599b81615686565b93969395505050506040820135916060013590565b634e487b7160e01b600052602160045260246000fd5b60608101600385106159e857634e487b7160e01b600052602160045260246000fd5b9381526001600160a01b039283166020820152911660409091015290565b801515811461094657600080fd5b600080600080600080600080610100898b031215615a3157600080fd5b8835615a3c81615686565b97506020890135965060408901359550606089013594506080890135935060a0890135925060c0890135915060e0890135615a7681615a06565b809150509295985092959890939650565b600060208284031215615a9957600080fd5b5035919050565b600060208284031215615ab257600080fd5b815161463181615686565b600060208284031215615acf57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615b0c57600080fd5b815161463181615a06565b634e487b7160e01b600052601160045260246000fd5b81810381811115615b4057615b40615b17565b92915050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0392831681529116602082015260400190565b93845260208401929092526040830152606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215615bbc57600080fd5b81516002811061463157600080fd5b60006020808385031215615bde57600080fd5b82516001600160401b03811115615bf457600080fd5b8301601f81018513615c0557600080fd5b8051615c1361590282615897565b81815260a09182028301840191848201919088841115615c3257600080fd5b938501935b83851015613c2d5780858a031215615c4f5760008081fd5b615c5881615740565b8551615c6381615686565b8152858701518782015260408087015190820152606080870151615c8681615686565b908201526080868101519082015283529384019391850191615c37565b8082028115828204841417615b4057615b40615b17565b600082615cd757634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6001600160a01b039390931683526020830191909152604082015260600190565b600060208284031215615d3257600080fd5b815162ffffff8116811461463157600080fd5b80820180821115615b4057615b40615b17565b60008151808452602080850194506020840160005b83811015615d925781516001600160a01b031687529582019590820190600101615d6d565b509495945050505050565b85815284602082015260a060408201526000615dbc60a0830186615d58565b6001600160a01b0394909416606083015250608001529392505050565b60005b83811015615df4578181015183820152602001615ddc565b50506000910152565b60008151808452615e15816020860160208601615dd9565b601f01601f19169290920160200192915050565b602081526000825160a06020840152615e4560c0840182615dfd565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b848152608060208201526000615e9a6080830186615d58565b6001600160a01b03949094166040830152506060015292915050565b60006020808385031215615ec957600080fd5b82516001600160401b03811115615edf57600080fd5b8301601f81018513615ef057600080fd5b8051615efe61590282615897565b81815260059190911b82018301908381019087831115615f1d57600080fd5b928401925b82841015613c2f57835182529284019290840190615f22565b60008251615f4d818460208701615dd9565b9190910192915050565b6020815260006146316020830184615dfd56fea2646970667358221220bd27f367dbaa5490007c2fcc4b6fb5dde5187a58cc084b9d3e6ecd2c53d80c5f64736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b94883000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e70000000000000000000000007ed6fd046ef71e2a71092d1597bcebe578a57a76
-----Decoded View---------------
Arg [0] : _v2Router (address): 0xa6AD18C2aC47803E193F75c3677b14BF19B94883
Arg [1] : _v3Router (address): 0xD26Def32fB422bC5d24FA2D1bE7ef4df1C73B8E7
Arg [2] : _v3TwapUtilities (address): 0x7eD6FD046ef71e2A71092D1597Bcebe578A57a76
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a6ad18c2ac47803e193f75c3677b14bf19b94883
Arg [1] : 000000000000000000000000d26def32fb422bc5d24fa2d1be7ef4df1c73b8e7
Arg [2] : 0000000000000000000000007ed6fd046ef71e2a71092d1597bcebe578a57a76
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.