Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 16 from a total of 16 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Zap | 18775757 | 814 days ago | IN | 0 ETH | 0.01184109 | ||||
| Zap | 18771150 | 814 days ago | IN | 0 ETH | 0.02193367 | ||||
| Zap | 18764359 | 815 days ago | IN | 0 ETH | 0.0160728 | ||||
| Zap | 18763351 | 815 days ago | IN | 0 ETH | 0.01428451 | ||||
| Zap | 18757728 | 816 days ago | IN | 0 ETH | 0.01130848 | ||||
| Zap | 18755262 | 817 days ago | IN | 0 ETH | 0.00871701 | ||||
| Zap | 18755220 | 817 days ago | IN | 0 ETH | 0.01009623 | ||||
| Zap | 18749650 | 817 days ago | IN | 0 ETH | 0.0170501 | ||||
| Zap | 18744443 | 818 days ago | IN | 0 ETH | 0.01658104 | ||||
| Zap | 18744433 | 818 days ago | IN | 0 ETH | 0.0017957 | ||||
| Add Zap | 18742644 | 818 days ago | IN | 0 ETH | 0.00492126 | ||||
| Add Zap | 18742644 | 818 days ago | IN | 0 ETH | 0.00392502 | ||||
| Remove Zap | 18742628 | 818 days ago | IN | 0 ETH | 0.00159359 | ||||
| Remove Zap | 18742627 | 818 days ago | IN | 0 ETH | 0.00159744 | ||||
| Add Zap | 18742530 | 818 days ago | IN | 0 ETH | 0.00478165 | ||||
| Add Zap | 18742528 | 818 days ago | IN | 0 ETH | 0.00469616 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x6bb3Da61...7f2AE7f18 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
PotionDaoZapWethSwap
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `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);
/**
* @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);
}
// File @openzeppelin/contracts/utils/Address.sol@v4.5.0
// OpenZeppelin Contracts (last updated v4.5.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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol@v4.5.0
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File @openzeppelin/contracts/utils/Context.sol@v4.5.0
// 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;
}
}
// File @openzeppelin/contracts/access/Ownable.sol@v4.5.0
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev 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 {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File @openzeppelin/contracts/security/ReentrancyGuard.sol@v4.5.0
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol@v1.1.0-beta.0
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts);
}
// File @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol@v1.1.0-beta.0
pragma solidity >=0.6.2;
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
// File @uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol@v1.0.1
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
event Swap(address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint256);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function price0CumulativeLast() external view returns (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function burn(address to) external returns (uint256 amount0, uint256 amount1);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File contracts/interfaces/IPotionDaoChef.sol
pragma solidity 0.8.4;
interface IPotionDaoChef {
function lpToken(uint256 pid) external view returns (IERC20);
function deposit(
uint256 pid,
uint256 amount,
address to
) external;
}
// File contracts/libs/Babylonian.sol
pragma solidity 0.8.4;
// computes square roots using the babylonian method
// https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
library Babylonian {
function sqrt(uint256 y) internal pure returns (uint256 z) {
if (y > 3) {
z = y;
uint256 x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
// else z = 0
}
}
// File contracts/farms/PotionDaoZapWethSwap.sol
pragma solidity 0.8.4;
/*
PotionDaoZap is a ZapperFi's simplified version of zapper contract which will:
1. use ETH to swap to target token
2. make LP between ETH and target token
3. add into PotionDaoChef farm
*/
contract PotionDaoZapWethSwap is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
struct ZapInfo {
uint256 pid;
IERC20 token0;
IERC20 token;
bool inactive;
}
ZapInfo[] public zaps;
IPotionDaoChef public PotionDaoChef;
IUniswapV2Router02 public uniRouter;
constructor(address _PotionDaoChef, address _uniRouter,address initialOwner) {
require(_PotionDaoChef != address(0), "Zap::constructor: Invalid address");
require(_uniRouter != address(0), "Zap::constructor: Invalid address");
PotionDaoChef = IPotionDaoChef(_PotionDaoChef);
uniRouter = IUniswapV2Router02(_uniRouter);
transferOwnership(initialOwner);
}
// ========= MUTATIVE FUNCTION ==============
/// @notice Zap function to receive WETH, swap for opposing token,
/// add liquidity, and deposit LP to farm
/// @param _zapId: Id of the zap configuration
/// @param _minLiquidity: Minimum amount of LP received
/// @param _transferResidual: Flag to determine to transfer dust back to user
function zap(
uint256 _zapId,
uint256 _minLiquidity,
uint256 _ethIn,
bool _transferResidual
) external nonReentrant {
ZapInfo memory _info = zaps[_zapId];
require(!_info.inactive, "Zap::zap: Zap configuration is inactive");
IERC20(_info.token0).safeTransferFrom(msg.sender, address(this), _ethIn);
address _lp = address(PotionDaoChef.lpToken(_info.pid));
require(_lp != address(0), "Zap::zap: Invalid LP");
// STEP 1: Swap or Mint token
(uint256 _ethAmtToSwap, uint256 _tokenAmtToAddLP) = swap(_lp, _ethIn, address(_info.token));
// STEP 2: Add liquditiy
uint256 _ethAmtToAddLP = _ethIn - _ethAmtToSwap;
approveToken(address(_info.token0), address(uniRouter), _ethAmtToAddLP);
approveToken(address(_info.token), address(uniRouter), _tokenAmtToAddLP);
(uint256 _ethAmtUsedInLp, uint256 _tokenAmtUsedInLp, uint256 _liquidity) = uniRouter.addLiquidity(
address(_info.token0),
address(_info.token),
_ethAmtToAddLP,
_tokenAmtToAddLP,
1,
1,
address(this),
block.timestamp
);
require(_liquidity >= _minLiquidity, "Zap::zap: Slippage. < minLiquidity");
// STEP 3: Deposit LP to Farm
approveToken(_lp, address(PotionDaoChef), _liquidity);
PotionDaoChef.deposit(_info.pid, _liquidity, msg.sender);
// STEP 4: Clean up dust
if (_transferResidual) {
if (_tokenAmtToAddLP > _tokenAmtUsedInLp) {
_info.token.safeTransfer(msg.sender, _tokenAmtToAddLP - _tokenAmtUsedInLp);
}
if (_ethAmtToAddLP > _ethAmtUsedInLp) {
IERC20(_info.token0).safeTransfer(msg.sender, _ethAmtToAddLP - _ethAmtUsedInLp);
}
}
emit Zapped(_zapId, _ethIn, _liquidity);
}
/// @notice Swap internal function to swap from ETH to target Token with calculation
/// for the appropriate amount of ETH will be used to swap in order to minimize dust
/// @param _lp: address of the LP pair between WETH and Token
/// @param _ethIn: Amount of ETH input
/// @param _token: address of target Token
function swap(
address _lp,
uint256 _ethIn,
address _token
) internal returns (uint256 _ethAmtToSwap, uint256 _tokenAmtReceived) {
address _token0 = IUniswapV2Pair(_lp).token0();
address _fromToken = _token0;
(uint256 _res0, uint256 _res1, ) = IUniswapV2Pair(_lp).getReserves();
if (_token == _token0) {
_ethAmtToSwap = calculateSwapInAmount(_res1, _ethIn);
_fromToken = IUniswapV2Pair(_lp).token1();
} else {
_ethAmtToSwap = calculateSwapInAmount(_res0, _ethIn);
}
if (_ethAmtToSwap <= 0) _ethAmtToSwap = _ethIn / 2;
_tokenAmtReceived = doSwapETH(_fromToken, _token, _ethAmtToSwap);
}
/// @notice Swap internal function to swap from ETH to target Token
/// @param _fromToken: address of base Token
/// @param _toToken: address of target Token
/// @param _ethAmt: Amount of ETH input
function doSwapETH(
address _fromToken,
address _toToken,
uint256 _ethAmt
) internal returns (uint256 _tokenReceived) {
address[] memory _path = new address[](2);
_path[0] = _fromToken;
_path[1] = _toToken;
approveToken(_fromToken, address(uniRouter), _ethAmt);
_tokenReceived = uniRouter.swapExactTokensForTokens(_ethAmt, 1, _path, address(this), block.timestamp)[_path.length - 1];
require(_tokenReceived > 0, "Zap::doSwapETH: Error Swapping Tokens 2");
}
/// @notice Safe approve spending of an token for an address
/// @param _token: address of target Token
/// @param _spender: address of spender
/// @param _amount: Amount of token can be spent
function approveToken(
address _token,
address _spender,
uint256 _amount
) internal {
IERC20 _erc20Token = IERC20(_token);
_erc20Token.safeApprove(_spender, 0);
_erc20Token.safeApprove(_spender, _amount);
}
/// @notice calculate amount to swap just enough so least dust will be leftover when adding liquidity
/// 0.17% swap fee
/// @param _reserveIn: Amount of Reserve for the target token
/// @param _tokenIn: Amount of total input
function calculateSwapInAmount(uint256 _reserveIn, uint256 _tokenIn) internal pure returns (uint256) {
uint256 swapFee = 17;
uint256 D = 10000; // denominator
uint256 R = D - swapFee; // r number
return (Babylonian.sqrt(_reserveIn * ((_tokenIn * 4 * D * R) + (_reserveIn * (D + R) * (D + R)))) - (_reserveIn * (R + D))) / (R * 2);
}
// ========= RESTRICTIVE FUNCTIONS ==============
/// @notice Add new zap configuration
/// @param _token0: address of base Token (MMF / MUSD)
/// @param _token: address of target Token
/// @param _pid: pid in the target farm
function addZap(
address _token0,
address _token,
uint256 _pid
) external onlyOwner returns (uint256 _zapId) {
require(_token != address(0), "Zap::addZap: Invalid address");
zaps.push(ZapInfo({token0: IERC20(_token0), token: IERC20(_token), pid: _pid, inactive: false}));
_zapId = zaps.length - 1;
emit ZapAdded(_zapId, _token0, _token, _pid);
}
/// @notice Deactivate a Zap configuration
/// @param _zapId: Id of the zap configuration
function removeZap(uint256 _zapId) external onlyOwner {
require(zaps.length > _zapId, "Zap::removeZap: Invalid zapId");
ZapInfo storage info = zaps[_zapId];
info.inactive = true;
emit ZapRemoved(_zapId);
}
// ========= EVENTS ==============
event ZapAdded(uint256 _id, address _token0, address _token, uint256 _pid);
event ZapRemoved(uint256 _id);
event Zapped(uint256 _zapId, uint256 _amount, uint256 _liquidity);
}{
"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":"_PotionDaoChef","type":"address"},{"internalType":"address","name":"_uniRouter","type":"address"},{"internalType":"address","name":"initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"address","name":"_token0","type":"address"},{"indexed":false,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"ZapAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"ZapRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_zapId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_liquidity","type":"uint256"}],"name":"Zapped","type":"event"},{"inputs":[],"name":"PotionDaoChef","outputs":[{"internalType":"contract IPotionDaoChef","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"addZap","outputs":[{"internalType":"uint256","name":"_zapId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_zapId","type":"uint256"}],"name":"removeZap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniRouter","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_zapId","type":"uint256"},{"internalType":"uint256","name":"_minLiquidity","type":"uint256"},{"internalType":"uint256","name":"_ethIn","type":"uint256"},{"internalType":"bool","name":"_transferResidual","type":"bool"}],"name":"zap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"zaps","outputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"contract IERC20","name":"token0","type":"address"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"bool","name":"inactive","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60806040523480156200001157600080fd5b5060405162001b2b38038062001b2b83398101604081905262000034916200026b565b6200003f336200012d565b600180556001600160a01b038316620000985760405162461bcd60e51b8152602060048201526021602482015260008051602062001b0b8339815191526044820152607360f81b60648201526084015b60405180910390fd5b6001600160a01b038216620000e95760405162461bcd60e51b8152602060048201526021602482015260008051602062001b0b8339815191526044820152607360f81b60648201526084016200008f565b600380546001600160a01b038086166001600160a01b031992831617909255600480549285169290911691909117905562000124816200017d565b505050620002b4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620001d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200008f565b6001600160a01b038116620002405760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200008f565b6200024b816200012d565b50565b80516001600160a01b03811681146200026657600080fd5b919050565b60008060006060848603121562000280578283fd5b6200028b846200024e565b92506200029b602085016200024e565b9150620002ab604085016200024e565b90509250925092565b61184780620002c46000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80639d8872b4116100665780639d8872b414610100578063a0e47bf614610113578063a26ddc3614610126578063b55c675b14610139578063f2fde38b1461017e57600080fd5b80633db0241614610098578063715018a6146100be5780638da5cb5b146100c85780638fbfe542146100ed575b600080fd5b6100ab6100a636600461142d565b610191565b6040519081526020015b60405180910390f35b6100c6610377565b005b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100b5565b6100c66100fb366004611597565b6103ad565b6100c661010e3660046115f4565b6104ab565b6004546100d5906001600160a01b031681565b6003546100d5906001600160a01b031681565b61014c610147366004611597565b61097b565b6040516100b594939291909384526001600160a01b039283166020850152911660408301521515606082015260800190565b6100c661018c3660046113f5565b6109c7565b600080546001600160a01b031633146101c55760405162461bcd60e51b81526004016101bc90611683565b60405180910390fd5b6001600160a01b03831661021b5760405162461bcd60e51b815260206004820152601c60248201527f5a61703a3a6164645a61703a20496e76616c696420616464726573730000000060448201526064016101bc565b604080516080810182528381526001600160a01b038681166020830190815286821693830193845260006060840181815260028054600180820183559382905295517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace60039097029687015592517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf860180546001600160a01b03191691861691909117905594517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad090940180549551949093166001600160a81b031990951694909417600160a01b931515939093029290921790555461031c919061177f565b604080518281526001600160a01b0387811660208301528616818301526060810185905290519192507f049b535ce8b71cb27058fe54432cb16418a4fd63341bab3e499da9ddc029b963919081900360800190a19392505050565b6000546001600160a01b031633146103a15760405162461bcd60e51b81526004016101bc90611683565b6103ab6000610a62565b565b6000546001600160a01b031633146103d75760405162461bcd60e51b81526004016101bc90611683565b60025481106104285760405162461bcd60e51b815260206004820152601d60248201527f5a61703a3a72656d6f76655a61703a20496e76616c6964207a6170496400000060448201526064016101bc565b60006002828154811061044b57634e487b7160e01b600052603260045260246000fd5b6000918252602091829020600390910201600281018054600160a01b60ff60a01b199091161790556040518481529092507fd9ced4406d2def1d2548558e9ebd2401bff001973d83d63a1213b6b7cc092805910160405180910390a15050565b600260015414156104fe5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101bc565b600260018190555060006002858154811061052957634e487b7160e01b600052603260045260246000fd5b6000918252602091829020604080516080810182526003939093029091018054835260018101546001600160a01b03908116948401949094526002015492831690820152600160a01b90910460ff1615801560608301529091506105df5760405162461bcd60e51b815260206004820152602760248201527f5a61703a3a7a61703a205a617020636f6e66696775726174696f6e20697320696044820152666e61637469766560c81b60648201526084016101bc565b60208101516105f9906001600160a01b0316333086610ab2565b60035481516040516378ed5d1f60e01b815260048101919091526000916001600160a01b0316906378ed5d1f9060240160206040518083038186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106799190611411565b90506001600160a01b0381166106c85760405162461bcd60e51b815260206004820152601460248201527305a61703a3a7a61703a20496e76616c6964204c560641b60448201526064016101bc565b6000806106da83878660400151610b23565b909250905060006106eb838861177f565b6020860151600454919250610709916001600160a01b031683610d05565b604085015160045461072591906001600160a01b031684610d05565b600480546020870151604080890151905162e8e33760e81b81526001600160a01b039283169481019490945281166024840152604483018490526064830185905260016084840181905260a48401523060c48401524260e484015260009283928392169063e8e337009061010401606060405180830381600087803b1580156107ad57600080fd5b505af11580156107c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e591906115c7565b9250925092508a8110156108465760405162461bcd60e51b815260206004820152602260248201527f5a61703a3a7a61703a20536c6970706167652e203c206d696e4c697175696469604482015261747960f01b60648201526084016101bc565b60035461085e9088906001600160a01b031683610d05565b6003548851604051638dbdbe6d60e01b81526004810191909152602481018390523360448201526001600160a01b0390911690638dbdbe6d90606401600060405180830381600087803b1580156108b457600080fd5b505af11580156108c8573d6000803e3d6000fd5b50505050881561092857818511156108fd576108fd336108e8848861177f565b60408b01516001600160a01b03169190610d2f565b828411156109285761092833610913858761177f565b60208b01516001600160a01b03169190610d2f565b604080518d8152602081018c90529081018290527fbc031082cd605f1f98d7e700cdbf802645f15dd7a88847dbc5bc61d518d87b149060600160405180910390a150506001805550505050505050505050565b6002818154811061098b57600080fd5b60009182526020909120600390910201805460018201546002909201549092506001600160a01b0391821691811690600160a01b900460ff1684565b6000546001600160a01b031633146109f15760405162461bcd60e51b81526004016101bc90611683565b6001600160a01b038116610a565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101bc565b610a5f81610a62565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610b1d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d64565b50505050565b6000806000856001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6157600080fd5b505afa158015610b75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b999190611411565b90506000819050600080886001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610bdc57600080fd5b505afa158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190611549565b506001600160701b031691506001600160701b03169150836001600160a01b0316876001600160a01b03161415610cc957610c4f8189610e36565b9550886001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190611411565b9250610cd6565b610cd38289610e36565b95505b60008611610cec57610ce9600289611740565b95505b610cf7838888610eec565b945050505050935093915050565b82610d1b6001600160a01b0382168460006110c7565b610b1d6001600160a01b03821684846110c7565b6040516001600160a01b038316602482015260448101829052610d5f90849063a9059cbb60e01b90606401610ae6565b505050565b6000610db9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111eb9092919063ffffffff16565b805190915015610d5f5780806020019051810190610dd7919061152d565b610d5f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101bc565b6000601161271082610e48838361177f565b9050610e55816002611760565b610e5f8383611728565b610e699088611760565b610ece610e768486611728565b610e808587611728565b610e8a908b611760565b610e949190611760565b8486610ea18b6004611760565b610eab9190611760565b610eb59190611760565b610ebf9190611728565b610ec9908a611760565b611204565b610ed8919061177f565b610ee29190611740565b9695505050505050565b604080516002808252606082018352600092839291906020830190803683370190505090508481600081518110610f3357634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110610f7557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600454610f9b9187911685610d05565b600480546040516338ed173960e01b81526001600160a01b03909116916338ed173991610fd3918791600191879130914291016116b8565b600060405180830381600087803b158015610fed57600080fd5b505af1158015611001573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611029919081019061146d565b60018251611037919061177f565b8151811061105557634e487b7160e01b600052603260045260246000fd5b60200260200101519150600082116110bf5760405162461bcd60e51b815260206004820152602760248201527f5a61703a3a646f537761704554483a204572726f72205377617070696e67205460448201526637b5b2b739901960c91b60648201526084016101bc565b509392505050565b8015806111505750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561111657600080fd5b505afa15801561112a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114e91906115af565b155b6111bb5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016101bc565b6040516001600160a01b038316602482015260448101829052610d5f90849063095ea7b360e01b90606401610ae6565b60606111fa8484600085611274565b90505b9392505050565b60006003821115611265575080600061121e600283611740565b611229906001611728565b90505b8181101561125f579050806002816112448186611740565b61124e9190611728565b6112589190611740565b905061122c565b50919050565b811561126f575060015b919050565b6060824710156112d55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101bc565b6001600160a01b0385163b61132c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101bc565b600080866001600160a01b031685876040516113489190611634565b60006040518083038185875af1925050503d8060008114611385576040519150601f19603f3d011682016040523d82523d6000602084013e61138a565b606091505b509150915061139a8282866113a5565b979650505050505050565b606083156113b45750816111fd565b8251156113c45782518084602001fd5b8160405162461bcd60e51b81526004016101bc9190611650565b80516001600160701b038116811461126f57600080fd5b600060208284031215611406578081fd5b81356111fd816117ee565b600060208284031215611422578081fd5b81516111fd816117ee565b600080600060608486031215611441578182fd5b833561144c816117ee565b9250602084013561145c816117ee565b929592945050506040919091013590565b6000602080838503121561147f578182fd5b825167ffffffffffffffff80821115611496578384fd5b818501915085601f8301126114a9578384fd5b8151818111156114bb576114bb6117d8565b8060051b604051601f19603f830116810181811085821117156114e0576114e06117d8565b604052828152858101935084860182860187018a10156114fe578788fd5b8795505b83861015611520578051855260019590950194938601938601611502565b5098975050505050505050565b60006020828403121561153e578081fd5b81516111fd81611803565b60008060006060848603121561155d578283fd5b611566846113de565b9250611574602085016113de565b9150604084015163ffffffff8116811461158c578182fd5b809150509250925092565b6000602082840312156115a8578081fd5b5035919050565b6000602082840312156115c0578081fd5b5051919050565b6000806000606084860312156115db578283fd5b8351925060208401519150604084015190509250925092565b60008060008060808587031215611609578081fd5b843593506020850135925060408501359150606085013561162981611803565b939692955090935050565b60008251611646818460208701611796565b9190910192915050565b602081526000825180602084015261166f816040850160208701611796565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156117075784516001600160a01b0316835293830193918301916001016116e2565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561173b5761173b6117c2565b500190565b60008261175b57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561177a5761177a6117c2565b500290565b600082821015611791576117916117c2565b500390565b60005b838110156117b1578181015183820152602001611799565b83811115610b1d5750506000910152565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a5f57600080fd5b8015158114610a5f57600080fdfea26469706673582212209241e2edf94b2257b524f330684c82dfbb1a3e97950b32bd0fd488eca66f569964736f6c634300080400335a61703a3a636f6e7374727563746f723a20496e76616c696420616464726573000000000000000000000000a5b341f6e931b6a510420e9030ef15ac17b8946c0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000fadf60115930f3cd497ac01da7b9ce551facfd38
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80639d8872b4116100665780639d8872b414610100578063a0e47bf614610113578063a26ddc3614610126578063b55c675b14610139578063f2fde38b1461017e57600080fd5b80633db0241614610098578063715018a6146100be5780638da5cb5b146100c85780638fbfe542146100ed575b600080fd5b6100ab6100a636600461142d565b610191565b6040519081526020015b60405180910390f35b6100c6610377565b005b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100b5565b6100c66100fb366004611597565b6103ad565b6100c661010e3660046115f4565b6104ab565b6004546100d5906001600160a01b031681565b6003546100d5906001600160a01b031681565b61014c610147366004611597565b61097b565b6040516100b594939291909384526001600160a01b039283166020850152911660408301521515606082015260800190565b6100c661018c3660046113f5565b6109c7565b600080546001600160a01b031633146101c55760405162461bcd60e51b81526004016101bc90611683565b60405180910390fd5b6001600160a01b03831661021b5760405162461bcd60e51b815260206004820152601c60248201527f5a61703a3a6164645a61703a20496e76616c696420616464726573730000000060448201526064016101bc565b604080516080810182528381526001600160a01b038681166020830190815286821693830193845260006060840181815260028054600180820183559382905295517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace60039097029687015592517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf860180546001600160a01b03191691861691909117905594517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad090940180549551949093166001600160a81b031990951694909417600160a01b931515939093029290921790555461031c919061177f565b604080518281526001600160a01b0387811660208301528616818301526060810185905290519192507f049b535ce8b71cb27058fe54432cb16418a4fd63341bab3e499da9ddc029b963919081900360800190a19392505050565b6000546001600160a01b031633146103a15760405162461bcd60e51b81526004016101bc90611683565b6103ab6000610a62565b565b6000546001600160a01b031633146103d75760405162461bcd60e51b81526004016101bc90611683565b60025481106104285760405162461bcd60e51b815260206004820152601d60248201527f5a61703a3a72656d6f76655a61703a20496e76616c6964207a6170496400000060448201526064016101bc565b60006002828154811061044b57634e487b7160e01b600052603260045260246000fd5b6000918252602091829020600390910201600281018054600160a01b60ff60a01b199091161790556040518481529092507fd9ced4406d2def1d2548558e9ebd2401bff001973d83d63a1213b6b7cc092805910160405180910390a15050565b600260015414156104fe5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101bc565b600260018190555060006002858154811061052957634e487b7160e01b600052603260045260246000fd5b6000918252602091829020604080516080810182526003939093029091018054835260018101546001600160a01b03908116948401949094526002015492831690820152600160a01b90910460ff1615801560608301529091506105df5760405162461bcd60e51b815260206004820152602760248201527f5a61703a3a7a61703a205a617020636f6e66696775726174696f6e20697320696044820152666e61637469766560c81b60648201526084016101bc565b60208101516105f9906001600160a01b0316333086610ab2565b60035481516040516378ed5d1f60e01b815260048101919091526000916001600160a01b0316906378ed5d1f9060240160206040518083038186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106799190611411565b90506001600160a01b0381166106c85760405162461bcd60e51b815260206004820152601460248201527305a61703a3a7a61703a20496e76616c6964204c560641b60448201526064016101bc565b6000806106da83878660400151610b23565b909250905060006106eb838861177f565b6020860151600454919250610709916001600160a01b031683610d05565b604085015160045461072591906001600160a01b031684610d05565b600480546020870151604080890151905162e8e33760e81b81526001600160a01b039283169481019490945281166024840152604483018490526064830185905260016084840181905260a48401523060c48401524260e484015260009283928392169063e8e337009061010401606060405180830381600087803b1580156107ad57600080fd5b505af11580156107c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e591906115c7565b9250925092508a8110156108465760405162461bcd60e51b815260206004820152602260248201527f5a61703a3a7a61703a20536c6970706167652e203c206d696e4c697175696469604482015261747960f01b60648201526084016101bc565b60035461085e9088906001600160a01b031683610d05565b6003548851604051638dbdbe6d60e01b81526004810191909152602481018390523360448201526001600160a01b0390911690638dbdbe6d90606401600060405180830381600087803b1580156108b457600080fd5b505af11580156108c8573d6000803e3d6000fd5b50505050881561092857818511156108fd576108fd336108e8848861177f565b60408b01516001600160a01b03169190610d2f565b828411156109285761092833610913858761177f565b60208b01516001600160a01b03169190610d2f565b604080518d8152602081018c90529081018290527fbc031082cd605f1f98d7e700cdbf802645f15dd7a88847dbc5bc61d518d87b149060600160405180910390a150506001805550505050505050505050565b6002818154811061098b57600080fd5b60009182526020909120600390910201805460018201546002909201549092506001600160a01b0391821691811690600160a01b900460ff1684565b6000546001600160a01b031633146109f15760405162461bcd60e51b81526004016101bc90611683565b6001600160a01b038116610a565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101bc565b610a5f81610a62565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610b1d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d64565b50505050565b6000806000856001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6157600080fd5b505afa158015610b75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b999190611411565b90506000819050600080886001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610bdc57600080fd5b505afa158015610bf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c149190611549565b506001600160701b031691506001600160701b03169150836001600160a01b0316876001600160a01b03161415610cc957610c4f8189610e36565b9550886001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190611411565b9250610cd6565b610cd38289610e36565b95505b60008611610cec57610ce9600289611740565b95505b610cf7838888610eec565b945050505050935093915050565b82610d1b6001600160a01b0382168460006110c7565b610b1d6001600160a01b03821684846110c7565b6040516001600160a01b038316602482015260448101829052610d5f90849063a9059cbb60e01b90606401610ae6565b505050565b6000610db9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111eb9092919063ffffffff16565b805190915015610d5f5780806020019051810190610dd7919061152d565b610d5f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101bc565b6000601161271082610e48838361177f565b9050610e55816002611760565b610e5f8383611728565b610e699088611760565b610ece610e768486611728565b610e808587611728565b610e8a908b611760565b610e949190611760565b8486610ea18b6004611760565b610eab9190611760565b610eb59190611760565b610ebf9190611728565b610ec9908a611760565b611204565b610ed8919061177f565b610ee29190611740565b9695505050505050565b604080516002808252606082018352600092839291906020830190803683370190505090508481600081518110610f3357634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110610f7557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600454610f9b9187911685610d05565b600480546040516338ed173960e01b81526001600160a01b03909116916338ed173991610fd3918791600191879130914291016116b8565b600060405180830381600087803b158015610fed57600080fd5b505af1158015611001573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611029919081019061146d565b60018251611037919061177f565b8151811061105557634e487b7160e01b600052603260045260246000fd5b60200260200101519150600082116110bf5760405162461bcd60e51b815260206004820152602760248201527f5a61703a3a646f537761704554483a204572726f72205377617070696e67205460448201526637b5b2b739901960c91b60648201526084016101bc565b509392505050565b8015806111505750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561111657600080fd5b505afa15801561112a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114e91906115af565b155b6111bb5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016101bc565b6040516001600160a01b038316602482015260448101829052610d5f90849063095ea7b360e01b90606401610ae6565b60606111fa8484600085611274565b90505b9392505050565b60006003821115611265575080600061121e600283611740565b611229906001611728565b90505b8181101561125f579050806002816112448186611740565b61124e9190611728565b6112589190611740565b905061122c565b50919050565b811561126f575060015b919050565b6060824710156112d55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101bc565b6001600160a01b0385163b61132c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101bc565b600080866001600160a01b031685876040516113489190611634565b60006040518083038185875af1925050503d8060008114611385576040519150601f19603f3d011682016040523d82523d6000602084013e61138a565b606091505b509150915061139a8282866113a5565b979650505050505050565b606083156113b45750816111fd565b8251156113c45782518084602001fd5b8160405162461bcd60e51b81526004016101bc9190611650565b80516001600160701b038116811461126f57600080fd5b600060208284031215611406578081fd5b81356111fd816117ee565b600060208284031215611422578081fd5b81516111fd816117ee565b600080600060608486031215611441578182fd5b833561144c816117ee565b9250602084013561145c816117ee565b929592945050506040919091013590565b6000602080838503121561147f578182fd5b825167ffffffffffffffff80821115611496578384fd5b818501915085601f8301126114a9578384fd5b8151818111156114bb576114bb6117d8565b8060051b604051601f19603f830116810181811085821117156114e0576114e06117d8565b604052828152858101935084860182860187018a10156114fe578788fd5b8795505b83861015611520578051855260019590950194938601938601611502565b5098975050505050505050565b60006020828403121561153e578081fd5b81516111fd81611803565b60008060006060848603121561155d578283fd5b611566846113de565b9250611574602085016113de565b9150604084015163ffffffff8116811461158c578182fd5b809150509250925092565b6000602082840312156115a8578081fd5b5035919050565b6000602082840312156115c0578081fd5b5051919050565b6000806000606084860312156115db578283fd5b8351925060208401519150604084015190509250925092565b60008060008060808587031215611609578081fd5b843593506020850135925060408501359150606085013561162981611803565b939692955090935050565b60008251611646818460208701611796565b9190910192915050565b602081526000825180602084015261166f816040850160208701611796565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156117075784516001600160a01b0316835293830193918301916001016116e2565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561173b5761173b6117c2565b500190565b60008261175b57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561177a5761177a6117c2565b500290565b600082821015611791576117916117c2565b500390565b60005b838110156117b1578181015183820152602001611799565b83811115610b1d5750506000910152565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a5f57600080fd5b8015158114610a5f57600080fdfea26469706673582212209241e2edf94b2257b524f330684c82dfbb1a3e97950b32bd0fd488eca66f569964736f6c63430008040033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.