Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 17 from a total of 17 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 13180988 | 1216 days ago | IN | 0 ETH | 0.0062833 | ||||
Approve | 13070594 | 1233 days ago | IN | 0 ETH | 0.00189528 | ||||
Approve | 13066034 | 1234 days ago | IN | 0 ETH | 0.001629 | ||||
Approve | 13057083 | 1235 days ago | IN | 0 ETH | 0.00168951 | ||||
Approve | 13051963 | 1236 days ago | IN | 0 ETH | 0.00153591 | ||||
Approve | 13039365 | 1238 days ago | IN | 0 ETH | 0.00172209 | ||||
Approve | 13039202 | 1238 days ago | IN | 0 ETH | 0.00200134 | ||||
Approve | 13038594 | 1238 days ago | IN | 0 ETH | 0.00215656 | ||||
Approve | 13038439 | 1238 days ago | IN | 0 ETH | 0.00240233 | ||||
Approve | 13038428 | 1238 days ago | IN | 0 ETH | 0.00273744 | ||||
Approve | 13038421 | 1238 days ago | IN | 0 ETH | 0.00302529 | ||||
Approve | 13037735 | 1238 days ago | IN | 0 ETH | 0.00237369 | ||||
Approve | 13037670 | 1238 days ago | IN | 0 ETH | 0.00251721 | ||||
Approve | 13037550 | 1238 days ago | IN | 0 ETH | 0.00311838 | ||||
Approve | 13037385 | 1238 days ago | IN | 0 ETH | 0.00326364 | ||||
Approve | 13037321 | 1238 days ago | IN | 0 ETH | 0.00372344 | ||||
Set Farming Rati... | 13028907 | 1239 days ago | IN | 0 ETH | 0.00223859 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
12998990 | 1244 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x23c1653E...2DB0483b6 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
YapePair
Compiler Version
v0.8.6+commit.11564f7e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; pragma abicoder v2; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {UniswapV2Pair} from "../helpers/uni-v2/UniswapV2Pair.sol"; import {IUniswapV2Factory} from "../helpers/uni-v2/interfaces/IUniswapV2Factory.sol"; import {UQ112x112} from "../helpers/uni-v2/libraries/UQ112x112.sol"; import {RegistryAPI} from "../helpers/yearn/BaseWrapper.sol"; import {YapeWrapper} from "./YapeWrapper.sol"; import {IYapePair} from "../interfaces/IYapePair.sol"; import {IYapeFactory} from "../interfaces/IYapeFactory.sol"; contract YapePair is UniswapV2Pair, YapeWrapper { using SafeMath for uint256; using SafeERC20 for IERC20; using UQ112x112 for uint224; mapping(address => uint256) public farming; uint256 private _minFarming; uint256 private _maxFarming; address private _registry; uint256 private constant DENOMINATOR = 10000; event YearnDeposit(address token, uint256 amount); event YearnWithdraw(address token, uint256 amount, uint256 yield); modifier onlyOperator() { require(msg.sender == IYapeFactory(factory).operator()); _; } modifier onlyReserved(address token) { require( token == token0 || token == token1, "Yapeswap: NOT A RESERVED TOKEN" ); _; } modifier keepBalance(address token) { uint256 prevBal = _balanceOf(token); _; require(_balanceOf(token) == prevBal, "Yapeswap: BALANCE CHANGED"); } function mint(address to) public override returns (uint256 liquidity) { liquidity = super.mint(to); _rebalance(token0, 0, false); _rebalance(token1, 0, false); } function updateRegistry() public { _registry = IYapeFactory(factory).registry(); } function setFarmingRatio(uint256 min, uint256 max) external onlyOperator { require(max <= DENOMINATOR); require(min <= max); _minFarming = min; _maxFarming = max; } /** * @param token use token0 or token1 * @param amount use type(uint256).max (when you want to migrate all) * @param maxMigrationLoss use 0 for the default value */ function migrate( address token, uint256 amount, uint256 maxMigrationLoss ) external onlyOperator onlyReserved(token) returns (uint256) { return _migrate(token, address(this), amount, maxMigrationLoss); } function rebalance(address token) external onlyReserved(token) { _rebalance(token, 0, true); } function registry() public view override returns (RegistryAPI) { return RegistryAPI(_registry); } function farmingRatio() public view returns (uint256 min, uint256 max) { return (_minFarming, _maxFarming); } function name() public view override returns (string memory) { return "Yape LP"; } function symbol() public view override returns (string memory) { return "YLP"; } function _balanceOf(address token) internal view override returns (uint256) { return IERC20(token).balanceOf(address(this)).add(farming[token]); } function _safeTransfer( address token, address to, uint256 value ) internal override { _rebalance(token, value, false); (bool success, bytes memory data) = token.call( abi.encodeWithSelector(SELECTOR, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "UniswapV2: TRANSFER_FAILED" ); } function _rebalance( address token, uint256 amountOut, bool force ) internal { uint256 newBal = _balanceOf(token).sub(amountOut); uint256 minFarming = newBal.mul(_minFarming).div(DENOMINATOR); uint256 maxFarming = newBal.mul(_maxFarming).div(DENOMINATOR); uint256 currentFarming = farming[token]; uint256 avg = Math.average(minFarming, maxFarming); if (currentFarming > maxFarming || (force && currentFarming > avg)) { // should withdraw from Yearn _fromYearn(token, currentFarming - avg); } else if ( minFarming > currentFarming || (force && avg > currentFarming) ) { // should deposit to Yearn _toYearn(token, avg - currentFarming); } } function _toYearn(address token, uint256 amount) internal keepBalance(token) { uint256 deposited = _deposit( token, address(this), address(this), amount, false ); farming[token] = farming[token].add(deposited); emit YearnDeposit(token, amount); } function _fromYearn(address token, uint256 amount) internal keepBalance(token) { uint256 yearnBal = totalVaultBalance(token, address(this)); uint256 farmingAmount = farming[token]; uint256 yield; if (yearnBal > farmingAmount) { yield = yearnBal - farmingAmount; } else { // rare case yield = 0; } uint256 withdrawn = _withdraw( token, address(this), address(this), amount.add(yield), true ); uint256 netYield; if (withdrawn > amount) { netYield = withdrawn - amount; } else { netYield = 0; } farming[token] = farmingAmount.sub(withdrawn - netYield); // Send fee address feeTo = IUniswapV2Factory(factory).feeTo(); if (netYield > 0) { IERC20(token).safeTransfer(feeTo, netYield); } emit YearnWithdraw(token, withdrawn, netYield); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; import "./interfaces/IUniswapV2Pair.sol"; import "./UniswapV2ERC20.sol"; import "./libraries/Math.sol"; import "./libraries/UQ112x112.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IUniswapV2Factory.sol"; import "./interfaces/IUniswapV2Callee.sol"; contract UniswapV2Pair is UniswapV2ERC20 { using SafeMath for uint256; using UQ112x112 for uint224; uint256 public constant MINIMUM_LIQUIDITY = 10**3; bytes4 internal constant SELECTOR = bytes4(keccak256(bytes("transfer(address,uint256)"))); address public factory; address public token0; address public token1; uint112 internal reserve0; // uses single storage slot, accessible via getReserves uint112 internal reserve1; // uses single storage slot, accessible via getReserves uint32 internal blockTimestampLast; // uses single storage slot, accessible via getReserves uint256 public price0CumulativeLast; uint256 public price1CumulativeLast; uint256 public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event uint256 internal unlocked = 1; modifier lock() { require(unlocked == 1, "UniswapV2: LOCKED"); unlocked = 0; _; unlocked = 1; } event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); constructor() { factory = msg.sender; } // called once by the factory at time of deployment function initialize(address _token0, address _token1) public virtual { require(msg.sender == factory, "UniswapV2: FORBIDDEN"); // sufficient check token0 = _token0; token1 = _token1; } // this low-level function should be called from a contract which performs important safety checks function mint(address to) public virtual lock returns (uint256 liquidity) { (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); // gas savings uint256 balance0 = _balanceOf(token0); uint256 balance1 = _balanceOf(token1); uint256 amount0 = balance0.sub(_reserve0); uint256 amount1 = balance1.sub(_reserve1); bool feeOn = _mintFee(_reserve0, _reserve1); uint256 _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee if (_totalSupply == 0) { liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY); _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens } else { liquidity = Math.min( amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1 ); } require(liquidity > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED"); _mint(to, liquidity); _update(balance0, balance1, _reserve0, _reserve1); if (feeOn) kLast = uint256(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date emit Mint(msg.sender, amount0, amount1); } // this low-level function should be called from a contract which performs important safety checks function burn(address to) public virtual lock returns (uint256 amount0, uint256 amount1) { (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); // gas savings address _token0 = token0; // gas savings address _token1 = token1; // gas savings uint256 balance0 = _balanceOf(_token0); uint256 balance1 = _balanceOf(_token1); uint256 liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); uint256 _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution require( amount0 > 0 && amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED" ); _burn(address(this), liquidity); _safeTransfer(_token0, to, amount0); _safeTransfer(_token1, to, amount1); balance0 = _balanceOf(_token0); balance1 = _balanceOf(_token1); _update(balance0, balance1, _reserve0, _reserve1); if (feeOn) kLast = uint256(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date emit Burn(msg.sender, amount0, amount1, to); } // this low-level function should be called from a contract which performs important safety checks function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) public virtual lock { require( amount0Out > 0 || amount1Out > 0, "UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT" ); (uint112 _reserve0, uint112 _reserve1, ) = getReserves(); // gas savings require( amount0Out < _reserve0 && amount1Out < _reserve1, "UniswapV2: INSUFFICIENT_LIQUIDITY" ); uint256 balance0; uint256 balance1; { // scope for _token{0,1}, avoids stack too deep errors address _token0 = token0; address _token1 = token1; require(to != _token0 && to != _token1, "UniswapV2: INVALID_TO"); if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call( msg.sender, amount0Out, amount1Out, data ); balance0 = _balanceOf(_token0); balance1 = _balanceOf(_token1); } uint256 amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0; uint256 amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0; require( amount0In > 0 || amount1In > 0, "UniswapV2: INSUFFICIENT_INPUT_AMOUNT" ); { // scope for reserve{0,1}Adjusted, avoids stack too deep errors uint256 balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3)); uint256 balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3)); require( balance0Adjusted.mul(balance1Adjusted) >= uint256(_reserve0).mul(_reserve1).mul(1000**2), "UniswapV2: K" ); } _update(balance0, balance1, _reserve0, _reserve1); emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to); } // force balances to match reserves function skim(address to) public virtual lock { address _token0 = token0; // gas savings address _token1 = token1; // gas savings _safeTransfer(_token0, to, _balanceOf(_token0).sub(reserve0)); _safeTransfer(_token1, to, _balanceOf(_token1).sub(reserve1)); } // force reserves to match balances function sync() public virtual lock { _update(_balanceOf(token0), _balanceOf(token1), reserve0, reserve1); } function getReserves() public view returns ( uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast ) { _reserve0 = reserve0; _reserve1 = reserve1; _blockTimestampLast = blockTimestampLast; } function _safeTransfer( address token, address to, uint256 value ) internal virtual { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(SELECTOR, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "UniswapV2: TRANSFER_FAILED" ); } // update reserves and, on the first call per block, price accumulators function _update( uint256 balance0, uint256 balance1, uint112 _reserve0, uint112 _reserve1 ) internal virtual { require( balance0 <= ~uint112(0) && balance1 <= ~uint112(0), "UniswapV2: OVERFLOW" ); uint32 blockTimestamp = uint32(block.timestamp % 2**32); uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { // * never overflows, and + overflow is desired price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed; price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed; } reserve0 = uint112(balance0); reserve1 = uint112(balance1); blockTimestampLast = blockTimestamp; emit Sync(reserve0, reserve1); } // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k) function _mintFee(uint112 _reserve0, uint112 _reserve1) internal virtual returns (bool feeOn) { address feeTo = IUniswapV2Factory(factory).feeTo(); feeOn = feeTo != address(0); uint256 _kLast = kLast; // gas savings if (feeOn) { if (_kLast != 0) { uint256 rootK = Math.sqrt(uint256(_reserve0).mul(_reserve1)); uint256 rootKLast = Math.sqrt(_kLast); if (rootK > rootKLast) { uint256 numerator = totalSupply.mul(rootK.sub(rootKLast)); uint256 denominator = rootK.mul(5).add(rootKLast); uint256 liquidity = numerator / denominator; if (liquidity > 0) _mint(feeTo, liquidity); } } } else if (_kLast != 0) { kLast = 0; } } function _balanceOf(address token) internal view virtual returns (uint256) { return IERC20(token).balanceOf(address(this)); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; interface IUniswapV2Pair { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint256); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns ( uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast ); function price0CumulativeLast() external view returns (uint256); function price1CumulativeLast() external view returns (uint256); function kLast() external view returns (uint256); function mint(address to) external returns (uint256 liquidity); function burn(address to) external returns (uint256 amount0, uint256 amount1); function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; import "./interfaces/IUniswapV2ERC20.sol"; import "./libraries/SafeMath.sol"; contract UniswapV2ERC20 { using SafeMath for uint256; uint8 public constant decimals = 18; uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; bytes32 public DOMAIN_SEPARATOR; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; mapping(address => uint256) public nonces; event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); constructor() { uint256 chainId; assembly { chainId := chainid() } DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes(name())), keccak256(bytes("1")), chainId, address(this) ) ); } function _mint(address to, uint256 value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(address(0), to, value); } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function _approve( address owner, address spender, uint256 value ) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer( address from, address to, uint256 value ) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint256 value) external returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom( address from, address to, uint256 value ) external returns (bool) { if (allowance[from][msg.sender] != ~uint256(0)) { allowance[from][msg.sender] = allowance[from][msg.sender].sub( value ); } _transfer(from, to, value); return true; } function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { require(deadline >= block.timestamp, "UniswapV2: EXPIRED"); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256( abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline ) ) ) ); address recoveredAddress = ecrecover(digest, v, r, s); require( recoveredAddress != address(0) && recoveredAddress == owner, "UniswapV2: INVALID_SIGNATURE" ); _approve(owner, spender, value); } function name() public view virtual returns (string memory) { return "Uniswap V2"; } function symbol() public view virtual returns (string memory) { return "UNI-V2"; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; interface IUniswapV2ERC20 { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) library SafeMath { function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x, "ds-math-add-overflow"); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "ds-math-sub-underflow"); } function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow"); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; // a library for performing various math operations library Math { function min(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x < y ? x : y; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint256 y) internal pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 / 2**112 library UQ112x112 { uint224 constant Q112 = 2**112; // encode a uint112 as a UQ112x112 function encode(uint112 y) internal pure returns (uint224 z) { z = uint224(y) * Q112; // never overflows } // divide a UQ112x112 by a uint112, returning a UQ112x112 function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { z = x / uint224(y); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; interface IERC20 { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; interface IUniswapV2Factory { event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint256) external view returns (address pair); function allPairsLength() external view returns (uint256); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; interface IUniswapV2Callee { function uniswapV2Call( address sender, uint256 amount0, uint256 amount1, bytes calldata data ) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; pragma abicoder v2; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {VaultAPI} from "./BaseStrategy.sol"; interface RegistryAPI { function governance() external view returns (address); function latestVault(address token) external view returns (address); function numVaults(address token) external view returns (uint256); function vaults(address token, uint256 deploymentId) external view returns (address); } /** * @title Yearn Base Wrapper * @author yearn.finance * @notice * BaseWrapper implements all of the required functionality to interoperate * closely with the Vault contract. This contract should be inherited and the * abstract methods implemented to adapt the Wrapper. * A good starting point to build a wrapper is https://github.com/yearn/brownie-wrapper-mix * */ abstract contract BaseWrapper { using Math for uint256; using SafeMath for uint256; IERC20 public token; // Reduce number of external calls (SLOADs stay the same) VaultAPI[] private _cachedVaults; RegistryAPI public registry; // ERC20 Unlimited Approvals (short-circuits VaultAPI.transferFrom) uint256 constant UNLIMITED_APPROVAL = type(uint256).max; // Sentinal values used to save gas on deposit/withdraw/migrate // NOTE: DEPOSIT_EVERYTHING == WITHDRAW_EVERYTHING == MIGRATE_EVERYTHING uint256 constant DEPOSIT_EVERYTHING = type(uint256).max; uint256 constant WITHDRAW_EVERYTHING = type(uint256).max; uint256 constant MIGRATE_EVERYTHING = type(uint256).max; // VaultsAPI.depositLimit is unlimited uint256 constant UNCAPPED_DEPOSITS = type(uint256).max; constructor(address _token, address _registry) { // Recommended to use a token with a `Registry.latestVault(_token) != address(0)` token = IERC20(_token); // Recommended to use `v2.registry.ychad.eth` registry = RegistryAPI(_registry); } /** * @notice * Used to update the yearn registry. * @param _registry The new _registry address. */ function setRegistry(address _registry) external { require(msg.sender == registry.governance()); // In case you want to override the registry instead of re-deploying registry = RegistryAPI(_registry); // Make sure there's no change in governance // NOTE: Also avoid bricking the wrapper from setting a bad registry require(msg.sender == registry.governance()); } /** * @notice * Used to get the most revent vault for the token using the registry. * @return An instance of a VaultAPI */ function bestVault() public view virtual returns (VaultAPI) { return VaultAPI(registry.latestVault(address(token))); } /** * @notice * Used to get all vaults from the registery for the token * @return An array containing instances of VaultAPI */ function allVaults() public view virtual returns (VaultAPI[] memory) { uint256 cache_length = _cachedVaults.length; uint256 num_vaults = registry.numVaults(address(token)); // Use cached if (cache_length == num_vaults) { return _cachedVaults; } VaultAPI[] memory vaults = new VaultAPI[](num_vaults); for (uint256 vault_id = 0; vault_id < cache_length; vault_id++) { vaults[vault_id] = _cachedVaults[vault_id]; } for ( uint256 vault_id = cache_length; vault_id < num_vaults; vault_id++ ) { vaults[vault_id] = VaultAPI( registry.vaults(address(token), vault_id) ); } return vaults; } function _updateVaultCache(VaultAPI[] memory vaults) internal { // NOTE: even though `registry` is update-able by Yearn, the intended behavior // is that any future upgrades to the registry will replay the version // history so that this cached value does not get out of date. if (vaults.length > _cachedVaults.length) { _cachedVaults = vaults; } } /** * @notice * Used to get the balance of an account accross all the vaults for a token. * @dev will be used to get the wrapper balance using totalVaultBalance(address(this)). * @param account The address of the account. * @return balance of token for the account accross all the vaults. */ function totalVaultBalance(address account) public view returns (uint256 balance) { VaultAPI[] memory vaults = allVaults(); for (uint256 id = 0; id < vaults.length; id++) { balance = balance.add( vaults[id] .balanceOf(account) .mul(vaults[id].pricePerShare()) .div(10**uint256(vaults[id].decimals())) ); } } /** * @notice * Used to get the TVL on the underlying vaults. * @return assets the sum of all the assets managed by the underlying vaults. */ function totalAssets() public view returns (uint256 assets) { VaultAPI[] memory vaults = allVaults(); for (uint256 id = 0; id < vaults.length; id++) { assets = assets.add(vaults[id].totalAssets()); } } function _deposit( address depositor, address receiver, uint256 amount, // if `MAX_UINT256`, just deposit everything bool pullFunds // If true, funds need to be pulled from `depositor` via `transferFrom` ) internal returns (uint256 deposited) { VaultAPI _bestVault = bestVault(); if (pullFunds) { if (amount != DEPOSIT_EVERYTHING) { SafeERC20.safeTransferFrom( token, depositor, address(this), amount ); } else { SafeERC20.safeTransferFrom( token, depositor, address(this), token.balanceOf(depositor) ); } } if (token.allowance(address(this), address(_bestVault)) < amount) { SafeERC20.safeApprove(token, address(_bestVault), 0); // Avoid issues with some tokens requiring 0 SafeERC20.safeApprove( token, address(_bestVault), UNLIMITED_APPROVAL ); // Vaults are trusted } // Depositing returns number of shares deposited // NOTE: Shortcut here is assuming the number of tokens deposited is equal to the // number of shares credited, which helps avoid an occasional multiplication // overflow if trying to adjust the number of shares by the share price. uint256 beforeBal = token.balanceOf(address(this)); if (receiver != address(this)) { _bestVault.deposit(amount, receiver); } else if (amount != DEPOSIT_EVERYTHING) { _bestVault.deposit(amount); } else { _bestVault.deposit(); } uint256 afterBal = token.balanceOf(address(this)); deposited = beforeBal.sub(afterBal); // `receiver` now has shares of `_bestVault` as balance, converted to `token` here // Issue a refund if not everything was deposited if (depositor != address(this) && afterBal > 0) SafeERC20.safeTransfer(token, depositor, afterBal); } function _withdraw( address sender, address receiver, uint256 amount, // if `MAX_UINT256`, just withdraw everything bool withdrawFromBest // If true, also withdraw from `_bestVault` ) internal returns (uint256 withdrawn) { VaultAPI _bestVault = bestVault(); VaultAPI[] memory vaults = allVaults(); _updateVaultCache(vaults); // NOTE: This loop will attempt to withdraw from each Vault in `allVaults` that `sender` // is deposited in, up to `amount` tokens. The withdraw action can be expensive, // so it if there is a denial of service issue in withdrawing, the downstream usage // of this wrapper contract must give an alternative method of withdrawing using // this function so that `amount` is less than the full amount requested to withdraw // (e.g. "piece-wise withdrawals"), leading to less loop iterations such that the // DoS issue is mitigated (at a tradeoff of requiring more txns from the end user). for (uint256 id = 0; id < vaults.length; id++) { if (!withdrawFromBest && vaults[id] == _bestVault) { continue; // Don't withdraw from the best } // Start with the total shares that `sender` has uint256 availableShares = vaults[id].balanceOf(sender); // Restrict by the allowance that `sender` has to this contract // NOTE: No need for allowance check if `sender` is this contract if (sender != address(this)) { availableShares = Math.min( availableShares, vaults[id].allowance(sender, address(this)) ); } // Limit by maximum withdrawal size from each vault availableShares = Math.min( availableShares, vaults[id].maxAvailableShares() ); if (availableShares > 0) { // Intermediate step to move shares to this contract before withdrawing // NOTE: No need for share transfer if this contract is `sender` if (sender != address(this)) vaults[id].transferFrom( sender, address(this), availableShares ); if (amount != WITHDRAW_EVERYTHING) { // Compute amount to withdraw fully to satisfy the request uint256 estimatedShares = amount .sub(withdrawn) // NOTE: Changes every iteration .mul(10**uint256(vaults[id].decimals())) .div(vaults[id].pricePerShare()); // NOTE: Every Vault is different // Limit amount to withdraw to the maximum made available to this contract // NOTE: Avoid corner case where `estimatedShares` isn't precise enough // NOTE: If `0 < estimatedShares < 1` but `availableShares > 1`, this will withdraw more than necessary if ( estimatedShares > 0 && estimatedShares < availableShares ) { withdrawn = withdrawn.add( vaults[id].withdraw(estimatedShares) ); } else { withdrawn = withdrawn.add( vaults[id].withdraw(availableShares) ); } } else { withdrawn = withdrawn.add(vaults[id].withdraw()); } // Check if we have fully satisfied the request // NOTE: use `amount = WITHDRAW_EVERYTHING` for withdrawing everything if (amount <= withdrawn) break; // withdrawn as much as we needed } } // If we have extra, deposit back into `_bestVault` for `sender` // NOTE: Invariant is `withdrawn <= amount` if ( withdrawn > amount && withdrawn.sub(amount) > _bestVault.pricePerShare().div(10**_bestVault.decimals()) ) { // Don't forget to approve the deposit if ( token.allowance(address(this), address(_bestVault)) < withdrawn.sub(amount) ) { SafeERC20.safeApprove( token, address(_bestVault), UNLIMITED_APPROVAL ); // Vaults are trusted } _bestVault.deposit(withdrawn.sub(amount), sender); withdrawn = amount; } // `receiver` now has `withdrawn` tokens as balance if (receiver != address(this)) SafeERC20.safeTransfer(token, receiver, withdrawn); } function _migrate(address account) internal returns (uint256) { return _migrate(account, MIGRATE_EVERYTHING); } function _migrate(address account, uint256 amount) internal returns (uint256) { // NOTE: In practice, it was discovered that <50 was the maximum we've see for this variance return _migrate(account, amount, 0); } function _migrate( address account, uint256 amount, uint256 maxMigrationLoss ) internal returns (uint256 migrated) { VaultAPI _bestVault = bestVault(); // NOTE: Only override if we aren't migrating everything uint256 _depositLimit = _bestVault.depositLimit(); uint256 _totalAssets = _bestVault.totalAssets(); if (_depositLimit <= _totalAssets) return 0; // Nothing to migrate (not a failure) uint256 _amount = amount; if ( _depositLimit < UNCAPPED_DEPOSITS && _amount < WITHDRAW_EVERYTHING ) { // Can only deposit up to this amount uint256 _depositLeft = _depositLimit.sub(_totalAssets); if (_amount > _depositLeft) _amount = _depositLeft; } if (_amount > 0) { // NOTE: `false` = don't withdraw from `_bestVault` uint256 withdrawn = _withdraw( account, address(this), _amount, false ); if (withdrawn == 0) return 0; // Nothing to migrate (not a failure) // NOTE: `false` = don't do `transferFrom` because it's already local migrated = _deposit(address(this), account, withdrawn, false); // NOTE: Due to the precision loss of certain calculations, there is a small inefficency // on how migrations are calculated, and this could lead to a DoS issue. Hence, this // value is made to be configurable to allow the user to specify how much is acceptable require(withdrawn.sub(migrated) <= maxMigrationLoss); } // else: nothing to migrate! (not a failure) } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; pragma abicoder v2; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uint256 totalDebt; uint256 totalGain; uint256 totalLoss; bool enforceChangeLimit; uint256 profitLimitRatio; uint256 lossLimitRatio; address customCheck; } interface VaultAPI is IERC20 { function name() external view returns (string calldata); function symbol() external view returns (string calldata); function decimals() external view returns (uint256); function apiVersion() external pure returns (string memory); function permit( address owner, address spender, uint256 amount, uint256 expiry, bytes calldata signature ) external returns (bool); // NOTE: Vyper produces multiple signatures for a given function with "default" args function deposit() external returns (uint256); function deposit(uint256 amount) external returns (uint256); function deposit(uint256 amount, address recipient) external returns (uint256); // NOTE: Vyper produces multiple signatures for a given function with "default" args function withdraw() external returns (uint256); function withdraw(uint256 maxShares) external returns (uint256); function withdraw(uint256 maxShares, address recipient) external returns (uint256); function token() external view returns (address); function strategies(address _strategy) external view returns (StrategyParams memory); function pricePerShare() external view returns (uint256); function totalAssets() external view returns (uint256); function depositLimit() external view returns (uint256); function maxAvailableShares() external view returns (uint256); /** * View how much the Vault would increase this Strategy's borrow limit, * based on its present performance (since its last report). Can be used to * determine expectedReturn in your Strategy. */ function creditAvailable() external view returns (uint256); /** * View how much the Vault would like to pull back from the Strategy, * based on its present performance (since its last report). Can be used to * determine expectedReturn in your Strategy. */ function debtOutstanding() external view returns (uint256); /** * View how much the Vault expect this Strategy to return at the current * block, based on its present performance (since its last report). Can be * used to determine expectedReturn in your Strategy. */ function expectedReturn() external view returns (uint256); /** * This is the main contact point where the Strategy interacts with the * Vault. It is critical that this call is handled as intended by the * Strategy. Therefore, this function will be called by BaseStrategy to * make sure the integration is correct. */ function report( uint256 _gain, uint256 _loss, uint256 _debtPayment ) external returns (uint256); /** * This function should only be used in the scenario where the Strategy is * being retired but no migration of the positions are possible, or in the * extreme scenario that the Strategy needs to be put into "Emergency Exit" * mode in order for it to exit as quickly as possible. The latter scenario * could be for any reason that is considered "critical" that the Strategy * exits its position as fast as possible, such as a sudden change in * market conditions leading to losses, or an imminent failure in an * external dependency. */ function revokeStrategy() external; /** * View the governance address of the Vault to assert privileged functions * can only be called by governance. The Strategy serves the Vault, so it * is subject to governance defined by the Vault. */ function governance() external view returns (address); /** * View the management address of the Vault to assert privileged functions * can only be called by management. The Strategy serves the Vault, so it * is subject to management defined by the Vault. */ function management() external view returns (address); /** * View the guardian address of the Vault to assert privileged functions * can only be called by guardian. The Strategy serves the Vault, so it * is subject to guardian defined by the Vault. */ function guardian() external view returns (address); } /** * This interface is here for the keeper bot to use. */ interface StrategyAPI { function name() external view returns (string memory); function vault() external view returns (address); function want() external view returns (address); function apiVersion() external pure returns (string memory); function keeper() external view returns (address); function isActive() external view returns (bool); function delegatedAssets() external view returns (uint256); function estimatedTotalAssets() external view returns (uint256); function tendTrigger(uint256 callCost) external view returns (bool); function tend() external; function harvestTrigger(uint256 callCost) external view returns (bool); function harvest() external; event Harvested( uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding ); } /** * @title Yearn Base Strategy * @author yearn.finance * @notice * BaseStrategy implements all of the required functionality to interoperate * closely with the Vault contract. This contract should be inherited and the * abstract methods implemented to adapt the Strategy to the particular needs * it has to create a return. * * Of special interest is the relationship between `harvest()` and * `vault.report()'. `harvest()` may be called simply because enough time has * elapsed since the last report, and not because any funds need to be moved * or positions adjusted. This is critical so that the Vault may maintain an * accurate picture of the Strategy's performance. See `vault.report()`, * `harvest()`, and `harvestTrigger()` for further details. */ abstract contract BaseStrategy { using SafeMath for uint256; string public metadataURI; /** * @notice * Used to track which version of `StrategyAPI` this Strategy * implements. * @dev The Strategy's version must match the Vault's `API_VERSION`. * @return A string which holds the current API version of this contract. */ function apiVersion() public pure returns (string memory) { return "0.4.2"; } /** * @notice This Strategy's name. * @dev * You can use this field to manage the "version" of this Strategy, e.g. * `StrategySomethingOrOtherV1`. However, "API Version" is managed by * `apiVersion()` function above. * @return This Strategy's name. */ function name() external view virtual returns (string memory); /** * @notice * The amount (priced in want) of the total assets managed by this strategy should not count * towards Yearn's TVL calculations. * @dev * You can override this field to set it to a non-zero value if some of the assets of this * Strategy is somehow delegated inside another part of of Yearn's ecosystem e.g. another Vault. * Note that this value must be strictly less than or equal to the amount provided by * `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets. * Also note that this value is used to determine the total assets under management by this * strategy, for the purposes of computing the management fee in `Vault` * @return * The amount of assets this strategy manages that should not be included in Yearn's Total Value * Locked (TVL) calculation across it's ecosystem. */ function delegatedAssets() external view virtual returns (uint256) { return 0; } VaultAPI public vault; address public strategist; address public rewards; address public keeper; IERC20 public want; // So indexers can keep track of this event Harvested( uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding ); event UpdatedStrategist(address newStrategist); event UpdatedKeeper(address newKeeper); event UpdatedRewards(address rewards); event UpdatedMinReportDelay(uint256 delay); event UpdatedMaxReportDelay(uint256 delay); event UpdatedProfitFactor(uint256 profitFactor); event UpdatedDebtThreshold(uint256 debtThreshold); event EmergencyExitEnabled(); event UpdatedMetadataURI(string metadataURI); // The minimum number of seconds between harvest calls. See // `setMinReportDelay()` for more details. uint256 public minReportDelay; // The maximum number of seconds between harvest calls. See // `setMaxReportDelay()` for more details. uint256 public maxReportDelay; // The minimum multiple that `callCost` must be above the credit/profit to // be "justifiable". See `setProfitFactor()` for more details. uint256 public profitFactor; // Use this to adjust the threshold at which running a debt causes a // harvest trigger. See `setDebtThreshold()` for more details. uint256 public debtThreshold; // See note on `setEmergencyExit()`. bool public emergencyExit; // modifiers modifier onlyAuthorized() { require( msg.sender == strategist || msg.sender == governance(), "!authorized" ); _; } modifier onlyEmergencyAuthorized() { require( msg.sender == strategist || msg.sender == governance() || msg.sender == vault.guardian() || msg.sender == vault.management(), "!authorized" ); _; } modifier onlyStrategist() { require(msg.sender == strategist, "!strategist"); _; } modifier onlyGovernance() { require(msg.sender == governance(), "!authorized"); _; } modifier onlyKeepers() { require( msg.sender == keeper || msg.sender == strategist || msg.sender == governance() || msg.sender == vault.guardian() || msg.sender == vault.management(), "!authorized" ); _; } constructor(address _vault) { _initialize(_vault, msg.sender, msg.sender, msg.sender); } /** * @notice * Initializes the Strategy, this is called only once, when the * contract is deployed. * @dev `_vault` should implement `VaultAPI`. * @param _vault The address of the Vault responsible for this Strategy. * @param _strategist The address to assign as `strategist`. * The strategist is able to change the reward address * @param _rewards The address to use for pulling rewards. * @param _keeper The adddress of the _keeper. _keeper * can harvest and tend a strategy. */ function _initialize( address _vault, address _strategist, address _rewards, address _keeper ) internal { require(address(want) == address(0), "Strategy already initialized"); vault = VaultAPI(_vault); want = IERC20(vault.token()); SafeERC20.safeApprove(want, _vault, type(uint256).max); // Give Vault unlimited access (might save gas) strategist = _strategist; rewards = _rewards; keeper = _keeper; // initialize variables minReportDelay = 0; maxReportDelay = 86400; profitFactor = 100; debtThreshold = 0; vault.approve(rewards, type(uint256).max); // Allow rewards to be pulled } /** * @notice * Used to change `strategist`. * * This may only be called by governance or the existing strategist. * @param _strategist The new address to assign as `strategist`. */ function setStrategist(address _strategist) external onlyAuthorized { require(_strategist != address(0)); strategist = _strategist; emit UpdatedStrategist(_strategist); } /** * @notice * Used to change `keeper`. * * `keeper` is the only address that may call `tend()` or `harvest()`, * other than `governance()` or `strategist`. However, unlike * `governance()` or `strategist`, `keeper` may *only* call `tend()` * and `harvest()`, and no other authorized functions, following the * principle of least privilege. * * This may only be called by governance or the strategist. * @param _keeper The new address to assign as `keeper`. */ function setKeeper(address _keeper) external onlyAuthorized { require(_keeper != address(0)); keeper = _keeper; emit UpdatedKeeper(_keeper); } /** * @notice * Used to change `rewards`. EOA or smart contract which has the permission * to pull rewards from the vault. * * This may only be called by the strategist. * @param _rewards The address to use for pulling rewards. */ function setRewards(address _rewards) external onlyStrategist { require(_rewards != address(0)); vault.approve(rewards, 0); rewards = _rewards; vault.approve(rewards, type(uint256).max); emit UpdatedRewards(_rewards); } /** * @notice * Used to change `minReportDelay`. `minReportDelay` is the minimum number * of blocks that should pass for `harvest()` to be called. * * For external keepers (such as the Keep3r network), this is the minimum * time between jobs to wait. (see `harvestTrigger()` * for more details.) * * This may only be called by governance or the strategist. * @param _delay The minimum number of seconds to wait between harvests. */ function setMinReportDelay(uint256 _delay) external onlyAuthorized { minReportDelay = _delay; emit UpdatedMinReportDelay(_delay); } /** * @notice * Used to change `maxReportDelay`. `maxReportDelay` is the maximum number * of blocks that should pass for `harvest()` to be called. * * For external keepers (such as the Keep3r network), this is the maximum * time between jobs to wait. (see `harvestTrigger()` * for more details.) * * This may only be called by governance or the strategist. * @param _delay The maximum number of seconds to wait between harvests. */ function setMaxReportDelay(uint256 _delay) external onlyAuthorized { maxReportDelay = _delay; emit UpdatedMaxReportDelay(_delay); } /** * @notice * Used to change `profitFactor`. `profitFactor` is used to determine * if it's worthwhile to harvest, given gas costs. (See `harvestTrigger()` * for more details.) * * This may only be called by governance or the strategist. * @param _profitFactor A ratio to multiply anticipated * `harvest()` gas cost against. */ function setProfitFactor(uint256 _profitFactor) external onlyAuthorized { profitFactor = _profitFactor; emit UpdatedProfitFactor(_profitFactor); } /** * @notice * Sets how far the Strategy can go into loss without a harvest and report * being required. * * By default this is 0, meaning any losses would cause a harvest which * will subsequently report the loss to the Vault for tracking. (See * `harvestTrigger()` for more details.) * * This may only be called by governance or the strategist. * @param _debtThreshold How big of a loss this Strategy may carry without * being required to report to the Vault. */ function setDebtThreshold(uint256 _debtThreshold) external onlyAuthorized { debtThreshold = _debtThreshold; emit UpdatedDebtThreshold(_debtThreshold); } /** * @notice * Used to change `metadataURI`. `metadataURI` is used to store the URI * of the file describing the strategy. * * This may only be called by governance or the strategist. * @param _metadataURI The URI that describe the strategy. */ function setMetadataURI(string calldata _metadataURI) external onlyAuthorized { metadataURI = _metadataURI; emit UpdatedMetadataURI(_metadataURI); } /** * Resolve governance address from Vault contract, used to make assertions * on protected functions in the Strategy. */ function governance() internal view returns (address) { return vault.governance(); } /** * @notice * Provide an accurate conversion from `_amtInWei` (denominated in wei) * to `want` (using the native decimal characteristics of `want`). * @dev * Care must be taken when working with decimals to assure that the conversion * is compatible. As an example: * * given 1e17 wei (0.1 ETH) as input, and want is USDC (6 decimals), * with USDC/ETH = 1800, this should give back 1800000000 (180 USDC) * * @param _amtInWei The amount (in wei/1e-18 ETH) to convert to `want` * @return The amount in `want` of `_amtInEth` converted to `want` **/ function ethToWant(uint256 _amtInWei) public view virtual returns (uint256); /** * @notice * Provide an accurate estimate for the total amount of assets * (principle + return) that this Strategy is currently managing, * denominated in terms of `want` tokens. * * This total should be "realizable" e.g. the total value that could * *actually* be obtained from this Strategy if it were to divest its * entire position based on current on-chain conditions. * @dev * Care must be taken in using this function, since it relies on external * systems, which could be manipulated by the attacker to give an inflated * (or reduced) value produced by this function, based on current on-chain * conditions (e.g. this function is possible to influence through * flashloan attacks, oracle manipulations, or other DeFi attack * mechanisms). * * It is up to governance to use this function to correctly order this * Strategy relative to its peers in the withdrawal queue to minimize * losses for the Vault based on sudden withdrawals. This value should be * higher than the total debt of the Strategy and higher than its expected * value to be "safe". * @return The estimated total assets in this Strategy. */ function estimatedTotalAssets() public view virtual returns (uint256); /* * @notice * Provide an indication of whether this strategy is currently "active" * in that it is managing an active position, or will manage a position in * the future. This should correlate to `harvest()` activity, so that Harvest * events can be tracked externally by indexing agents. * @return True if the strategy is actively managing a position. */ function isActive() public view returns (bool) { return vault.strategies(address(this)).debtRatio > 0 || estimatedTotalAssets() > 0; } /** * Perform any Strategy unwinding or other calls necessary to capture the * "free return" this Strategy has generated since the last time its core * position(s) were adjusted. Examples include unwrapping extra rewards. * This call is only used during "normal operation" of a Strategy, and * should be optimized to minimize losses as much as possible. * * This method returns any realized profits and/or realized losses * incurred, and should return the total amounts of profits/losses/debt * payments (in `want` tokens) for the Vault's accounting (e.g. * `want.balanceOf(this) >= _debtPayment + _profit`). * * `_debtOutstanding` will be 0 if the Strategy is not past the configured * debt limit, otherwise its value will be how far past the debt limit * the Strategy is. The Strategy's debt limit is configured in the Vault. * * NOTE: `_debtPayment` should be less than or equal to `_debtOutstanding`. * It is okay for it to be less than `_debtOutstanding`, as that * should only used as a guide for how much is left to pay back. * Payments should be made to minimize loss from slippage, debt, * withdrawal fees, etc. * * See `vault.debtOutstanding()`. */ function prepareReturn(uint256 _debtOutstanding) internal virtual returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ); /** * Perform any adjustments to the core position(s) of this Strategy given * what change the Vault made in the "investable capital" available to the * Strategy. Note that all "free capital" in the Strategy after the report * was made is available for reinvestment. Also note that this number * could be 0, and you should handle that scenario accordingly. * * See comments regarding `_debtOutstanding` on `prepareReturn()`. */ function adjustPosition(uint256 _debtOutstanding) internal virtual; /** * Liquidate up to `_amountNeeded` of `want` of this strategy's positions, * irregardless of slippage. Any excess will be re-invested with `adjustPosition()`. * This function should return the amount of `want` tokens made available by the * liquidation. If there is a difference between them, `_loss` indicates whether the * difference is due to a realized loss, or if there is some other sitution at play * (e.g. locked funds) where the amount made available is less than what is needed. * * NOTE: The invariant `_liquidatedAmount + _loss <= _amountNeeded` should always be maintained */ function liquidatePosition(uint256 _amountNeeded) internal virtual returns (uint256 _liquidatedAmount, uint256 _loss); /** * Liquidate everything and returns the amount that got freed. * This function is used during emergency exit instead of `prepareReturn()` to * liquidate all of the Strategy's positions back to the Vault. */ function liquidateAllPositions() internal virtual returns (uint256 _amountFreed); /** * @notice * Provide a signal to the keeper that `tend()` should be called. The * keeper will provide the estimated gas cost that they would pay to call * `tend()`, and this function should use that estimate to make a * determination if calling it is "worth it" for the keeper. This is not * the only consideration into issuing this trigger, for example if the * position would be negatively affected if `tend()` is not called * shortly, then this can return `true` even if the keeper might be * "at a loss" (keepers are always reimbursed by Yearn). * @dev * `callCostInWei` must be priced in terms of `wei` (1e-18 ETH). * * This call and `harvestTrigger()` should never return `true` at the same * time. * @param callCostInWei The keeper's estimated gas cost to call `tend()` (in wei). * @return `true` if `tend()` should be called, `false` otherwise. */ function tendTrigger(uint256 callCostInWei) public view virtual returns (bool) { // We usually don't need tend, but if there are positions that need // active maintainence, overriding this function is how you would // signal for that. // If your implementation uses the cost of the call in want, you can // use uint256 callCost = ethToWant(callCostInWei); return false; } /** * @notice * Adjust the Strategy's position. The purpose of tending isn't to * realize gains, but to maximize yield by reinvesting any returns. * * See comments on `adjustPosition()`. * * This may only be called by governance, the strategist, or the keeper. */ function tend() external onlyKeepers { // Don't take profits with this call, but adjust for better gains adjustPosition(vault.debtOutstanding()); } /** * @notice * Provide a signal to the keeper that `harvest()` should be called. The * keeper will provide the estimated gas cost that they would pay to call * `harvest()`, and this function should use that estimate to make a * determination if calling it is "worth it" for the keeper. This is not * the only consideration into issuing this trigger, for example if the * position would be negatively affected if `harvest()` is not called * shortly, then this can return `true` even if the keeper might be "at a * loss" (keepers are always reimbursed by Yearn). * @dev * `callCostInWei` must be priced in terms of `wei` (1e-18 ETH). * * This call and `tendTrigger` should never return `true` at the * same time. * * See `min/maxReportDelay`, `profitFactor`, `debtThreshold` to adjust the * strategist-controlled parameters that will influence whether this call * returns `true` or not. These parameters will be used in conjunction * with the parameters reported to the Vault (see `params`) to determine * if calling `harvest()` is merited. * * It is expected that an external system will check `harvestTrigger()`. * This could be a script run off a desktop or cloud bot (e.g. * https://github.com/iearn-finance/yearn-vaults/blob/master/scripts/keep.py), * or via an integration with the Keep3r network (e.g. * https://github.com/Macarse/GenericKeep3rV2/blob/master/contracts/keep3r/GenericKeep3rV2.sol). * @param callCostInWei The keeper's estimated gas cost to call `harvest()` (in wei). * @return `true` if `harvest()` should be called, `false` otherwise. */ function harvestTrigger(uint256 callCostInWei) public view virtual returns (bool) { uint256 callCost = ethToWant(callCostInWei); StrategyParams memory params = vault.strategies(address(this)); // Should not trigger if Strategy is not activated if (params.activation == 0) return false; // Should not trigger if we haven't waited long enough since previous harvest if (block.timestamp.sub(params.lastReport) < minReportDelay) return false; // Should trigger if hasn't been called in a while if (block.timestamp.sub(params.lastReport) >= maxReportDelay) return true; // If some amount is owed, pay it back // NOTE: Since debt is based on deposits, it makes sense to guard against large // changes to the value from triggering a harvest directly through user // behavior. This should ensure reasonable resistance to manipulation // from user-initiated withdrawals as the outstanding debt fluctuates. uint256 outstanding = vault.debtOutstanding(); if (outstanding > debtThreshold) return true; // Check for profits and losses uint256 total = estimatedTotalAssets(); // Trigger if we have a loss to report if (total.add(debtThreshold) < params.totalDebt) return true; uint256 profit = 0; if (total > params.totalDebt) profit = total.sub(params.totalDebt); // We've earned a profit! // Otherwise, only trigger if it "makes sense" economically (gas cost // is <N% of value moved) uint256 credit = vault.creditAvailable(); return (profitFactor.mul(callCost) < credit.add(profit)); } /** * @notice * Harvests the Strategy, recognizing any profits or losses and adjusting * the Strategy's position. * * In the rare case the Strategy is in emergency shutdown, this will exit * the Strategy's position. * * This may only be called by governance, the strategist, or the keeper. * @dev * When `harvest()` is called, the Strategy reports to the Vault (via * `vault.report()`), so in some cases `harvest()` must be called in order * to take in profits, to borrow newly available funds from the Vault, or * otherwise adjust its position. In other cases `harvest()` must be * called to report to the Vault on the Strategy's position, especially if * any losses have occurred. */ function harvest() external onlyKeepers { uint256 profit = 0; uint256 loss = 0; uint256 debtOutstanding = vault.debtOutstanding(); uint256 debtPayment = 0; if (emergencyExit) { // Free up as much capital as possible uint256 amountFreed = liquidateAllPositions(); if (amountFreed < debtOutstanding) { loss = debtOutstanding.sub(amountFreed); } else if (amountFreed > debtOutstanding) { profit = amountFreed.sub(debtOutstanding); } debtPayment = debtOutstanding.sub(loss); } else { // Free up returns for Vault to pull (profit, loss, debtPayment) = prepareReturn(debtOutstanding); } // Allow Vault to take up to the "harvested" balance of this contract, // which is the amount it has earned since the last time it reported to // the Vault. debtOutstanding = vault.report(profit, loss, debtPayment); // Check if free returns are left, and re-invest them adjustPosition(debtOutstanding); emit Harvested(profit, loss, debtPayment, debtOutstanding); } /** * @notice * Withdraws `_amountNeeded` to `vault`. * * This may only be called by the Vault. * @param _amountNeeded How much `want` to withdraw. * @return _loss Any realized losses */ function withdraw(uint256 _amountNeeded) external returns (uint256 _loss) { require(msg.sender == address(vault), "!vault"); // Liquidate as much as possible to `want`, up to `_amountNeeded` uint256 amountFreed; (amountFreed, _loss) = liquidatePosition(_amountNeeded); // Send it directly back (NOTE: Using `msg.sender` saves some gas here) SafeERC20.safeTransfer(want, msg.sender, amountFreed); // NOTE: Reinvest anything leftover on next `tend`/`harvest` } /** * Do anything necessary to prepare this Strategy for migration, such as * transferring any reserve or LP tokens, CDPs, or other tokens or stores of * value. */ function prepareMigration(address _newStrategy) internal virtual; /** * @notice * Transfers all `want` from this Strategy to `_newStrategy`. * * This may only be called by the Vault. * @dev * The new Strategy's Vault must be the same as this Strategy's Vault. * The migration process should be carefully performed to make sure all * the assets are migrated to the new address, which should have never * interacted with the vault before. * @param _newStrategy The Strategy to migrate to. */ function migrate(address _newStrategy) external { require(msg.sender == address(vault)); require(BaseStrategy(_newStrategy).vault() == vault); prepareMigration(_newStrategy); SafeERC20.safeTransfer( want, _newStrategy, want.balanceOf(address(this)) ); } /** * @notice * Activates emergency exit. Once activated, the Strategy will exit its * position upon the next harvest, depositing all funds into the Vault as * quickly as is reasonable given on-chain conditions. * * This may only be called by governance or the strategist. * @dev * See `vault.setEmergencyShutdown()` and `harvest()` for further details. */ function setEmergencyExit() external onlyEmergencyAuthorized { emergencyExit = true; vault.revokeStrategy(); emit EmergencyExitEnabled(); } /** * Override this to add all tokens/tokenized positions this contract * manages on a *persistent* basis (e.g. not just for swapping back to * want ephemerally). * * NOTE: Do *not* include `want`, already included in `sweep` below. * * Example: * ``` * function protectedTokens() internal override view returns (address[] memory) { * address[] memory protected = new address[](3); * protected[0] = tokenA; * protected[1] = tokenB; * protected[2] = tokenC; * return protected; * } * ``` */ function protectedTokens() internal view virtual returns (address[] memory); /** * @notice * Removes tokens from this Strategy that are not the type of tokens * managed by this Strategy. This may be used in case of accidentally * sending the wrong kind of token to this Strategy. * * Tokens will be sent to `governance()`. * * This will fail if an attempt is made to sweep `want`, or any tokens * that are protected by this Strategy. * * This may only be called by governance. * @dev * Implement `protectedTokens()` to specify any additional tokens that * should be protected from sweeping in addition to `want`. * @param _token The token to transfer out of this vault. */ function sweep(address _token) external onlyGovernance { require(_token != address(want), "!want"); require(_token != address(vault), "!shares"); address[] memory _protectedTokens = protectedTokens(); for (uint256 i; i < _protectedTokens.length; i++) require(_token != _protectedTokens[i], "!protected"); SafeERC20.safeTransfer( IERC20(_token), governance(), IERC20(_token).balanceOf(address(this)) ); } } abstract contract BaseStrategyInitializable is BaseStrategy { bool public isOriginal = true; event Cloned(address indexed clone); constructor(address _vault) BaseStrategy(_vault) {} function initialize( address _vault, address _strategist, address _rewards, address _keeper ) external virtual { _initialize(_vault, _strategist, _rewards, _keeper); } function clone(address _vault) external returns (address) { require(isOriginal, "!clone"); return this.clone(_vault, msg.sender, msg.sender, msg.sender); } function clone( address _vault, address _strategist, address _rewards, address _keeper ) external returns (address newStrategy) { // Copied from https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol bytes20 addressBytes = bytes20(address(this)); assembly { // EIP-1167 bytecode let clone_code := mload(0x40) mstore( clone_code, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 ) mstore(add(clone_code, 0x14), addressBytes) mstore( add(clone_code, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) newStrategy := create(0, clone_code, 0x37) } BaseStrategyInitializable(newStrategy).initialize( _vault, _strategist, _rewards, _keeper ); emit Cloned(newStrategy); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; pragma abicoder v2; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {VaultAPI} from "../helpers/yearn/BaseStrategy.sol"; import {RegistryAPI} from "../helpers/yearn/BaseWrapper.sol"; /** * @title Functional Wrapper * @author yapeswap * @notice * YapeWrapper is a fork of Yearn Finance's BaseWrapper not to store the token address as * the state variable. * */ abstract contract YapeWrapper { using SafeERC20 for IERC20; using Math for uint256; using SafeMath for uint256; // Reduce number of external calls (SLOADs stay the same) mapping(address => VaultAPI[]) private _cachedVaults; // ERC20 Unlimited Approvals (short-circuits VaultAPI.transferFrom) uint256 constant UNLIMITED_APPROVAL = type(uint256).max; // Sentinal values used to save gas on deposit/withdraw/migrate // NOTE: DEPOSIT_EVERYTHING == WITHDRAW_EVERYTHING == MIGRATE_EVERYTHING uint256 constant DEPOSIT_EVERYTHING = type(uint256).max; uint256 constant WITHDRAW_EVERYTHING = type(uint256).max; uint256 constant MIGRATE_EVERYTHING = type(uint256).max; // VaultsAPI.depositLimit is unlimited uint256 constant UNCAPPED_DEPOSITS = type(uint256).max; /** * @notice * Used to get the most revent vault for the token using the registry. * @return An instance of a VaultAPI */ function bestVault(address token) public view virtual returns (VaultAPI) { return VaultAPI(registry().latestVault(token)); } /** * @notice * Used to get all vaults from the registery for the token * @return An array containing instances of VaultAPI */ function allVaults(address token) public view virtual returns (VaultAPI[] memory) { uint256 cache_length = _cachedVaults[token].length; uint256 num_vaults = registry().numVaults(token); // Use cached if (cache_length == num_vaults) { return _cachedVaults[token]; } VaultAPI[] memory vaults = new VaultAPI[](num_vaults); for (uint256 vault_id = 0; vault_id < cache_length; vault_id++) { vaults[vault_id] = _cachedVaults[token][vault_id]; } for ( uint256 vault_id = cache_length; vault_id < num_vaults; vault_id++ ) { vaults[vault_id] = VaultAPI(registry().vaults(token, vault_id)); } return vaults; } function _updateVaultCache(address token, VaultAPI[] memory vaults) internal { // NOTE: even though `registry` is update-able by Yearn, the intended behavior // is that any future upgrades to the registry will replay the version // history so that this cached value does not get out of date. if (vaults.length > _cachedVaults[token].length) { _cachedVaults[token] = vaults; } } /** * @notice * Used to get the balance of an account accross all the vaults for a token. * @dev will be used to get the wrapper balance using totalVaultBalance(address(this)). * @param account The address of the account. * @return balance of token for the account accross all the vaults. */ function totalVaultBalance(address token, address account) public view returns (uint256 balance) { VaultAPI[] memory vaults = allVaults(token); for (uint256 id = 0; id < vaults.length; id++) { balance = balance.add( vaults[id] .balanceOf(account) .mul(vaults[id].pricePerShare()) .div(10**uint256(vaults[id].decimals())) ); } } /** * @notice * Used to get the TVL on the underlying vaults. * @return assets the sum of all the assets managed by the underlying vaults. */ function totalAssets(address token) public view returns (uint256 assets) { VaultAPI[] memory vaults = allVaults(token); for (uint256 id = 0; id < vaults.length; id++) { assets = assets.add(vaults[id].totalAssets()); } } function _deposit( address token, address depositor, address receiver, uint256 amount, // if `MAX_UINT256`, just deposit everything bool pullFunds // If true, funds need to be pulled from `depositor` via `transferFrom` ) internal returns (uint256 deposited) { VaultAPI _bestVault = bestVault(token); // in case there does not exist yearn vault if (address(_bestVault) == address(0)) return 0; IERC20 _token = IERC20(token); if (pullFunds) { if (amount != DEPOSIT_EVERYTHING) { _token.safeTransferFrom(depositor, address(this), amount); } else { _token.safeTransferFrom( depositor, address(this), _token.balanceOf(depositor) ); } } if (_token.allowance(address(this), address(_bestVault)) < amount) { _token.safeApprove(address(_bestVault), 0); // Avoid issues with some tokens requiring 0 _token.safeApprove(address(_bestVault), UNLIMITED_APPROVAL); // Vaults are trusted } // Depositing returns number of shares deposited // NOTE: Shortcut here is assuming the number of tokens deposited is equal to the // number of shares credited, which helps avoid an occasional multiplication // overflow if trying to adjust the number of shares by the share price. uint256 beforeBal = _token.balanceOf(address(this)); if (receiver != address(this)) { _bestVault.deposit(amount, receiver); } else if (amount != DEPOSIT_EVERYTHING) { _bestVault.deposit(amount); } else { _bestVault.deposit(); } uint256 afterBal = _token.balanceOf(address(this)); deposited = beforeBal.sub(afterBal); // `receiver` now has shares of `_bestVault` as balance, converted to `token` here // Issue a refund if not everything was deposited if (depositor != address(this) && afterBal > 0) _token.safeTransfer(depositor, afterBal); } function _withdraw( address token, address sender, address receiver, uint256 amount, // if `MAX_UINT256`, just withdraw everything bool withdrawFromBest // If true, also withdraw from `_bestVault` ) internal returns (uint256 withdrawn) { VaultAPI _bestVault = bestVault(token); IERC20 _token = IERC20(token); VaultAPI[] memory vaults = allVaults(token); _updateVaultCache(address(token), vaults); // NOTE: This loop will attempt to withdraw from each Vault in `allVaults` that `sender` // is deposited in, up to `amount` tokens. The withdraw action can be expensive, // so it if there is a denial of service issue in withdrawing, the downstream usage // of this wrapper contract must give an alternative method of withdrawing using // this function so that `amount` is less than the full amount requested to withdraw // (e.g. "piece-wise withdrawals"), leading to less loop iterations such that the // DoS issue is mitigated (at a tradeoff of requiring more txns from the end user). for (uint256 id = 0; id < vaults.length; id++) { if (!withdrawFromBest && vaults[id] == _bestVault) { continue; // Don't withdraw from the best } // Start with the total shares that `sender` has uint256 availableShares = vaults[id].balanceOf(sender); // Restrict by the allowance that `sender` has to this contract // NOTE: No need for allowance check if `sender` is this contract if (sender != address(this)) { availableShares = Math.min( availableShares, vaults[id].allowance(sender, address(this)) ); } // Limit by maximum withdrawal size from each vault availableShares = Math.min( availableShares, vaults[id].maxAvailableShares() ); if (availableShares > 0) { // Intermediate step to move shares to this contract before withdrawing // NOTE: No need for share transfer if this contract is `sender` if (sender != address(this)) vaults[id].transferFrom( sender, address(this), availableShares ); if (amount != WITHDRAW_EVERYTHING) { // Compute amount to withdraw fully to satisfy the request uint256 estimatedShares = amount .sub(withdrawn) // NOTE: Changes every iteration .mul(10**uint256(vaults[id].decimals())) .div(vaults[id].pricePerShare()); // NOTE: Every Vault is different // Limit amount to withdraw to the maximum made available to this contract // NOTE: Avoid corner case where `estimatedShares` isn't precise enough // NOTE: If `0 < estimatedShares < 1` but `availableShares > 1`, this will withdraw more than necessary if ( estimatedShares > 0 && estimatedShares < availableShares ) { withdrawn = withdrawn.add( vaults[id].withdraw(estimatedShares) ); } else { withdrawn = withdrawn.add( vaults[id].withdraw(availableShares) ); } } else { withdrawn = withdrawn.add(vaults[id].withdraw()); } // Check if we have fully satisfied the request // NOTE: use `amount = WITHDRAW_EVERYTHING` for withdrawing everything if (amount <= withdrawn) break; // withdrawn as much as we needed } } // If we have extra, deposit back into `_bestVault` for `sender` // NOTE: Invariant is `withdrawn <= amount` if ( withdrawn > amount && withdrawn.sub(amount) > _bestVault.pricePerShare().div(10**_bestVault.decimals()) ) { // Don't forget to approve the deposit if ( _token.allowance(address(this), address(_bestVault)) < withdrawn.sub(amount) ) { _token.safeApprove(address(_bestVault), UNLIMITED_APPROVAL); // Vaults are trusted } _bestVault.deposit(withdrawn.sub(amount), sender); withdrawn = amount; } // `receiver` now has `withdrawn` tokens as balance if (receiver != address(this)) _token.safeTransfer(receiver, withdrawn); } function _migrate( address token, address account, uint256 amount, uint256 maxMigrationLoss ) internal returns (uint256 migrated) { VaultAPI _bestVault = bestVault(address(token)); // NOTE: Only override if we aren't migrating everything uint256 _depositLimit = _bestVault.depositLimit(); uint256 _totalAssets = _bestVault.totalAssets(); if (_depositLimit <= _totalAssets) return 0; // Nothing to migrate (not a failure) uint256 _amount = amount; if ( _depositLimit < UNCAPPED_DEPOSITS && _amount < WITHDRAW_EVERYTHING ) { // Can only deposit up to this amount uint256 _depositLeft = _depositLimit.sub(_totalAssets); if (_amount > _depositLeft) _amount = _depositLeft; } if (_amount > 0) { // NOTE: `false` = don't withdraw from `_bestVault` uint256 withdrawn = _withdraw( token, account, address(this), _amount, false ); if (withdrawn == 0) return 0; // Nothing to migrate (not a failure) // NOTE: `false` = don't do `transferFrom` because it's already local migrated = _deposit( token, address(this), account, withdrawn, false ); // NOTE: Due to the precision loss of certain calculations, there is a small inefficency // on how migrations are calculated, and this could lead to a DoS issue. Hence, this // value is made to be configurable to allow the user to specify how much is acceptable require(withdrawn.sub(migrated) <= maxMigrationLoss); } // else: nothing to migrate! (not a failure) } function registry() public view virtual returns (RegistryAPI); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; import {IUniswapV2Pair} from "../helpers/uni-v2/interfaces/IUniswapV2Pair.sol"; interface IYapePair is IUniswapV2Pair { function updateRegistry() external; function setFarmingRatio(uint256 min, uint256 max) external; function migrate(address token) external returns (uint256); function migrate(address token, uint256 amount) external returns (uint256); function migrate( address token, uint256 amount, uint256 maxMigrationLoss ) external returns (uint256); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.0; import {IUniswapV2Factory} from "../helpers/uni-v2/interfaces/IUniswapV2Factory.sol"; interface IYapeFactory is IUniswapV2Factory { function registry() external view returns (address); function operator() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "metadata": { "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"YearnDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"yield","type":"uint256"}],"name":"YearnWithdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"allVaults","outputs":[{"internalType":"contract VaultAPI[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"bestVault","outputs":[{"internalType":"contract VaultAPI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"farming","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"farmingRatio","outputs":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"_reserve0","type":"uint112"},{"internalType":"uint112","name":"_reserve1","type":"uint112"},{"internalType":"uint32","name":"_blockTimestampLast","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxMigrationLoss","type":"uint256"}],"name":"migrate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"rebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract RegistryAPI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setFarmingRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"totalVaultBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102925760003560e01c806370a0823111610160578063ba9a7a56116100d8578063dd62ed3e1161008c578063f3e0ffbf11610071578063f3e0ffbf14610681578063fc22d0e514610694578063fff6cae9146106a757600080fd5b8063dd62ed3e14610643578063ed69e8651461066e57600080fd5b8063c45a0155116100bd578063c45a0155146105f0578063d21220a714610610578063d505accf1461063057600080fd5b8063ba9a7a56146105d4578063bc25cf77146105dd57600080fd5b80637ecebe001161012f57806395d89b411161011457806395d89b4114610575578063a9059cbb146105ae578063ac069907146105c157600080fd5b80637ecebe001461054257806389afcb441461056257600080fd5b806370a08231146104db578063732cd7ab146104fb5780637464fc3d1461051b5780637b1039991461052457600080fd5b806323b872dd1161020e578063485cc955116101c25780635909c0d5116101a75780635909c0d5146104b65780635a3d5493146104bf5780636a627842146104c857600080fd5b8063485cc9551461049b57806349d10b64146104ae57600080fd5b806330adf81f116101f357806330adf81f14610451578063313ce567146104785780633644e5151461049257600080fd5b806323b872dd1461041e57806328d6dbcd1461043157600080fd5b80630dfe16811161026557806319de419e1161024a57806319de419e146103dc578063212a8c95146103f857806321c281911461040b57600080fd5b80630dfe16811461038057806318160ddd146103c557600080fd5b8063022c0d9f1461029757806306fdde03146102ac5780630902f1ac146102f7578063095ea7b31461035d575b600080fd5b6102aa6102a5366004614f7f565b6106af565b005b60408051808201909152600781527f59617065204c500000000000000000000000000000000000000000000000000060208201525b6040516102ee9190615103565b60405180910390f35b600854604080516dffffffffffffffffffffffffffff80841682526e01000000000000000000000000000084041660208201527c010000000000000000000000000000000000000000000000000000000090920463ffffffff16908201526060016102ee565b61037061036b366004614ec1565b610d00565b60405190151581526020016102ee565b6006546103a09073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102ee565b6103ce60005481565b6040519081526020016102ee565b600f546010545b604080519283526020830191909152016102ee565b6103ce610406366004614dd0565b610d17565b6102aa610419366004614d96565b610f5f565b61037061042c366004614e09565b61101b565b6103ce61043f366004614d96565b600e6020526000908152604090205481565b6103ce7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b610480601281565b60405160ff90911681526020016102ee565b6103ce60035481565b6102aa6104a9366004614dd0565b6110f5565b6102aa6111c9565b6103ce60095481565b6103ce600a5481565b6103ce6104d6366004614d96565b6112b0565b6103ce6104e9366004614d96565b60016020526000908152604090205481565b61050e610509366004614d96565b61130d565b6040516102ee91906150a9565b6103ce600b5481565b60115473ffffffffffffffffffffffffffffffffffffffff166103a0565b6103ce610550366004614d96565b60046020526000908152604090205481565b6103e3610570366004614d96565b6116ab565b60408051808201909152600381527f594c50000000000000000000000000000000000000000000000000000000000060208201526102e1565b6103706105bc366004614ec1565b611959565b6103a06105cf366004614d96565b611966565b6103ce6103e881565b6102aa6105eb366004614d96565b611a28565b6005546103a09073ffffffffffffffffffffffffffffffffffffffff1681565b6007546103a09073ffffffffffffffffffffffffffffffffffffffff1681565b6102aa61063e366004614e4a565b611b2d565b6103ce610651366004614dd0565b600260209081526000928352604080842090915290825290205481565b6102aa61067c366004614f5d565b611e18565b6103ce61068f366004614d96565b611f16565b6103ce6106a2366004614eed565b611fe5565b6102aa61217f565b600c54600114610720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b454400000000000000000000000000000060448201526064015b60405180910390fd5b6000600c55841515806107335750600084115b6107bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f556e697377617056323a20494e53554646494349454e545f4f55545055545f4160448201527f4d4f554e540000000000000000000000000000000000000000000000000000006064820152608401610717565b60008061081b6008546dffffffffffffffffffffffffffff808216926e01000000000000000000000000000083049091169163ffffffff7c01000000000000000000000000000000000000000000000000000000009091041690565b5091509150816dffffffffffffffffffffffffffff168710801561084e5750806dffffffffffffffffffffffffffff1686105b6108da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f556e697377617056323a20494e53554646494349454e545f4c4951554944495460448201527f59000000000000000000000000000000000000000000000000000000000000006064820152608401610717565b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061093f57508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f00000000000000000000006044820152606401610717565b8a156109b6576109b6828a8d61226d565b89156109c7576109c7818a8c61226d565b8615610a5a576040517f10d1e85c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a16906310d1e85c90610a279033908f908f908e908e90600401615031565b600060405180830381600087803b158015610a4157600080fd5b505af1158015610a55573d6000803e3d6000fd5b505050505b610a6382612419565b9350610a6e81612419565b92505050600089856dffffffffffffffffffffffffffff16610a909190615363565b8311610a9d576000610ac1565b610ab78a6dffffffffffffffffffffffffffff8716615363565b610ac19084615363565b90506000610adf8a6dffffffffffffffffffffffffffff8716615363565b8311610aec576000610b10565b610b068a6dffffffffffffffffffffffffffff8716615363565b610b109084615363565b90506000821180610b215750600081115b610bac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f556e697377617056323a20494e53554646494349454e545f494e5055545f414d60448201527f4f554e54000000000000000000000000000000000000000000000000000000006064820152608401610717565b6000610bce610bbc8460036124d0565b610bc8876103e86124d0565b9061255a565b90506000610be0610bbc8460036124d0565b9050610c0c620f4240610c066dffffffffffffffffffffffffffff8b8116908b166124d0565b906124d0565b610c1683836124d0565b1015610c7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b00000000000000000000000000000000000000006044820152606401610717565b5050610c8c848488886125d2565b60408051838152602081018390529081018c9052606081018b905273ffffffffffffffffffffffffffffffffffffffff8a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001600c55505050505050505050565b6000610d0d3384846128ae565b5060015b92915050565b600080610d238461130d565b905060005b8151811015610f5757610f43610f3c838381518110610d4957610d49615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9657600080fd5b505afa158015610daa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dce9190614f44565b610dd990600a61521c565b610f36858581518110610dee57610dee615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3b57600080fd5b505afa158015610e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e739190614f44565b868681518110610e8557610e85615476565b60209081029190910101516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152909116906370a082319060240160206040518083038186803b158015610ef857600080fd5b505afa158015610f0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f309190614f44565b9061291d565b90612929565b8490612935565b925080610f4f816153cb565b915050610d28565b505092915050565b600654819073ffffffffffffffffffffffffffffffffffffffff80831691161480610fa4575060075473ffffffffffffffffffffffffffffffffffffffff8281169116145b61100a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f59617065737761703a204e4f54204120524553455256454420544f4b454e00006044820152606401610717565b6110178260006001612941565b5050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146110df5773ffffffffffffffffffffffffffffffffffffffff841660009081526002602090815260408083203384529091529020546110ad908361255a565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b6110ea848484612a32565b5060015b9392505050565b60055473ffffffffffffffffffffffffffffffffffffffff163314611176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e0000000000000000000000006044820152606401610717565b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b1039996040518163ffffffff1660e01b815260040160206040518083038186803b15801561123157600080fd5b505afa158015611245573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112699190614db3565b601180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006112bb82612aff565b6006549091506112e39073ffffffffffffffffffffffffffffffffffffffff16600080612941565b6007546113089073ffffffffffffffffffffffffffffffffffffffff16600080612941565b919050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600d602052604081205460609161135560115473ffffffffffffffffffffffffffffffffffffffff1690565b6040517ff9c7bba500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152919091169063f9c7bba59060240160206040518083038186803b1580156113be57600080fd5b505afa1580156113d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f69190614f44565b9050808214156114905773ffffffffffffffffffffffffffffffffffffffff84166000908152600d60209081526040918290208054835181840281018401909452808452909183018282801561148257602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611457575b505050505092505050919050565b60008167ffffffffffffffff8111156114ab576114ab6154a5565b6040519080825280602002602001820160405280156114d4578160200160208202803683370190505b50905060005b8381101561158d5773ffffffffffffffffffffffffffffffffffffffff86166000908152600d6020526040902080548290811061151957611519615476565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682828151811061155657611556615476565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015280611585816153cb565b9150506114da565b50825b828110156116a25760115473ffffffffffffffffffffffffffffffffffffffff166040517f7bbfc69e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018490529190911690637bbfc69e9060440160206040518083038186803b15801561162157600080fd5b505afa158015611635573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116599190614db3565b82828151811061166b5761166b615476565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101528061169a816153cb565b915050611590565b50949350505050565b600080600c5460011461171a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b45440000000000000000000000000000006044820152606401610717565b6000600c8190556008546006546007546dffffffffffffffffffffffffffff808416946e010000000000000000000000000000909404169273ffffffffffffffffffffffffffffffffffffffff928316929091169061177883612419565b9050600061178583612419565b306000908152600160205260408120549192506117a28888612df0565b600054909150806117b384876124d0565b6117bd91906151a7565b9a50806117ca84866124d0565b6117d491906151a7565b995060008b1180156117e6575060008a115b611872576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f556e697377617056323a20494e53554646494349454e545f4c4951554944495460448201527f595f4255524e45440000000000000000000000000000000000000000000000006064820152608401610717565b61187c3084612f69565b611887878d8d61226d565b611892868d8c61226d565b61189b87612419565b94506118a686612419565b93506118b485858b8b6125d2565b81156118f0576008546118ec906dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166124d0565b600b555b604080518c8152602081018c905273ffffffffffffffffffffffffffffffffffffffff8e169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a35050505050505050506001600c81905550915091565b6000610d0d338484612a32565b600061198760115473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fe177dc7000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152919091169063e177dc709060240160206040518083038186803b1580156119f057600080fd5b505afa158015611a04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d119190614db3565b600c54600114611a94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b45440000000000000000000000000000006044820152606401610717565b6000600c5560065460075460085473ffffffffffffffffffffffffffffffffffffffff9283169290911690611ae99083908590611ae4906dffffffffffffffffffffffffffff16610bc884612419565b61226d565b600854611b239082908590611ae4906e01000000000000000000000000000090046dffffffffffffffffffffffffffff16610bc884612419565b50506001600c5550565b42841015611b97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a204558504952454400000000000000000000000000006044820152606401610717565b60035473ffffffffffffffffffffffffffffffffffffffff8816600090815260046020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611bf7836153cb565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611c989291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611d21573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d9c57508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611e02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e4154555245000000006044820152606401610717565b611e0d8989896128ae565b505050505050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663570ca7356040518163ffffffff1660e01b815260040160206040518083038186803b158015611e8057600080fd5b505afa158015611e94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb89190614db3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611eef57600080fd5b612710811115611efe57600080fd5b80821115611f0b57600080fd5b600f91909155601055565b600080611f228361130d565b905060005b8151811015611fde57611fca828281518110611f4557611f45615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c9190614f44565b925080611fd6816153cb565b915050611f27565b5050919050565b600554604080517f570ca735000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b15801561205057600080fd5b505afa158015612064573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120889190614db3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120bf57600080fd5b600654849073ffffffffffffffffffffffffffffffffffffffff80831691161480612104575060075473ffffffffffffffffffffffffffffffffffffffff8281169116145b61216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f59617065737761703a204e4f54204120524553455256454420544f4b454e00006044820152606401610717565b61217685308686613022565b95945050505050565b600c546001146121eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b45440000000000000000000000000000006044820152606401610717565b6000600c55600654612266906122169073ffffffffffffffffffffffffffffffffffffffff16612419565b6007546122389073ffffffffffffffffffffffffffffffffffffffff16612419565b6008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166125d2565b6001600c55565b61227983826000612941565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052915160009283928716916123409190615015565b6000604051808303816000865af19150503d806000811461237d576040519150601f19603f3d011682016040523d82523d6000602084013e612382565b606091505b50915091508180156123ac5750805115806123ac5750808060200190518101906123ac9190614f22565b612412576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c45440000000000006044820152606401610717565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000818152600e60205260408082205490517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192610d11926370a082319060240160206040518083038186803b15801561249257600080fd5b505afa1580156124a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ca9190614f44565b90612935565b60008115806124f4575082826124e68183615326565b92506124f290836151a7565b145b610d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f770000000000000000000000006044820152606401610717565b6000826125678382615363565b9150811115610d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f7700000000000000000000006044820152606401610717565b6dffffffffffffffffffffffffffff84118015906125fe57506dffffffffffffffffffffffffffff8311155b612664576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f57000000000000000000000000006044820152606401610717565b600061267564010000000042615404565b6008549091506000906126ae907c0100000000000000000000000000000000000000000000000000000000900463ffffffff168361537a565b905060008163ffffffff161180156126d557506dffffffffffffffffffffffffffff841615155b80156126f057506dffffffffffffffffffffffffffff831615155b156127be578063ffffffff1661272d8561270986613217565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690613242565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166127559190615326565b600960008282546127669190615154565b909155505063ffffffff811661277f8461270987613217565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166127a79190615326565b600a60008282546127b89190615154565b90915550505b6008805463ffffffff84167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff6dffffffffffffffffffffffffffff8981166e0100000000000000000000000000009081027fffffffff000000000000000000000000000000000000000000000000000000009095168c83161794909417918216831794859055604080519382169282169290921783529290930490911660208201527f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1910160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006110ee8284615326565b60006110ee82846151a7565b60006110ee8284615154565b60006129568361295086612419565b9061325e565b90506000612975612710610f36600f548561291d90919063ffffffff16565b90506000612994612710610f366010548661291d90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600e60205260408120549192506129c7848461326a565b9050828211806129de57508580156129de57508082115b156129fb576129f6886129f18385615363565b6132c1565b612a28565b81841180612a105750858015612a1057508181115b15612a2857612a2888612a238484615363565b613521565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612a62908261255a565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612a9e90826135e0565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906129109085815260200190565b6000600c54600114612b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b45440000000000000000000000000000006044820152606401610717565b6000600c8190556008546006546dffffffffffffffffffffffffffff808316936e010000000000000000000000000000909304169190612bc29073ffffffffffffffffffffffffffffffffffffffff16612419565b600754909150600090612bea9073ffffffffffffffffffffffffffffffffffffffff16612419565b90506000612c08836dffffffffffffffffffffffffffff871661255a565b90506000612c26836dffffffffffffffffffffffffffff871661255a565b90506000612c348787612df0565b60005490915080612c6b57612c576103e8610bc8612c5287876124d0565b613658565b9850612c6660006103e86136c7565b612cc0565b612cbd6dffffffffffffffffffffffffffff8916612c8986846124d0565b612c9391906151a7565b6dffffffffffffffffffffffffffff8916612cae86856124d0565b612cb891906151a7565b613764565b98505b60008911612d50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f556e697377617056323a20494e53554646494349454e545f4c4951554944495460448201527f595f4d494e5445440000000000000000000000000000000000000000000000006064820152608401610717565b612d5a8a8a6136c7565b612d6686868a8a6125d2565b8115612da257600854612d9e906dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166124d0565b600b555b604080518581526020810185905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001600c5550949695505050505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b158015612e5b57600080fd5b505afa158015612e6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e939190614db3565b600b5473ffffffffffffffffffffffffffffffffffffffff8216158015945091925090612f56578015612f51576000612ee2612c526dffffffffffffffffffffffffffff8881169088166124d0565b90506000612eef83613658565b905080821115612f4e576000612f11612f08848461255a565b600054906124d0565b90506000612f2a83612f248660056124d0565b906135e0565b90506000612f3882846151a7565b90508015612f4a57612f4a87826136c7565b5050505b50505b610f57565b8015610f57576000600b55505092915050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902054612f99908261255a565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612fcd908261255a565b600090815560405182815273ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b60008061302e86611966565b905060008173ffffffffffffffffffffffffffffffffffffffff1663ecf708586040518163ffffffff1660e01b815260040160206040518083038186803b15801561307857600080fd5b505afa15801561308c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130b09190614f44565b905060008273ffffffffffffffffffffffffffffffffffffffff166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b1580156130fa57600080fd5b505afa15801561310e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131329190614f44565b9050808211613147576000935050505061320f565b857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8310801561319657507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81105b156131b75760006131a7848461325e565b9050808211156131b5578091505b505b801561320a5760006131cd8a8a3085600061377a565b9050806131e25760009550505050505061320f565b6131f08a308b8460006141a2565b9550866131fd828861325e565b111561320857600080fd5b505b505050505b949350505050565b6000610d116e0100000000000000000000000000006dffffffffffffffffffffffffffff84166152e2565b60006110ee6dffffffffffffffffffffffffffff83168461516c565b60006110ee8284615363565b600060026132788184615404565b613283600286615404565b61328d9190615154565b61329791906151a7565b6132a26002846151a7565b6132ad6002866151a7565b6132b79190615154565b6110ee9190615154565b8160006132cd82612419565b905060006132db8530610d17565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600e60205260408120549192508183111561331d576133168284615363565b9050613321565b5060005b600061333a8830806133338b87612935565b600161377a565b9050600087821115613357576133508883615363565b905061335b565b5060005b61336f6133688284615363565b859061325e565b73ffffffffffffffffffffffffffffffffffffffff808b166000908152600e602090815260408083209490945560055484517f017e7e580000000000000000000000000000000000000000000000000000000081529451929493169263017e7e589260048083019392829003018186803b1580156133ec57600080fd5b505afa158015613400573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134249190614db3565b9050811561344d5761344d73ffffffffffffffffffffffffffffffffffffffff8b168284614773565b6040805173ffffffffffffffffffffffffffffffffffffffff8c168152602081018590529081018390527fef4df05a61bbcf67d2847e7a9b3553ac9561d4505a2a4f25e680563432d8acd29060600160405180910390a1505050505050806134b483612419565b1461351b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f59617065737761703a2042414c414e4345204348414e474544000000000000006044820152606401610717565b50505050565b81600061352d82612419565b9050600061353f8530308760006141a2565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600e60205260409020549091506135729082612935565b73ffffffffffffffffffffffffffffffffffffffff86166000818152600e60209081526040918290209390935580519182529181018690527f38477e4b620b58ac2682bb0495f4dbe976f682fd6092063680e66e953562d9c0910160405180910390a150806134b483612419565b6000826135ed8382615154565b9150811015610d11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f770000000000000000000000006044820152606401610717565b600060038211156136b957508060006136726002836151a7565b61367d906001615154565b90505b818110156136b35790508060028161369881866151a7565b6136a29190615154565b6136ac91906151a7565b9050613680565b50919050565b811561130857506001919050565b6000546136d490826135e0565b600090815573ffffffffffffffffffffffffffffffffffffffff831681526001602052604090205461370690826135e0565b73ffffffffffffffffffffffffffffffffffffffff83166000818152600160205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906130169085815260200190565b600081831061377357816110ee565b5090919050565b60008061378687611966565b90508660006137948261130d565b90506137a0898261484c565b60005b8151811015613e6c57851580156137fe57508373ffffffffffffffffffffffffffffffffffffffff168282815181106137de576137de615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16145b1561380857613e5a565b600082828151811061381c5761381c615476565b60209081029190910101516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c81166004830152909116906370a082319060240160206040518083038186803b15801561388f57600080fd5b505afa1580156138a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138c79190614f44565b905073ffffffffffffffffffffffffffffffffffffffff8a1630146139b0576139ad818484815181106138fc576138fc615476565b60209081029190910101516040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8e811660048301523060248301529091169063dd62ed3e9060440160206040518083038186803b15801561397557600080fd5b505afa158015613989573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb89190614f44565b90505b613a13818484815181106139c6576139c6615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff166375de29026040518163ffffffff1660e01b815260040160206040518083038186803b15801561397557600080fd5b90508015613e585773ffffffffffffffffffffffffffffffffffffffff8a163014613b0657828281518110613a4a57613a4a615476565b60209081029190910101516040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8c8116600483015230602483015260448201849052909116906323b872dd90606401602060405180830381600087803b158015613acc57600080fd5b505af1158015613ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b049190614f22565b505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8814613da5576000613c78848481518110613b4457613b44615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015613b9157600080fd5b505afa158015613ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bc99190614f44565b610f36868681518110613bde57613bde615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613c2b57600080fd5b505afa158015613c3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c639190614f44565b613c6e90600a61521c565b610f308d8c61325e565b9050600081118015613c8957508181105b15613d4557613d3e848481518110613ca357613ca3615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b8152600401613ce591815260200190565b602060405180830381600087803b158015613cff57600080fd5b505af1158015613d13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d379190614f44565b8890612935565b9650613d9f565b613d9c848481518110613d5a57613d5a615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b8152600401613ce591815260200190565b96505b50613e4b565b613e48838381518110613dba57613dba615476565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16633ccfd60b6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015613e0957600080fd5b505af1158015613e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e419190614f44565b8790612935565b95505b858811613e585750613e6c565b505b80613e64816153cb565b9150506137a3565b508584118015613f8d5750613f818373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613ec057600080fd5b505afa158015613ed4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef89190614f44565b613f0390600a61521c565b8473ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015613f4957600080fd5b505afa158015613f5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f369190614f44565b613f8b858861325e565b115b1561415857613f9c848761325e565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff858116602483015284169063dd62ed3e9060440160206040518083038186803b15801561400957600080fd5b505afa15801561401d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140419190614f44565b10156140885761408873ffffffffffffffffffffffffffffffffffffffff8316847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6148b0565b73ffffffffffffffffffffffffffffffffffffffff8316636e553f656140ae868961325e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b168152600481019190915273ffffffffffffffffffffffffffffffffffffffff8b166024820152604401602060405180830381600087803b15801561411b57600080fd5b505af115801561412f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141539190614f44565b508593505b73ffffffffffffffffffffffffffffffffffffffff871630146141965761419673ffffffffffffffffffffffffffffffffffffffff83168886614773565b50505095945050505050565b6000806141ae87611966565b905073ffffffffffffffffffffffffffffffffffffffff81166141d5576000915050612176565b8683156142f1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff851461422a5761422573ffffffffffffffffffffffffffffffffffffffff8216883088614a41565b6142f1565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80891660048301526142f19189913091908516906370a082319060240160206040518083038186803b15801561429a57600080fd5b505afa1580156142ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142d29190614f44565b73ffffffffffffffffffffffffffffffffffffffff8516929190614a41565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015286919083169063dd62ed3e9060440160206040518083038186803b15801561436157600080fd5b505afa158015614375573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143999190614f44565b1015614402576143c173ffffffffffffffffffffffffffffffffffffffff82168360006148b0565b61440273ffffffffffffffffffffffffffffffffffffffff8216837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6148b0565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b15801561446a57600080fd5b505afa15801561447e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144a29190614f44565b905073ffffffffffffffffffffffffffffffffffffffff87163014614570576040517f6e553f650000000000000000000000000000000000000000000000000000000081526004810187905273ffffffffffffffffffffffffffffffffffffffff8881166024830152841690636e553f65906044015b602060405180830381600087803b15801561453257600080fd5b505af1158015614546573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061456a9190614f44565b5061466c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86146145ea576040517fb6b55f250000000000000000000000000000000000000000000000000000000081526004810187905273ffffffffffffffffffffffffffffffffffffffff84169063b6b55f2590602401614518565b8273ffffffffffffffffffffffffffffffffffffffff1663d0e30db06040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561463257600080fd5b505af1158015614646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061466a9190614f44565b505b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a082319060240160206040518083038186803b1580156146d457600080fd5b505afa1580156146e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061470c9190614f44565b9050614718828261325e565b945073ffffffffffffffffffffffffffffffffffffffff891630148015906147405750600081115b156147665761476673ffffffffffffffffffffffffffffffffffffffff84168a83614773565b5050505095945050505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526148479084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614a9f565b505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d6020526040902054815111156110175773ffffffffffffffffffffffffffffffffffffffff82166000908152600d60209081526040909120825161484792840190614cf7565b80158061495f57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561492557600080fd5b505afa158015614939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061495d9190614f44565b155b6149eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610717565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526148479084907f095ea7b300000000000000000000000000000000000000000000000000000000906064016147c5565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905261351b9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016147c5565b6000614b01826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614bab9092919063ffffffff16565b8051909150156148475780806020019051810190614b1f9190614f22565b614847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610717565b606061320f848460008585843b614c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610717565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051614c479190615015565b60006040518083038185875af1925050503d8060008114614c84576040519150601f19603f3d011682016040523d82523d6000602084013e614c89565b606091505b5091509150614c99828286614ca4565b979650505050505050565b60608315614cb35750816110ee565b825115614cc35782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107179190615103565b828054828255906000526020600020908101928215614d71579160200282015b82811115614d7157825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614d17565b50614d7d929150614d81565b5090565b5b80821115614d7d5760008155600101614d82565b600060208284031215614da857600080fd5b81356110ee816154d4565b600060208284031215614dc557600080fd5b81516110ee816154d4565b60008060408385031215614de357600080fd5b8235614dee816154d4565b91506020830135614dfe816154d4565b809150509250929050565b600080600060608486031215614e1e57600080fd5b8335614e29816154d4565b92506020840135614e39816154d4565b929592945050506040919091013590565b600080600080600080600060e0888a031215614e6557600080fd5b8735614e70816154d4565b96506020880135614e80816154d4565b95506040880135945060608801359350608088013560ff81168114614ea457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215614ed457600080fd5b8235614edf816154d4565b946020939093013593505050565b600080600060608486031215614f0257600080fd5b8335614f0d816154d4565b95602085013595506040909401359392505050565b600060208284031215614f3457600080fd5b815180151581146110ee57600080fd5b600060208284031215614f5657600080fd5b5051919050565b60008060408385031215614f7057600080fd5b50508035926020909101359150565b600080600080600060808688031215614f9757600080fd5b85359450602086013593506040860135614fb0816154d4565b9250606086013567ffffffffffffffff80821115614fcd57600080fd5b818801915088601f830112614fe157600080fd5b813581811115614ff057600080fd5b89602082850101111561500257600080fd5b9699959850939650602001949392505050565b6000825161502781846020870161539f565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff8616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160101949350505050565b6020808252825182820181905260009190848201906040850190845b818110156150f757835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016150c5565b50909695505050505050565b602081526000825180602084015261512281604085016020870161539f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000821982111561516757615167615418565b500190565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8084168061519b5761519b615447565b92169190910492915050565b6000826151b6576151b6615447565b500490565b600181815b8085111561521457817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156151fa576151fa615418565b8085161561520757918102915b93841c93908002906151c0565b509250929050565b60006110ee838360008261523257506001610d11565b8161523f57506000610d11565b8160018114615255576002811461525f5761527b565b6001915050610d11565b60ff84111561527057615270615418565b50506001821b610d11565b5060208310610133831016604e8410600b841016171561529e575081810a610d11565b6152a883836151bb565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156152da576152da615418565b029392505050565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083168185168183048111821515161561531d5761531d615418565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561535e5761535e615418565b500290565b60008282101561537557615375615418565b500390565b600063ffffffff8381169083168181101561539757615397615418565b039392505050565b60005b838110156153ba5781810151838201526020016153a2565b8381111561351b5750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156153fd576153fd615418565b5060010190565b60008261541357615413615447565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146154f657600080fd5b5056fea264697066735822122001183ca384ed9641ab9a4b1426aebdc987104748bfe3a2ac01fc39baf3e5db6764736f6c63430008060033
Deployed Bytecode Sourcemap
833:5283:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5064:2289:3;;;;;;:::i;:::-;;:::i;:::-;;3080:94:0;3151:16;;;;;;;;;;;;;;;;;3080:94;;;;;;;:::i;:::-;;;;;;;;7864:301:3;8070:8;;7864:301;;;8070:8;;;;19396:34:21;;8100:8:3;;;;19461:2:21;19446:18;;19439:43;8140:18:3;;;;;;19498::21;;;19491:51;19335:2;19320:18;7864:301:3;19302:246:21;2269:147:2;;;;;;:::i;:::-;;:::i;:::-;;;8466:14:21;;8459:22;8441:41;;8429:2;8414:18;2269:147:2;8396:92:21;626:21:3;;;;;;;;;;;;5414:42:21;5402:55;;;5384:74;;5372:2;5357:18;626:21:3;5339:125:21;246:26:2;;;;;;;;;8639:25:21;;;8627:2;8612:18;246:26:2;8594:76:21;2953:121:0;3042:11;;3055;;2953:121;;;;20211:25:21;;;20267:2;20252:18;;20245:34;;;;20184:18;2953:121:0;20166:119:21;3554:472:1;;;;;;:::i;:::-;;:::i;2726:106:0:-;;;;;;:::i;:::-;;:::i;2567:361:2:-;;;;;;:::i;:::-;;:::i;985:42:0:-;;;;;;:::i;:::-;;;;;;;;;;;;;;540:116:2;;590:66;540:116;;204:35;;237:2;204:35;;;;;20858:4:21;20846:17;;;20828:36;;20816:2;20801:18;204:35:2;20783:87:21;399:31:2;;;;;;1877:212:3;;;;;;:::i;:::-;;:::i;1980:94:0:-;;;:::i;952:35:3:-;;;;;;993;;;;;;1785:189:0;;;;;;:::i;:::-;;:::i;278:44:2:-;;;;;;:::i;:::-;;;;;;;;;;;;;;1943:812:1;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;1034:20:3:-;;;;;;2838:109:0;2930:9;;;;2838:109;;662:41:2;;;;;;:::i;:::-;;;;;;;;;;;;;;3559:1396:3;;;;;;:::i;:::-;;:::i;3180:92:0:-;3253:12;;;;;;;;;;;;;;;;;3180:92;;2422:139:2;;;;;;:::i;:::-;;:::i;1649:136:1:-;;;;;;:::i;:::-;;:::i;439:49:3:-;;483:5;439:49;;7399:293;;;;;;:::i;:::-;;:::i;598:22::-;;;;;;;;;653:21;;;;;;;;;2934:968:2;;;;;;:::i;:::-;;:::i;328:64::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;2080:200:0;;;;;;:::i;:::-;;:::i;4200:260:1:-;;;;;;:::i;:::-;;:::i;2476:244:0:-;;;;;;:::i;:::-;;:::i;7738:120:3:-;;;:::i;5064:2289::-;1210:8;;1222:1;1210:13;1202:43;;;;;;;14514:2:21;1202:43:3;;;14496:21:21;14553:2;14533:18;;;14526:30;14592:19;14572:18;;;14565:47;14629:18;;1202:43:3;;;;;;;;;1266:1;1255:8;:12;5240:14;;;;:32:::1;;;5271:1;5258:10;:14;5240:32;5219:116;;;::::0;::::1;::::0;;11195:2:21;5219:116:3::1;::::0;::::1;11177:21:21::0;11234:2;11214:18;;;11207:30;11273:34;11253:18;;;11246:62;11344:7;11324:18;;;11317:35;11369:19;;5219:116:3::1;11167:227:21::0;5219:116:3::1;5346:17;5365::::0;5388:13:::1;8070:8:::0;;;;;;;8100;;;;;;;8140:18;;;;;;;7864:301;5388:13:::1;5345:56;;;;;5460:9;5447:22;;:10;:22;:48;;;;;5486:9;5473:22;;:10;:22;5447:48;5426:128;;;::::0;::::1;::::0;;13765:2:21;5426:128:3::1;::::0;::::1;13747:21:21::0;13804:2;13784:18;;;13777:30;13843:34;13823:18;;;13816:62;13914:3;13894:18;;;13887:31;13935:19;;5426:128:3::1;13737:223:21::0;5426:128:3::1;5716:6;::::0;5754::::1;::::0;5565:16:::1;::::0;;;5716:6:::1;::::0;;::::1;::::0;5754;;::::1;::::0;5782:13;::::1;::::0;::::1;::::0;::::1;::::0;:30:::1;;;5805:7;5799:13;;:2;:13;;;;5782:30;5774:64;;;::::0;::::1;::::0;;12709:2:21;5774:64:3::1;::::0;::::1;12691:21:21::0;12748:2;12728:18;;;12721:30;12787:23;12767:18;;;12760:51;12828:18;;5774:64:3::1;12681:171:21::0;5774:64:3::1;5856:14:::0;;5852:58:::1;;5872:38;5886:7;5895:2;5899:10;5872:13;:38::i;:::-;5962:14:::0;;5958:58:::1;;5978:38;5992:7;6001:2;6005:10;5978:13;:38::i;:::-;6068:15:::0;;6064:211:::1;;6101:174;::::0;;;;:34:::1;::::0;::::1;::::0;::::1;::::0;:174:::1;::::0;6157:10:::1;::::0;6189;;6221;;6253:4;;;;6101:174:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;6064:211;6300:19;6311:7;6300:10;:19::i;:::-;6289:30;;6344:19;6355:7;6344:10;:19::i;:::-;6333:30;;5617:757;;6383:17;6426:10;6414:9;:22;;;;;;:::i;:::-;6403:8;:33;:99;;6501:1;6403:99;;;6463:22;6475:10:::0;6463:22:::1;::::0;::::1;;:::i;:::-;6451:35;::::0;:8;:35:::1;:::i;:::-;6383:119:::0;-1:-1:-1;6512:17:3::1;6543:22;6555:10:::0;6543:22:::1;::::0;::::1;;:::i;:::-;6532:8;:33;:99;;6630:1;6532:99;;;6592:22;6604:10:::0;6592:22:::1;::::0;::::1;;:::i;:::-;6580:35;::::0;:8;:35:::1;:::i;:::-;6512:119;;6674:1;6662:9;:13;:30;;;;6691:1;6679:9;:13;6662:30;6641:113;;;::::0;::::1;::::0;;11601:2:21;6641:113:3::1;::::0;::::1;11583:21:21::0;11640:2;11620:18;;;11613:30;11679:34;11659:18;;;11652:62;11750:6;11730:18;;;11723:34;11774:19;;6641:113:3::1;11573:226:21::0;6641:113:3::1;6854:24;6881:40;6904:16;:9:::0;6918:1:::1;6904:13;:16::i;:::-;6881:18;:8:::0;6894:4:::1;6881:12;:18::i;:::-;:22:::0;::::1;:40::i;:::-;6854:67:::0;-1:-1:-1;6935:24:3::1;6962:40;6985:16;:9:::0;6999:1:::1;6985:13;:16::i;6962:40::-;6935:67:::0;-1:-1:-1;7103:46:3::1;7141:7;7103:33;;:18:::0;;::::1;::::0;:33;::::1;:22;:33::i;:::-;:37:::0;::::1;:46::i;:::-;7041:38;:16:::0;7062;7041:20:::1;:38::i;:::-;:108;;7016:179;;;::::0;::::1;::::0;;14860:2:21;7016:179:3::1;::::0;::::1;14842:21:21::0;14899:2;14879:18;;;14872:30;14938:14;14918:18;;;14911:42;14970:18;;7016:179:3::1;14832:162:21::0;7016:179:3::1;6764:442;;7216:49;7224:8;7234;7244:9;7255;7216:7;:49::i;:::-;7280:66;::::0;;20521:25:21;;;20577:2;20562:18;;20555:34;;;20605:18;;;20598:34;;;20663:2;20648:18;;20641:34;;;7280:66:3::1;::::0;::::1;::::0;7285:10:::1;::::0;7280:66:::1;::::0;20508:3:21;20493:19;7280:66:3::1;;;;;;;-1:-1:-1::0;;1299:1:3;1288:8;:12;-1:-1:-1;;;;;;;;;5064:2289:3:o;2269:147:2:-;2336:4;2352:36;2361:10;2373:7;2382:5;2352:8;:36::i;:::-;-1:-1:-1;2405:4:2;2269:147;;;;;:::o;3554:472:1:-;3658:15;3689:24;3716:16;3726:5;3716:9;:16::i;:::-;3689:43;;3748:10;3743:277;3769:6;:13;3764:2;:18;3743:277;;;3814:195;3843:152;3972:6;3979:2;3972:10;;;;;;;;:::i;:::-;;;;;;;:19;;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3960:34;;:2;:34;:::i;:::-;3843:95;3911:6;3918:2;3911:10;;;;;;;;:::i;:::-;;;;;;;:24;;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3843:6;3850:2;3843:10;;;;;;;;:::i;:::-;;;;;;;;;;;:46;;;;;:37;5402:55:21;;;3843:46:1;;;5384:74:21;3843:37:1;;;;;;5357:18:21;;3843:46:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:67;;:95::i;:::-;:116;;:152::i;:::-;3814:7;;:11;:195::i;:::-;3804:205;-1:-1:-1;3784:4:1;;;;:::i;:::-;;;;3743:277;;;;3679:347;3554:472;;;;:::o;2726:106:0:-;1499:6;;2782:5;;1499:6;1490:15;;;1499:6;;1490:15;;:34;;-1:-1:-1;1518:6:0;;;1509:15;;;1518:6;;1509:15;1490:34;1469:111;;;;;;;16017:2:21;1469:111:0;;;15999:21:21;16056:2;16036:18;;;16029:30;16095:32;16075:18;;;16068:60;16145:18;;1469:111:0;15989:180:21;1469:111:0;2799:26:::1;2810:5;2817:1;2820:4;2799:10;:26::i;:::-;2726:106:::0;;:::o;2567:361:2:-;2698:15;;;2678:4;2698:15;;;:9;:15;;;;;;;;2714:10;2698:27;;;;;;;;2729:11;2698:42;2694:171;;2786:15;;;;;;;:9;:15;;;;;;;;2802:10;2786:27;;;;;;;;:68;;2835:5;2786:31;:68::i;:::-;2756:15;;;;;;;:9;:15;;;;;;;;2772:10;2756:27;;;;;;;:98;2694:171;2874:26;2884:4;2890:2;2894:5;2874:9;:26::i;:::-;-1:-1:-1;2917:4:2;2567:361;;;;;;:::o;1877:212:3:-;1978:7;;;;1964:10;:21;1956:54;;;;;;;16785:2:21;1956:54:3;;;16767:21:21;16824:2;16804:18;;;16797:30;16863:22;16843:18;;;16836:50;16903:18;;1956:54:3;16757:170:21;1956:54:3;2040:6;:16;;;;;;;;;;;;;;2066:6;:16;;;;;;;;;;;1877:212::o;1980:94:0:-;2048:7;;;;;;;;;;;2035:30;;;:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2023:9;:44;;;;;;;;;;;;;;;1980:94::o;1785:189::-;1836:17;1877:14;1888:2;1877:10;:14::i;:::-;1912:6;;1865:26;;-1:-1:-1;1901:28:0;;1912:6;;;;1901:10;:28::i;:::-;1950:6;;1939:28;;1950:6;;;;1939:10;:28::i;:::-;1785:189;;;:::o;1943:812:1:-;2094:20;;;2071;2094;;;:13;:20;;;;;:27;2038:17;;2152:10;2930:9:0;;;;;2838:109;2152:10:1;:27;;;;;:20;5402:55:21;;;2152:27:1;;;5384:74:21;2152:20:1;;;;;;;5357:18:21;;2152:27:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2131:48;;2232:10;2216:12;:26;2212:84;;;2265:20;;;;;;;:13;:20;;;;;;;;;2258:27;;;;;;;;;;;;;;;;;2265:20;;2258:27;;2265:20;2258:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1943:812;;;:::o;2212:84::-;2306:24;2348:10;2333:26;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2333:26:1;;2306:53;;2375:16;2370:138;2408:12;2397:8;:23;2370:138;;;2467:20;;;;;;;:13;:20;;;;;:30;;2488:8;;2467:30;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;2448:6;2455:8;2448:16;;;;;;;;:::i;:::-;:49;;;;:16;;;;;;;;;;;:49;2422:10;;;;:::i;:::-;;;;2370:138;;;-1:-1:-1;2555:12:1;2518:207;2592:10;2581:8;:21;2518:207;;;2930:9:0;;;;2679:34:1;;;;;:17;6396:55:21;;;2679:34:1;;;6378:74:21;6468:18;;;6461:34;;;2679:17:1;;;;;;;6351:18:21;;2679:34:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2651:6;2658:8;2651:16;;;;;;;;:::i;:::-;:63;;;;:16;;;;;;;;;;;:63;2616:10;;;;:::i;:::-;;;;2518:207;;;-1:-1:-1;2742:6:1;1943:812;-1:-1:-1;;;;1943:812:1:o;3559:1396:3:-;3646:15;3663;1210:8;;1222:1;1210:13;1202:43;;;;;;;14514:2:21;1202:43:3;;;14496:21:21;14553:2;14533:18;;;14526:30;14592:19;14572:18;;;14565:47;14629:18;;1202:43:3;14486:167:21;1202:43:3;1266:1;1255:8;:12;;;8070:8;;3793:6:::1;::::0;3842::::1;::::0;8070:8;;;;;8100;;;;;;3793:6:::1;::::0;;::::1;::::0;3842;;::::1;::::0;3892:19:::1;3793:6:::0;3892:10:::1;:19::i;:::-;3873:38;;3921:16;3940:19;3951:7;3940:10;:19::i;:::-;4007:4;3969:17;3989:24:::0;;;:9:::1;:24;::::0;;;;;3921:38;;-1:-1:-1;4037:30:3::1;4046:9:::0;4057;4037:8:::1;:30::i;:::-;4077:20;4100:11:::0;4024:43;;-1:-1:-1;4100:11:3;4209:23:::1;:9:::0;4223:8;4209:13:::1;:23::i;:::-;:38;;;;:::i;:::-;4199:48:::0;-1:-1:-1;4341:12:3;4315:23:::1;:9:::0;4329:8;4315:13:::1;:23::i;:::-;:38;;;;:::i;:::-;4305:48;;4442:1;4432:7;:11;:26;;;;;4457:1;4447:7;:11;4432:26;4411:113;;;::::0;::::1;::::0;;15608:2:21;4411:113:3::1;::::0;::::1;15590:21:21::0;15647:2;15627:18;;;15620:30;15686:34;15666:18;;;15659:62;15757:10;15737:18;;;15730:38;15785:19;;4411:113:3::1;15580:230:21::0;4411:113:3::1;4534:31;4548:4;4555:9;4534:5;:31::i;:::-;4575:35;4589:7;4598:2;4602:7;4575:13;:35::i;:::-;4620;4634:7;4643:2;4647:7;4620:13;:35::i;:::-;4676:19;4687:7;4676:10;:19::i;:::-;4665:30;;4716:19;4727:7;4716:10;:19::i;:::-;4705:30;;4746:49;4754:8;4764;4774:9;4785;4746:7;:49::i;:::-;4809:5;4805:50;;;4846:8;::::0;4824:31:::1;::::0;4846:8:::1;4832::::0;;::::1;::::0;4846;;::::1;;4824:21;:31::i;:::-;4816:5;:39:::0;4805:50:::1;4910:38;::::0;;20211:25:21;;;20267:2;20252:18;;20245:34;;;4910:38:3::1;::::0;::::1;::::0;4915:10:::1;::::0;4910:38:::1;::::0;20184:18:21;4910:38:3::1;;;;;;;3684:1271;;;;;;;;;1299:1:::0;1288:8;:12;;;;3559:1396;;;:::o;2422:139:2:-;2485:4;2501:32;2511:10;2523:2;2527:5;2501:9;:32::i;1649:136:1:-;1712:8;1748:10;2930:9:0;;;;;2838:109;1748:10:1;:29;;;;;:22;5402:55:21;;;1748:29:1;;;5384:74:21;1748:22:1;;;;;;;5357:18:21;;1748:29:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;7399:293:3:-;1210:8;;1222:1;1210:13;1202:43;;;;;;;14514:2:21;1202:43:3;;;14496:21:21;14553:2;14533:18;;;14526:30;14592:19;14572:18;;;14565:47;14629:18;;1202:43:3;14486:167:21;1202:43:3;1266:1;1255:8;:12;7473:6:::1;::::0;7522::::1;::::0;7604:8:::1;::::0;7473:6:::1;::::0;;::::1;::::0;7522;;::::1;::::0;7553:61:::1;::::0;7473:6;;7576:2;;7580:33:::1;::::0;7604:8:::1;;7580:19;7473:6:::0;7580:10:::1;:19::i;:33::-;7553:13;:61::i;:::-;7675:8;::::0;7624:61:::1;::::0;7638:7;;7647:2;;7651:33:::1;::::0;7675:8;;::::1;;;7651:19;7638:7:::0;7651:10:::1;:19::i;7624:61::-;-1:-1:-1::0;;1299:1:3;1288:8;:12;-1:-1:-1;7399:293:3:o;2934:968:2:-;3147:15;3135:8;:27;;3127:58;;;;;;;14167:2:21;3127:58:2;;;14149:21:21;14206:2;14186:18;;;14179:30;14245:20;14225:18;;;14218:48;14283:18;;3127:58:2;14139:168:21;3127:58:2;3297:16;;3534:13;;;3195:14;3534:13;;;:6;:13;;;;;:15;;3195:14;;3297:16;590:66;;3439:5;;3470:7;;3503:5;;3534:15;3195:14;3534:15;;;:::i;:::-;;;;-1:-1:-1;3362:243:2;;;;;;8962:25:21;;;;9006:42;9084:15;;;9064:18;;;9057:43;9136:15;;;;9116:18;;;9109:43;9168:18;;;9161:34;9211:19;;;9204:35;9255:19;;;9248:35;;;8934:19;;3362:243:2;;;;;;;;;;;;3331:292;;;;;;3235:402;;;;;;;;5059:66:21;5047:79;;5151:1;5142:11;;5135:27;;;;5187:2;5178:12;;5171:28;5224:2;5215:12;;5037:196;3235:402:2;;;;;;;;;;;;;;3212:435;;3235:402;3212:435;;;;3657:24;3684:26;;;;;;;;;9521:25:21;;;9594:4;9582:17;;9562:18;;;9555:45;;;;9616:18;;;9609:34;;;9659:18;;;9652:34;;;3212:435:2;;-1:-1:-1;3657:24:2;3684:26;;9493:19:21;;3684:26:2;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3684:26:2;;;;;;-1:-1:-1;;3741:30:2;;;;;;;:59;;;3795:5;3775:25;;:16;:25;;;3741:59;3720:134;;;;;;;13059:2:21;3720:134:2;;;13041:21:21;13098:2;13078:18;;;13071:30;13137;13117:18;;;13110:58;13185:18;;3720:134:2;13031:178:21;3720:134:2;3864:31;3873:5;3880:7;3889:5;3864:8;:31::i;:::-;3117:785;;2934:968;;;;;;;:::o;2080:200:0:-;1378:7;;;;;;;;;;;1365:30;;;:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1351:46;;:10;:46;;;1343:55;;;;;;1170:5:::1;2171:3;:18;;2163:27;;;::::0;::::1;;2215:3;2208;:10;;2200:19;;;::::0;::::1;;2229:11;:17:::0;;;;2256:11:::1;:17:::0;2080:200::o;4200:260:1:-;4257:14;4283:24;4310:16;4320:5;4310:9;:16::i;:::-;4283:43;;4342:10;4337:117;4363:6;:13;4358:2;:18;4337:117;;;4407:36;4418:6;4425:2;4418:10;;;;;;;;:::i;:::-;;;;;;;:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;4407:36::-;4398:45;-1:-1:-1;4378:4:1;;;;:::i;:::-;;;;4337:117;;;;4273:187;4200:260;;;:::o;2476:244:0:-;1378:7;;1365:32;;;;;;;;2631:7;;1378;;;1365:30;;:32;;;;;;;;;;;;;;1378:7;1365:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1351:46;;:10;:46;;;1343:55;;;;;;1499:6:::1;::::0;2615:5;;1499:6:::1;1490:15:::0;;::::1;1499:6:::0;::::1;1490:15;::::0;:34:::1;;-1:-1:-1::0;1518:6:0::1;::::0;::::1;1509:15:::0;;::::1;1518:6:::0;::::1;1509:15;1490:34;1469:111;;;::::0;::::1;::::0;;16017:2:21;1469:111:0::1;::::0;::::1;15999:21:21::0;16056:2;16036:18;;;16029:30;16095:32;16075:18;;;16068:60;16145:18;;1469:111:0::1;15989:180:21::0;1469:111:0::1;2657:56:::2;2666:5;2681:4;2688:6;2696:16;2657:8;:56::i;:::-;2650:63:::0;2476:244;-1:-1:-1;;;;;2476:244:0:o;7738:120:3:-;1210:8;;1222:1;1210:13;1202:43;;;;;;;14514:2:21;1202:43:3;;;14496:21:21;14553:2;14533:18;;;14526:30;14592:19;14572:18;;;14565:47;14629:18;;1202:43:3;14486:167:21;1202:43:3;1266:1;1255:8;:12;7803:6:::1;::::0;7784:67:::1;::::0;7792:18:::1;::::0;7803:6:::1;;7792:10;:18::i;:::-;7823:6;::::0;7812:18:::1;::::0;7823:6:::1;;7812:10;:18::i;:::-;7832:8;::::0;::::1;::::0;;::::1;::::0;7842;;::::1;;7784:7;:67::i;:::-;1299:1:::0;1288:8;:12;7738:120::o;3478:424:0:-;3601:31;3612:5;3619;3626;3601:10;:31::i;:::-;555:34:3;;;;;;;;;;;;;;;;;3702:43:0;;3678:10;6396:55:21;;;3702:43:0;;;6378:74:21;6468:18;;;;6461:34;;;3702:43:0;;;;;;;;;;6351:18:21;;;;3702:43:0;;;;;;;;;;;;;3678:77;;-1:-1:-1;;;;3678:10:0;;;:77;;3702:43;3678:77;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3642:113;;;;3786:7;:57;;;;-1:-1:-1;3798:11:0;;:16;;:44;;;3829:4;3818:24;;;;;;;;;;;;:::i;:::-;3765:130;;;;;;;17840:2:21;3765:130:0;;;17822:21:21;17879:2;17859:18;;;17852:30;17918:28;17898:18;;;17891:56;17964:18;;3765:130:0;17812:176:21;3765:130:0;3591:311;;3478:424;;;:::o;3278:194::-;3450:14;;;3377:7;3450:14;;;:7;:14;;;;;;;3407:38;;;;;3439:4;3407:38;;;5384:74:21;3377:7:0;;3407:58;;:23;;5357:18:21;;3407:38:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:42;;:58::i;474:149:10:-;532:9;561:6;;;:30;;-1:-1:-1;590:1:10;585;576:5;585:1;590;576:5;:::i;:::-;572:9;-1:-1:-1;571:15:10;;572:9;571:15;:::i;:::-;:20;561:30;553:63;;;;;;;12360:2:21;553:63:10;;;12342:21:21;12399:2;12379:18;;;12372:30;12438:22;12418:18;;;12411:50;12478:18;;553:63:10;12332:170:21;332:136:10;390:9;434:1;424:5;428:1;434;424:5;:::i;:::-;420:9;;;419:16;;411:50;;;;;;;10845:2:21;411:50:10;;;10827:21:21;10884:2;10864:18;;;10857:30;10923:23;10903:18;;;10896:51;10964:18;;411:50:10;10817:171:21;8635:1004:3;8812:23;;;;;;:50;;-1:-1:-1;8839:23:3;;;;8812:50;8791:116;;;;;;;17134:2:21;8791:116:3;;;17116:21:21;17173:2;17153:18;;;17146:30;17212:21;17192:18;;;17185:49;17251:18;;8791:116:3;17106:169:21;8791:116:3;8917:21;8948:23;8966:5;8948:15;:23;:::i;:::-;9020:18;;8917:55;;-1:-1:-1;8982:18:3;;9003:35;;9020:18;;;;;8917:55;9003:35;:::i;:::-;8982:56;;9089:1;9075:11;:15;;;:33;;;;-1:-1:-1;9094:14:3;;;;;9075:33;:51;;;;-1:-1:-1;9112:14:3;;;;;9075:51;9071:402;;;9314:11;9242:83;;9250:44;9284:9;9250:27;9267:9;9250:16;:27::i;:::-;:33;;;;:44::i;:::-;9242:53;;:83;;;;:::i;:::-;9202:20;;:123;;;;;;;:::i;:::-;;;;-1:-1:-1;;9379:83:3;;;9387:44;9421:9;9387:27;9404:9;9387:16;:27::i;:44::-;9379:53;;:83;;;;:::i;:::-;9339:20;;:123;;;;;;;:::i;:::-;;;;-1:-1:-1;;9071:402:3;9482:8;:28;;9558:35;;;;;;9482:28;9520;;;;;;;;;;;9482;;;9520;;;;;9558:35;;;;;;;;;9608:24;;;9613:8;;;;;;;;;;19050:34:21;;9623:8:3;;;;;;;19115:2:21;19100:18;;19093:43;9608:24:3;;18974:18:21;9608:24:3;;;;;;;8781:858;;8635:1004;;;;:::o;1809:199:2:-;1922:16;;;;;;;;:9;:16;;;;;;;;:25;;;;;;;;;;;;;:33;;;1970:31;;8639:25:21;;;1970:31:2;;8612:18:21;1970:31:2;;;;;;;;1809:199;;;:::o;3382:96:20:-;3440:7;3466:5;3470:1;3466;:5;:::i;3767:96::-;3825:7;3851:5;3855:1;3851;:5;:::i;2672:96::-;2730:7;2756:5;2760:1;2756;:5;:::i;3908:802:0:-;4023:14;4040:32;4062:9;4040:17;4051:5;4040:10;:17::i;:::-;:21;;:32::i;:::-;4023:49;;4082:18;4103:40;1170:5;4103:23;4114:11;;4103:6;:10;;:23;;;;:::i;:40::-;4082:61;;4153:18;4174:40;1170:5;4174:23;4185:11;;4174:6;:10;;:23;;;;:::i;:40::-;4249:14;;;4224:22;4249:14;;;:7;:14;;;;;;4153:61;;-1:-1:-1;4287:36:0;4300:10;4153:61;4287:12;:36::i;:::-;4273:50;;4354:10;4337:14;:27;:62;;;;4369:5;:29;;;;;4395:3;4378:14;:20;4369:29;4333:371;;;4457:39;4468:5;4475:20;4492:3;4475:14;:20;:::i;:::-;4457:10;:39::i;:::-;4333:371;;;4543:14;4530:10;:27;:62;;;;4562:5;:29;;;;;4577:14;4571:3;:20;4562:29;4513:191;;;4656:37;4665:5;4672:20;4678:14;4672:3;:20;:::i;:::-;4656:8;:37::i;:::-;4013:697;;;;;3908:802;;;:::o;2014:249:2:-;2140:15;;;;;;;:9;:15;;;;;;:26;;2160:5;2140:19;:26::i;:::-;2122:15;;;;;;;;:9;:15;;;;;;:44;;;;2192:13;;;;;;;:24;;2210:5;2192:17;:24::i;:::-;2176:13;;;;;;;;:9;:13;;;;;;;:40;;;;2231:25;;;;;;;;;;2250:5;8639:25:21;;8627:2;8612:18;;8594:76;2198:1252:3;2253:17;1210:8;;1222:1;1210:13;1202:43;;;;;;;14514:2:21;1202:43:3;;;14496:21:21;14553:2;14533:18;;;14526:30;14592:19;14572:18;;;14565:47;14629:18;;1202:43:3;14486:167:21;1202:43:3;1266:1;1255:8;:12;;;8070:8;;2393:6:::1;::::0;8070:8;;;;;8100;;;;;;1266:1;2382:18:::1;::::0;2393:6:::1;;2382:10;:18::i;:::-;2440:6;::::0;2363:37;;-1:-1:-1;2410:16:3::1;::::0;2429:18:::1;::::0;2440:6:::1;;2429:10;:18::i;:::-;2410:37:::0;-1:-1:-1;2457:15:3::1;2475:23;:8:::0;:23:::1;::::0;::::1;:12;:23::i;:::-;2457:41:::0;-1:-1:-1;2508:15:3::1;2526:23;:8:::0;:23:::1;::::0;::::1;:12;:23::i;:::-;2508:41;;2560:10;2573:30;2582:9;2593;2573:8;:30::i;:::-;2613:20;2636:11:::0;2560:43;;-1:-1:-1;2739:17:3;2735:394:::1;;2784:54;483:5;2784:31;2794:20;:7:::0;2806;2794:11:::1;:20::i;:::-;2784:9;:31::i;:54::-;2772:66;;2852:36;2866:1;483:5;2852;:36::i;:::-;2735:394;;;2986:132;3012:37;::::0;::::1;:25;:7:::0;3024:12;3012:11:::1;:25::i;:::-;:37;;;;:::i;:::-;3067;::::0;::::1;:25;:7:::0;3079:12;3067:11:::1;:25::i;:::-;:37;;;;:::i;:::-;2986:8;:132::i;:::-;2974:144;;2735:394;3158:1;3146:9;:13;3138:66;;;::::0;::::1;::::0;;16376:2:21;3138:66:3::1;::::0;::::1;16358:21:21::0;16415:2;16395:18;;;16388:30;16454:34;16434:18;;;16427:62;16525:10;16505:18;;;16498:38;16553:19;;3138:66:3::1;16348:230:21::0;3138:66:3::1;3214:20;3220:2;3224:9;3214:5;:20::i;:::-;3245:49;3253:8;3263;3273:9;3284;3245:7;:49::i;:::-;3308:5;3304:50;;;3345:8;::::0;3323:31:::1;::::0;3345:8:::1;3331::::0;;::::1;::::0;3345;;::::1;;3323:21;:31::i;:::-;3315:5;:39:::0;3304:50:::1;3409:34;::::0;;20211:25:21;;;20267:2;20252:18;;20245:34;;;3414:10:3::1;::::0;3409:34:::1;::::0;20184:18:21;3409:34:3::1;;;;;;;-1:-1:-1::0;;1299:1:3;1288:8;:12;-1:-1:-1;2198:1252:3;;;-1:-1:-1;;;;;;2198:1252:3:o;9726:877::-;9832:10;9858:13;9892:7;;;;;;;;;;;9874:32;;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9972:5;;9926:19;;;;;;;-1:-1:-1;9858:50:3;;-1:-1:-1;9972:5:3;10002:595;;10031:11;;10027:503;;10062:13;10078:44;10088:33;;:18;;;;:33;;:22;:33::i;10078:44::-;10062:60;;10140:17;10160;10170:6;10160:9;:17::i;:::-;10140:37;;10207:9;10199:5;:17;10195:321;;;10240:17;10260:37;10276:20;:5;10286:9;10276;:20::i;:::-;10260:11;;;:15;:37::i;:::-;10240:57;-1:-1:-1;10319:19:3;10341:27;10358:9;10341:12;:5;10351:1;10341:9;:12::i;:::-;:16;;:27::i;:::-;10319:49;-1:-1:-1;10390:17:3;10410:23;10319:49;10410:9;:23;:::i;:::-;10390:43;-1:-1:-1;10459:13:3;;10455:42;;10474:23;10480:5;10487:9;10474:5;:23::i;:::-;10218:298;;;10195:321;10044:486;;10027:503;10002:595;;;10550:11;;10546:51;;10585:1;10577:5;:9;9848:755;;9726:877;;;;:::o;1595:208:2:-;1676:15;;;;;;;:9;:15;;;;;;:26;;1696:5;1676:19;:26::i;:::-;1658:15;;;;;;;:9;:15;;;;;:44;;;;1726:11;:22;;1742:5;1726:15;:22::i;:::-;1712:11;:36;;;1763:33;;8639:25:21;;;1763:33:2;;;;;;8627:2:21;8612:18;1763:33:2;;;;;;;;1595:208;;:::o;11522:1880:1:-;11670:16;11698:19;11720:25;11738:5;11720:9;:25::i;:::-;11698:47;;11821:21;11845:10;:23;;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;11821:49;;11880:20;11903:10;:22;;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;11880:47;;11958:12;11941:13;:29;11937:43;;11979:1;11972:8;;;;;;;11937:43;12047:6;1477:17;12080:33;;:66;;;;;1313:17;12117:7;:29;12080:66;12063:287;;;12221:20;12244:31;:13;12262:12;12244:17;:31::i;:::-;12221:54;;12303:12;12293:7;:22;12289:50;;;12327:12;12317:22;;12289:50;12157:193;12063:287;12364:11;;12360:991;;12455:17;12475:150;12502:5;12525:7;12558:4;12581:7;12606:5;12475:9;:150::i;:::-;12455:170;-1:-1:-1;12643:14:1;12639:28;;12666:1;12659:8;;;;;;;;;12639:28;12813:151;12839:5;12870:4;12893:7;12918:9;12945:5;12813:8;:151::i;:::-;12802:162;-1:-1:-1;13323:16:1;13296:23;:9;12802:162;13296:13;:23::i;:::-;:43;;13288:52;;;;;;12377:974;12360:991;11688:1714;;;;11522:1880;;;;;;;:::o;319:118:11:-;369:9;394:17;267:6;394:10;;;:17;:::i;505:106::-;565:9;590:14;594:10;;;590:1;:14;:::i;3039:96:20:-;3097:7;3123:5;3127:1;3123;:5;:::i;608:190:19:-;670:7;789:1;780:5;789:1;780;:5;:::i;:::-;772;776:1;772;:5;:::i;:::-;:13;;;;:::i;:::-;771:19;;;;:::i;:::-;761:5;765:1;761;:5;:::i;:::-;751;755:1;751;:5;:::i;:::-;750:17;;;;:::i;:::-;:41;;;;:::i;5084:1030:0:-;5172:5;1650:15;1668:17;1679:5;1668:10;:17::i;:::-;1650:35;;5193:16:::1;5212:39;5230:5;5245:4;5212:17;:39::i;:::-;5285:14;::::0;::::1;5261:21;5285:14:::0;;;:7:::1;:14;::::0;;;;;5193:58;;-1:-1:-1;5336:24:0;;::::1;5332:152;;;5384:24;5395:13:::0;5384:8;:24:::1;:::i;:::-;5376:32;;5332:152;;;-1:-1:-1::0;5472:1:0::1;5332:152;5493:17;5513:141;5536:5:::0;5563:4:::1;::::0;5609:17:::1;:6:::0;5620:5;5609:10:::1;:17::i;:::-;5640:4;5513:9;:141::i;:::-;5493:161;;5664:16;5706:6;5694:9;:18;5690:121;;;5739:18;5751:6:::0;5739:9;:18:::1;:::i;:::-;5728:29;;5690:121;;;-1:-1:-1::0;5799:1:0::1;5690:121;5837:39;5855:20;5867:8:::0;5855:9;:20:::1;:::i;:::-;5837:13:::0;;:17:::1;:39::i;:::-;5820:14;::::0;;::::1;;::::0;;;:7:::1;:14;::::0;;;;;;;:56;;;;5940:7:::1;::::0;5922:34;;;;;;;5820:14;;5940:7;::::1;::::0;5922:32:::1;::::0;:34:::1;::::0;;::::1;::::0;5820:14;5922:34;;;;;5940:7;5922:34;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5906:50:::0;-1:-1:-1;5970:12:0;;5966:86:::1;;5998:43;:26;::::0;::::1;6025:5:::0;6032:8;5998:26:::1;:43::i;:::-;6066:41;::::0;;6738:42:21;6726:55;;6708:74;;6813:2;6798:18;;6791:34;;;6841:18;;;6834:34;;;6066:41:0::1;::::0;6696:2:21;6681:18;6066:41:0::1;;;;;;;5183:931;;;;;;1735:7:::0;1714:17;1725:5;1714:10;:17::i;:::-;:28;1706:66;;;;;;;12006:2:21;1706:66:0;;;11988:21:21;12045:2;12025:18;;;12018:30;12084:27;12064:18;;;12057:55;12129:18;;1706:66:0;11978:175:21;1706:66:0;1640:139;5084:1030;;;:::o;4716:362::-;4802:5;1650:15;1668:17;1679:5;1668:10;:17::i;:::-;1650:35;;4823:17:::1;4843:130;4865:5;4892:4;4919;4938:6;4958:5;4843:8;:130::i;:::-;5000:14;::::0;::::1;;::::0;;;:7:::1;:14;::::0;;;;;4823:150;;-1:-1:-1;5000:29:0::1;::::0;4823:150;5000:18:::1;:29::i;:::-;4983:14;::::0;::::1;;::::0;;;:7:::1;:14;::::0;;;;;;;;:46;;;;5044:27;;6378:74:21;;;6468:18;;;6461:34;;;5044:27:0::1;::::0;6351:18:21;5044:27:0::1;;;;;;;4813:265;1735:7:::0;1714:17;1725:5;1714:10;:17::i;191:135:10:-;249:9;293:1;283:5;287:1;293;283:5;:::i;:::-;279:9;;;278:16;;270:49;;;;;;;13416:2:21;270:49:10;;;13398:21:21;13455:2;13435:18;;;13428:30;13494:22;13474:18;;;13467:50;13534:18;;270:49:10;13388:170:21;352:301:9;400:9;429:1;425;:5;421:226;;;-1:-1:-1;450:1:9;465:9;477:5;481:1;450;477:5;:::i;:::-;:9;;485:1;477:9;:::i;:::-;465:21;;500:89;511:1;507;:5;500:89;;;536:1;-1:-1:-1;536:1:9;573;536;560:5;536:1;560;:5;:::i;:::-;:9;;;;:::i;:::-;559:15;;;;:::i;:::-;555:19;;500:89;;;432:167;1785:189:0;;;:::o;421:226:9:-;609:6;;605:42;;-1:-1:-1;635:1:9;352:301;;;:::o;1389:200:2:-;1464:11;;:22;;1480:5;1464:15;:22::i;:::-;1450:11;:36;;;1512:13;;;;;:9;:13;;;;;;:24;;1530:5;1512:17;:24::i;:::-;1496:13;;;;;;;:9;:13;;;;;;:40;;;;1551:31;;1496:13;;;1551:31;;;;1576:5;8639:25:21;;8627:2;8612:18;;8594:76;134:103:9;192:9;221:1;217;:5;:13;;229:1;217:13;;;-1:-1:-1;225:1:9;;213:17;-1:-1:-1;134:103:9:o;6625:4891:1:-;6886:17;6915:19;6937:16;6947:5;6937:9;:16::i;:::-;6915:38;-1:-1:-1;6986:5:1;6963:13;7030:16;6986:5;7030:9;:16::i;:::-;7003:43;;7056:41;7082:5;7090:6;7056:17;:41::i;:::-;7791:10;7786:2879;7812:6;:13;7807:2;:18;7786:2879;;;7852:16;7851:17;:45;;;;;7886:10;7872:24;;:6;7879:2;7872:10;;;;;;;;:::i;:::-;;;;;;;:24;;;7851:45;7847:124;;;7916:8;;7847:124;8046:23;8072:6;8079:2;8072:10;;;;;;;;:::i;:::-;;;;;;;;;;;:28;;;;;:20;5402:55:21;;;8072:28:1;;;5384:74:21;8072:20:1;;;;;;5357:18:21;;8072:28:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8046:54;-1:-1:-1;8273:23:1;;;8291:4;8273:23;8269:208;;8334:128;8364:15;8401:6;8408:2;8401:10;;;;;;;;:::i;:::-;;;;;;;;;;;:43;;;;;:20;5722:15:21;;;8401:43:1;;;5704:34:21;8438:4:1;5754:18:21;;;5747:43;8401:20:1;;;;;;5616:18:21;;8401:43:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;8334:128::-;8316:146;;8269:208;8573:104;8599:15;8632:6;8639:2;8632:10;;;;;;;;:::i;:::-;;;;;;;:29;;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8573:104;8555:122;-1:-1:-1;8696:19:1;;8692:1963;;8908:23;;;8926:4;8908:23;8904:206;;8953:6;8960:2;8953:10;;;;;;;;:::i;:::-;;;;;;;;;;;:157;;;;;:23;6082:15:21;;;8953:157:1;;;6064:34:21;9042:4:1;6114:18:21;;;6107:43;6166:18;;;6159:34;;;8953:23:1;;;;;;5976:18:21;;8953:157:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;8904:206;1313:17;9133:6;:29;9129:1278;;9265:23;9291:189;9453:6;9460:2;9453:10;;;;;;;;:::i;:::-;;;;;;;:24;;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9291:136;9404:6;9411:2;9404:10;;;;;;;;:::i;:::-;;;;;;;:19;;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9392:34;;:2;:34;:::i;:::-;9291:42;:6;9323:9;9291:31;:42::i;:189::-;9265:215;;9895:1;9877:15;:19;:56;;;;;9918:15;9900;:33;9877:56;9848:446;;;9994:105;10037:6;10044:2;10037:10;;;;;;;;:::i;:::-;;;;;;;:19;;;10057:15;10037:36;;;;;;;;;;;;;8639:25:21;;8627:2;8612:18;;8594:76;10037:36:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9994:9;;:13;:105::i;:::-;9982:117;;9848:446;;;10166:105;10209:6;10216:2;10209:10;;;;;;;;:::i;:::-;;;;;;;:19;;;10229:15;10209:36;;;;;;;;;;;;;8639:25:21;;8627:2;8612:18;;8594:76;10166:105:1;10154:117;;9848:446;9164:1148;9129:1278;;;10352:36;10366:6;10373:2;10366:10;;;;;;;;:::i;:::-;;;;;;;:19;;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;10352:9;;:13;:36::i;:::-;10340:48;;9129:1278;10590:9;10580:6;:19;10576:30;;10601:5;;;10576:30;7833:2832;7786:2879;7827:4;;;;:::i;:::-;;;;7786:2879;;;;10829:6;10817:9;:18;:127;;;;;10887:57;10922:10;:19;;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;10918:25;;:2;:25;:::i;:::-;10887:10;:24;;;:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:57::-;10851:21;:9;10865:6;10851:13;:21::i;:::-;:93;10817:127;10800:568;;;11112:21;:9;11126:6;11112:13;:21::i;:::-;11041:52;;;;;11066:4;11041:52;;;5704:34:21;11041:16:1;5774:15:21;;;5754:18;;;5747:43;11041:16:1;;;;;5616:18:21;;11041:52:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:92;11020:242;;;11166:59;:18;;;11193:10;1045:17;11166:18;:59::i;:::-;11276:18;;;;11295:21;:9;11309:6;11295:13;:21::i;:::-;11276:49;;;;;;;;;;;;;19909:25:21;;;;19982:42;19970:55;;19950:18;;;19943:83;19882:18;;11276:49:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;11351:6;11339:18;;10800:568;11442:25;;;11462:4;11442:25;11438:71;;11469:40;:19;;;11489:8;11499:9;11469:19;:40::i;:::-;6905:4611;;;6625:4891;;;;;;;:::o;4466:2153::-;4749:17;4778:19;4800:16;4810:5;4800:9;:16::i;:::-;4778:38;-1:-1:-1;4882:33:1;;;4878:47;;4924:1;4917:8;;;;;4878:47;4959:5;4976:358;;;;1251:17;5009:6;:28;5005:319;;5057:57;:23;;;5081:9;5100:4;5107:6;5057:23;:57::i;:::-;5005:319;;;5264:27;;;;;:16;5402:55:21;;;5264:27:1;;;5384:74:21;5153:156:1;;5198:9;;5237:4;;5264:16;;;;;;5357:18:21;;5264:27:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5153:23;;;;:156;;:23;:156::i;:::-;5348:52;;;;;5373:4;5348:52;;;5704:34:21;5348:16:1;5774:15:21;;;5754:18;;;5747:43;5403:6:1;;5348:16;;;;;;5616:18:21;;5348:52:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:61;5344:274;;;5425:42;:18;;;5452:10;5465:1;5425:18;:42::i;:::-;5526:59;:18;;;5553:10;1045:17;5526:18;:59::i;:::-;5973:31;;;;;5998:4;5973:31;;;5384:74:21;5953:17:1;;5973:16;;;;;;5357:18:21;;5973:31:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5953:51;-1:-1:-1;6018:25:1;;;6038:4;6018:25;6014:234;;6059:36;;;;;;;;19909:25:21;;;6059:18:1;19970:55:21;;;19950:18;;;19943:83;6059:18:1;;;;;19882::21;;6059:36:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;6014:234;;;1251:17;6116:6;:28;6112:136;;6160:26;;;;;;;;8639:25:21;;;6160:18:1;;;;;;8612::21;;6160:26:1;8594:76:21;6112:136:1;6217:10;:18;;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;6112:136;6277:31;;;;;6302:4;6277:31;;;5384:74:21;6258:16:1;;6277;;;;;;5357:18:21;;6277:31:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6258:50;-1:-1:-1;6330:23:1;:9;6258:50;6330:13;:23::i;:::-;6318:35;-1:-1:-1;6516:26:1;;;6537:4;6516:26;;;;:42;;;6557:1;6546:8;:12;6516:42;6512:100;;;6572:40;:19;;;6592:9;6603:8;6572:19;:40::i;:::-;4768:1851;;;;4466:2153;;;;;;;:::o;634:175:17:-;743:58;;6408:42:21;6396:55;;743:58:17;;;6378:74:21;6468:18;;;6461:34;;;716:86:17;;736:5;;766:23;;6351:18:21;;743:58:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;716:19;:86::i;:::-;634:175;;;:::o;2761:457:1:-;3129:20;;;;;;;:13;:20;;;;;:27;3113:13;;:43;3109:103;;;3172:20;;;;;;;:13;:20;;;;;;;;:29;;;;;;;;:::i;1278:613:17:-;1643:10;;;1642:62;;-1:-1:-1;1659:39:17;;;;;1683:4;1659:39;;;5704:34:21;1659:15:17;5774::21;;;5754:18;;;5747:43;1659:15:17;;;;;5616:18:21;;1659:39:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:44;1642:62;1634:150;;;;;;;18606:2:21;1634:150:17;;;18588:21:21;18645:2;18625:18;;;18618:30;18684:34;18664:18;;;18657:62;18755:24;18735:18;;;18728:52;18797:19;;1634:150:17;18578:244:21;1634:150:17;1821:62;;6408:42:21;6396:55;;1821:62:17;;;6378:74:21;6468:18;;;6461:34;;;1794:90:17;;1814:5;;1844:22;;6351:18:21;;1821:62:17;6333:168:21;815:203:17;942:68;;6013:42:21;6082:15;;;942:68:17;;;6064:34:21;6134:15;;6114:18;;;6107:43;6166:18;;;6159:34;;;915:96:17;;935:5;;965:27;;5976:18:21;;942:68:17;5958:241:21;3022:751:17;3441:23;3467:69;3495:4;3467:69;;;;;;;;;;;;;;;;;3475:5;3467:27;;;;:69;;;;;:::i;:::-;3550:17;;3441:95;;-1:-1:-1;3550:21:17;3546:221;;3690:10;3679:30;;;;;;;;;;;;:::i;:::-;3671:85;;;;;;;18195:2:21;3671:85:17;;;18177:21:21;18234:2;18214:18;;;18207:30;18273:34;18253:18;;;18246:62;18344:12;18324:18;;;18317:40;18374:19;;3671:85:17;18167:232:21;3573:193:18;3676:12;3707:52;3729:6;3737:4;3743:1;3746:12;3676;1078:20;;4842:60;;;;;;;17482:2:21;4842:60:18;;;17464:21:21;17521:2;17501:18;;;17494:30;17560:31;17540:18;;;17533:59;17609:18;;4842:60:18;17454:179:21;4842:60:18;4973:12;4987:23;5014:6;:11;;5034:5;5042:4;5014:33;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4972:75;;;;5064:52;5082:7;5091:10;5103:12;5064:17;:52::i;:::-;5057:59;4600:523;-1:-1:-1;;;;;;;4600:523:18:o;7083:725::-;7198:12;7226:7;7222:580;;;-1:-1:-1;7256:10:18;7249:17;;7222:580;7367:17;;:21;7363:429;;7625:10;7619:17;7685:15;7672:10;7668:2;7664:19;7657:44;7363:429;7764:12;7757:20;;;;;;;;;;;:::i;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;14:247:21;73:6;126:2;114:9;105:7;101:23;97:32;94:2;;;142:1;139;132:12;94:2;181:9;168:23;200:31;225:5;200:31;:::i;266:251::-;336:6;389:2;377:9;368:7;364:23;360:32;357:2;;;405:1;402;395:12;357:2;437:9;431:16;456:31;481:5;456:31;:::i;522:388::-;590:6;598;651:2;639:9;630:7;626:23;622:32;619:2;;;667:1;664;657:12;619:2;706:9;693:23;725:31;750:5;725:31;:::i;:::-;775:5;-1:-1:-1;832:2:21;817:18;;804:32;845:33;804:32;845:33;:::i;:::-;897:7;887:17;;;609:301;;;;;:::o;915:456::-;992:6;1000;1008;1061:2;1049:9;1040:7;1036:23;1032:32;1029:2;;;1077:1;1074;1067:12;1029:2;1116:9;1103:23;1135:31;1160:5;1135:31;:::i;:::-;1185:5;-1:-1:-1;1242:2:21;1227:18;;1214:32;1255:33;1214:32;1255:33;:::i;:::-;1019:352;;1307:7;;-1:-1:-1;;;1361:2:21;1346:18;;;;1333:32;;1019:352::o;1376:829::-;1487:6;1495;1503;1511;1519;1527;1535;1588:3;1576:9;1567:7;1563:23;1559:33;1556:2;;;1605:1;1602;1595:12;1556:2;1644:9;1631:23;1663:31;1688:5;1663:31;:::i;:::-;1713:5;-1:-1:-1;1770:2:21;1755:18;;1742:32;1783:33;1742:32;1783:33;:::i;:::-;1835:7;-1:-1:-1;1889:2:21;1874:18;;1861:32;;-1:-1:-1;1940:2:21;1925:18;;1912:32;;-1:-1:-1;1996:3:21;1981:19;;1968:33;2045:4;2032:18;;2020:31;;2010:2;;2065:1;2062;2055:12;2010:2;1546:659;;;;-1:-1:-1;1546:659:21;;;;2088:7;2142:3;2127:19;;2114:33;;-1:-1:-1;2194:3:21;2179:19;;;2166:33;;1546:659;-1:-1:-1;;1546:659:21:o;2210:315::-;2278:6;2286;2339:2;2327:9;2318:7;2314:23;2310:32;2307:2;;;2355:1;2352;2345:12;2307:2;2394:9;2381:23;2413:31;2438:5;2413:31;:::i;:::-;2463:5;2515:2;2500:18;;;;2487:32;;-1:-1:-1;;;2297:228:21:o;2530:383::-;2607:6;2615;2623;2676:2;2664:9;2655:7;2651:23;2647:32;2644:2;;;2692:1;2689;2682:12;2644:2;2731:9;2718:23;2750:31;2775:5;2750:31;:::i;:::-;2800:5;2852:2;2837:18;;2824:32;;-1:-1:-1;2903:2:21;2888:18;;;2875:32;;2634:279;-1:-1:-1;;;2634:279:21:o;2918:277::-;2985:6;3038:2;3026:9;3017:7;3013:23;3009:32;3006:2;;;3054:1;3051;3044:12;3006:2;3086:9;3080:16;3139:5;3132:13;3125:21;3118:5;3115:32;3105:2;;3161:1;3158;3151:12;3200:184;3270:6;3323:2;3311:9;3302:7;3298:23;3294:32;3291:2;;;3339:1;3336;3329:12;3291:2;-1:-1:-1;3362:16:21;;3281:103;-1:-1:-1;3281:103:21:o;3389:248::-;3457:6;3465;3518:2;3506:9;3497:7;3493:23;3489:32;3486:2;;;3534:1;3531;3524:12;3486:2;-1:-1:-1;;3557:23:21;;;3627:2;3612:18;;;3599:32;;-1:-1:-1;3476:161:21:o;3642:863::-;3739:6;3747;3755;3763;3771;3824:3;3812:9;3803:7;3799:23;3795:33;3792:2;;;3841:1;3838;3831:12;3792:2;3877:9;3864:23;3854:33;;3934:2;3923:9;3919:18;3906:32;3896:42;;3988:2;3977:9;3973:18;3960:32;4001:31;4026:5;4001:31;:::i;:::-;4051:5;-1:-1:-1;4107:2:21;4092:18;;4079:32;4130:18;4160:14;;;4157:2;;;4187:1;4184;4177:12;4157:2;4225:6;4214:9;4210:22;4200:32;;4270:7;4263:4;4259:2;4255:13;4251:27;4241:2;;4292:1;4289;4282:12;4241:2;4332;4319:16;4358:2;4350:6;4347:14;4344:2;;;4374:1;4371;4364:12;4344:2;4419:7;4414:2;4405:6;4401:2;4397:15;4393:24;4390:37;4387:2;;;4440:1;4437;4430:12;4387:2;3782:723;;;;-1:-1:-1;3782:723:21;;-1:-1:-1;4471:2:21;4463:11;;4493:6;3782:723;-1:-1:-1;;;3782:723:21:o;4510:274::-;4639:3;4677:6;4671:13;4693:53;4739:6;4734:3;4727:4;4719:6;4715:17;4693:53;:::i;:::-;4762:16;;;;;4647:137;-1:-1:-1;;4647:137:21:o;6879:714::-;7132:42;7124:6;7120:55;7109:9;7102:74;7212:6;7207:2;7196:9;7192:18;7185:34;7255:6;7250:2;7239:9;7235:18;7228:34;7298:3;7293:2;7282:9;7278:18;7271:31;7339:6;7333:3;7322:9;7318:19;7311:35;7397:6;7389;7383:3;7372:9;7368:19;7355:49;7454:1;7424:22;;;7448:3;7420:32;;;7413:43;;;;7508:2;7496:15;;;7513:66;7492:88;7477:104;7473:114;;7092:501;-1:-1:-1;;;;7092:501:21:o;7598:698::-;7786:2;7838:21;;;7908:13;;7811:18;;;7930:22;;;7757:4;;7786:2;8009:15;;;;7983:2;7968:18;;;7757:4;8052:218;8066:6;8063:1;8060:13;8052:218;;;8131:13;;8146:42;8127:62;8115:75;;8245:15;;;;8210:12;;;;8088:1;8081:9;8052:218;;;-1:-1:-1;8287:3:21;;7766:530;-1:-1:-1;;;;;;7766:530:21:o;10196:442::-;10345:2;10334:9;10327:21;10308:4;10377:6;10371:13;10420:6;10415:2;10404:9;10400:18;10393:34;10436:66;10495:6;10490:2;10479:9;10475:18;10470:2;10462:6;10458:15;10436:66;:::i;:::-;10554:2;10542:15;10559:66;10538:88;10523:104;;;;10629:2;10519:113;;10317:321;-1:-1:-1;;10317:321:21:o;20875:128::-;20915:3;20946:1;20942:6;20939:1;20936:13;20933:2;;;20952:18;;:::i;:::-;-1:-1:-1;20988:9:21;;20923:80::o;21008:240::-;21048:1;21074:58;21159:2;21156:1;21152:10;21181:3;21171:2;;21188:18;;:::i;:::-;21226:10;;21222:20;;;;;21054:194;-1:-1:-1;;21054:194:21:o;21253:120::-;21293:1;21319;21309:2;;21324:18;;:::i;:::-;-1:-1:-1;21358:9:21;;21299:74::o;21378:482::-;21467:1;21510:5;21467:1;21524:330;21545:7;21535:8;21532:21;21524:330;;;21664:4;21596:66;21592:77;21586:4;21583:87;21580:2;;;21673:18;;:::i;:::-;21723:7;21713:8;21709:22;21706:2;;;21743:16;;;;21706:2;21822:22;;;;21782:15;;;;21524:330;;;21528:3;21442:418;;;;;:::o;21865:131::-;21925:5;21954:36;21981:8;21975:4;22050:5;22080:8;22070:2;;-1:-1:-1;22121:1:21;22135:5;;22070:2;22169:4;22159:2;;-1:-1:-1;22206:1:21;22220:5;;22159:2;22251:4;22269:1;22264:59;;;;22337:1;22332:130;;;;22244:218;;22264:59;22294:1;22285:10;;22308:5;;;22332:130;22369:3;22359:8;22356:17;22353:2;;;22376:18;;:::i;:::-;-1:-1:-1;;22432:1:21;22418:16;;22447:5;;22244:218;;22546:2;22536:8;22533:16;22527:3;22521:4;22518:13;22514:36;22508:2;22498:8;22495:16;22490:2;22484:4;22481:12;22477:35;22474:77;22471:2;;;-1:-1:-1;22583:19:21;;;22615:5;;22471:2;22662:34;22687:8;22681:4;22662:34;:::i;:::-;22792:6;22724:66;22720:79;22711:7;22708:92;22705:2;;;22803:18;;:::i;:::-;22841:20;;22060:807;-1:-1:-1;;;22060:807:21:o;22872:311::-;22912:7;22944:58;23029:2;23026:1;23022:10;23059:2;23056:1;23052:10;23115:3;23111:2;23107:12;23102:3;23099:21;23092:3;23085:11;23078:19;23074:47;23071:2;;;23124:18;;:::i;:::-;23164:13;;22924:259;-1:-1:-1;;;;22924:259:21:o;23188:228::-;23228:7;23354:1;23286:66;23282:74;23279:1;23276:81;23271:1;23264:9;23257:17;23253:105;23250:2;;;23361:18;;:::i;:::-;-1:-1:-1;23401:9:21;;23240:176::o;23421:125::-;23461:4;23489:1;23486;23483:8;23480:2;;;23494:18;;:::i;:::-;-1:-1:-1;23531:9:21;;23470:76::o;23551:221::-;23590:4;23619:10;23679;;;;23649;;23701:12;;;23698:2;;;23716:18;;:::i;:::-;23753:13;;23599:173;-1:-1:-1;;;23599:173:21:o;23777:258::-;23849:1;23859:113;23873:6;23870:1;23867:13;23859:113;;;23949:11;;;23943:18;23930:11;;;23923:39;23895:2;23888:10;23859:113;;;23990:6;23987:1;23984:13;23981:2;;;-1:-1:-1;;24025:1:21;24007:16;;24000:27;23830:205::o;24040:195::-;24079:3;24110:66;24103:5;24100:77;24097:2;;;24180:18;;:::i;:::-;-1:-1:-1;24227:1:21;24216:13;;24087:148::o;24240:112::-;24272:1;24298;24288:2;;24303:18;;:::i;:::-;-1:-1:-1;24337:9:21;;24278:74::o;24357:184::-;24409:77;24406:1;24399:88;24506:4;24503:1;24496:15;24530:4;24527:1;24520:15;24546:184;24598:77;24595:1;24588:88;24695:4;24692:1;24685:15;24719:4;24716:1;24709:15;24735:184;24787:77;24784:1;24777:88;24884:4;24881:1;24874:15;24908:4;24905:1;24898:15;24924:184;24976:77;24973:1;24966:88;25073:4;25070:1;25063:15;25097:4;25094:1;25087:15;25113:154;25199:42;25192:5;25188:54;25181:5;25178:65;25168:2;;25257:1;25254;25247:12;25168:2;25158:109;:::o
Swarm Source
ipfs://01183ca384ed9641ab9a4b1426aebdc987104748bfe3a2ac01fc39baf3e5db67
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.