Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 87403746 | 980 days ago | 0.001 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BeefyHopZapOneInch
Compiler Version
v0.8.15+commit.e14f2714
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.8.0;
import "@openzeppelin-4/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin-4/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin-4/contracts/utils/math/Math.sol";
import "../interfaces/hop/IHopSwap.sol";
import "../interfaces/hop/IHopLp.sol";
import "./zapInterfaces/IWETH.sol";
import "./zapInterfaces/IBeefyVault.sol";
import "./zapInterfaces/IStrategy.sol";
import "./zapInterfaces/IERC20Extended.sol";
// Aggregator Zap compatible with all Hop vaults.
contract BeefyHopZapOneInch {
using SafeERC20 for IERC20;
using SafeERC20 for IBeefyVault;
// needed addresses for zap
address public immutable oneInchRouter;
address public immutable WETH;
uint256 public constant minimumAmount = 1000;
event TokenReturned(address token, uint256 amount);
event ZapIn(address vault, address tokenIn, uint256 amountIn);
event ZapOut(address vault, address desiredToken, uint256 mooTokenIn);
constructor(address _oneInchRouter, address _WETH) {
// Safety checks to ensure WETH token address
IWETH(_WETH).deposit{value: 0}();
IWETH(_WETH).withdraw(0);
WETH = _WETH;
oneInchRouter = _oneInchRouter;
}
// Zap's main functions external and public functions
function beefInETH(address _beefyVault, bytes calldata _token0, uint256 _minAmountOut) external payable {
require(msg.value >= minimumAmount, 'Beefy: Insignificant input amount');
IWETH(WETH).deposit{value: msg.value}();
_swapAndStake(_beefyVault, WETH, _token0, _minAmountOut);
emit ZapIn(_beefyVault, WETH, msg.value);
}
function beefIn(address _beefyVault, address _inputToken, uint256 _tokenInAmount, bytes calldata _token0, uint256 _minAmountOut) public {
require(_tokenInAmount >= minimumAmount, 'Beefy: Insignificant input amount');
IERC20(_inputToken).safeTransferFrom(msg.sender, address(this), _tokenInAmount);
_swapAndStake(_beefyVault, _inputToken, _token0, _minAmountOut);
emit ZapIn(_beefyVault, _inputToken, _tokenInAmount);
}
function beefOut(address _beefyVault, uint256 _withdrawAmount, uint256 _minAmountOut) external {
address[] memory tokens = _beefOut(_beefyVault, _withdrawAmount, _minAmountOut);
_returnAssets(tokens);
}
function beefOutAndSwap(address _beefyVault, uint256 _withdrawAmount, address _desiredToken, bytes calldata _dataToken0, uint256 _minAmountOut) external {
(IBeefyVault vault, IHopSwap pool, address lpToken) = _getVaultPool(_beefyVault);
vault.safeTransferFrom(msg.sender, address(this), _withdrawAmount);
vault.withdraw(_withdrawAmount);
emit ZapOut(_beefyVault, _desiredToken, _withdrawAmount);
_removeLiquidity(lpToken, address(pool), _minAmountOut);
address[] memory tokens = new address[](2);
tokens[0] = pool.getToken(0);
tokens[1] = _desiredToken;
_approveTokenIfNeeded(tokens[0], address(oneInchRouter));
_swapViaOneInch(tokens[0], _dataToken0);
_returnAssets(tokens);
}
// Internal functions
function _beefOut(address _beefyVault, uint256 _withdrawAmount, uint256 _minAmountOut) private returns (address[] memory tokens) {
(IBeefyVault vault, IHopSwap pool, address lpToken) = _getVaultPool(_beefyVault);
IERC20(_beefyVault).safeTransferFrom(msg.sender, address(this), _withdrawAmount);
vault.withdraw(_withdrawAmount);
_removeLiquidity(lpToken, address(pool), _minAmountOut);
tokens = new address[](1);
tokens[0] = pool.getToken(0);
emit ZapOut(_beefyVault, address(pool), _withdrawAmount);
}
function _removeLiquidity(address _lpToken, address _pool, uint256 _minAmountOut) private {
IHopSwap(_pool).removeLiquidityOneToken(
IERC20(_lpToken).balanceOf(address(this)),
0,
_minAmountOut,
block.timestamp
);
}
function _getVaultPool(address _beefyVault) private view returns (IBeefyVault vault, IHopSwap pool, address lpToken) {
vault = IBeefyVault(_beefyVault);
lpToken = vault.want();
pool = IHopSwap(IHopLp(lpToken).swap());
}
function _swapAndStake(address _vault, address _inputToken, bytes calldata _token0, uint256 _minAmountOut) private {
(IBeefyVault vault, IHopSwap pool, address lpToken) = _getVaultPool(_vault);
address[] memory tokens = new address[](2);
tokens[0] = pool.getToken(0);
tokens[1] = _inputToken;
if (_inputToken != tokens[0]) {
_swapViaOneInch(_inputToken, _token0);
}
_approveTokenIfNeeded(tokens[0], address(pool));
uint256[] memory inputAmounts = new uint256[](2);
inputAmounts[0] = IERC20(tokens[0]).balanceOf(address(this));
pool.addLiquidity(inputAmounts, _minAmountOut, block.timestamp);
_approveTokenIfNeeded(lpToken, address(vault));
uint256 lpBal = IERC20(lpToken).balanceOf(address(this));
vault.deposit(lpBal);
vault.safeTransfer(msg.sender, vault.balanceOf(address(this)));
_returnAssets(tokens);
}
// our main swap function call. we call the aggregator contract with our fed data. if we get an error we revert and return the error result.
function _swapViaOneInch(address _inputToken, bytes memory _callData) private {
_approveTokenIfNeeded(_inputToken, address(oneInchRouter));
(bool success, bytes memory retData) = oneInchRouter.call(_callData);
propagateError(success, retData, "1inch");
require(success == true, "calling 1inch got an error");
}
function _returnAssets(address[] memory _tokens) private {
uint256 balance;
for (uint256 i; i < _tokens.length; i++) {
balance = IERC20(_tokens[i]).balanceOf(address(this));
if (balance > 0) {
if (_tokens[i] == WETH) {
IWETH(WETH).withdraw(balance);
(bool success,) = msg.sender.call{value: balance}(new bytes(0));
require(success, 'Beefy: ETH transfer failed');
emit TokenReturned(_tokens[i], balance);
} else {
IERC20(_tokens[i]).safeTransfer(msg.sender, balance);
emit TokenReturned(_tokens[i], balance);
}
}
}
}
function _approveTokenIfNeeded(address _token, address _spender) private {
if (IERC20(_token).allowance(address(this), _spender) == 0) {
IERC20(_token).safeApprove(_spender, type(uint).max);
}
}
// Error reporting from our call to the aggrator contract when we try to swap.
function propagateError(
bool success,
bytes memory data,
string memory errorMessage
) public pure {
// Forward error message from call/delegatecall
if (!success) {
if (data.length == 0) revert(errorMessage);
assembly {
revert(add(32, data), mload(data))
}
}
}
receive() external payable {
assert(msg.sender == WETH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, 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}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, 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}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. It the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`.
// We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`.
// This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`.
// Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a
// good first aproximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1;
uint256 x = a;
if (x >> 128 > 0) {
x >>= 128;
result <<= 64;
}
if (x >> 64 > 0) {
x >>= 64;
result <<= 32;
}
if (x >> 32 > 0) {
x >>= 32;
result <<= 16;
}
if (x >> 16 > 0) {
x >>= 16;
result <<= 8;
}
if (x >> 8 > 0) {
x >>= 8;
result <<= 4;
}
if (x >> 4 > 0) {
x >>= 4;
result <<= 2;
}
if (x >> 2 > 0) {
result <<= 1;
}
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
uint256 result = sqrt(a);
if (rounding == Rounding.Up && result * result < a) {
result += 1;
}
return result;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IHopLp {
function swap() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IHopSwap {
function addLiquidity(
uint256[] calldata amounts,
uint256 minToMint,
uint256 deadline
) external returns (uint256);
function removeLiquidityOneToken(
uint256 tokenAmount,
uint8 tokenIndex,
uint256 minAmount,
uint256 deadline
) external returns (uint256);
function getToken(uint8 index) external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin-4/contracts/token/ERC20/ERC20.sol";
interface IBeefyVault is IERC20 {
function deposit(uint256 amount) external;
function withdraw(uint256 shares) external;
function want() external pure returns (address); // Beefy Vault V6
function token() external pure returns (address); // Beefy Vault V5
function balance() external pure returns (uint256);
function totalSupply() external pure returns (uint256);
function strategy() external pure returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20Extended {
function decimals() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IStrategy {
function withdrawalFee() external view returns (uint256);
function unirouter() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin-4/contracts/token/ERC20/ERC20.sol";
interface IWETH is IERC20 {
function deposit() external payable;
function withdraw(uint256 wad) external;
}{
"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":"_oneInchRouter","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenReturned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"ZapIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address","name":"desiredToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"mooTokenIn","type":"uint256"}],"name":"ZapOut","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beefyVault","type":"address"},{"internalType":"address","name":"_inputToken","type":"address"},{"internalType":"uint256","name":"_tokenInAmount","type":"uint256"},{"internalType":"bytes","name":"_token0","type":"bytes"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"}],"name":"beefIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beefyVault","type":"address"},{"internalType":"bytes","name":"_token0","type":"bytes"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"}],"name":"beefInETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_beefyVault","type":"address"},{"internalType":"uint256","name":"_withdrawAmount","type":"uint256"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"}],"name":"beefOut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beefyVault","type":"address"},{"internalType":"uint256","name":"_withdrawAmount","type":"uint256"},{"internalType":"address","name":"_desiredToken","type":"address"},{"internalType":"bytes","name":"_dataToken0","type":"bytes"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"}],"name":"beefOutAndSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minimumAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oneInchRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"string","name":"errorMessage","type":"string"}],"name":"propagateError","outputs":[],"stateMutability":"pure","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001da638038062001da683398101604081905262000034916200011d565b806001600160a01b031663d0e30db060006040518263ffffffff1660e01b81526004016000604051808303818588803b1580156200007157600080fd5b505af115801562000086573d6000803e3d6000fd5b5050604051632e1a7d4d60e01b8152600060048201526001600160a01b0385169350632e1a7d4d92506024019050600060405180830381600087803b158015620000cf57600080fd5b505af1158015620000e4573d6000803e3d6000fd5b5050506001600160a01b0391821660a052501660805262000155565b80516001600160a01b03811681146200011857600080fd5b919050565b600080604083850312156200013157600080fd5b6200013c8362000100565b91506200014c6020840162000100565b90509250929050565b60805160a051611bed620001b960003960008181608f015281816101990152818161022c015281816102a4015281816102ef01528181610d3c0152610da2015260008181610148015281816105e10152818161122b01526112540152611bed6000f3fe60806040526004361061007f5760003560e01c8063ac3af2081161004e578063ac3af20814610136578063ad5c464814610187578063bb0c8298146101bb578063f068d9c7146101df57600080fd5b80630299d1e6146100c35780632e11d785146100d65780638e9a9d64146100f657806393cf97f81461011657600080fd5b366100be57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100bc576100bc6116e5565b005b600080fd5b6100bc6100d136600461175c565b6101ff565b3480156100e257600080fd5b506100bc6100f13660046117b8565b61032c565b34801561010257600080fd5b506100bc610111366004611833565b6103b3565b34801561012257600080fd5b506100bc610131366004611902565b6103d1565b34801561014257600080fd5b5061016a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561019357600080fd5b5061016a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c757600080fd5b506101d16103e881565b60405190815260200161017e565b3480156101eb57600080fd5b506100bc6101fa3660046119a3565b610406565b6103e834101561022a5760405162461bcd60e51b8152600401610221906119fa565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561028557600080fd5b505af1158015610299573d6000803e3d6000fd5b50505050506102cb847f0000000000000000000000000000000000000000000000000000000000000000858585610674565b7f4fd86e42fdf9189d86bda34d3e693c24264ea2b54ff7796d9e1d40f5e29f4f59847f00000000000000000000000000000000000000000000000000000000000000003460405161031e93929190611a3b565b60405180910390a150505050565b6103e884101561034e5760405162461bcd60e51b8152600401610221906119fa565b6103636001600160a01b038616333087610ab5565b6103708686858585610674565b7f4fd86e42fdf9189d86bda34d3e693c24264ea2b54ff7796d9e1d40f5e29f4f598686866040516103a393929190611a3b565b60405180910390a1505050505050565b60006103c0848484610b0d565b90506103cb81610c9f565b50505050565b826104015781516000036103f9578060405162461bcd60e51b81526004016102219190611a8b565b815182602001fd5b505050565b600080600061041489610fd5565b919450925090506104306001600160a01b03841633308b610ab5565b604051632e1a7d4d60e01b8152600481018990526001600160a01b03841690632e1a7d4d90602401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b505050507fde160ef457e2842f9b597ec662dc8b390d699ba99300cfe5429f960b4bffd2f089888a6040516104bd93929190611a3b565b60405180910390a16104d08183866110ac565b6040805160028082526060820183526000926020830190803683370190505060405162415c3360e91b8152600060048201529091506001600160a01b038416906382b8660090602401602060405180830381865afa158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055a9190611abe565b8160008151811061056d5761056d611adb565b60200260200101906001600160a01b031690816001600160a01b03168152505087816001815181106105a1576105a1611adb565b60200260200101906001600160a01b031690816001600160a01b031681525050610605816000815181106105d7576105d7611adb565b60200260200101517f0000000000000000000000000000000000000000000000000000000000000000611194565b61065f8160008151811061061b5761061b611adb565b602002602001015188888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061122592505050565b61066881610c9f565b50505050505050505050565b600080600061068288610fd5565b604080516002808252606082018352949750929550909350600092906020830190803683370190505060405162415c3360e91b8152600060048201529091506001600160a01b038416906382b8660090602401602060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190611abe565b8160008151811061072957610729611adb565b60200260200101906001600160a01b031690816001600160a01b031681525050878160018151811061075d5761075d611adb565b60200260200101906001600160a01b031690816001600160a01b0316815250508060008151811061079057610790611adb565b60200260200101516001600160a01b0316886001600160a01b0316146107f0576107f08888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061122592505050565b6108148160008151811061080657610806611adb565b602002602001015184611194565b6040805160028082526060820183526000926020830190803683370190505090508160008151811061084857610848611adb565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bc9190611af1565b816000815181106108cf576108cf611adb565b6020908102919091010152604051634d49e87d60e01b81526001600160a01b03851690634d49e87d9061090a9084908a904290600401611b0a565b6020604051808303816000875af1158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190611af1565b506109588386611194565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190611af1565b60405163b6b55f2560e01b8152600481018290529091506001600160a01b0387169063b6b55f2590602401600060405180830381600087803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152610a9f92503391506001600160a01b038916906370a0823190602401602060405180830381865afa158015610a6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8e9190611af1565b6001600160a01b038916919061134b565b610aa883610c9f565b5050505050505050505050565b6103cb846323b872dd60e01b858585604051602401610ad693929190611a3b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261137b565b60606000806000610b1d87610fd5565b91945092509050610b396001600160a01b038816333089610ab5565b604051632e1a7d4d60e01b8152600481018790526001600160a01b03841690632e1a7d4d90602401600060405180830381600087803b158015610b7b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b50505050610b9e8183876110ac565b60408051600180825281830190925290602080830190803683370190505060405162415c3360e91b8152600060048201529094506001600160a01b038316906382b8660090602401602060405180830381865afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611abe565b84600081518110610c3a57610c3a611adb565b60200260200101906001600160a01b031690816001600160a01b0316815250507fde160ef457e2842f9b597ec662dc8b390d699ba99300cfe5429f960b4bffd2f0878388604051610c8d93929190611a3b565b60405180910390a15050509392505050565b6000805b825181101561040157828181518110610cbe57610cbe611adb565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610d0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d329190611af1565b91508115610fc3577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316838281518110610d7657610d76611adb565b60200260200101516001600160a01b031603610f2557604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610dee57600080fd5b505af1158015610e02573d6000803e3d6000fd5b5050604080516000808252602082019283905293503392508591610e269190611b57565b60006040518083038185875af1925050503d8060008114610e63576040519150601f19603f3d011682016040523d82523d6000602084013e610e68565b606091505b5050905080610eb95760405162461bcd60e51b815260206004820152601a60248201527f42656566793a20455448207472616e73666572206661696c65640000000000006044820152606401610221565b7feaf449319c042c9ba3474fa0c5329eb58cd1f23be110cdbf9d697b8d303dac15848381518110610eec57610eec611adb565b602002602001015184604051610f179291906001600160a01b03929092168252602082015260400190565b60405180910390a150610fc3565b610f5c3383858481518110610f3c57610f3c611adb565b60200260200101516001600160a01b031661134b9092919063ffffffff16565b7feaf449319c042c9ba3474fa0c5329eb58cd1f23be110cdbf9d697b8d303dac15838281518110610f8f57610f8f611adb565b602002602001015183604051610fba9291906001600160a01b03929092168252602082015260400190565b60405180910390a15b80610fcd81611b73565b915050610ca3565b6000806000839250826001600160a01b0316631f1fcd516040518163ffffffff1660e01b8152600401602060405180830381865afa15801561101b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103f9190611abe565b9050806001600160a01b0316638119c0656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561107f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a39190611abe565b91509193909250565b6040516370a0823160e01b81523060048201526001600160a01b0380841691633e3a1560918616906370a0823190602401602060405180830381865afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e9190611af1565b6040516001600160e01b031960e084901b168152600481019190915260006024820152604481018490524260648201526084016020604051808303816000875af1158015611170573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cb9190611af1565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156111e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112049190611af1565b600003611221576112216001600160a01b0383168260001961144d565b5050565b61124f827f0000000000000000000000000000000000000000000000000000000000000000611194565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168360405161128a9190611b57565b6000604051808303816000865af19150503d80600081146112c7576040519150601f19603f3d011682016040523d82523d6000602084013e6112cc565b606091505b50915091506112f9828260405180604001604052806005815260200164062d2dcc6d60db1b8152506103d1565b6001821515146103cb5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f720000000000006044820152606401610221565b6040516001600160a01b03831660248201526044810182905261040190849063a9059cbb60e01b90606401610ad6565b60006113d0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115629092919063ffffffff16565b80519091501561040157808060200190518101906113ee9190611b9a565b6104015760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610221565b8015806114c75750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156114a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c59190611af1565b155b6115325760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610221565b6040516001600160a01b03831660248201526044810182905261040190849063095ea7b360e01b90606401610ad6565b6060611571848460008561157b565b90505b9392505050565b6060824710156115dc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610221565b6001600160a01b0385163b6116335760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610221565b600080866001600160a01b0316858760405161164f9190611b57565b60006040518083038185875af1925050503d806000811461168c576040519150601f19603f3d011682016040523d82523d6000602084013e611691565b606091505b50915091506116a18282866116ac565b979650505050505050565b606083156116bb575081611574565b8251156116cb5782518084602001fd5b8160405162461bcd60e51b81526004016102219190611a8b565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b038116811461171057600080fd5b50565b60008083601f84011261172557600080fd5b50813567ffffffffffffffff81111561173d57600080fd5b60208301915083602082850101111561175557600080fd5b9250929050565b6000806000806060858703121561177257600080fd5b843561177d816116fb565b9350602085013567ffffffffffffffff81111561179957600080fd5b6117a587828801611713565b9598909750949560400135949350505050565b60008060008060008060a087890312156117d157600080fd5b86356117dc816116fb565b955060208701356117ec816116fb565b945060408701359350606087013567ffffffffffffffff81111561180f57600080fd5b61181b89828a01611713565b979a9699509497949695608090950135949350505050565b60008060006060848603121561184857600080fd5b8335611853816116fb565b95602085013595506040909401359392505050565b801515811461171057600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156118a7576118a7611876565b604051601f8501601f19908116603f011681019082821181831017156118cf576118cf611876565b816040528093508581528686860111156118e857600080fd5b858560208301376000602087830101525050509392505050565b60008060006060848603121561191757600080fd5b833561192281611868565b9250602084013567ffffffffffffffff8082111561193f57600080fd5b818601915086601f83011261195357600080fd5b6119628783356020850161188c565b9350604086013591508082111561197857600080fd5b508401601f8101861361198a57600080fd5b6119998682356020840161188c565b9150509250925092565b60008060008060008060a087890312156119bc57600080fd5b86356119c7816116fb565b95506020870135945060408701356119de816116fb565b9350606087013567ffffffffffffffff81111561180f57600080fd5b60208082526021908201527f42656566793a20496e7369676e69666963616e7420696e70757420616d6f756e6040820152601d60fa1b606082015260800190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60005b83811015611a7a578181015183820152602001611a62565b838111156103cb5750506000910152565b6020815260008251806020840152611aaa816040850160208701611a5f565b601f01601f19169190910160400192915050565b600060208284031215611ad057600080fd5b8151611574816116fb565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611b0357600080fd5b5051919050565b606080825284519082018190526000906020906080840190828801845b82811015611b4357815184529284019290840190600101611b27565b505050908301949094525060400152919050565b60008251611b69818460208701611a5f565b9190910192915050565b600060018201611b9357634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215611bac57600080fd5b81516115748161186856fea26469706673582212206a76567169946454f766941b22e44391fd76d6c635fc4ad44afe9752d3aed4dd64736f6c634300080f00330000000000000000000000001111111254eeb25477b68fb85ed929f73a9605820000000000000000000000004200000000000000000000000000000000000006
Deployed Bytecode
0x60806040526004361061007f5760003560e01c8063ac3af2081161004e578063ac3af20814610136578063ad5c464814610187578063bb0c8298146101bb578063f068d9c7146101df57600080fd5b80630299d1e6146100c35780632e11d785146100d65780638e9a9d64146100f657806393cf97f81461011657600080fd5b366100be57336001600160a01b037f000000000000000000000000420000000000000000000000000000000000000616146100bc576100bc6116e5565b005b600080fd5b6100bc6100d136600461175c565b6101ff565b3480156100e257600080fd5b506100bc6100f13660046117b8565b61032c565b34801561010257600080fd5b506100bc610111366004611833565b6103b3565b34801561012257600080fd5b506100bc610131366004611902565b6103d1565b34801561014257600080fd5b5061016a7f0000000000000000000000001111111254eeb25477b68fb85ed929f73a96058281565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561019357600080fd5b5061016a7f000000000000000000000000420000000000000000000000000000000000000681565b3480156101c757600080fd5b506101d16103e881565b60405190815260200161017e565b3480156101eb57600080fd5b506100bc6101fa3660046119a3565b610406565b6103e834101561022a5760405162461bcd60e51b8152600401610221906119fa565b60405180910390fd5b7f00000000000000000000000042000000000000000000000000000000000000066001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561028557600080fd5b505af1158015610299573d6000803e3d6000fd5b50505050506102cb847f0000000000000000000000004200000000000000000000000000000000000006858585610674565b7f4fd86e42fdf9189d86bda34d3e693c24264ea2b54ff7796d9e1d40f5e29f4f59847f00000000000000000000000042000000000000000000000000000000000000063460405161031e93929190611a3b565b60405180910390a150505050565b6103e884101561034e5760405162461bcd60e51b8152600401610221906119fa565b6103636001600160a01b038616333087610ab5565b6103708686858585610674565b7f4fd86e42fdf9189d86bda34d3e693c24264ea2b54ff7796d9e1d40f5e29f4f598686866040516103a393929190611a3b565b60405180910390a1505050505050565b60006103c0848484610b0d565b90506103cb81610c9f565b50505050565b826104015781516000036103f9578060405162461bcd60e51b81526004016102219190611a8b565b815182602001fd5b505050565b600080600061041489610fd5565b919450925090506104306001600160a01b03841633308b610ab5565b604051632e1a7d4d60e01b8152600481018990526001600160a01b03841690632e1a7d4d90602401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b505050507fde160ef457e2842f9b597ec662dc8b390d699ba99300cfe5429f960b4bffd2f089888a6040516104bd93929190611a3b565b60405180910390a16104d08183866110ac565b6040805160028082526060820183526000926020830190803683370190505060405162415c3360e91b8152600060048201529091506001600160a01b038416906382b8660090602401602060405180830381865afa158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055a9190611abe565b8160008151811061056d5761056d611adb565b60200260200101906001600160a01b031690816001600160a01b03168152505087816001815181106105a1576105a1611adb565b60200260200101906001600160a01b031690816001600160a01b031681525050610605816000815181106105d7576105d7611adb565b60200260200101517f0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582611194565b61065f8160008151811061061b5761061b611adb565b602002602001015188888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061122592505050565b61066881610c9f565b50505050505050505050565b600080600061068288610fd5565b604080516002808252606082018352949750929550909350600092906020830190803683370190505060405162415c3360e91b8152600060048201529091506001600160a01b038416906382b8660090602401602060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190611abe565b8160008151811061072957610729611adb565b60200260200101906001600160a01b031690816001600160a01b031681525050878160018151811061075d5761075d611adb565b60200260200101906001600160a01b031690816001600160a01b0316815250508060008151811061079057610790611adb565b60200260200101516001600160a01b0316886001600160a01b0316146107f0576107f08888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061122592505050565b6108148160008151811061080657610806611adb565b602002602001015184611194565b6040805160028082526060820183526000926020830190803683370190505090508160008151811061084857610848611adb565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bc9190611af1565b816000815181106108cf576108cf611adb565b6020908102919091010152604051634d49e87d60e01b81526001600160a01b03851690634d49e87d9061090a9084908a904290600401611b0a565b6020604051808303816000875af1158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190611af1565b506109588386611194565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190611af1565b60405163b6b55f2560e01b8152600481018290529091506001600160a01b0387169063b6b55f2590602401600060405180830381600087803b158015610a0857600080fd5b505af1158015610a1c573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152610a9f92503391506001600160a01b038916906370a0823190602401602060405180830381865afa158015610a6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8e9190611af1565b6001600160a01b038916919061134b565b610aa883610c9f565b5050505050505050505050565b6103cb846323b872dd60e01b858585604051602401610ad693929190611a3b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261137b565b60606000806000610b1d87610fd5565b91945092509050610b396001600160a01b038816333089610ab5565b604051632e1a7d4d60e01b8152600481018790526001600160a01b03841690632e1a7d4d90602401600060405180830381600087803b158015610b7b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b50505050610b9e8183876110ac565b60408051600180825281830190925290602080830190803683370190505060405162415c3360e91b8152600060048201529094506001600160a01b038316906382b8660090602401602060405180830381865afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611abe565b84600081518110610c3a57610c3a611adb565b60200260200101906001600160a01b031690816001600160a01b0316815250507fde160ef457e2842f9b597ec662dc8b390d699ba99300cfe5429f960b4bffd2f0878388604051610c8d93929190611a3b565b60405180910390a15050509392505050565b6000805b825181101561040157828181518110610cbe57610cbe611adb565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610d0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d329190611af1565b91508115610fc3577f00000000000000000000000042000000000000000000000000000000000000066001600160a01b0316838281518110610d7657610d76611adb565b60200260200101516001600160a01b031603610f2557604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000042000000000000000000000000000000000000066001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610dee57600080fd5b505af1158015610e02573d6000803e3d6000fd5b5050604080516000808252602082019283905293503392508591610e269190611b57565b60006040518083038185875af1925050503d8060008114610e63576040519150601f19603f3d011682016040523d82523d6000602084013e610e68565b606091505b5050905080610eb95760405162461bcd60e51b815260206004820152601a60248201527f42656566793a20455448207472616e73666572206661696c65640000000000006044820152606401610221565b7feaf449319c042c9ba3474fa0c5329eb58cd1f23be110cdbf9d697b8d303dac15848381518110610eec57610eec611adb565b602002602001015184604051610f179291906001600160a01b03929092168252602082015260400190565b60405180910390a150610fc3565b610f5c3383858481518110610f3c57610f3c611adb565b60200260200101516001600160a01b031661134b9092919063ffffffff16565b7feaf449319c042c9ba3474fa0c5329eb58cd1f23be110cdbf9d697b8d303dac15838281518110610f8f57610f8f611adb565b602002602001015183604051610fba9291906001600160a01b03929092168252602082015260400190565b60405180910390a15b80610fcd81611b73565b915050610ca3565b6000806000839250826001600160a01b0316631f1fcd516040518163ffffffff1660e01b8152600401602060405180830381865afa15801561101b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103f9190611abe565b9050806001600160a01b0316638119c0656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561107f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a39190611abe565b91509193909250565b6040516370a0823160e01b81523060048201526001600160a01b0380841691633e3a1560918616906370a0823190602401602060405180830381865afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e9190611af1565b6040516001600160e01b031960e084901b168152600481019190915260006024820152604481018490524260648201526084016020604051808303816000875af1158015611170573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103cb9190611af1565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa1580156111e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112049190611af1565b600003611221576112216001600160a01b0383168260001961144d565b5050565b61124f827f0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582611194565b6000807f0000000000000000000000001111111254eeb25477b68fb85ed929f73a9605826001600160a01b03168360405161128a9190611b57565b6000604051808303816000865af19150503d80600081146112c7576040519150601f19603f3d011682016040523d82523d6000602084013e6112cc565b606091505b50915091506112f9828260405180604001604052806005815260200164062d2dcc6d60db1b8152506103d1565b6001821515146103cb5760405162461bcd60e51b815260206004820152601a60248201527f63616c6c696e672031696e636820676f7420616e206572726f720000000000006044820152606401610221565b6040516001600160a01b03831660248201526044810182905261040190849063a9059cbb60e01b90606401610ad6565b60006113d0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115629092919063ffffffff16565b80519091501561040157808060200190518101906113ee9190611b9a565b6104015760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610221565b8015806114c75750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156114a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c59190611af1565b155b6115325760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610221565b6040516001600160a01b03831660248201526044810182905261040190849063095ea7b360e01b90606401610ad6565b6060611571848460008561157b565b90505b9392505050565b6060824710156115dc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610221565b6001600160a01b0385163b6116335760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610221565b600080866001600160a01b0316858760405161164f9190611b57565b60006040518083038185875af1925050503d806000811461168c576040519150601f19603f3d011682016040523d82523d6000602084013e611691565b606091505b50915091506116a18282866116ac565b979650505050505050565b606083156116bb575081611574565b8251156116cb5782518084602001fd5b8160405162461bcd60e51b81526004016102219190611a8b565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b038116811461171057600080fd5b50565b60008083601f84011261172557600080fd5b50813567ffffffffffffffff81111561173d57600080fd5b60208301915083602082850101111561175557600080fd5b9250929050565b6000806000806060858703121561177257600080fd5b843561177d816116fb565b9350602085013567ffffffffffffffff81111561179957600080fd5b6117a587828801611713565b9598909750949560400135949350505050565b60008060008060008060a087890312156117d157600080fd5b86356117dc816116fb565b955060208701356117ec816116fb565b945060408701359350606087013567ffffffffffffffff81111561180f57600080fd5b61181b89828a01611713565b979a9699509497949695608090950135949350505050565b60008060006060848603121561184857600080fd5b8335611853816116fb565b95602085013595506040909401359392505050565b801515811461171057600080fd5b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156118a7576118a7611876565b604051601f8501601f19908116603f011681019082821181831017156118cf576118cf611876565b816040528093508581528686860111156118e857600080fd5b858560208301376000602087830101525050509392505050565b60008060006060848603121561191757600080fd5b833561192281611868565b9250602084013567ffffffffffffffff8082111561193f57600080fd5b818601915086601f83011261195357600080fd5b6119628783356020850161188c565b9350604086013591508082111561197857600080fd5b508401601f8101861361198a57600080fd5b6119998682356020840161188c565b9150509250925092565b60008060008060008060a087890312156119bc57600080fd5b86356119c7816116fb565b95506020870135945060408701356119de816116fb565b9350606087013567ffffffffffffffff81111561180f57600080fd5b60208082526021908201527f42656566793a20496e7369676e69666963616e7420696e70757420616d6f756e6040820152601d60fa1b606082015260800190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60005b83811015611a7a578181015183820152602001611a62565b838111156103cb5750506000910152565b6020815260008251806020840152611aaa816040850160208701611a5f565b601f01601f19169190910160400192915050565b600060208284031215611ad057600080fd5b8151611574816116fb565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611b0357600080fd5b5051919050565b606080825284519082018190526000906020906080840190828801845b82811015611b4357815184529284019290840190600101611b27565b505050908301949094525060400152919050565b60008251611b69818460208701611a5f565b9190910192915050565b600060018201611b9357634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215611bac57600080fd5b81516115748161186856fea26469706673582212206a76567169946454f766941b22e44391fd76d6c635fc4ad44afe9752d3aed4dd64736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000001111111254eeb25477b68fb85ed929f73a9605820000000000000000000000004200000000000000000000000000000000000006
-----Decoded View---------------
Arg [0] : _oneInchRouter (address): 0x1111111254EEB25477B68fb85Ed929f73A960582
Arg [1] : _WETH (address): 0x4200000000000000000000000000000000000006
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582
Arg [1] : 0000000000000000000000004200000000000000000000000000000000000006
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.