Address Details
contract
0x138709a1a6dd8669Af5096110452DeF4b6f9d0D4
- Contract Name
- StrategyStakingDoubleRewardLP
- Creator
- 0xad3018–0630fc at 0x3d01ac–9a3e05
- Balance
- 0.000457614586800269 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 14,294 Transactions
- Transfers
- 232,470 Transfers
- Gas Used
- 11,090,338,885
- Last Balance Update
- 24266189
Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- StrategyStakingDoubleRewardLP
- Optimization enabled
- true
- Compiler version
- v0.8.4+commit.c7e474f2
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2022-01-11T02:02:18.528463Z
contracts/ACFI/strategies/ubeswap/StrategyStakingDoubleRewardLP.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../../interfaces/common/IUniswapRouterETH.sol"; import "../../interfaces/common/IUniswapV2Pair.sol"; import "../../interfaces/synthetix/IStakingRewards.sol"; import "../common/StratManager.sol"; import "../common/FeeManager.sol"; import "../common/BaseStrategyDoubleRewardLP.sol"; contract StrategyStakingDoubleRewardLP is StratManager, BaseStrategyDoubleRewardLP, FeeManager { using SafeERC20 for IERC20; using SafeMath for uint256; bool public harvestOnDeposit; /** * @dev Event that is fired each time someone harvests the strat. */ event _SafeSwap( uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline ); constructor( address _want, address _chef, StratMgr memory stratMgr, address[] memory _outputToNativeRoute, address[] memory _outputToLp0Route, address[] memory _outputToLp1Route, address[] memory _output2ToOutputRoute ) public StratManager(stratMgr) { want = _want; chef = _chef; // console.log("stratMgr %s ", stratMgr.vault); require(_outputToNativeRoute.length >= 2); output = _outputToNativeRoute[0]; native = _outputToNativeRoute[_outputToNativeRoute.length - 1]; outputToNativeRoute = _outputToNativeRoute; // setup lp routing lpToken0 = IUniswapV2Pair(want).token0(); require(_outputToLp0Route[0] == output); require(_outputToLp0Route[_outputToLp0Route.length - 1] == lpToken0); outputToLp0Route = _outputToLp0Route; lpToken1 = IUniswapV2Pair(want).token1(); require(_outputToLp1Route[0] == output); require(_outputToLp1Route[_outputToLp1Route.length - 1] == lpToken1); outputToLp1Route = _outputToLp1Route; // setup 2nd output require(_output2ToOutputRoute.length >= 2); output2 = _output2ToOutputRoute[0]; require(_output2ToOutputRoute[_output2ToOutputRoute.length - 1] == output); output2ToOutputRoute = _output2ToOutputRoute; _giveAllowances(); } // puts the funds to work function deposit() public override { uint256 wantBal = IERC20(want).balanceOf(address(this)); if (wantBal > 0) { IStakingRewards(chef).stake(wantBal); } } function withdraw(uint256 _amount) external { require(msg.sender == vault, "!vault"); uint256 wantBal = IERC20(want).balanceOf(address(this)); if (wantBal < _amount) { IStakingRewards(chef).withdraw(_amount.sub(wantBal)); wantBal = IERC20(want).balanceOf(address(this)); } if (wantBal > _amount) { wantBal = _amount; } if (tx.origin == owner() || paused()) { IERC20(want).safeTransfer(vault, wantBal); } else { uint256 withdrawalFeeAmount = wantBal.mul(withdrawalFee).div( WITHDRAWAL_MAX ); IERC20(want).safeTransfer(vault, wantBal.sub(withdrawalFeeAmount)); } } function beforeDeposit() external override { if (harvestOnDeposit) { require(msg.sender == vault, "!vault"); _harvest(nullAddress); } } // performance fees function chargeFees(address callFeeRecipient) internal override { // take fee from output uint256 toNative = IERC20(output).balanceOf(address(this)).mul(45).div( 1000 ); _safeSwap(toNative, outputToNativeRoute, address(this)); uint256 nativeBal = IERC20(native).balanceOf(address(this)); uint256 callFeeAmount = nativeBal.mul(callFee).div(MAX_FEE); if (callFeeRecipient != nullAddress) { IERC20(native).safeTransfer(callFeeRecipient, callFeeAmount); } else { IERC20(native).safeTransfer(tx.origin, callFeeAmount); } uint256 autocompFeeAmount = nativeBal.mul(autocompFee).div(MAX_FEE); IERC20(native).safeTransfer(autocompFeeRecipient, autocompFeeAmount); uint256 strategistFee = nativeBal.mul(STRATEGIST_FEE).div(MAX_FEE); IERC20(native).safeTransfer(strategist, strategistFee); } // calculate the total underlaying 'want' held by the strat. function balanceOf() public view returns (uint256) { return balanceOfWant().add(balanceOfPool()); } // it calculates how much 'want' this contract holds. function balanceOfWant() public view returns (uint256) { return IERC20(want).balanceOf(address(this)); } // it calculates how much 'want' the strategy has working in the farm. function balanceOfPool() public view returns (uint256) { uint256 _amount = IStakingRewards(chef).balanceOf(address(this)); return _amount; } // called as part of strat migration. Sends all the available funds back to the vault. function retireStrat() external { require(msg.sender == vault, "!vault"); IStakingRewards(chef).withdraw(balanceOfPool()); uint256 wantBal = IERC20(want).balanceOf(address(this)); IERC20(want).transfer(vault, wantBal); } function setHarvestOnDeposit(bool _harvestOnDeposit) external onlyManager { harvestOnDeposit = _harvestOnDeposit; if (harvestOnDeposit) { setWithdrawalFee(0); } else { setWithdrawalFee(10); } } function _safeSwap( uint256 _amountIn, address[] memory _path, address _to ) internal override { // swapExactTokensForTokens emit _SafeSwap(_amountIn, 0, _path, _to, block.timestamp.add(600)); IUniswapRouterETH(unirouter).swapExactTokensForTokens( _amountIn, 0, _path, _to, block.timestamp.add(600) ); } function _addLiquidity(uint256 lp0Bal, uint256 lp1Bal) internal override { IUniswapRouterETH(unirouter).addLiquidity( lpToken0, lpToken1, lp0Bal, lp1Bal, 1, 1, address(this), block.timestamp ); } // pauses deposits and withdraws all funds from third party systems. function panic() public onlyManager { pause(); IStakingRewards(chef).withdraw(balanceOfPool()); } function pause() public onlyManager { _pause(); _removeAllowances(); } function unpause() external onlyManager { _unpause(); _giveAllowances(); deposit(); } function _giveAllowances() internal { IERC20(want).safeApprove(chef, type(uint256).max); IERC20(output).safeApprove(unirouter, type(uint256).max); IERC20(lpToken0).safeApprove(unirouter, 0); IERC20(lpToken0).safeApprove(unirouter, type(uint256).max); IERC20(lpToken1).safeApprove(unirouter, 0); IERC20(lpToken1).safeApprove(unirouter, type(uint256).max); IERC20(output2).safeApprove(unirouter, 0); IERC20(output2).safeApprove(unirouter, type(uint256).max); } function _removeAllowances() internal { IERC20(want).safeApprove(chef, 0); IERC20(output).safeApprove(unirouter, 0); IERC20(lpToken0).safeApprove(unirouter, 0); IERC20(lpToken1).safeApprove(unirouter, 0); } }
/_openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
/_openzeppelin/contracts/security/Pausable.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
/_openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
/_openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
/_openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
/_openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' 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 require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
/_openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; 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"); (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"); (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"); (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"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
/_openzeppelin/contracts/utils/math/SafeMath.sol
// 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. 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; } } }
/contracts/ACFI/interfaces/common/IUniswapRouterETH.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0; interface IUniswapRouterETH { function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); }
/contracts/ACFI/interfaces/common/IUniswapV2Pair.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IUniswapV2Pair { function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function burn(address to) external returns (uint256 amount0, uint256 amount1); function getReserves() external view returns ( uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast ); }
/contracts/ACFI/interfaces/synthetix/IStakingRewards.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // import "../../../openzeppelin-solidity/contracts/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // https://docs.synthetix.io/contracts/source/interfaces/istakingrewards interface IStakingRewards { // Views function rewardsToken() external view returns (IERC20); function stakingToken() external view returns (IERC20); function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; }
/contracts/ACFI/strategies/common/BaseStrategyDoubleRewardLP.sol
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../../interfaces/synthetix/IStakingRewards.sol"; import "./StratManager.sol"; abstract contract BaseStrategyDoubleRewardLP is StratManager { using SafeERC20 for IERC20; using SafeMath for uint256; // Tokens used address public native; address public output; address public want; address public lpToken0; address public lpToken1; address constant nullAddress = address(0); // 2nd reward address public output2; // Third party contracts address public chef; uint256 public lastHarvest; // Routes address[] public outputToNativeRoute; address[] public outputToLp0Route; address[] public outputToLp1Route; address[] public output2ToOutputRoute; function chargeFees(address) internal virtual; function deposit() public virtual; function _safeSwap( uint256 _amountIn, address[] memory _path, address _to ) internal virtual; function _addLiquidity(uint256 lp0Bal, uint256 lp1Bal) internal virtual; //events event StratHarvest(address indexed harvester); function harvest() external virtual onlyHarvester { _harvest(nullAddress); } function harvestWithCallFeeRecipient(address callFeeRecipient) external virtual onlyHarvester { _harvest(callFeeRecipient); } function managerHarvest() external onlyManager { _harvest(nullAddress); } // compounds earnings and charges performance fee function _harvest(address callFeeRecipient) internal whenNotPaused { IStakingRewards(chef).getReward(); uint256 outputBal = IERC20(output).balanceOf(address(this)); uint256 output2Bal = IERC20(output2).balanceOf(address(this)); if (outputBal > 0 && output2Bal > 0) { _safeSwap(output2Bal, output2ToOutputRoute, address(this)); chargeFees(callFeeRecipient); addLiquidity(); deposit(); lastHarvest = block.timestamp; emit StratHarvest(msg.sender); } } // Adds liquidity to AMM and gets more LP tokens. function addLiquidity() internal { uint256 outputHalf = IERC20(output).balanceOf(address(this)).div(2); if (lpToken0 != output) { _safeSwap(outputHalf, outputToLp0Route, address(this)); } if (lpToken1 != output) { _safeSwap(outputHalf, outputToLp1Route, address(this)); } uint256 lp0Bal = IERC20(lpToken0).balanceOf(address(this)); uint256 lp1Bal = IERC20(lpToken1).balanceOf(address(this)); if (lp0Bal > 0 && lp1Bal > 0) { _addLiquidity(lp0Bal, lp1Bal); } } }
/contracts/ACFI/strategies/common/FeeManager.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./StratManager.sol"; abstract contract FeeManager is StratManager { uint256 public constant STRATEGIST_FEE = 112; uint256 public constant MAX_FEE = 1000; uint256 public constant MAX_CALL_FEE = 111; uint256 public constant WITHDRAWAL_FEE_CAP = 50; uint256 public constant WITHDRAWAL_MAX = 10000; uint256 public withdrawalFee = 10; uint256 public callFee = 111; uint256 public autocompFee = MAX_FEE - STRATEGIST_FEE - callFee; function setCallFee(uint256 _fee) public onlyManager { require(_fee <= MAX_CALL_FEE, "!cap"); callFee = _fee; autocompFee = MAX_FEE - STRATEGIST_FEE - callFee; } function setWithdrawalFee(uint256 _fee) public onlyManager { require(_fee <= WITHDRAWAL_FEE_CAP, "!cap"); withdrawalFee = _fee; } }
/contracts/ACFI/strategies/common/StratManager.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract StratManager is Ownable, Pausable { /** * @dev Autocomp Contracts: * {keeper} - Address to manage a few lower risk features of the strat * {strategist} - Address of the strategy author/deployer where strategist fee will go. * {vault} - Address of the vault that controls the strategy's funds. * {unirouter} - Address of exchange to execute swaps. */ address public keeper; address public strategist; address public unirouter; address public vault; address public harvester; address public autocompFeeRecipient; struct StratMgr { address keeper; address strategist; address unirouter; address vault; address harvester; address autocompFeeRecipient; } /** * @dev Initializes the base strategy. * @param stratMgr.keeper address to use as alternative owner. * @param stratMgr.strategist address where strategist fees go. * @param stratMgr.unirouter router to use for swaps * @param stratMgr.vault address of parent vault. * @param stratMgr.autocompFeeRecipient address where to send autocomp's fees. */ constructor(StratMgr memory stratMgr) public { keeper = stratMgr.keeper; strategist = stratMgr.strategist; unirouter = stratMgr.unirouter; vault = stratMgr.vault; harvester = stratMgr.harvester; autocompFeeRecipient = stratMgr.autocompFeeRecipient; } // checks that caller is either owner or keeper. modifier onlyManager() { require(msg.sender == owner() || msg.sender == keeper, "!manager"); _; } // checks that caller is harvestr. modifier onlyHarvester() { require(msg.sender == harvester, "!harvester"); _; } /** * @dev Updates address of the strat keeper. * @param _keeper new keeper address. */ function setKeeper(address _keeper) external onlyManager { keeper = _keeper; } /** * @dev Updates address of the strat harvester. * @param _harvester new harvester address. */ function setHarvester(address _harvester) external onlyManager { harvester = _harvester; } /** * @dev Updates address where strategist fee earnings will go. * @param _strategist new strategist address. */ function setStrategist(address _strategist) external { require(msg.sender == strategist, "!strategist"); strategist = _strategist; } /** * @dev Updates router that will be used for swaps. * @param _unirouter new unirouter address. */ function setUnirouter(address _unirouter) external onlyOwner { unirouter = _unirouter; } /** * @dev Updates parent vault. * @param _vault new vault address. */ function setVault(address _vault) external onlyOwner { vault = _vault; } /** * @dev Updates autocomp fee recipient. * @param _autocompFeeRecipient new autocomp fee recipient address. */ function setAutocompFeeRecipient(address _autocompFeeRecipient) external onlyOwner { autocompFeeRecipient = _autocompFeeRecipient; } /** * @dev Function to synchronize balances before new user deposit. * Can be overridden in the strategy. */ function beforeDeposit() external virtual {} }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_want","internalType":"address"},{"type":"address","name":"_chef","internalType":"address"},{"type":"tuple","name":"stratMgr","internalType":"struct StratManager.StratMgr","components":[{"type":"address","name":"keeper","internalType":"address"},{"type":"address","name":"strategist","internalType":"address"},{"type":"address","name":"unirouter","internalType":"address"},{"type":"address","name":"vault","internalType":"address"},{"type":"address","name":"harvester","internalType":"address"},{"type":"address","name":"autocompFeeRecipient","internalType":"address"}]},{"type":"address[]","name":"_outputToNativeRoute","internalType":"address[]"},{"type":"address[]","name":"_outputToLp0Route","internalType":"address[]"},{"type":"address[]","name":"_outputToLp1Route","internalType":"address[]"},{"type":"address[]","name":"_output2ToOutputRoute","internalType":"address[]"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"StratHarvest","inputs":[{"type":"address","name":"harvester","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"_SafeSwap","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256","indexed":false},{"type":"uint256","name":"amountInMax","internalType":"uint256","indexed":false},{"type":"address[]","name":"path","internalType":"address[]","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":false},{"type":"uint256","name":"deadline","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_CALL_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"STRATEGIST_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"WITHDRAWAL_FEE_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"WITHDRAWAL_MAX","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"autocompFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"autocompFeeRecipient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfPool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfWant","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"beforeDeposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"callFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"chef","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"harvestOnDeposit","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvestWithCallFeeRecipient","inputs":[{"type":"address","name":"callFeeRecipient","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"harvester","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"keeper","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastHarvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpToken0","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpToken1","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"managerHarvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"native","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"output","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"output2","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"output2ToOutputRoute","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"outputToLp0Route","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"outputToLp1Route","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"outputToNativeRoute","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"panic","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"retireStrat","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAutocompFeeRecipient","inputs":[{"type":"address","name":"_autocompFeeRecipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCallFee","inputs":[{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setHarvestOnDeposit","inputs":[{"type":"bool","name":"_harvestOnDeposit","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setHarvester","inputs":[{"type":"address","name":"_harvester","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setKeeper","inputs":[{"type":"address","name":"_keeper","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStrategist","inputs":[{"type":"address","name":"_strategist","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUnirouter","inputs":[{"type":"address","name":"_unirouter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVault","inputs":[{"type":"address","name":"_vault","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWithdrawalFee","inputs":[{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"strategist","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"unirouter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"vault","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"want","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawalFee","inputs":[]}]
Contract Creation Code
0x6080604052600a601355606f60148190556200001f60706103e862000e98565b6200002b919062000e98565b6015553480156200003b57600080fd5b506040516200363c3803806200363c8339810160408190526200005e9162000d17565b846200006a3362000578565b6000805460ff60a01b191690558051600180546001600160a01b03199081166001600160a01b0393841617909155602083015160028054831691841691909117815560408401516003805484169185169190911790556060840151600480548416918516919091179055608084015160058054841691851691909117905560a0909301516006805483169184169190911790556009805482168b8416179055600d8054909116918916919091179055845110156200012757600080fd5b836000815181106200014957634e487b7160e01b600052603260045260246000fd5b6020026020010151600860006101000a8154816001600160a01b0302191690836001600160a01b03160217905550836001855162000188919062000e98565b81518110620001a757634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600780546001600160a01b0319166001600160a01b039092169190911790558451620001e691600f919087019062000afc565b50600960009054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156200023657600080fd5b505afa1580156200024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000271919062000cfa565b600a80546001600160a01b0319166001600160a01b0392831617905560085484519116908490600090620002b557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614620002d157600080fd5b600a5483516001600160a01b03909116908490620002f29060019062000e98565b815181106200031157634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316146200032d57600080fd5b82516200034290601090602086019062000afc565b50600960009054906101000a90046001600160a01b03166001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156200039257600080fd5b505afa158015620003a7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003cd919062000cfa565b600b80546001600160a01b0319166001600160a01b03928316179055600854835191169083906000906200041157634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316146200042d57600080fd5b600b5482516001600160a01b039091169083906200044e9060019062000e98565b815181106200046d57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316146200048957600080fd5b81516200049e90601190602085019062000afc565b50600281511015620004af57600080fd5b80600081518110620004d157634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600c80546001600160a01b0319166001600160a01b0392831617905560085482519116908290620005109060019062000e98565b815181106200052f57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316146200054b57600080fd5b80516200056090601290602084019062000afc565b506200056b620005c8565b5050505050505062000f05565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d54600954620005f5916001600160a01b0391821691166000196200072f602090811b6200138b17901c565b60035460085462000622916001600160a01b0391821691166000196200072f602090811b6200138b17901c565b600354600a546200064e916001600160a01b03918216911660006200072f602090811b6200138b17901c565b600354600a546200067b916001600160a01b0391821691166000196200072f602090811b6200138b17901c565b600354600b54620006a7916001600160a01b03918216911660006200072f602090811b6200138b17901c565b600354600b54620006d4916001600160a01b0391821691166000196200072f602090811b6200138b17901c565b600354600c5462000700916001600160a01b03918216911660006200072f602090811b6200138b17901c565b600354600c546200072d916001600160a01b0391821691166000196200072f602090811b6200138b17901c565b565b801580620007bd5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156200078057600080fd5b505afa15801562000795573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007bb919062000e2c565b155b620008355760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200088d9185916200089216565b505050565b6000620008ee826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200097060201b620014e2179092919060201c565b8051909150156200088d57808060200190518101906200090f919062000e0a565b6200088d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200082c565b60606200098184846000856200098b565b90505b9392505050565b606082471015620009ee5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200082c565b843b62000a3e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200082c565b600080866001600160a01b0316858760405162000a5c919062000e45565b60006040518083038185875af1925050503d806000811462000a9b576040519150601f19603f3d011682016040523d82523d6000602084013e62000aa0565b606091505b50909250905062000ab382828662000abe565b979650505050505050565b6060831562000acf57508162000984565b82511562000ae05782518084602001fd5b8160405162461bcd60e51b81526004016200082c919062000e63565b82805482825590600052602060002090810192821562000b54579160200282015b8281111562000b5457825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000b1d565b5062000b6292915062000b66565b5090565b5b8082111562000b62576000815560010162000b67565b80516001600160a01b038116811462000b9557600080fd5b919050565b600082601f83011262000bab578081fd5b815160206001600160401b038083111562000bca5762000bca62000eef565b8260051b604051601f19603f8301168101818110848211171562000bf25762000bf262000eef565b6040528481528381019250868401828801850189101562000c11578687fd5b8692505b8583101562000c3e5762000c298162000b7d565b84529284019260019290920191840162000c15565b50979650505050505050565b600060c0828403121562000c5c578081fd5b60405160c081016001600160401b038111828210171562000c815762000c8162000eef565b60405290508062000c928362000b7d565b815262000ca26020840162000b7d565b602082015262000cb56040840162000b7d565b604082015262000cc86060840162000b7d565b606082015262000cdb6080840162000b7d565b608082015262000cee60a0840162000b7d565b60a08201525092915050565b60006020828403121562000d0c578081fd5b620009848262000b7d565b6000806000806000806000610180888a03121562000d33578283fd5b62000d3e8862000b7d565b965062000d4e6020890162000b7d565b955062000d5f8960408a0162000c4a565b6101008901519095506001600160401b038082111562000d7d578485fd5b62000d8b8b838c0162000b9a565b95506101208a015191508082111562000da2578485fd5b62000db08b838c0162000b9a565b94506101408a015191508082111562000dc7578384fd5b62000dd58b838c0162000b9a565b93506101608a015191508082111562000dec578283fd5b5062000dfb8a828b0162000b9a565b91505092959891949750929550565b60006020828403121562000e1c578081fd5b8151801515811462000984578182fd5b60006020828403121562000e3e578081fd5b5051919050565b6000825162000e5981846020870162000ebc565b9190910192915050565b602081526000825180602084015262000e8481604085016020870162000ebc565b601f01601f19169190910160400192915050565b60008282101562000eb757634e487b7160e01b81526011600452602481fd5b500390565b60005b8381101562000ed957818101518382015260200162000ebf565b8381111562000ee9576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b6127278062000f156000396000f3fe608060405234801561001057600080fd5b50600436106103275760003560e01c806380a2e6ac116101b8578063c1a3d44c11610104578063f20eaeb8116100a2578063fbfa77cf1161007c578063fbfa77cf1461061e578063fcec0dfa14610631578063fd63a88714610644578063feaaf04b1461065757600080fd5b8063f20eaeb8146105f0578063f2fde38b14610603578063fb6177871461061657600080fd5b8063d801d946116100de578063d801d946146105c4578063d92f3d73146105cc578063dfbdc437146105df578063f1a392da146105e757600080fd5b8063c1a3d44c146105a1578063c7b9d530146105a9578063d0e30db0146105bc57600080fd5b806390321e1a11610171578063ac1e50251161014b578063ac1e50251461055f578063aced166114610572578063bc063e1a14610585578063be12a9781461058e57600080fd5b806390321e1a1461053a578063a0824cc414610543578063a2f809091461054c57600080fd5b806380a2e6ac146104e55780638456cb59146104f8578063877562b6146105005780638912cb8b146105135780638bc7e8c4146105205780638da5cb5b1461052957600080fd5b80634641257d116102775780635ee167c011610230578063715018a61161020a578063715018a6146104ba578063722713f7146104c2578063748747e6146104ca5780637d38ca65146104dd57600080fd5b80635ee167c014610481578063623d8bd2146104945780636817031b146104a757600080fd5b80634641257d1461042f5780634700d305146104375780634bdaeac11461043f57806354518b1a14610452578063573fef0a1461045b5780635c975abb1461046357600080fd5b80631fe4a686116102e45780632ad5a53f116102be5780632ad5a53f146103f95780632e1a7d4d1461040157806336c6cf21146104145780633f4ba83a1461042757600080fd5b80631fe4a686146103c0578063257ae0de146103d357806326465826146103e657600080fd5b80630e8fbb5a1461032c578063115880861461034157806311b0b42d1461035c57806315de1daa146103875780631f1fcd511461039a5780631fc8bc5d146103ad575b600080fd5b61033f61033a366004612452565b61066a565b005b6103496106e2565b6040519081526020015b60405180910390f35b60075461036f906001600160a01b031681565b6040516001600160a01b039091168152602001610353565b61033f61039536600461236b565b610768565b60095461036f906001600160a01b031681565b600d5461036f906001600160a01b031681565b60025461036f906001600160a01b031681565b60035461036f906001600160a01b031681565b61033f6103f436600461248a565b6107c9565b610349606f81565b61033f61040f36600461248a565b610865565b61036f61042236600461248a565b610aa9565b61033f610ad3565b61033f610b2c565b61033f610b7d565b60055461036f906001600160a01b031681565b61034961271081565b61033f610c2f565b600054600160a01b900460ff165b6040519015158152602001610353565b600a5461036f906001600160a01b031681565b61033f6104a236600461236b565b610c64565b61033f6104b536600461236b565b610cb4565b61033f610d00565b610349610d34565b61033f6104d836600461236b565b610d54565b610349607081565b60065461036f906001600160a01b031681565b61033f610db5565b600b5461036f906001600160a01b031681565b6016546104719060ff1681565b61034960135481565b6000546001600160a01b031661036f565b61034960145481565b61034960155481565b61036f61055a36600461248a565b610e04565b61033f61056d36600461248a565b610e14565b60015461036f906001600160a01b031681565b6103496103e881565b61036f61059c36600461248a565b610e92565b610349610ea2565b61033f6105b736600461236b565b610f1e565b61033f610f88565b61033f61106d565b61033f6105da36600461236b565b6110ac565b610349603281565b610349600e5481565b60085461036f906001600160a01b031681565b61033f61061136600461236b565b6110f8565b61033f611190565b60045461036f906001600160a01b031681565b600c5461036f906001600160a01b031681565b61036f61065236600461248a565b61132f565b61033f61066536600461236b565b61133f565b6000546001600160a01b031633148061068d57506001546001600160a01b031633145b6106b25760405162461bcd60e51b81526004016106a99061258b565b60405180910390fd5b6016805460ff191682151590811790915560ff16156106d8576106d56000610e14565b50565b6106d5600a610e14565b600d546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b15801561072a57600080fd5b505afa15801561073e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076291906124a2565b92915050565b6000546001600160a01b031633148061078b57506001546001600160a01b031633145b6107a75760405162461bcd60e51b81526004016106a99061258b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314806107ec57506001546001600160a01b031633145b6108085760405162461bcd60e51b81526004016106a99061258b565b606f8111156108425760405162461bcd60e51b81526004016106a9906020808252600490820152630216361760e41b604082015260600190565b60148190558061085560706103e8612674565b61085f9190612674565b60155550565b6004546001600160a01b0316331461088f5760405162461bcd60e51b81526004016106a990612536565b6009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156108d357600080fd5b505afa1580156108e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090b91906124a2565b9050818110156109fe57600d546001600160a01b0316632e1a7d4d61093084846114fb565b6040518263ffffffff1660e01b815260040161094e91815260200190565b600060405180830381600087803b15801561096857600080fd5b505af115801561097c573d6000803e3d6000fd5b50506009546040516370a0823160e01b81523060048201526001600160a01b0390911692506370a08231915060240160206040518083038186803b1580156109c357600080fd5b505afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb91906124a2565b90505b81811115610a095750805b6000546001600160a01b0316321480610a2b5750600054600160a01b900460ff165b15610a5157600454600954610a4d916001600160a01b03918216911683611507565b5050565b6000610a74612710610a6e6013548561153790919063ffffffff16565b90611543565b600454909150610aa4906001600160a01b0316610a9184846114fb565b6009546001600160a01b03169190611507565b505050565b60108181548110610ab957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b0316331480610af657506001546001600160a01b031633145b610b125760405162461bcd60e51b81526004016106a99061258b565b610b1a61154f565b610b226115ec565b610b2a610f88565b565b6005546001600160a01b03163314610b735760405162461bcd60e51b815260206004820152600a60248201526910b430b93b32b9ba32b960b11b60448201526064016106a9565b610b2a60006116e1565b6000546001600160a01b0316331480610ba057506001546001600160a01b031633145b610bbc5760405162461bcd60e51b81526004016106a99061258b565b610bc4610db5565b600d546001600160a01b0316632e1a7d4d610bdd6106e2565b6040518263ffffffff1660e01b8152600401610bfb91815260200190565b600060405180830381600087803b158015610c1557600080fd5b505af1158015610c29573d6000803e3d6000fd5b50505050565b60165460ff1615610b2a576004546001600160a01b03163314610b735760405162461bcd60e51b81526004016106a990612536565b6005546001600160a01b03163314610cab5760405162461bcd60e51b815260206004820152600a60248201526910b430b93b32b9ba32b960b11b60448201526064016106a9565b6106d5816116e1565b6000546001600160a01b03163314610cde5760405162461bcd60e51b81526004016106a990612556565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d2a5760405162461bcd60e51b81526004016106a990612556565b610b2a600061195e565b6000610d4f610d416106e2565b610d49610ea2565b906119ae565b905090565b6000546001600160a01b0316331480610d7757506001546001600160a01b031633145b610d935760405162461bcd60e51b81526004016106a99061258b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331480610dd857506001546001600160a01b031633145b610df45760405162461bcd60e51b81526004016106a99061258b565b610dfc6119ba565b610b2a611a42565b60128181548110610ab957600080fd5b6000546001600160a01b0316331480610e3757506001546001600160a01b031633145b610e535760405162461bcd60e51b81526004016106a99061258b565b6032811115610e8d5760405162461bcd60e51b81526004016106a9906020808252600490820152630216361760e41b604082015260600190565b601355565b600f8181548110610ab957600080fd5b6009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610ee657600080fd5b505afa158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4f91906124a2565b6002546001600160a01b03163314610f665760405162461bcd60e51b815260206004820152600b60248201526a085cdd1c985d1959da5cdd60aa1b60448201526064016106a9565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610fcc57600080fd5b505afa158015610fe0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100491906124a2565b905080156106d557600d5460405163534a7e1d60e11b8152600481018390526001600160a01b039091169063a694fc3a90602401600060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b5050505050565b6000546001600160a01b031633148061109057506001546001600160a01b031633145b610b735760405162461bcd60e51b81526004016106a99061258b565b6000546001600160a01b031633146110d65760405162461bcd60e51b81526004016106a990612556565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146111225760405162461bcd60e51b81526004016106a990612556565b6001600160a01b0381166111875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a9565b6106d58161195e565b6004546001600160a01b031633146111ba5760405162461bcd60e51b81526004016106a990612536565b600d546001600160a01b0316632e1a7d4d6111d36106e2565b6040518263ffffffff1660e01b81526004016111f191815260200190565b600060405180830381600087803b15801561120b57600080fd5b505af115801561121f573d6000803e3d6000fd5b50506009546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a082319060240160206040518083038186803b15801561126957600080fd5b505afa15801561127d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a191906124a2565b6009546004805460405163a9059cbb60e01b81526001600160a01b03918216928101929092526024820184905292935091169063a9059cbb90604401602060405180830381600087803b1580156112f757600080fd5b505af115801561130b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4d919061246e565b60118181548110610ab957600080fd5b6000546001600160a01b031633146113695760405162461bcd60e51b81526004016106a990612556565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b8015806114145750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156113da57600080fd5b505afa1580156113ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141291906124a2565b155b61147f5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016106a9565b6040516001600160a01b038316602482015260448101829052610aa490849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611aba565b60606114f18484600085611b8c565b90505b9392505050565b60006114f48284612674565b6040516001600160a01b038316602482015260448101829052610aa490849063a9059cbb60e01b906064016114ab565b60006114f48284612655565b60006114f48284612635565b600054600160a01b900460ff1661159f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106a9565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600d5460095461160b916001600160a01b03918216911660001961138b565b60035460085461162a916001600160a01b03918216911660001961138b565b600354600a54611648916001600160a01b039182169116600061138b565b600354600a54611667916001600160a01b03918216911660001961138b565b600354600b54611685916001600160a01b039182169116600061138b565b600354600b546116a4916001600160a01b03918216911660001961138b565b600354600c546116c2916001600160a01b039182169116600061138b565b600354600c54610b2a916001600160a01b03918216911660001961138b565b600054600160a01b900460ff161561172e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a9565b600d60009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561177e57600080fd5b505af1158015611792573d6000803e3d6000fd5b50506008546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a082319060240160206040518083038186803b1580156117dc57600080fd5b505afa1580156117f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181491906124a2565b600c546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a082319060240160206040518083038186803b15801561185d57600080fd5b505afa158015611871573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189591906124a2565b90506000821180156118a75750600081115b15610aa45761191181601280548060200260200160405190810160405280929190818152602001828054801561190657602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116118e8575b505050505030611cb4565b61191a83611d97565b611922611fe4565b61192a610f88565b42600e5560405133907f577a37fdb49a88d66684922c6f913df5239b4f214b2b97c53ef8e3bbb2034cb590600090a2505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006114f4828461261d565b600054600160a01b900460ff1615611a075760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a9565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586115cf3390565b600d54600954611a60916001600160a01b039182169116600061138b565b600354600854611a7e916001600160a01b039182169116600061138b565b600354600a54611a9c916001600160a01b039182169116600061138b565b600354600b54610b2a916001600160a01b039182169116600061138b565b6000611b0f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114e29092919063ffffffff16565b805190915015610aa45780806020019051810190611b2d919061246e565b610aa45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106a9565b606082471015611bed5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106a9565b843b611c3b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106a9565b600080866001600160a01b03168587604051611c5791906124e7565b60006040518083038185875af1925050503d8060008114611c94576040519150601f19603f3d011682016040523d82523d6000602084013e611c99565b606091505b5091509150611ca982828661227e565b979650505050505050565b7faa327e5489499adc5f676ea1a378dd62fcf22884ae5855531b1e25c47d956a048360008484611ce6426102586119ae565b604051611cf79594939291906125ad565b60405180910390a16003546001600160a01b03166338ed17398460008585611d21426102586119ae565b6040518663ffffffff1660e01b8152600401611d419594939291906125ad565b600060405180830381600087803b158015611d5b57600080fd5b505af1158015611d6f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c299190810190612392565b6008546040516370a0823160e01b8152306004820152600091611e28916103e891610a6e91602d916001600160a01b0316906370a082319060240160206040518083038186803b158015611dea57600080fd5b505afa158015611dfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2291906124a2565b90611537565b9050611e8d81600f805480602002602001604051908101604052809291908181526020018280548015611906576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116118e857505050505030611cb4565b6007546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015611ed157600080fd5b505afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0991906124a2565b90506000611f286103e8610a6e6014548561153790919063ffffffff16565b90506001600160a01b03841615611f5557600754611f50906001600160a01b03168583611507565b611f6c565b600754611f6c906001600160a01b03163283611507565b6000611f896103e8610a6e6015548661153790919063ffffffff16565b600654600754919250611fa9916001600160a01b03908116911683611507565b6000611fbc6103e8610a6e866070611537565b600254600754919250611fdc916001600160a01b03908116911683611507565b505050505050565b6008546040516370a0823160e01b8152306004820152600091612067916002916001600160a01b0316906370a082319060240160206040518083038186803b15801561202f57600080fd5b505afa158015612043573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e91906124a2565b600854600a549192506001600160a01b039182169116146120e5576120e5816010805480602002602001604051908101604052809291908181526020018280548015611906576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116118e857505050505030611cb4565b600854600b546001600160a01b0390811691161461216057612160816011805480602002602001604051908101604052809291908181526020018280548015611906576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116118e857505050505030611cb4565b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156121a457600080fd5b505afa1580156121b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121dc91906124a2565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a082319060240160206040518083038186803b15801561222557600080fd5b505afa158015612239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225d91906124a2565b905060008211801561226f5750600081115b15610aa457610aa482826122b7565b6060831561228d5750816114f4565b82511561229d5782518084602001fd5b8160405162461bcd60e51b81526004016106a99190612503565b600354600a54600b5460405162e8e33760e81b81526001600160a01b0392831660048201529082166024820152604481018590526064810184905260016084820181905260a48201523060c48201524260e482015291169063e8e337009061010401606060405180830381600087803b15801561233357600080fd5b505af1158015612347573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106691906124ba565b60006020828403121561237c578081fd5b81356001600160a01b03811681146114f4578182fd5b600060208083850312156123a4578182fd5b825167ffffffffffffffff808211156123bb578384fd5b818501915085601f8301126123ce578384fd5b8151818111156123e0576123e06126cd565b8060051b604051601f19603f83011681018181108582111715612405576124056126cd565b604052828152858101935084860182860187018a1015612423578788fd5b8795505b83861015612445578051855260019590950194938601938601612427565b5098975050505050505050565b600060208284031215612463578081fd5b81356114f4816126e3565b60006020828403121561247f578081fd5b81516114f4816126e3565b60006020828403121561249b578081fd5b5035919050565b6000602082840312156124b3578081fd5b5051919050565b6000806000606084860312156124ce578182fd5b8351925060208401519150604084015190509250925092565b600082516124f981846020870161268b565b9190910192915050565b602081526000825180602084015261252281604085016020870161268b565b601f01601f19169190910160400192915050565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526008908201526710b6b0b730b3b2b960c11b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156125fc5784516001600160a01b0316835293830193918301916001016125d7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612630576126306126b7565b500190565b60008261265057634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561266f5761266f6126b7565b500290565b600082821015612686576126866126b7565b500390565b60005b838110156126a657818101518382015260200161268e565b83811115610c295750506000910152565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146106d557600080fdfea264697066735822122052b36bd76226510e4726f8c7aa564d7cfcec2f57d7330e24dbdc6de70b0c6ec864736f6c6343000804003300000000000000000000000065596e0f281b0cbcba0aa261982690e9bcba7247000000000000000000000000efe2f9d62e45815837b4f20c1f44f0a83605b5400000000000000000000000002bb07bd4524789fa45dbbd9ccba8eaea6aa7de76000000000000000000000000d061376868ae2638b72fb451f32d819c4ab07416000000000000000000000000e3d8bd6aed4f159bc8000a9cd47cffdb95f96121000000000000000000000000ad301865992a47ea78635cc23c02d758d70630fc00000000000000000000000091bc5fa600e71fd4c36825dbf095da1b202567e4000000000000000000000000002ff8162d4f44457c897b5a77026b2e75235c64000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000be915b9dcf56a3cbe739d9b9c202ca692409ec000000000000000000000000471ece3750da237f93b8e339c536989b8978a438000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000be915b9dcf56a3cbe739d9b9c202ca692409ec000000000000000000000000471ece3750da237f93b8e339c536989b8978a43800000000000000000000000020677d4f3d0f08e735ab512393524a3cfceb250c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000be915b9dcf56a3cbe739d9b9c202ca692409ec000000000000000000000000471ece3750da237f93b8e339c536989b8978a438000000000000000000000000000000000000000000000000000000000000000300000000000000000000000020677d4f3d0f08e735ab512393524a3cfceb250c000000000000000000000000471ece3750da237f93b8e339c536989b8978a43800000000000000000000000000be915b9dcf56a3cbe739d9b9c202ca692409ec
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106103275760003560e01c806380a2e6ac116101b8578063c1a3d44c11610104578063f20eaeb8116100a2578063fbfa77cf1161007c578063fbfa77cf1461061e578063fcec0dfa14610631578063fd63a88714610644578063feaaf04b1461065757600080fd5b8063f20eaeb8146105f0578063f2fde38b14610603578063fb6177871461061657600080fd5b8063d801d946116100de578063d801d946146105c4578063d92f3d73146105cc578063dfbdc437146105df578063f1a392da146105e757600080fd5b8063c1a3d44c146105a1578063c7b9d530146105a9578063d0e30db0146105bc57600080fd5b806390321e1a11610171578063ac1e50251161014b578063ac1e50251461055f578063aced166114610572578063bc063e1a14610585578063be12a9781461058e57600080fd5b806390321e1a1461053a578063a0824cc414610543578063a2f809091461054c57600080fd5b806380a2e6ac146104e55780638456cb59146104f8578063877562b6146105005780638912cb8b146105135780638bc7e8c4146105205780638da5cb5b1461052957600080fd5b80634641257d116102775780635ee167c011610230578063715018a61161020a578063715018a6146104ba578063722713f7146104c2578063748747e6146104ca5780637d38ca65146104dd57600080fd5b80635ee167c014610481578063623d8bd2146104945780636817031b146104a757600080fd5b80634641257d1461042f5780634700d305146104375780634bdaeac11461043f57806354518b1a14610452578063573fef0a1461045b5780635c975abb1461046357600080fd5b80631fe4a686116102e45780632ad5a53f116102be5780632ad5a53f146103f95780632e1a7d4d1461040157806336c6cf21146104145780633f4ba83a1461042757600080fd5b80631fe4a686146103c0578063257ae0de146103d357806326465826146103e657600080fd5b80630e8fbb5a1461032c578063115880861461034157806311b0b42d1461035c57806315de1daa146103875780631f1fcd511461039a5780631fc8bc5d146103ad575b600080fd5b61033f61033a366004612452565b61066a565b005b6103496106e2565b6040519081526020015b60405180910390f35b60075461036f906001600160a01b031681565b6040516001600160a01b039091168152602001610353565b61033f61039536600461236b565b610768565b60095461036f906001600160a01b031681565b600d5461036f906001600160a01b031681565b60025461036f906001600160a01b031681565b60035461036f906001600160a01b031681565b61033f6103f436600461248a565b6107c9565b610349606f81565b61033f61040f36600461248a565b610865565b61036f61042236600461248a565b610aa9565b61033f610ad3565b61033f610b2c565b61033f610b7d565b60055461036f906001600160a01b031681565b61034961271081565b61033f610c2f565b600054600160a01b900460ff165b6040519015158152602001610353565b600a5461036f906001600160a01b031681565b61033f6104a236600461236b565b610c64565b61033f6104b536600461236b565b610cb4565b61033f610d00565b610349610d34565b61033f6104d836600461236b565b610d54565b610349607081565b60065461036f906001600160a01b031681565b61033f610db5565b600b5461036f906001600160a01b031681565b6016546104719060ff1681565b61034960135481565b6000546001600160a01b031661036f565b61034960145481565b61034960155481565b61036f61055a36600461248a565b610e04565b61033f61056d36600461248a565b610e14565b60015461036f906001600160a01b031681565b6103496103e881565b61036f61059c36600461248a565b610e92565b610349610ea2565b61033f6105b736600461236b565b610f1e565b61033f610f88565b61033f61106d565b61033f6105da36600461236b565b6110ac565b610349603281565b610349600e5481565b60085461036f906001600160a01b031681565b61033f61061136600461236b565b6110f8565b61033f611190565b60045461036f906001600160a01b031681565b600c5461036f906001600160a01b031681565b61036f61065236600461248a565b61132f565b61033f61066536600461236b565b61133f565b6000546001600160a01b031633148061068d57506001546001600160a01b031633145b6106b25760405162461bcd60e51b81526004016106a99061258b565b60405180910390fd5b6016805460ff191682151590811790915560ff16156106d8576106d56000610e14565b50565b6106d5600a610e14565b600d546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b15801561072a57600080fd5b505afa15801561073e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076291906124a2565b92915050565b6000546001600160a01b031633148061078b57506001546001600160a01b031633145b6107a75760405162461bcd60e51b81526004016106a99061258b565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314806107ec57506001546001600160a01b031633145b6108085760405162461bcd60e51b81526004016106a99061258b565b606f8111156108425760405162461bcd60e51b81526004016106a9906020808252600490820152630216361760e41b604082015260600190565b60148190558061085560706103e8612674565b61085f9190612674565b60155550565b6004546001600160a01b0316331461088f5760405162461bcd60e51b81526004016106a990612536565b6009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156108d357600080fd5b505afa1580156108e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090b91906124a2565b9050818110156109fe57600d546001600160a01b0316632e1a7d4d61093084846114fb565b6040518263ffffffff1660e01b815260040161094e91815260200190565b600060405180830381600087803b15801561096857600080fd5b505af115801561097c573d6000803e3d6000fd5b50506009546040516370a0823160e01b81523060048201526001600160a01b0390911692506370a08231915060240160206040518083038186803b1580156109c357600080fd5b505afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb91906124a2565b90505b81811115610a095750805b6000546001600160a01b0316321480610a2b5750600054600160a01b900460ff165b15610a5157600454600954610a4d916001600160a01b03918216911683611507565b5050565b6000610a74612710610a6e6013548561153790919063ffffffff16565b90611543565b600454909150610aa4906001600160a01b0316610a9184846114fb565b6009546001600160a01b03169190611507565b505050565b60108181548110610ab957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b0316331480610af657506001546001600160a01b031633145b610b125760405162461bcd60e51b81526004016106a99061258b565b610b1a61154f565b610b226115ec565b610b2a610f88565b565b6005546001600160a01b03163314610b735760405162461bcd60e51b815260206004820152600a60248201526910b430b93b32b9ba32b960b11b60448201526064016106a9565b610b2a60006116e1565b6000546001600160a01b0316331480610ba057506001546001600160a01b031633145b610bbc5760405162461bcd60e51b81526004016106a99061258b565b610bc4610db5565b600d546001600160a01b0316632e1a7d4d610bdd6106e2565b6040518263ffffffff1660e01b8152600401610bfb91815260200190565b600060405180830381600087803b158015610c1557600080fd5b505af1158015610c29573d6000803e3d6000fd5b50505050565b60165460ff1615610b2a576004546001600160a01b03163314610b735760405162461bcd60e51b81526004016106a990612536565b6005546001600160a01b03163314610cab5760405162461bcd60e51b815260206004820152600a60248201526910b430b93b32b9ba32b960b11b60448201526064016106a9565b6106d5816116e1565b6000546001600160a01b03163314610cde5760405162461bcd60e51b81526004016106a990612556565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d2a5760405162461bcd60e51b81526004016106a990612556565b610b2a600061195e565b6000610d4f610d416106e2565b610d49610ea2565b906119ae565b905090565b6000546001600160a01b0316331480610d7757506001546001600160a01b031633145b610d935760405162461bcd60e51b81526004016106a99061258b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331480610dd857506001546001600160a01b031633145b610df45760405162461bcd60e51b81526004016106a99061258b565b610dfc6119ba565b610b2a611a42565b60128181548110610ab957600080fd5b6000546001600160a01b0316331480610e3757506001546001600160a01b031633145b610e535760405162461bcd60e51b81526004016106a99061258b565b6032811115610e8d5760405162461bcd60e51b81526004016106a9906020808252600490820152630216361760e41b604082015260600190565b601355565b600f8181548110610ab957600080fd5b6009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610ee657600080fd5b505afa158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4f91906124a2565b6002546001600160a01b03163314610f665760405162461bcd60e51b815260206004820152600b60248201526a085cdd1c985d1959da5cdd60aa1b60448201526064016106a9565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6009546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610fcc57600080fd5b505afa158015610fe0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100491906124a2565b905080156106d557600d5460405163534a7e1d60e11b8152600481018390526001600160a01b039091169063a694fc3a90602401600060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b5050505050565b6000546001600160a01b031633148061109057506001546001600160a01b031633145b610b735760405162461bcd60e51b81526004016106a99061258b565b6000546001600160a01b031633146110d65760405162461bcd60e51b81526004016106a990612556565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146111225760405162461bcd60e51b81526004016106a990612556565b6001600160a01b0381166111875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a9565b6106d58161195e565b6004546001600160a01b031633146111ba5760405162461bcd60e51b81526004016106a990612536565b600d546001600160a01b0316632e1a7d4d6111d36106e2565b6040518263ffffffff1660e01b81526004016111f191815260200190565b600060405180830381600087803b15801561120b57600080fd5b505af115801561121f573d6000803e3d6000fd5b50506009546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a082319060240160206040518083038186803b15801561126957600080fd5b505afa15801561127d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a191906124a2565b6009546004805460405163a9059cbb60e01b81526001600160a01b03918216928101929092526024820184905292935091169063a9059cbb90604401602060405180830381600087803b1580156112f757600080fd5b505af115801561130b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4d919061246e565b60118181548110610ab957600080fd5b6000546001600160a01b031633146113695760405162461bcd60e51b81526004016106a990612556565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b8015806114145750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156113da57600080fd5b505afa1580156113ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141291906124a2565b155b61147f5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016106a9565b6040516001600160a01b038316602482015260448101829052610aa490849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611aba565b60606114f18484600085611b8c565b90505b9392505050565b60006114f48284612674565b6040516001600160a01b038316602482015260448101829052610aa490849063a9059cbb60e01b906064016114ab565b60006114f48284612655565b60006114f48284612635565b600054600160a01b900460ff1661159f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106a9565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600d5460095461160b916001600160a01b03918216911660001961138b565b60035460085461162a916001600160a01b03918216911660001961138b565b600354600a54611648916001600160a01b039182169116600061138b565b600354600a54611667916001600160a01b03918216911660001961138b565b600354600b54611685916001600160a01b039182169116600061138b565b600354600b546116a4916001600160a01b03918216911660001961138b565b600354600c546116c2916001600160a01b039182169116600061138b565b600354600c54610b2a916001600160a01b03918216911660001961138b565b600054600160a01b900460ff161561172e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a9565b600d60009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561177e57600080fd5b505af1158015611792573d6000803e3d6000fd5b50506008546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a082319060240160206040518083038186803b1580156117dc57600080fd5b505afa1580156117f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181491906124a2565b600c546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a082319060240160206040518083038186803b15801561185d57600080fd5b505afa158015611871573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189591906124a2565b90506000821180156118a75750600081115b15610aa45761191181601280548060200260200160405190810160405280929190818152602001828054801561190657602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116118e8575b505050505030611cb4565b61191a83611d97565b611922611fe4565b61192a610f88565b42600e5560405133907f577a37fdb49a88d66684922c6f913df5239b4f214b2b97c53ef8e3bbb2034cb590600090a2505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006114f4828461261d565b600054600160a01b900460ff1615611a075760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106a9565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586115cf3390565b600d54600954611a60916001600160a01b039182169116600061138b565b600354600854611a7e916001600160a01b039182169116600061138b565b600354600a54611a9c916001600160a01b039182169116600061138b565b600354600b54610b2a916001600160a01b039182169116600061138b565b6000611b0f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114e29092919063ffffffff16565b805190915015610aa45780806020019051810190611b2d919061246e565b610aa45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106a9565b606082471015611bed5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106a9565b843b611c3b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106a9565b600080866001600160a01b03168587604051611c5791906124e7565b60006040518083038185875af1925050503d8060008114611c94576040519150601f19603f3d011682016040523d82523d6000602084013e611c99565b606091505b5091509150611ca982828661227e565b979650505050505050565b7faa327e5489499adc5f676ea1a378dd62fcf22884ae5855531b1e25c47d956a048360008484611ce6426102586119ae565b604051611cf79594939291906125ad565b60405180910390a16003546001600160a01b03166338ed17398460008585611d21426102586119ae565b6040518663ffffffff1660e01b8152600401611d419594939291906125ad565b600060405180830381600087803b158015611d5b57600080fd5b505af1158015611d6f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c299190810190612392565b6008546040516370a0823160e01b8152306004820152600091611e28916103e891610a6e91602d916001600160a01b0316906370a082319060240160206040518083038186803b158015611dea57600080fd5b505afa158015611dfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2291906124a2565b90611537565b9050611e8d81600f805480602002602001604051908101604052809291908181526020018280548015611906576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116118e857505050505030611cb4565b6007546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015611ed157600080fd5b505afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0991906124a2565b90506000611f286103e8610a6e6014548561153790919063ffffffff16565b90506001600160a01b03841615611f5557600754611f50906001600160a01b03168583611507565b611f6c565b600754611f6c906001600160a01b03163283611507565b6000611f896103e8610a6e6015548661153790919063ffffffff16565b600654600754919250611fa9916001600160a01b03908116911683611507565b6000611fbc6103e8610a6e866070611537565b600254600754919250611fdc916001600160a01b03908116911683611507565b505050505050565b6008546040516370a0823160e01b8152306004820152600091612067916002916001600160a01b0316906370a082319060240160206040518083038186803b15801561202f57600080fd5b505afa158015612043573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e91906124a2565b600854600a549192506001600160a01b039182169116146120e5576120e5816010805480602002602001604051908101604052809291908181526020018280548015611906576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116118e857505050505030611cb4565b600854600b546001600160a01b0390811691161461216057612160816011805480602002602001604051908101604052809291908181526020018280548015611906576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116118e857505050505030611cb4565b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156121a457600080fd5b505afa1580156121b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121dc91906124a2565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a082319060240160206040518083038186803b15801561222557600080fd5b505afa158015612239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225d91906124a2565b905060008211801561226f5750600081115b15610aa457610aa482826122b7565b6060831561228d5750816114f4565b82511561229d5782518084602001fd5b8160405162461bcd60e51b81526004016106a99190612503565b600354600a54600b5460405162e8e33760e81b81526001600160a01b0392831660048201529082166024820152604481018590526064810184905260016084820181905260a48201523060c48201524260e482015291169063e8e337009061010401606060405180830381600087803b15801561233357600080fd5b505af1158015612347573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106691906124ba565b60006020828403121561237c578081fd5b81356001600160a01b03811681146114f4578182fd5b600060208083850312156123a4578182fd5b825167ffffffffffffffff808211156123bb578384fd5b818501915085601f8301126123ce578384fd5b8151818111156123e0576123e06126cd565b8060051b604051601f19603f83011681018181108582111715612405576124056126cd565b604052828152858101935084860182860187018a1015612423578788fd5b8795505b83861015612445578051855260019590950194938601938601612427565b5098975050505050505050565b600060208284031215612463578081fd5b81356114f4816126e3565b60006020828403121561247f578081fd5b81516114f4816126e3565b60006020828403121561249b578081fd5b5035919050565b6000602082840312156124b3578081fd5b5051919050565b6000806000606084860312156124ce578182fd5b8351925060208401519150604084015190509250925092565b600082516124f981846020870161268b565b9190910192915050565b602081526000825180602084015261252281604085016020870161268b565b601f01601f19169190910160400192915050565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526008908201526710b6b0b730b3b2b960c11b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156125fc5784516001600160a01b0316835293830193918301916001016125d7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612630576126306126b7565b500190565b60008261265057634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561266f5761266f6126b7565b500290565b600082821015612686576126866126b7565b500390565b60005b838110156126a657818101518382015260200161268e565b83811115610c295750506000910152565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146106d557600080fdfea264697066735822122052b36bd76226510e4726f8c7aa564d7cfcec2f57d7330e24dbdc6de70b0c6ec864736f6c63430008040033