Source Code
Latest 16 from a total of 16 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Panic | 17129805 | 1293 days ago | IN | 0 ETH | 0.000061492881 | ||||
| Set Keeper | 15856932 | 1299 days ago | IN | 0 ETH | 0.000086303934 | ||||
| Set Call Fee | 15744187 | 1300 days ago | IN | 0 ETH | 0.000165138975 | ||||
| Harvest | 15351042 | 1303 days ago | IN | 0 ETH | 0.000052434779 | ||||
| Harvest | 15023695 | 1306 days ago | IN | 0 ETH | 0.000216174931 | ||||
| Transfer Ownersh... | 14100388 | 1317 days ago | IN | 0 ETH | 0.000136162653 | ||||
| Set Harvest On D... | 14100265 | 1317 days ago | IN | 0 ETH | 0.000185309962 | ||||
| Harvest | 14100216 | 1317 days ago | IN | 0 ETH | 0.000227339382 | ||||
| Harvest | 14100156 | 1317 days ago | IN | 0 ETH | 0.000314307425 | ||||
| Unpause | 14100086 | 1317 days ago | IN | 0 ETH | 0.000313929634 | ||||
| Panic | 14100057 | 1317 days ago | IN | 0 ETH | 0.000312815024 | ||||
| Harvest | 14099419 | 1317 days ago | IN | 0 ETH | 0.000172264353 | ||||
| Unpause | 14097942 | 1317 days ago | IN | 0 ETH | 0.000113202407 | ||||
| Panic | 14097939 | 1317 days ago | IN | 0 ETH | 0.000112727026 | ||||
| Set Unirouter | 14097895 | 1317 days ago | IN | 0 ETH | 0.000110150071 | ||||
| Set Pending Rewa... | 14096780 | 1317 days ago | IN | 0 ETH | 0.000193414308 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
StrategyStargateOp
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../../interfaces/common/IMasterChef.sol";
import "../../interfaces/stargate/IStargateRouter.sol";
import "../Common/StratManager.sol";
import "../Common/FeeManager.sol";
import "../../utils/StringUtils.sol";
import "../../utils/GasThrottler.sol";
import "../../utils/UniswapV3Utils.sol";
contract StrategyStargateOp is StratManager, FeeManager, GasThrottler {
using SafeERC20 for IERC20;
using SafeMath for uint256;
struct StratManagerParams {
address keeper;
address strategist;
address unirouter;
address vault;
address beefyFeeRecipient;
}
// Tokens used
address public native;
address public output;
address public want;
address public depositToken;
// Third party contracts
address public chef;
uint256 public poolId;
address public stargateRouter;
uint256 public routerPoolId;
bool public harvestOnDeposit;
uint256 public lastHarvest;
string public pendingRewardsFunctionName;
// Uniswap V3 paths
bytes public outputToNativePath;
bytes public outputToDepositPath;
event StratHarvest(address indexed harvester, uint256 wantHarvested, uint256 tvl);
event Deposit(uint256 tvl);
event Withdraw(uint256 tvl);
event ChargedFees(uint256 callFees, uint256 beefyFees, uint256 strategistFees);
constructor(
address _want,
uint256 _poolId,
address _chef,
uint256 _routerPoolId,
address _stargateRouter,
address[] memory _outputToNativeRoute,
address[] memory _outputToDepositRoute,
uint24[] memory _outputToNativeFee,
uint24[] memory _outputToDepositFee,
StratManagerParams memory _stratManager
) StratManager(_stratManager.keeper, _stratManager.strategist, _stratManager.unirouter, _stratManager.vault, _stratManager.beefyFeeRecipient) public {
want = _want;
poolId = _poolId;
routerPoolId = _routerPoolId;
chef = _chef;
stargateRouter = _stargateRouter;
output = _outputToNativeRoute[0];
native = _outputToNativeRoute[_outputToNativeRoute.length - 1];
outputToNativePath = UniswapV3Utils.routeToPath(_outputToNativeRoute, _outputToNativeFee);
require(_outputToDepositRoute[0] == output, '_outputToDeposit[0] != output');
depositToken = _outputToDepositRoute[_outputToDepositRoute.length - 1];
outputToDepositPath = UniswapV3Utils.routeToPath(_outputToDepositRoute, _outputToDepositFee);
_giveAllowances();
}
// puts the funds to work
function deposit() public whenNotPaused {
uint256 wantBal = IERC20(want).balanceOf(address(this));
if (wantBal > 0) {
IMasterChef(chef).deposit(poolId, wantBal);
emit Deposit(balanceOf());
}
}
function withdraw(uint256 _amount) external {
require(msg.sender == vault, "!vault");
uint256 wantBal = IERC20(want).balanceOf(address(this));
if (wantBal < _amount) {
IMasterChef(chef).withdraw(poolId, _amount.sub(wantBal));
wantBal = IERC20(want).balanceOf(address(this));
}
if (wantBal > _amount) {
wantBal = _amount;
}
if (tx.origin != owner() && !paused()) {
uint256 withdrawalFeeAmount = wantBal.mul(withdrawalFee).div(WITHDRAWAL_MAX);
wantBal = wantBal.sub(withdrawalFeeAmount);
}
IERC20(want).safeTransfer(vault, wantBal);
emit Withdraw(balanceOf());
}
function beforeDeposit() external override {
if (harvestOnDeposit) {
require(msg.sender == vault, "!vault");
_harvest(tx.origin);
}
}
function harvest() external gasThrottle virtual {
_harvest(tx.origin);
}
function harvest(address callFeeRecipient) external gasThrottle virtual {
_harvest(callFeeRecipient);
}
function managerHarvest() external onlyManager {
_harvest(tx.origin);
}
// compounds earnings and charges performance fee
function _harvest(address callFeeRecipient) internal whenNotPaused {
IMasterChef(chef).deposit(poolId, 0);
uint256 outputBal = IERC20(output).balanceOf(address(this));
if (outputBal > 0) {
chargeFees(callFeeRecipient);
addLiquidity();
uint256 wantHarvested = balanceOfWant();
deposit();
lastHarvest = block.timestamp;
emit StratHarvest(msg.sender, wantHarvested, balanceOf());
}
}
// performance fees
function chargeFees(address callFeeRecipient) internal {
uint256 toNative = IERC20(output).balanceOf(address(this)).mul(45).div(1000);
UniswapV3Utils.swap(unirouter, outputToNativePath, toNative);
uint256 nativeBal = IERC20(native).balanceOf(address(this));
uint256 callFeeAmount = nativeBal.mul(callFee).div(MAX_FEE);
IERC20(native).safeTransfer(callFeeRecipient, callFeeAmount);
uint256 beefyFeeAmount = nativeBal.mul(beefyFee).div(MAX_FEE);
IERC20(native).safeTransfer(beefyFeeRecipient, beefyFeeAmount);
uint256 strategistFeeAmount = nativeBal.mul(STRATEGIST_FEE).div(MAX_FEE);
IERC20(native).safeTransfer(strategist, strategistFeeAmount);
emit ChargedFees(callFeeAmount, beefyFeeAmount, strategistFeeAmount);
}
// Adds liquidity to AMM and gets more LP tokens.
function addLiquidity() internal {
uint256 outputBal = IERC20(output).balanceOf(address(this));
UniswapV3Utils.swap(unirouter, outputToDepositPath, outputBal);
uint256 depositBal = IERC20(depositToken).balanceOf(address(this));
IStargateRouter(stargateRouter).addLiquidity(routerPoolId, depositBal, address(this));
}
// 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,) = IMasterChef(chef).userInfo(poolId, address(this));
return _amount;
}
// change encoded path for swapping output to native
function setNativePath(address[] memory _route, uint24[] memory _fee) external onlyOwner {
require(_route[0] == output, '!output');
require(_route[_route.length - 1] == native, '!native');
outputToNativePath = UniswapV3Utils.routeToPath(_route, _fee);
}
// change encoded path for swapping output to deposit token
function setDepositPath(address[] memory _route, uint24[] memory _fee) external onlyOwner {
require(_route[0] == output, '!output');
require(_route[_route.length - 1] == depositToken, '!deposit');
outputToDepositPath = UniswapV3Utils.routeToPath(_route, _fee);
}
function setPendingRewardsFunctionName(string calldata _pendingRewardsFunctionName) external onlyManager {
pendingRewardsFunctionName = _pendingRewardsFunctionName;
}
// returns rewards unharvested
function rewardsAvailable() public view returns (uint256) {
string memory signature = StringUtils.concat(pendingRewardsFunctionName, "(uint256,address)");
bytes memory result = Address.functionStaticCall(
chef,
abi.encodeWithSignature(
signature,
poolId,
address(this)
)
);
return abi.decode(result, (uint256));
}
// native reward amount for calling harvest
// no "view" functions in Uniswap V3 to quote amounts
function callReward() external pure returns (uint256) {
return 0;
}
function setHarvestOnDeposit(bool _harvestOnDeposit) external onlyManager {
harvestOnDeposit = _harvestOnDeposit;
if (harvestOnDeposit) {
setWithdrawalFee(0);
} else {
setWithdrawalFee(10);
}
}
function setShouldGasThrottle(bool _shouldGasThrottle) external onlyManager {
shouldGasThrottle = _shouldGasThrottle;
}
// called as part of strat migration. Sends all the available funds back to the vault.
function retireStrat() external {
require(msg.sender == vault, "!vault");
IMasterChef(chef).emergencyWithdraw(poolId);
uint256 wantBal = IERC20(want).balanceOf(address(this));
IERC20(want).transfer(vault, wantBal);
}
// pauses deposits and withdraws all funds from third party systems.
function panic() public onlyManager {
pause();
IMasterChef(chef).emergencyWithdraw(poolId);
}
function pause() public onlyManager {
_pause();
_removeAllowances();
}
function unpause() external onlyManager {
_unpause();
_giveAllowances();
deposit();
}
function _giveAllowances() internal {
IERC20(want).safeApprove(chef, uint256(-1));
IERC20(output).safeApprove(unirouter, uint256(-1));
IERC20(depositToken).safeApprove(stargateRouter, uint256(-1));
}
function _removeAllowances() internal {
IERC20(want).safeApprove(chef, 0);
IERC20(output).safeApprove(unirouter, 0);
IERC20(depositToken).safeApprove(stargateRouter, 0);
}
function outputToNative() external view returns (address[] memory) {
return UniswapV3Utils.pathToRoute(outputToNativePath);
}
function outputToDeposit() external view returns (address[] memory) {
return UniswapV3Utils.pathToRoute(outputToDepositPath);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.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 guidelines: functions revert instead
* of 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 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual 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 {_setupDecimals} is
* called.
*
* 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 returns (uint8) {
return _decimals;
}
/**
* @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);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
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].add(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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(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:
*
* - `to` 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 = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(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);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
/**
* @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 to 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 { }
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
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) {
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) {
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) {
// 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) {
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) {
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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @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. 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) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
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) {
require(b > 0, "SafeMath: modulo by zero");
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) {
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.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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) {
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) {
require(b > 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IMasterChef {
function deposit(uint256 _pid, uint256 _amount) external;
function withdraw(uint256 _pid, uint256 _amount) external;
function enterStaking(uint256 _amount) external;
function leaveStaking(uint256 _amount) external;
function userInfo(uint256 _pid, address _user) external view returns (uint256, uint256);
function emergencyWithdraw(uint256 _pid) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
interface IStargateRouter {
function addLiquidity(
uint256 _poolId,
uint256 _amountLD,
address _to
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
contract StratManager is Ownable, Pausable {
/**
* @dev Beefy 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 beefyFeeRecipient;
/**
* @dev Initializes the base strategy.
* @param _keeper address to use as alternative owner.
* @param _strategist address where strategist fees go.
* @param _unirouter router to use for swaps
* @param _vault address of parent vault.
* @param _beefyFeeRecipient address where to send Beefy's fees.
*/
constructor(
address _keeper,
address _strategist,
address _unirouter,
address _vault,
address _beefyFeeRecipient
) public {
keeper = _keeper;
strategist = _strategist;
unirouter = _unirouter;
vault = _vault;
beefyFeeRecipient = _beefyFeeRecipient;
}
// checks that caller is either owner or keeper.
modifier onlyManager() {
require(msg.sender == owner() || msg.sender == keeper, "!manager");
_;
}
/**
* @dev Updates address of the strat keeper.
* @param _keeper new keeper address.
*/
function setKeeper(address _keeper) external onlyManager {
keeper = _keeper;
}
/**
* @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 beefy fee recipient.
* @param _beefyFeeRecipient new beefy fee recipient address.
*/
function setBeefyFeeRecipient(address _beefyFeeRecipient) external onlyOwner {
beefyFeeRecipient = _beefyFeeRecipient;
}
/**
* @dev Function to synchronize balances before new user deposit.
* Can be overridden in the strategy.
*/
function beforeDeposit() external virtual {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "./StratManager.sol";
abstract contract FeeManager is StratManager {
uint constant public STRATEGIST_FEE = 112;
uint constant public MAX_FEE = 1000;
uint constant public MAX_CALL_FEE = 111;
uint constant public WITHDRAWAL_FEE_CAP = 50;
uint constant public WITHDRAWAL_MAX = 10000;
uint public withdrawalFee = 10;
uint public callFee = 111;
uint public beefyFee = MAX_FEE - STRATEGIST_FEE - callFee;
function setCallFee(uint256 _fee) public onlyManager {
require(_fee <= MAX_CALL_FEE, "!cap");
callFee = _fee;
beefyFee = MAX_FEE - STRATEGIST_FEE - callFee;
}
function setWithdrawalFee(uint256 _fee) public onlyManager {
require(_fee <= WITHDRAWAL_FEE_CAP, "!cap");
withdrawalFee = _fee;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
library StringUtils {
function concat(string memory a, string memory b) internal pure returns (string memory) {
return string(abi.encodePacked(a, b));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "@openzeppelin/contracts/utils/Address.sol";
import "./IGasPrice.sol";
contract GasThrottler {
bool public shouldGasThrottle = true;
address public gasprice = address(0xA43509661141F254F54D9A326E8Ec851A0b95307);
modifier gasThrottle() {
if (shouldGasThrottle && Address.isContract(gasprice)) {
require(tx.gasprice <= IGasPrice(gasprice).maxGasPrice(), "gas is too high!");
}
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import '@uniswap/v3-periphery/contracts/libraries/Path.sol';
import "../interfaces/common/IUniswapRouterV3.sol";
library UniswapV3Utils {
using Path for bytes;
// Swap along an encoded path using known amountIn
function swap(
address _router,
bytes memory _path,
uint256 _amountIn
) internal returns (uint256 amountOut) {
IUniswapRouterV3.ExactInputParams memory params = IUniswapRouterV3.ExactInputParams({
path: _path,
recipient: address(this),
deadline: block.timestamp,
amountIn: _amountIn,
amountOutMinimum: 0
});
return IUniswapRouterV3(_router).exactInput(params);
}
// Swap along a token route using known fees and amountIn
function swap(
address _router,
address[] memory _route,
uint24[] memory _fee,
uint256 _amountIn
) internal returns (uint256 amountOut) {
return swap(_router, routeToPath(_route, _fee), _amountIn);
}
// Convert encoded path to token route
function pathToRoute(bytes memory _path) internal pure returns (address[] memory) {
uint256 numPools = _path.numPools();
address[] memory route = new address[](numPools + 1);
for (uint256 i; i < numPools; i++) {
(address tokenA, address tokenB,) = _path.decodeFirstPool();
route[i] = tokenA;
route[i + 1] = tokenB;
_path = _path.skipToken();
}
return route;
}
// Convert token route to encoded path
// uint24 type for fees so path is packed tightly
function routeToPath(
address[] memory _route,
uint24[] memory _fee
) internal pure returns (bytes memory path) {
path = abi.encodePacked(_route[0]);
uint256 feeLength = _fee.length;
for (uint256 i = 0; i < feeLength; i++) {
path = abi.encodePacked(path, _fee[i], _route[i+1]);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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 GSN 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 payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <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 () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./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 () internal {
_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());
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IGasPrice {
function maxGasPrice() external returns (uint);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;
import './BytesLib.sol';
/// @title Functions for manipulating path data for multihop swaps
library Path {
using BytesLib for bytes;
/// @dev The length of the bytes encoded address
uint256 private constant ADDR_SIZE = 20;
/// @dev The length of the bytes encoded fee
uint256 private constant FEE_SIZE = 3;
/// @dev The offset of a single token address and pool fee
uint256 private constant NEXT_OFFSET = ADDR_SIZE + FEE_SIZE;
/// @dev The offset of an encoded pool key
uint256 private constant POP_OFFSET = NEXT_OFFSET + ADDR_SIZE;
/// @dev The minimum length of an encoding that contains 2 or more pools
uint256 private constant MULTIPLE_POOLS_MIN_LENGTH = POP_OFFSET + NEXT_OFFSET;
/// @notice Returns true iff the path contains two or more pools
/// @param path The encoded swap path
/// @return True if path contains two or more pools, otherwise false
function hasMultiplePools(bytes memory path) internal pure returns (bool) {
return path.length >= MULTIPLE_POOLS_MIN_LENGTH;
}
/// @notice Returns the number of pools in the path
/// @param path The encoded swap path
/// @return The number of pools in the path
function numPools(bytes memory path) internal pure returns (uint256) {
// Ignore the first token address. From then on every fee and token offset indicates a pool.
return ((path.length - ADDR_SIZE) / NEXT_OFFSET);
}
/// @notice Decodes the first pool in path
/// @param path The bytes encoded swap path
/// @return tokenA The first token of the given pool
/// @return tokenB The second token of the given pool
/// @return fee The fee level of the pool
function decodeFirstPool(bytes memory path)
internal
pure
returns (
address tokenA,
address tokenB,
uint24 fee
)
{
tokenA = path.toAddress(0);
fee = path.toUint24(ADDR_SIZE);
tokenB = path.toAddress(NEXT_OFFSET);
}
/// @notice Gets the segment corresponding to the first pool in the path
/// @param path The bytes encoded swap path
/// @return The segment containing all data necessary to target the first pool in the path
function getFirstPool(bytes memory path) internal pure returns (bytes memory) {
return path.slice(0, POP_OFFSET);
}
/// @notice Skips a token + fee element from the buffer and returns the remainder
/// @param path The swap path
/// @return The remaining token + fee elements in the path
function skipToken(bytes memory path) internal pure returns (bytes memory) {
return path.slice(NEXT_OFFSET, path.length - NEXT_OFFSET);
}
}// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.6.0;
interface IUniswapRouterV3 {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
/// @return amountOut The amount of the received token
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another token
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
/// @return amountIn The amount of the input token
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
struct ExactOutputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
/// @return amountIn The amount of the input token
function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}// SPDX-License-Identifier: GPL-2.0-or-later /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.5.0 <0.8.0; library BytesLib { function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, 'slice_overflow'); require(_start + _length >= _start, 'slice_overflow'); require(_bytes.length >= _start + _length, 'slice_outOfBounds'); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_start + 20 >= _start, 'toAddress_overflow'); require(_bytes.length >= _start + 20, 'toAddress_outOfBounds'); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) { require(_start + 3 >= _start, 'toUint24_overflow'); require(_bytes.length >= _start + 3, 'toUint24_outOfBounds'); uint24 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x3), _start)) } return tempUint; } }
{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_want","type":"address"},{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"address","name":"_chef","type":"address"},{"internalType":"uint256","name":"_routerPoolId","type":"uint256"},{"internalType":"address","name":"_stargateRouter","type":"address"},{"internalType":"address[]","name":"_outputToNativeRoute","type":"address[]"},{"internalType":"address[]","name":"_outputToDepositRoute","type":"address[]"},{"internalType":"uint24[]","name":"_outputToNativeFee","type":"uint24[]"},{"internalType":"uint24[]","name":"_outputToDepositFee","type":"uint24[]"},{"components":[{"internalType":"address","name":"keeper","type":"address"},{"internalType":"address","name":"strategist","type":"address"},{"internalType":"address","name":"unirouter","type":"address"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"address","name":"beefyFeeRecipient","type":"address"}],"internalType":"struct StrategyStargateOp.StratManagerParams","name":"_stratManager","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"callFees","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"beefyFees","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"strategistFees","type":"uint256"}],"name":"ChargedFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tvl","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"harvester","type":"address"},{"indexed":false,"internalType":"uint256","name":"wantHarvested","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tvl","type":"uint256"}],"name":"StratHarvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tvl","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAX_CALL_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STRATEGIST_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_FEE_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOfPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOfWant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beefyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beefyFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beforeDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"callFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"chef","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gasprice","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"callFeeRecipient","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvestOnDeposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastHarvest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerHarvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"native","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"output","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"outputToDeposit","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"outputToDepositPath","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"outputToNative","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"outputToNativePath","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"panic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingRewardsFunctionName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"retireStrat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"routerPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beefyFeeRecipient","type":"address"}],"name":"setBeefyFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setCallFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_route","type":"address[]"},{"internalType":"uint24[]","name":"_fee","type":"uint24[]"}],"name":"setDepositPath","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_harvestOnDeposit","type":"bool"}],"name":"setHarvestOnDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"setKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_route","type":"address[]"},{"internalType":"uint24[]","name":"_fee","type":"uint24[]"}],"name":"setNativePath","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_pendingRewardsFunctionName","type":"string"}],"name":"setPendingRewardsFunctionName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_shouldGasThrottle","type":"bool"}],"name":"setShouldGasThrottle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategist","type":"address"}],"name":"setStrategist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_unirouter","type":"address"}],"name":"setUnirouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setWithdrawalFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shouldGasThrottle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stargateRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unirouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"want","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052600a600655606f60075561030960085560098054600160ff1990911617610100600160a81b03191674a43509661141f254f54d9a326e8ec851a0b95307001790553480156200005257600080fd5b50604051620046a0380380620046a083398101604081905262000075916200095a565b8051602082015160408301516060840151608085015160006200009762000303565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b19168155600180546001600160a01b03199081166001600160a01b0398891617909155600280548216968816969096179095556003805486169487169490941790935560048054851692861692909217909155600580548416918516919091179055600c805483168e8516179055600f8c905560118a9055600e805483168c85161790556010805490921692891692909217905585518691906200018a57fe5b6020026020010151600b60006101000a8154816001600160a01b0302191690836001600160a01b0316021790555084600186510381518110620001c957fe5b6020026020010151600a60006101000a8154816001600160a01b0302191690836001600160a01b031602179055506200020e85846200030760201b62001cf01760201c565b8051620002249160159160209091019062000719565b50600b5484516001600160a01b039091169085906000906200024257fe5b60200260200101516001600160a01b0316146200027c5760405162461bcd60e51b8152600401620002739062000c12565b60405180910390fd5b836001855103815181106200028d57fe5b6020026020010151600d60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620002d284836200030760201b62001cf01760201c565b8051620002e89160169160209091019062000719565b50620002f3620003b7565b5050505050505050505062000d6a565b3390565b6060826000815181106200031757fe5b602002602001015160405160200162000331919062000aae565b60408051601f19818403018152919052825190915060005b81811015620003af57828482815181106200036057fe5b60200260200101518683600101815181106200037857fe5b6020026020010151604051602001620003949392919062000ae4565b60408051601f19818403018152919052925060010162000349565b505092915050565b600e54600c54620003e4916001600160a01b03918216911660001962000440602090811b62001d9717901c565b600354600b5462000411916001600160a01b03918216911660001962000440602090811b62001d9717901c565b601054600d546200043e916001600160a01b03918216911660001962000440602090811b62001d9717901c565b565b801580620004cf5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e9062000479903090869060040162000b2d565b60206040518083038186803b1580156200049257600080fd5b505afa158015620004a7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004cd919062000a95565b155b620004ee5760405162461bcd60e51b8152600401620002739062000c93565b620005498363095ea7b360e01b84846040516024016200051092919062000b47565b60408051808303601f190181529190526020810180516001600160e01b0319939093166001600160e01b03938416179052906200054e16565b505050565b6060620005aa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620005ea60201b62001e91179092919060201c565b805190915015620005495780806020019051810190620005cb919062000a73565b620005495760405162461bcd60e51b8152600401620002739062000c49565b6060620005fb848460008562000605565b90505b9392505050565b6060824710156200062a5760405162461bcd60e51b8152600401620002739062000b95565b6200063585620006d5565b620006545760405162461bcd60e51b8152600401620002739062000bdb565b60006060866001600160a01b0316858760405162000673919062000ac6565b60006040518083038185875af1925050503d8060008114620006b2576040519150601f19603f3d011682016040523d82523d6000602084013e620006b7565b606091505b509092509050620006ca828286620006db565b979650505050505050565b3b151590565b60608315620006ec575081620005fe565b825115620006fd5782518084602001fd5b8160405162461bcd60e51b815260040162000273919062000b60565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200075c57805160ff19168380011785556200078c565b828001600101855582156200078c579182015b828111156200078c5782518255916020019190600101906200076f565b506200079a9291506200079e565b5090565b5b808211156200079a57600081556001016200079f565b80516001600160a01b0381168114620007cd57600080fd5b92915050565b600082601f830112620007e4578081fd5b8151620007fb620007f58262000d17565b62000cf0565b8181529150602080830190848101818402860182018710156200081d57600080fd5b60005b848110156200084857620008358883620007b5565b8452928201929082019060010162000820565b505050505092915050565b600082601f83011262000864578081fd5b815162000875620007f58262000d17565b8181529150602080830190848101818402860182018710156200089757600080fd5b6000805b85811015620008ca57825162ffffff81168114620008b7578283fd5b855293830193918301916001016200089b565b50505050505092915050565b600060a08284031215620008e8578081fd5b620008f460a062000cf0565b9050620009028383620007b5565b8152620009138360208401620007b5565b6020820152620009278360408401620007b5565b60408201526200093b8360608401620007b5565b60608201526200094f8360808401620007b5565b608082015292915050565b6000806000806000806000806000806101c08b8d0312156200097a578586fd5b620009868c8c620007b5565b995060208b015198506200099e8c60408d01620007b5565b975060608b01519650620009b68c60808d01620007b5565b60a08c01519096506001600160401b0380821115620009d3578687fd5b620009e18e838f01620007d3565b965060c08d0151915080821115620009f7578586fd5b62000a058e838f01620007d3565b955060e08d015191508082111562000a1b578485fd5b62000a298e838f0162000853565b94506101008d015191508082111562000a40578384fd5b5062000a4f8d828e0162000853565b92505062000a628c6101208d01620008d6565b90509295989b9194979a5092959850565b60006020828403121562000a85578081fd5b81518015158114620005fe578182fd5b60006020828403121562000aa7578081fd5b5051919050565b60609190911b6001600160601b031916815260140190565b6000825162000ada81846020870162000d37565b9190910192915050565b6000845162000af881846020890162000d37565b60e89490941b6001600160e81b0319169190930190815260609190911b6001600160601b031916600382015260170192915050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b600060208252825180602084015262000b8181604085016020870162000d37565b601f01601f19169190910160400192915050565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601d908201527f5f6f7574707574546f4465706f7369745b305d20213d206f7574707574000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000606082015260800190565b6040518181016001600160401b038111828210171562000d0f57600080fd5b604052919050565b60006001600160401b0382111562000d2d578081fd5b5060209081020190565b60005b8381101562000d5457818101518382015260200162000d3a565b8381111562000d64576000848401525b50505050565b6139268062000d7a6000396000f3fe608060405234801561001057600080fd5b50600436106103af5760003560e01c80638912cb8b116101f4578063c1a3d44c1161011a578063e48f98fd116100ad578063f2fde38b1161007c578063f2fde38b14610657578063fad4675e1461066a578063fb6177871461067d578063fbfa77cf14610685576103af565b8063e48f98fd14610637578063e7a7250a1461063f578063f1a392da14610647578063f20eaeb81461064f576103af565b8063d3102589116100e9578063d31025891461060c578063d801d94614610614578063d92f3d731461061c578063dfbdc4371461062f576103af565b8063c1a3d44c146105e1578063c7b9d530146105e9578063c89039c5146105fc578063d0e30db014610604576103af565b806397fd323d11610192578063ac1e502511610161578063ac1e5025146105b6578063aced1661146105c9578063adc64279146105d1578063bc063e1a146105d9576103af565b806397fd323d1461058b5780639f8b5da114610593578063a68833e51461059b578063a9e56f3c146105ae576103af565b80638e145459116101ce5780638e145459146105605780638fcb2be61461056857806390321e1a14610570578063931ff90e14610578576103af565b80638912cb8b146105485780638bc7e8c4146105505780638da5cb5b14610558576103af565b80634641257d116102d95780636817031b11610277578063722713f711610246578063722713f71461051d578063748747e6146105255780637d38ca65146105385780638456cb5914610540576103af565b80636817031b146104f25780636a1833a9146105055780636ec232d31461050d578063715018a614610515576103af565b806354518b1a116102b357806354518b1a146104ba578063573fef0a146104c257806359e79138146104ca5780635c975abb146104dd576103af565b80634641257d146104975780634700d3051461049f5780634a4e4fbe146104a7576103af565b80631fe4a686116103515780632ad5a53f116103205780632ad5a53f1461046c5780632e1a7d4d146104745780633e0dc34e146104875780633f4ba83a1461048f576103af565b80631fe4a68614610434578063257ae0de1461043c5780632646582614610444578063277e5cfd14610457576103af565b806311b0b42d1161038d57806311b0b42d146103fa57806313e120b11461040f5780631f1fcd51146104245780631fc8bc5d1461042c576103af565b80630e5c011e146103b45780630e8fbb5a146103c957806311588086146103dc575b600080fd5b6103c76103c2366004612ef4565b61068d565b005b6103c76103d7366004612fd1565b610775565b6103e46107f3565b6040516103f191906137e7565b60405180910390f35b610402610881565b6040516103f191906131a9565b610417610890565b6040516103f191906131f0565b61040261092e565b61040261093d565b61040261094c565b61040261095b565b6103c7610452366004613076565b61096a565b61045f6109e6565b6040516103f19190613248565b6103e4610a74565b6103c7610482366004613076565b610a79565b6103e4610cf2565b6103c7610cf8565b6103c7610d5f565b6103c7610e3b565b6103c76104b5366004612f0f565b610ef5565b6103e4610ff0565b6103c7610ff6565b6103c76104d8366004613009565b61102b565b6104e5611084565b6040516103f1919061323d565b6103c7610500366004612ef4565b611094565b6104176110f5565b610402611159565b6103c761116d565b6103e46111f6565b6103c7610533366004612ef4565b611211565b6103e4611280565b6103c7611285565b6104e56112e2565b6103e46112eb565b6104026112f1565b610402611300565b6103e461130f565b6103e4611315565b6103c7610586366004612f0f565b61131b565b6103e4611411565b6104e5611416565b6103c76105a9366004612ef4565b61141f565b610402611480565b6103c76105c4366004613076565b61148f565b610402611502565b61045f611511565b6103e461156c565b6103e4611572565b6103c76105f7366004612ef4565b6115f3565b61040261163f565b6103c761164e565b6103e46117a2565b6103c76117a8565b6103c761062a366004612ef4565b6117f5565b6103e4611856565b61045f61185b565b6103e46118b6565b6103e4611a0e565b610402611a14565b6103c7610665366004612ef4565b611a23565b6103c7610678366004612fd1565b611ae3565b6103c7611b43565b610402611ce1565b60095460ff1680156106b457506009546106b49061010090046001600160a01b0316611eaa565b1561076957600960019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561070957600080fd5b505af115801561071d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610741919061308e565b3a11156107695760405162461bcd60e51b8152600401610760906135d1565b60405180910390fd5b61077281611eb0565b50565b61077d6112f1565b6001600160a01b0316336001600160a01b031614806107a657506001546001600160a01b031633145b6107c25760405162461bcd60e51b8152600401610760906136a1565b6012805460ff1916821515179081905560ff16156107e9576107e4600061148f565b610772565b610772600a61148f565b600e54600f546040516393f1a40b60e01b815260009283926001600160a01b03909116916393f1a40b9161082b9130906004016137f0565b604080518083038186803b15801561084257600080fd5b505afa158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a91906130a6565b5091505090565b600a546001600160a01b031681565b6015805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152606093610929939192909183018282801561091f5780601f106108f45761010080835404028352916020019161091f565b820191906000526020600020905b81548152906001019060200180831161090257829003601f168201915b5050505050612035565b905090565b600c546001600160a01b031681565b600e546001600160a01b031681565b6002546001600160a01b031681565b6003546001600160a01b031681565b6109726112f1565b6001600160a01b0316336001600160a01b0316148061099b57506001546001600160a01b031633145b6109b75760405162461bcd60e51b8152600401610760906136a1565b606f8111156109d85760405162461bcd60e51b81526004016107609061349e565b600781905561037803600855565b6014805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a6c5780601f10610a4157610100808354040283529160200191610a6c565b820191906000526020600020905b815481529060010190602001808311610a4f57829003601f168201915b505050505081565b606f81565b6004546001600160a01b03163314610aa35760405162461bcd60e51b81526004016107609061354d565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610ad49030906004016131a9565b60206040518083038186803b158015610aec57600080fd5b505afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b24919061308e565b905081811015610c2257600e54600f546001600160a01b039091169063441a3e7090610b508585612123565b6040518363ffffffff1660e01b8152600401610b6d929190613807565b600060405180830381600087803b158015610b8757600080fd5b505af1158015610b9b573d6000803e3d6000fd5b5050600c546040516370a0823160e01b81526001600160a01b0390911692506370a082319150610bcf9030906004016131a9565b60206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f919061308e565b90505b81811115610c2d5750805b610c356112f1565b6001600160a01b0316326001600160a01b031614158015610c5b5750610c59611084565b155b15610c93576000610c83612710610c7d6006548561215090919063ffffffff16565b9061218a565b9050610c8f8282612123565b9150505b600454600c54610cb0916001600160a01b039182169116836121bc565b7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d610cd96111f6565b604051610ce691906137e7565b60405180910390a15050565b600f5481565b610d006112f1565b6001600160a01b0316336001600160a01b03161480610d2957506001546001600160a01b031633145b610d455760405162461bcd60e51b8152600401610760906136a1565b610d4d6121db565b610d5561224c565b610d5d61164e565b565b60095460ff168015610d865750600954610d869061010090046001600160a01b0316611eaa565b15610e3257600960019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610ddb57600080fd5b505af1158015610def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e13919061308e565b3a1115610e325760405162461bcd60e51b8152600401610760906135d1565b610d5d32611eb0565b610e436112f1565b6001600160a01b0316336001600160a01b03161480610e6c57506001546001600160a01b031633145b610e885760405162461bcd60e51b8152600401610760906136a1565b610e90611285565b600e54600f54604051632989754760e11b81526001600160a01b0390921691635312ea8e91610ec1916004016137e7565b600060405180830381600087803b158015610edb57600080fd5b505af1158015610eef573d6000803e3d6000fd5b50505050565b610efd6122a9565b6001600160a01b0316610f0e6112f1565b6001600160a01b031614610f345760405162461bcd60e51b81526004016107609061356d565b600b5482516001600160a01b03909116908390600090610f5057fe5b60200260200101516001600160a01b031614610f7e5760405162461bcd60e51b81526004016107609061332b565b600a5482516001600160a01b039091169083906000198101908110610f9f57fe5b60200260200101516001600160a01b031614610fcd5760405162461bcd60e51b81526004016107609061334c565b610fd78282611cf0565b8051610feb91601591602090910190612d24565b505050565b61271081565b60125460ff1615610d5d576004546001600160a01b03163314610e325760405162461bcd60e51b81526004016107609061354d565b6110336112f1565b6001600160a01b0316336001600160a01b0316148061105c57506001546001600160a01b031633145b6110785760405162461bcd60e51b8152600401610760906136a1565b610feb60148383612da2565b600054600160a01b900460ff1690565b61109c6122a9565b6001600160a01b03166110ad6112f1565b6001600160a01b0316146110d35760405162461bcd60e51b81526004016107609061356d565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6016805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152606093610929939192909183018282801561091f5780601f106108f45761010080835404028352916020019161091f565b60095461010090046001600160a01b031681565b6111756122a9565b6001600160a01b03166111866112f1565b6001600160a01b0316146111ac5760405162461bcd60e51b81526004016107609061356d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006109296112036107f3565b61120b611572565b906122ad565b6112196112f1565b6001600160a01b0316336001600160a01b0316148061124257506001546001600160a01b031633145b61125e5760405162461bcd60e51b8152600401610760906136a1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b607081565b61128d6112f1565b6001600160a01b0316336001600160a01b031614806112b657506001546001600160a01b031633145b6112d25760405162461bcd60e51b8152600401610760906136a1565b6112da6122d2565b610d5d612333565b60125460ff1681565b60065481565b6000546001600160a01b031690565b6005546001600160a01b031681565b60115481565b60075481565b6113236122a9565b6001600160a01b03166113346112f1565b6001600160a01b03161461135a5760405162461bcd60e51b81526004016107609061356d565b600b5482516001600160a01b0390911690839060009061137657fe5b60200260200101516001600160a01b0316146113a45760405162461bcd60e51b81526004016107609061332b565b600d5482516001600160a01b0390911690839060001981019081106113c557fe5b60200260200101516001600160a01b0316146113f35760405162461bcd60e51b8152600401610760906134bc565b6113fd8282611cf0565b8051610feb91601691602090910190612d24565b600090565b60095460ff1681565b6114276122a9565b6001600160a01b03166114386112f1565b6001600160a01b03161461145e5760405162461bcd60e51b81526004016107609061356d565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6010546001600160a01b031681565b6114976112f1565b6001600160a01b0316336001600160a01b031614806114c057506001546001600160a01b031633145b6114dc5760405162461bcd60e51b8152600401610760906136a1565b60328111156114fd5760405162461bcd60e51b81526004016107609061349e565b600655565b6001546001600160a01b031681565b6016805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a6c5780601f10610a4157610100808354040283529160200191610a6c565b6103e881565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a08231906115a39030906004016131a9565b60206040518083038186803b1580156115bb57600080fd5b505afa1580156115cf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610929919061308e565b6002546001600160a01b0316331461161d5760405162461bcd60e51b815260040161076090613289565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600d546001600160a01b031681565b611656611084565b156116735760405162461bcd60e51b815260040161076090613474565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a08231906116a49030906004016131a9565b60206040518083038186803b1580156116bc57600080fd5b505afa1580156116d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f4919061308e565b9050801561077257600e54600f54604051631c57762b60e31b81526001600160a01b039092169163e2bbb1589161172f918590600401613807565b600060405180830381600087803b15801561174957600080fd5b505af115801561175d573d6000803e3d6000fd5b505050507f4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e3842661178a6111f6565b60405161179791906137e7565b60405180910390a150565b60085481565b6117b06112f1565b6001600160a01b0316336001600160a01b031614806117d957506001546001600160a01b031633145b610e325760405162461bcd60e51b8152600401610760906136a1565b6117fd6122a9565b6001600160a01b031661180e6112f1565b6001600160a01b0316146118345760405162461bcd60e51b81526004016107609061356d565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b603281565b6015805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a6c5780601f10610a4157610100808354040283529160200191610a6c565b60148054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152600093606093611979938301828280156119455780601f1061191a57610100808354040283529160200191611945565b820191906000526020600020905b81548152906001019060200180831161192857829003601f168201915b5050505050604051806040016040528060118152602001702875696e743235362c616464726573732960781b81525061238d565b600e54600f546040519293506060926119f1926001600160a01b03169185916119a7919030906024016137f0565b60408051601f1981840301815290829052916119c291613112565b6040519081900390206020820180516001600160e01b03166001600160e01b03199092169190911790526123b9565b905080806020019051810190611a07919061308e565b9250505090565b60135481565b600b546001600160a01b031681565b611a2b6122a9565b6001600160a01b0316611a3c6112f1565b6001600160a01b031614611a625760405162461bcd60e51b81526004016107609061356d565b6001600160a01b038116611a885760405162461bcd60e51b8152600401610760906132ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b611aeb6112f1565b6001600160a01b0316336001600160a01b03161480611b1457506001546001600160a01b031633145b611b305760405162461bcd60e51b8152600401610760906136a1565b6009805460ff1916911515919091179055565b6004546001600160a01b03163314611b6d5760405162461bcd60e51b81526004016107609061354d565b600e54600f54604051632989754760e11b81526001600160a01b0390921691635312ea8e91611b9e916004016137e7565b600060405180830381600087803b158015611bb857600080fd5b505af1158015611bcc573d6000803e3d6000fd5b5050600c546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611c039030906004016131a9565b60206040518083038186803b158015611c1b57600080fd5b505afa158015611c2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c53919061308e565b600c546004805460405163a9059cbb60e01b81529394506001600160a01b039283169363a9059cbb93611c8b939216918691016131d7565b602060405180830381600087803b158015611ca557600080fd5b505af1158015611cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cdd9190612fed565b5050565b6004546001600160a01b031681565b606082600081518110611cff57fe5b6020026020010151604051602001611d1791906130f5565b60408051601f19818403018152919052825190915060005b81811015611d8f5782848281518110611d4457fe5b6020026020010151868360010181518110611d5b57fe5b6020026020010151604051602001611d759392919061312e565b60408051601f198184030181529190529250600101611d2f565b505092915050565b801580611e1f5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90611dcd90309086906004016131bd565b60206040518083038186803b158015611de557600080fd5b505afa158015611df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1d919061308e565b155b611e3b5760405162461bcd60e51b81526004016107609061370d565b610feb8363095ea7b360e01b8484604051602401611e5a9291906131d7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526123de565b6060611ea0848460008561246d565b90505b9392505050565b3b151590565b611eb8611084565b15611ed55760405162461bcd60e51b815260040161076090613474565b600e54600f54604051631c57762b60e31b81526001600160a01b039092169163e2bbb15891611f0991600090600401613807565b600060405180830381600087803b158015611f2357600080fd5b505af1158015611f37573d6000803e3d6000fd5b5050600b546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611f6e9030906004016131a9565b60206040518083038186803b158015611f8657600080fd5b505afa158015611f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbe919061308e565b90508015611cdd57611fcf8261252e565b611fd76127d9565b6000611fe1611572565b9050611feb61164e565b42601355337f9bc239f1724cacfb88cb1d66a2dc437467699b68a8c90d7b63110cf4b6f924108261201a6111f6565b604051612028929190613807565b60405180910390a2505050565b60606000612042836129bb565b905060608160010167ffffffffffffffff8111801561206057600080fd5b5060405190808252806020026020018201604052801561208a578160200160208202803683370190505b50905060005b8281101561211b576000806120a4876129c8565b5091509150818484815181106120b657fe5b60200260200101906001600160a01b031690816001600160a01b031681525050808484600101815181106120e657fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061210f876129f9565b96505050600101612090565b509392505050565b6000828211156121455760405162461bcd60e51b815260040161076090613398565b508082035b92915050565b60008261215f5750600061214a565b8282028284828161216c57fe5b0414611ea35760405162461bcd60e51b8152600401610760906134de565b60008082116121ab5760405162461bcd60e51b815260040161076090613415565b8183816121b457fe5b049392505050565b610feb8363a9059cbb60e01b8484604051602401611e5a9291906131d7565b6121e3611084565b6121ff5760405162461bcd60e51b81526004016107609061325b565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6122356122a9565b60405161224291906131a9565b60405180910390a1565b600e54600c5461226b916001600160a01b039182169116600019611d97565b600354600b5461228a916001600160a01b039182169116600019611d97565b601054600d54610d5d916001600160a01b039182169116600019611d97565b3390565b600082820183811015611ea35760405162461bcd60e51b8152600401610760906132f4565b6122da611084565b156122f75760405162461bcd60e51b815260040161076090613474565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122356122a9565b600e54600c54612351916001600160a01b0391821691166000611d97565b600354600b5461236f916001600160a01b0391821691166000611d97565b601054600d54610d5d916001600160a01b0391821691166000611d97565b606082826040516020016123a292919061317a565b604051602081830303815290604052905092915050565b6060611ea383836040518060600160405280602581526020016138cc60259139612a10565b6060612433826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e919092919063ffffffff16565b805190915015610feb57808060200190518101906124519190612fed565b610feb5760405162461bcd60e51b8152600401610760906136c3565b60608247101561248f5760405162461bcd60e51b8152600401610760906133cf565b61249885611eaa565b6124b45760405162461bcd60e51b81526004016107609061363f565b60006060866001600160a01b031685876040516124d19190613112565b60006040518083038185875af1925050503d806000811461250e576040519150601f19603f3d011682016040523d82523d6000602084013e612513565b606091505b5091509150612523828286612aad565b979650505050505050565b600b546040516370a0823160e01b81526000916125c4916103e891610c7d91602d916001600160a01b0316906370a082319061256e9030906004016131a9565b60206040518083038186803b15801561258657600080fd5b505afa15801561259a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125be919061308e565b90612150565b6003546015805460408051602060026101006001861615026000190190941693909304601f810184900484028201840190925281815294955061266b946001600160a01b039094169392918301828280156126605780601f1061263557610100808354040283529160200191612660565b820191906000526020600020905b81548152906001019060200180831161264357829003601f168201915b505050505083612ae6565b50600a546040516370a0823160e01b81526000916001600160a01b0316906370a082319061269d9030906004016131a9565b60206040518083038186803b1580156126b557600080fd5b505afa1580156126c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ed919061308e565b9050600061270c6103e8610c7d6007548561215090919063ffffffff16565b600a54909150612726906001600160a01b031685836121bc565b60006127436103e8610c7d6008548661215090919063ffffffff16565b600554600a54919250612763916001600160a01b039081169116836121bc565b60006127766103e8610c7d866070612150565b600254600a54919250612796916001600160a01b039081169116836121bc565b7fd255b592c7f268a73e534da5219a60ff911b4cf6daae21c7d20527dd657bd99a8383836040516127c993929190613834565b60405180910390a1505050505050565b600b546040516370a0823160e01b81526000916001600160a01b0316906370a082319061280a9030906004016131a9565b60206040518083038186803b15801561282257600080fd5b505afa158015612836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061285a919061308e565b6003546016805460408051602060026101006001861615026000190190941693909304601f81018490048402820184019092528181529495506128cb946001600160a01b039094169392918301828280156126605780601f1061263557610100808354040283529160200191612660565b50600d546040516370a0823160e01b81526000916001600160a01b0316906370a08231906128fd9030906004016131a9565b60206040518083038186803b15801561291557600080fd5b505afa158015612929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294d919061308e565b6010546011546040516321ec87bf60e21b81529293506001600160a01b03909116916387b21efc916129859185903090600401613815565b600060405180830381600087803b15801561299f57600080fd5b505af11580156129b3573d6000803e3d6000fd5b505050505050565b5160176013199091010490565b600080806129d68482612b9d565b92506129e3846014612bf6565b90506129f0846017612b9d565b91509193909250565b805160609061214a90839060179060161901612c48565b6060612a1b84611eaa565b612a375760405162461bcd60e51b8152600401610760906135fb565b60006060856001600160a01b031685604051612a539190613112565b600060405180830381855afa9150503d8060008114612a8e576040519150601f19603f3d011682016040523d82523d6000602084013e612a93565b606091505b5091509150612aa3828286612aad565b9695505050505050565b60608315612abc575081611ea3565b825115612acc5782518084602001fd5b8160405162461bcd60e51b81526004016107609190613248565b6000612af0612e10565b506040805160a08101825284815230602082015242818301526060810184905260006080820152905163c04b8d5960e01b81526001600160a01b0386169063c04b8d5990612b4290849060040161378f565b602060405180830381600087803b158015612b5c57600080fd5b505af1158015612b70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b94919061308e565b95945050505050565b600081826014011015612bc25760405162461bcd60e51b815260040161076090613763565b8160140183511015612be65760405162461bcd60e51b8152600401610760906135a2565b500160200151600160601b900490565b600081826003011015612c1b5760405162461bcd60e51b81526004016107609061336d565b8160030183511015612c3f5760405162461bcd60e51b81526004016107609061351f565b50016003015190565b60608182601f011015612c6d5760405162461bcd60e51b81526004016107609061344c565b828284011015612c8f5760405162461bcd60e51b81526004016107609061344c565b81830184511015612cb25760405162461bcd60e51b815260040161076090613676565b606082158015612cd15760405191506000825260208201604052612d1b565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612d0a578051835260209283019201612cf2565b5050858452601f01601f1916604052505b50949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612d6557805160ff1916838001178555612d92565b82800160010185558215612d92579182015b82811115612d92578251825591602001919060010190612d77565b50612d9e929150612e48565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612de35782800160ff19823516178555612d92565b82800160010185558215612d92579182015b82811115612d92578235825591602001919060010190612df5565b6040518060a001604052806060815260200160006001600160a01b031681526020016000815260200160008152602001600081525090565b5b80821115612d9e5760008155600101612e49565b80356001600160a01b038116811461214a57600080fd5b600082601f830112612e84578081fd5b8135612e97612e9282613871565b61384a565b818152915060208083019084810181840286018201871015612eb857600080fd5b6000805b85811015612ee857823562ffffff81168114612ed6578283fd5b85529383019391830191600101612ebc565b50505050505092915050565b600060208284031215612f05578081fd5b611ea38383612e5d565b60008060408385031215612f21578081fd5b823567ffffffffffffffff80821115612f38578283fd5b818501915085601f830112612f4b578283fd5b8135612f59612e9282613871565b80828252602080830192508086018a828387028901011115612f79578788fd5b8796505b84871015612fa357612f8f8b82612e5d565b845260019690960195928101928101612f7d565b509096508701359350505080821115612fba578283fd5b50612fc785828601612e74565b9150509250929050565b600060208284031215612fe2578081fd5b8135611ea3816138bd565b600060208284031215612ffe578081fd5b8151611ea3816138bd565b6000806020838503121561301b578182fd5b823567ffffffffffffffff80821115613032578384fd5b818501915085601f830112613045578384fd5b813581811115613053578485fd5b866020828501011115613064578485fd5b60209290920196919550909350505050565b600060208284031215613087578081fd5b5035919050565b60006020828403121561309f578081fd5b5051919050565b600080604083850312156130b8578182fd5b505080516020909101519092909150565b600081518084526130e1816020860160208601613891565b601f01601f19169290920160200192915050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60008251613124818460208701613891565b9190910192915050565b60008451613140818460208901613891565b60e89490941b6001600160e81b0319169190930190815260609190911b6bffffffffffffffffffffffff1916600382015260170192915050565b6000835161318c818460208801613891565b8351908301906131a0818360208801613891565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156132315783516001600160a01b03168352928401929184019160010161320c565b50909695505050505050565b901515815260200190565b600060208252611ea360208301846130c9565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252600b908201526a085cdd1c985d1959da5cdd60aa1b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b602080825260079082015266085bdd5d1c1d5d60ca1b604082015260600190565b602080825260079082015266216e617469766560c81b604082015260600190565b602080825260119082015270746f55696e7432345f6f766572666c6f7760781b604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252600e908201526d736c6963655f6f766572666c6f7760901b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600490820152630216361760e41b604082015260600190565b6020808252600890820152670859195c1bdcda5d60c21b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b602080825260149082015273746f55696e7432345f6f75744f66426f756e647360601b604082015260600190565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260159082015274746f416464726573735f6f75744f66426f756e647360581b604082015260600190565b60208082526010908201526f67617320697320746f6f20686967682160801b604082015260600190565b60208082526024908201527f416464726573733a207374617469632063616c6c20746f206e6f6e2d636f6e746040820152631c9858dd60e21b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b602080825260119082015270736c6963655f6f75744f66426f756e647360781b604082015260600190565b60208082526008908201526710b6b0b730b3b2b960c11b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b602080825260129082015271746f416464726573735f6f766572666c6f7760701b604082015260600190565b600060208252825160a060208401526137ab60c08401826130c9565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b90815260200190565b9182526001600160a01b0316602082015260400190565b918252602082015260400190565b92835260208301919091526001600160a01b0316604082015260600190565b9283526020830191909152604082015260600190565b60405181810167ffffffffffffffff8111828210171561386957600080fd5b604052919050565b600067ffffffffffffffff821115613887578081fd5b5060209081020190565b60005b838110156138ac578181015183820152602001613894565b83811115610eef5750506000910152565b801515811461077257600080fdfe416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a26469706673582212209949663a0f91543e2243d518618c58e9c72fd6b4f9f80a41ed80fac985aadf0164736f6c634300060c0033000000000000000000000000decc0c09c3b5f6e92ef4184125d5648a66e3529800000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a364f8c717caad9a442737eb7b8a55cc6cf18d80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b0d502e938ed5f4df2e681fe6e419ff29631d62b00000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000340465d9d2ebde78f15a3870884757584f97abb40000000000000000000000004cc72219fc8aef162fc0c255d9b9c3ff93b1088200000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45000000000000000000000000e536f8141d8eb7b1f096934af3329cb581bfe9950000000000000000000000004aba01fb8e1f6bfe80c56deb367f19f35df0f4ae0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000296f55f8fb28e498b858d0bcda06d955b2cb3f970000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160700000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000296f55f8fb28e498b858d0bcda06d955b2cb3f970000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160700000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000bb8
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103af5760003560e01c80638912cb8b116101f4578063c1a3d44c1161011a578063e48f98fd116100ad578063f2fde38b1161007c578063f2fde38b14610657578063fad4675e1461066a578063fb6177871461067d578063fbfa77cf14610685576103af565b8063e48f98fd14610637578063e7a7250a1461063f578063f1a392da14610647578063f20eaeb81461064f576103af565b8063d3102589116100e9578063d31025891461060c578063d801d94614610614578063d92f3d731461061c578063dfbdc4371461062f576103af565b8063c1a3d44c146105e1578063c7b9d530146105e9578063c89039c5146105fc578063d0e30db014610604576103af565b806397fd323d11610192578063ac1e502511610161578063ac1e5025146105b6578063aced1661146105c9578063adc64279146105d1578063bc063e1a146105d9576103af565b806397fd323d1461058b5780639f8b5da114610593578063a68833e51461059b578063a9e56f3c146105ae576103af565b80638e145459116101ce5780638e145459146105605780638fcb2be61461056857806390321e1a14610570578063931ff90e14610578576103af565b80638912cb8b146105485780638bc7e8c4146105505780638da5cb5b14610558576103af565b80634641257d116102d95780636817031b11610277578063722713f711610246578063722713f71461051d578063748747e6146105255780637d38ca65146105385780638456cb5914610540576103af565b80636817031b146104f25780636a1833a9146105055780636ec232d31461050d578063715018a614610515576103af565b806354518b1a116102b357806354518b1a146104ba578063573fef0a146104c257806359e79138146104ca5780635c975abb146104dd576103af565b80634641257d146104975780634700d3051461049f5780634a4e4fbe146104a7576103af565b80631fe4a686116103515780632ad5a53f116103205780632ad5a53f1461046c5780632e1a7d4d146104745780633e0dc34e146104875780633f4ba83a1461048f576103af565b80631fe4a68614610434578063257ae0de1461043c5780632646582614610444578063277e5cfd14610457576103af565b806311b0b42d1161038d57806311b0b42d146103fa57806313e120b11461040f5780631f1fcd51146104245780631fc8bc5d1461042c576103af565b80630e5c011e146103b45780630e8fbb5a146103c957806311588086146103dc575b600080fd5b6103c76103c2366004612ef4565b61068d565b005b6103c76103d7366004612fd1565b610775565b6103e46107f3565b6040516103f191906137e7565b60405180910390f35b610402610881565b6040516103f191906131a9565b610417610890565b6040516103f191906131f0565b61040261092e565b61040261093d565b61040261094c565b61040261095b565b6103c7610452366004613076565b61096a565b61045f6109e6565b6040516103f19190613248565b6103e4610a74565b6103c7610482366004613076565b610a79565b6103e4610cf2565b6103c7610cf8565b6103c7610d5f565b6103c7610e3b565b6103c76104b5366004612f0f565b610ef5565b6103e4610ff0565b6103c7610ff6565b6103c76104d8366004613009565b61102b565b6104e5611084565b6040516103f1919061323d565b6103c7610500366004612ef4565b611094565b6104176110f5565b610402611159565b6103c761116d565b6103e46111f6565b6103c7610533366004612ef4565b611211565b6103e4611280565b6103c7611285565b6104e56112e2565b6103e46112eb565b6104026112f1565b610402611300565b6103e461130f565b6103e4611315565b6103c7610586366004612f0f565b61131b565b6103e4611411565b6104e5611416565b6103c76105a9366004612ef4565b61141f565b610402611480565b6103c76105c4366004613076565b61148f565b610402611502565b61045f611511565b6103e461156c565b6103e4611572565b6103c76105f7366004612ef4565b6115f3565b61040261163f565b6103c761164e565b6103e46117a2565b6103c76117a8565b6103c761062a366004612ef4565b6117f5565b6103e4611856565b61045f61185b565b6103e46118b6565b6103e4611a0e565b610402611a14565b6103c7610665366004612ef4565b611a23565b6103c7610678366004612fd1565b611ae3565b6103c7611b43565b610402611ce1565b60095460ff1680156106b457506009546106b49061010090046001600160a01b0316611eaa565b1561076957600960019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561070957600080fd5b505af115801561071d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610741919061308e565b3a11156107695760405162461bcd60e51b8152600401610760906135d1565b60405180910390fd5b61077281611eb0565b50565b61077d6112f1565b6001600160a01b0316336001600160a01b031614806107a657506001546001600160a01b031633145b6107c25760405162461bcd60e51b8152600401610760906136a1565b6012805460ff1916821515179081905560ff16156107e9576107e4600061148f565b610772565b610772600a61148f565b600e54600f546040516393f1a40b60e01b815260009283926001600160a01b03909116916393f1a40b9161082b9130906004016137f0565b604080518083038186803b15801561084257600080fd5b505afa158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a91906130a6565b5091505090565b600a546001600160a01b031681565b6015805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152606093610929939192909183018282801561091f5780601f106108f45761010080835404028352916020019161091f565b820191906000526020600020905b81548152906001019060200180831161090257829003601f168201915b5050505050612035565b905090565b600c546001600160a01b031681565b600e546001600160a01b031681565b6002546001600160a01b031681565b6003546001600160a01b031681565b6109726112f1565b6001600160a01b0316336001600160a01b0316148061099b57506001546001600160a01b031633145b6109b75760405162461bcd60e51b8152600401610760906136a1565b606f8111156109d85760405162461bcd60e51b81526004016107609061349e565b600781905561037803600855565b6014805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a6c5780601f10610a4157610100808354040283529160200191610a6c565b820191906000526020600020905b815481529060010190602001808311610a4f57829003601f168201915b505050505081565b606f81565b6004546001600160a01b03163314610aa35760405162461bcd60e51b81526004016107609061354d565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610ad49030906004016131a9565b60206040518083038186803b158015610aec57600080fd5b505afa158015610b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b24919061308e565b905081811015610c2257600e54600f546001600160a01b039091169063441a3e7090610b508585612123565b6040518363ffffffff1660e01b8152600401610b6d929190613807565b600060405180830381600087803b158015610b8757600080fd5b505af1158015610b9b573d6000803e3d6000fd5b5050600c546040516370a0823160e01b81526001600160a01b0390911692506370a082319150610bcf9030906004016131a9565b60206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f919061308e565b90505b81811115610c2d5750805b610c356112f1565b6001600160a01b0316326001600160a01b031614158015610c5b5750610c59611084565b155b15610c93576000610c83612710610c7d6006548561215090919063ffffffff16565b9061218a565b9050610c8f8282612123565b9150505b600454600c54610cb0916001600160a01b039182169116836121bc565b7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d610cd96111f6565b604051610ce691906137e7565b60405180910390a15050565b600f5481565b610d006112f1565b6001600160a01b0316336001600160a01b03161480610d2957506001546001600160a01b031633145b610d455760405162461bcd60e51b8152600401610760906136a1565b610d4d6121db565b610d5561224c565b610d5d61164e565b565b60095460ff168015610d865750600954610d869061010090046001600160a01b0316611eaa565b15610e3257600960019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610ddb57600080fd5b505af1158015610def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e13919061308e565b3a1115610e325760405162461bcd60e51b8152600401610760906135d1565b610d5d32611eb0565b610e436112f1565b6001600160a01b0316336001600160a01b03161480610e6c57506001546001600160a01b031633145b610e885760405162461bcd60e51b8152600401610760906136a1565b610e90611285565b600e54600f54604051632989754760e11b81526001600160a01b0390921691635312ea8e91610ec1916004016137e7565b600060405180830381600087803b158015610edb57600080fd5b505af1158015610eef573d6000803e3d6000fd5b50505050565b610efd6122a9565b6001600160a01b0316610f0e6112f1565b6001600160a01b031614610f345760405162461bcd60e51b81526004016107609061356d565b600b5482516001600160a01b03909116908390600090610f5057fe5b60200260200101516001600160a01b031614610f7e5760405162461bcd60e51b81526004016107609061332b565b600a5482516001600160a01b039091169083906000198101908110610f9f57fe5b60200260200101516001600160a01b031614610fcd5760405162461bcd60e51b81526004016107609061334c565b610fd78282611cf0565b8051610feb91601591602090910190612d24565b505050565b61271081565b60125460ff1615610d5d576004546001600160a01b03163314610e325760405162461bcd60e51b81526004016107609061354d565b6110336112f1565b6001600160a01b0316336001600160a01b0316148061105c57506001546001600160a01b031633145b6110785760405162461bcd60e51b8152600401610760906136a1565b610feb60148383612da2565b600054600160a01b900460ff1690565b61109c6122a9565b6001600160a01b03166110ad6112f1565b6001600160a01b0316146110d35760405162461bcd60e51b81526004016107609061356d565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6016805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152606093610929939192909183018282801561091f5780601f106108f45761010080835404028352916020019161091f565b60095461010090046001600160a01b031681565b6111756122a9565b6001600160a01b03166111866112f1565b6001600160a01b0316146111ac5760405162461bcd60e51b81526004016107609061356d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006109296112036107f3565b61120b611572565b906122ad565b6112196112f1565b6001600160a01b0316336001600160a01b0316148061124257506001546001600160a01b031633145b61125e5760405162461bcd60e51b8152600401610760906136a1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b607081565b61128d6112f1565b6001600160a01b0316336001600160a01b031614806112b657506001546001600160a01b031633145b6112d25760405162461bcd60e51b8152600401610760906136a1565b6112da6122d2565b610d5d612333565b60125460ff1681565b60065481565b6000546001600160a01b031690565b6005546001600160a01b031681565b60115481565b60075481565b6113236122a9565b6001600160a01b03166113346112f1565b6001600160a01b03161461135a5760405162461bcd60e51b81526004016107609061356d565b600b5482516001600160a01b0390911690839060009061137657fe5b60200260200101516001600160a01b0316146113a45760405162461bcd60e51b81526004016107609061332b565b600d5482516001600160a01b0390911690839060001981019081106113c557fe5b60200260200101516001600160a01b0316146113f35760405162461bcd60e51b8152600401610760906134bc565b6113fd8282611cf0565b8051610feb91601691602090910190612d24565b600090565b60095460ff1681565b6114276122a9565b6001600160a01b03166114386112f1565b6001600160a01b03161461145e5760405162461bcd60e51b81526004016107609061356d565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6010546001600160a01b031681565b6114976112f1565b6001600160a01b0316336001600160a01b031614806114c057506001546001600160a01b031633145b6114dc5760405162461bcd60e51b8152600401610760906136a1565b60328111156114fd5760405162461bcd60e51b81526004016107609061349e565b600655565b6001546001600160a01b031681565b6016805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a6c5780601f10610a4157610100808354040283529160200191610a6c565b6103e881565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a08231906115a39030906004016131a9565b60206040518083038186803b1580156115bb57600080fd5b505afa1580156115cf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610929919061308e565b6002546001600160a01b0316331461161d5760405162461bcd60e51b815260040161076090613289565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600d546001600160a01b031681565b611656611084565b156116735760405162461bcd60e51b815260040161076090613474565b600c546040516370a0823160e01b81526000916001600160a01b0316906370a08231906116a49030906004016131a9565b60206040518083038186803b1580156116bc57600080fd5b505afa1580156116d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f4919061308e565b9050801561077257600e54600f54604051631c57762b60e31b81526001600160a01b039092169163e2bbb1589161172f918590600401613807565b600060405180830381600087803b15801561174957600080fd5b505af115801561175d573d6000803e3d6000fd5b505050507f4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e3842661178a6111f6565b60405161179791906137e7565b60405180910390a150565b60085481565b6117b06112f1565b6001600160a01b0316336001600160a01b031614806117d957506001546001600160a01b031633145b610e325760405162461bcd60e51b8152600401610760906136a1565b6117fd6122a9565b6001600160a01b031661180e6112f1565b6001600160a01b0316146118345760405162461bcd60e51b81526004016107609061356d565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b603281565b6015805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a6c5780601f10610a4157610100808354040283529160200191610a6c565b60148054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152600093606093611979938301828280156119455780601f1061191a57610100808354040283529160200191611945565b820191906000526020600020905b81548152906001019060200180831161192857829003601f168201915b5050505050604051806040016040528060118152602001702875696e743235362c616464726573732960781b81525061238d565b600e54600f546040519293506060926119f1926001600160a01b03169185916119a7919030906024016137f0565b60408051601f1981840301815290829052916119c291613112565b6040519081900390206020820180516001600160e01b03166001600160e01b03199092169190911790526123b9565b905080806020019051810190611a07919061308e565b9250505090565b60135481565b600b546001600160a01b031681565b611a2b6122a9565b6001600160a01b0316611a3c6112f1565b6001600160a01b031614611a625760405162461bcd60e51b81526004016107609061356d565b6001600160a01b038116611a885760405162461bcd60e51b8152600401610760906132ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b611aeb6112f1565b6001600160a01b0316336001600160a01b03161480611b1457506001546001600160a01b031633145b611b305760405162461bcd60e51b8152600401610760906136a1565b6009805460ff1916911515919091179055565b6004546001600160a01b03163314611b6d5760405162461bcd60e51b81526004016107609061354d565b600e54600f54604051632989754760e11b81526001600160a01b0390921691635312ea8e91611b9e916004016137e7565b600060405180830381600087803b158015611bb857600080fd5b505af1158015611bcc573d6000803e3d6000fd5b5050600c546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611c039030906004016131a9565b60206040518083038186803b158015611c1b57600080fd5b505afa158015611c2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c53919061308e565b600c546004805460405163a9059cbb60e01b81529394506001600160a01b039283169363a9059cbb93611c8b939216918691016131d7565b602060405180830381600087803b158015611ca557600080fd5b505af1158015611cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cdd9190612fed565b5050565b6004546001600160a01b031681565b606082600081518110611cff57fe5b6020026020010151604051602001611d1791906130f5565b60408051601f19818403018152919052825190915060005b81811015611d8f5782848281518110611d4457fe5b6020026020010151868360010181518110611d5b57fe5b6020026020010151604051602001611d759392919061312e565b60408051601f198184030181529190529250600101611d2f565b505092915050565b801580611e1f5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90611dcd90309086906004016131bd565b60206040518083038186803b158015611de557600080fd5b505afa158015611df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1d919061308e565b155b611e3b5760405162461bcd60e51b81526004016107609061370d565b610feb8363095ea7b360e01b8484604051602401611e5a9291906131d7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526123de565b6060611ea0848460008561246d565b90505b9392505050565b3b151590565b611eb8611084565b15611ed55760405162461bcd60e51b815260040161076090613474565b600e54600f54604051631c57762b60e31b81526001600160a01b039092169163e2bbb15891611f0991600090600401613807565b600060405180830381600087803b158015611f2357600080fd5b505af1158015611f37573d6000803e3d6000fd5b5050600b546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611f6e9030906004016131a9565b60206040518083038186803b158015611f8657600080fd5b505afa158015611f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbe919061308e565b90508015611cdd57611fcf8261252e565b611fd76127d9565b6000611fe1611572565b9050611feb61164e565b42601355337f9bc239f1724cacfb88cb1d66a2dc437467699b68a8c90d7b63110cf4b6f924108261201a6111f6565b604051612028929190613807565b60405180910390a2505050565b60606000612042836129bb565b905060608160010167ffffffffffffffff8111801561206057600080fd5b5060405190808252806020026020018201604052801561208a578160200160208202803683370190505b50905060005b8281101561211b576000806120a4876129c8565b5091509150818484815181106120b657fe5b60200260200101906001600160a01b031690816001600160a01b031681525050808484600101815181106120e657fe5b60200260200101906001600160a01b031690816001600160a01b03168152505061210f876129f9565b96505050600101612090565b509392505050565b6000828211156121455760405162461bcd60e51b815260040161076090613398565b508082035b92915050565b60008261215f5750600061214a565b8282028284828161216c57fe5b0414611ea35760405162461bcd60e51b8152600401610760906134de565b60008082116121ab5760405162461bcd60e51b815260040161076090613415565b8183816121b457fe5b049392505050565b610feb8363a9059cbb60e01b8484604051602401611e5a9291906131d7565b6121e3611084565b6121ff5760405162461bcd60e51b81526004016107609061325b565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6122356122a9565b60405161224291906131a9565b60405180910390a1565b600e54600c5461226b916001600160a01b039182169116600019611d97565b600354600b5461228a916001600160a01b039182169116600019611d97565b601054600d54610d5d916001600160a01b039182169116600019611d97565b3390565b600082820183811015611ea35760405162461bcd60e51b8152600401610760906132f4565b6122da611084565b156122f75760405162461bcd60e51b815260040161076090613474565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122356122a9565b600e54600c54612351916001600160a01b0391821691166000611d97565b600354600b5461236f916001600160a01b0391821691166000611d97565b601054600d54610d5d916001600160a01b0391821691166000611d97565b606082826040516020016123a292919061317a565b604051602081830303815290604052905092915050565b6060611ea383836040518060600160405280602581526020016138cc60259139612a10565b6060612433826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e919092919063ffffffff16565b805190915015610feb57808060200190518101906124519190612fed565b610feb5760405162461bcd60e51b8152600401610760906136c3565b60608247101561248f5760405162461bcd60e51b8152600401610760906133cf565b61249885611eaa565b6124b45760405162461bcd60e51b81526004016107609061363f565b60006060866001600160a01b031685876040516124d19190613112565b60006040518083038185875af1925050503d806000811461250e576040519150601f19603f3d011682016040523d82523d6000602084013e612513565b606091505b5091509150612523828286612aad565b979650505050505050565b600b546040516370a0823160e01b81526000916125c4916103e891610c7d91602d916001600160a01b0316906370a082319061256e9030906004016131a9565b60206040518083038186803b15801561258657600080fd5b505afa15801561259a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125be919061308e565b90612150565b6003546015805460408051602060026101006001861615026000190190941693909304601f810184900484028201840190925281815294955061266b946001600160a01b039094169392918301828280156126605780601f1061263557610100808354040283529160200191612660565b820191906000526020600020905b81548152906001019060200180831161264357829003601f168201915b505050505083612ae6565b50600a546040516370a0823160e01b81526000916001600160a01b0316906370a082319061269d9030906004016131a9565b60206040518083038186803b1580156126b557600080fd5b505afa1580156126c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ed919061308e565b9050600061270c6103e8610c7d6007548561215090919063ffffffff16565b600a54909150612726906001600160a01b031685836121bc565b60006127436103e8610c7d6008548661215090919063ffffffff16565b600554600a54919250612763916001600160a01b039081169116836121bc565b60006127766103e8610c7d866070612150565b600254600a54919250612796916001600160a01b039081169116836121bc565b7fd255b592c7f268a73e534da5219a60ff911b4cf6daae21c7d20527dd657bd99a8383836040516127c993929190613834565b60405180910390a1505050505050565b600b546040516370a0823160e01b81526000916001600160a01b0316906370a082319061280a9030906004016131a9565b60206040518083038186803b15801561282257600080fd5b505afa158015612836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061285a919061308e565b6003546016805460408051602060026101006001861615026000190190941693909304601f81018490048402820184019092528181529495506128cb946001600160a01b039094169392918301828280156126605780601f1061263557610100808354040283529160200191612660565b50600d546040516370a0823160e01b81526000916001600160a01b0316906370a08231906128fd9030906004016131a9565b60206040518083038186803b15801561291557600080fd5b505afa158015612929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294d919061308e565b6010546011546040516321ec87bf60e21b81529293506001600160a01b03909116916387b21efc916129859185903090600401613815565b600060405180830381600087803b15801561299f57600080fd5b505af11580156129b3573d6000803e3d6000fd5b505050505050565b5160176013199091010490565b600080806129d68482612b9d565b92506129e3846014612bf6565b90506129f0846017612b9d565b91509193909250565b805160609061214a90839060179060161901612c48565b6060612a1b84611eaa565b612a375760405162461bcd60e51b8152600401610760906135fb565b60006060856001600160a01b031685604051612a539190613112565b600060405180830381855afa9150503d8060008114612a8e576040519150601f19603f3d011682016040523d82523d6000602084013e612a93565b606091505b5091509150612aa3828286612aad565b9695505050505050565b60608315612abc575081611ea3565b825115612acc5782518084602001fd5b8160405162461bcd60e51b81526004016107609190613248565b6000612af0612e10565b506040805160a08101825284815230602082015242818301526060810184905260006080820152905163c04b8d5960e01b81526001600160a01b0386169063c04b8d5990612b4290849060040161378f565b602060405180830381600087803b158015612b5c57600080fd5b505af1158015612b70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b94919061308e565b95945050505050565b600081826014011015612bc25760405162461bcd60e51b815260040161076090613763565b8160140183511015612be65760405162461bcd60e51b8152600401610760906135a2565b500160200151600160601b900490565b600081826003011015612c1b5760405162461bcd60e51b81526004016107609061336d565b8160030183511015612c3f5760405162461bcd60e51b81526004016107609061351f565b50016003015190565b60608182601f011015612c6d5760405162461bcd60e51b81526004016107609061344c565b828284011015612c8f5760405162461bcd60e51b81526004016107609061344c565b81830184511015612cb25760405162461bcd60e51b815260040161076090613676565b606082158015612cd15760405191506000825260208201604052612d1b565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612d0a578051835260209283019201612cf2565b5050858452601f01601f1916604052505b50949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612d6557805160ff1916838001178555612d92565b82800160010185558215612d92579182015b82811115612d92578251825591602001919060010190612d77565b50612d9e929150612e48565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612de35782800160ff19823516178555612d92565b82800160010185558215612d92579182015b82811115612d92578235825591602001919060010190612df5565b6040518060a001604052806060815260200160006001600160a01b031681526020016000815260200160008152602001600081525090565b5b80821115612d9e5760008155600101612e49565b80356001600160a01b038116811461214a57600080fd5b600082601f830112612e84578081fd5b8135612e97612e9282613871565b61384a565b818152915060208083019084810181840286018201871015612eb857600080fd5b6000805b85811015612ee857823562ffffff81168114612ed6578283fd5b85529383019391830191600101612ebc565b50505050505092915050565b600060208284031215612f05578081fd5b611ea38383612e5d565b60008060408385031215612f21578081fd5b823567ffffffffffffffff80821115612f38578283fd5b818501915085601f830112612f4b578283fd5b8135612f59612e9282613871565b80828252602080830192508086018a828387028901011115612f79578788fd5b8796505b84871015612fa357612f8f8b82612e5d565b845260019690960195928101928101612f7d565b509096508701359350505080821115612fba578283fd5b50612fc785828601612e74565b9150509250929050565b600060208284031215612fe2578081fd5b8135611ea3816138bd565b600060208284031215612ffe578081fd5b8151611ea3816138bd565b6000806020838503121561301b578182fd5b823567ffffffffffffffff80821115613032578384fd5b818501915085601f830112613045578384fd5b813581811115613053578485fd5b866020828501011115613064578485fd5b60209290920196919550909350505050565b600060208284031215613087578081fd5b5035919050565b60006020828403121561309f578081fd5b5051919050565b600080604083850312156130b8578182fd5b505080516020909101519092909150565b600081518084526130e1816020860160208601613891565b601f01601f19169290920160200192915050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60008251613124818460208701613891565b9190910192915050565b60008451613140818460208901613891565b60e89490941b6001600160e81b0319169190930190815260609190911b6bffffffffffffffffffffffff1916600382015260170192915050565b6000835161318c818460208801613891565b8351908301906131a0818360208801613891565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156132315783516001600160a01b03168352928401929184019160010161320c565b50909695505050505050565b901515815260200190565b600060208252611ea360208301846130c9565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252600b908201526a085cdd1c985d1959da5cdd60aa1b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b602080825260079082015266085bdd5d1c1d5d60ca1b604082015260600190565b602080825260079082015266216e617469766560c81b604082015260600190565b602080825260119082015270746f55696e7432345f6f766572666c6f7760781b604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252600e908201526d736c6963655f6f766572666c6f7760901b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600490820152630216361760e41b604082015260600190565b6020808252600890820152670859195c1bdcda5d60c21b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b602080825260149082015273746f55696e7432345f6f75744f66426f756e647360601b604082015260600190565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b602080825260159082015274746f416464726573735f6f75744f66426f756e647360581b604082015260600190565b60208082526010908201526f67617320697320746f6f20686967682160801b604082015260600190565b60208082526024908201527f416464726573733a207374617469632063616c6c20746f206e6f6e2d636f6e746040820152631c9858dd60e21b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b602080825260119082015270736c6963655f6f75744f66426f756e647360781b604082015260600190565b60208082526008908201526710b6b0b730b3b2b960c11b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b602080825260129082015271746f416464726573735f6f766572666c6f7760701b604082015260600190565b600060208252825160a060208401526137ab60c08401826130c9565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b90815260200190565b9182526001600160a01b0316602082015260400190565b918252602082015260400190565b92835260208301919091526001600160a01b0316604082015260600190565b9283526020830191909152604082015260600190565b60405181810167ffffffffffffffff8111828210171561386957600080fd5b604052919050565b600067ffffffffffffffff821115613887578081fd5b5060209081020190565b60005b838110156138ac578181015183820152602001613894565b83811115610eef5750506000910152565b801515811461077257600080fdfe416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a26469706673582212209949663a0f91543e2243d518618c58e9c72fd6b4f9f80a41ed80fac985aadf0164736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000decc0c09c3b5f6e92ef4184125d5648a66e3529800000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a364f8c717caad9a442737eb7b8a55cc6cf18d80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b0d502e938ed5f4df2e681fe6e419ff29631d62b00000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000340465d9d2ebde78f15a3870884757584f97abb40000000000000000000000004cc72219fc8aef162fc0c255d9b9c3ff93b1088200000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45000000000000000000000000e536f8141d8eb7b1f096934af3329cb581bfe9950000000000000000000000004aba01fb8e1f6bfe80c56deb367f19f35df0f4ae0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000296f55f8fb28e498b858d0bcda06d955b2cb3f970000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160700000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000296f55f8fb28e498b858d0bcda06d955b2cb3f970000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160700000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000bb8
-----Decoded View---------------
Arg [0] : _want (address): 0xDecC0c09c3B5f6e92EF4184125D5648a66E35298
Arg [1] : _poolId (uint256): 0
Arg [2] : _chef (address): 0x4a364f8c717cAAD9A442737Eb7b8A55cc6cf18D8
Arg [3] : _routerPoolId (uint256): 1
Arg [4] : _stargateRouter (address): 0xB0D502E938ed5f4df2E681fE6E419ff29631d62b
Arg [5] : _outputToNativeRoute (address[]): 0x296F55F8Fb28E498B858d0BcDA06D955B2Cb3f97,0x7F5c764cBc14f9669B88837ca1490cCa17c31607,0x4200000000000000000000000000000000000006
Arg [6] : _outputToDepositRoute (address[]): 0x296F55F8Fb28E498B858d0BcDA06D955B2Cb3f97,0x7F5c764cBc14f9669B88837ca1490cCa17c31607
Arg [7] : _outputToNativeFee (uint24[]): 3000,500
Arg [8] : _outputToDepositFee (uint24[]): 3000
Arg [9] : _stratManager (tuple):
Arg [1] : keeper (address): 0x340465d9D2EbDE78F15a3870884757584F97aBB4
Arg [2] : strategist (address): 0x4cC72219fc8aEF162FC0c255D9B9C3Ff93B10882
Arg [3] : unirouter (address): 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45
Arg [4] : vault (address): 0xe536F8141D8EB7B1f096934AF3329cB581bFe995
Arg [5] : beefyFeeRecipient (address): 0x4ABa01FB8E1f6BFE80c56Deb367f19F35Df0f4aE
-----Encoded View---------------
26 Constructor Arguments found :
Arg [0] : 000000000000000000000000decc0c09c3b5f6e92ef4184125d5648a66e35298
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000004a364f8c717caad9a442737eb7b8a55cc6cf18d8
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 000000000000000000000000b0d502e938ed5f4df2e681fe6e419ff29631d62b
Arg [5] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [7] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000300
Arg [9] : 000000000000000000000000340465d9d2ebde78f15a3870884757584f97abb4
Arg [10] : 0000000000000000000000004cc72219fc8aef162fc0c255d9b9c3ff93b10882
Arg [11] : 00000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45
Arg [12] : 000000000000000000000000e536f8141d8eb7b1f096934af3329cb581bfe995
Arg [13] : 0000000000000000000000004aba01fb8e1f6bfe80c56deb367f19f35df0f4ae
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [15] : 000000000000000000000000296f55f8fb28e498b858d0bcda06d955b2cb3f97
Arg [16] : 0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607
Arg [17] : 0000000000000000000000004200000000000000000000000000000000000006
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [19] : 000000000000000000000000296f55f8fb28e498b858d0bcda06d955b2cb3f97
Arg [20] : 0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000bb8
Arg [23] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [25] : 0000000000000000000000000000000000000000000000000000000000000bb8
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$1.58
Net Worth in ETH
0.000765
Token Allocations
STG
100.00%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| OP | 100.00% | $0.162179 | 9.7155 | $1.58 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.