More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,009 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Distribute All | 20496544 | 168 days ago | IN | 0 ETH | 0.00007401 | ||||
Distribute All | 19289320 | 337 days ago | IN | 0 ETH | 0.00225573 | ||||
Swap To Native V... | 19238139 | 344 days ago | IN | 0 ETH | 0.00374283 | ||||
Distribute All | 18766731 | 410 days ago | IN | 0 ETH | 0.00207106 | ||||
Swap Native To V... | 18760221 | 411 days ago | IN | 0.89 ETH | 0.00687122 | ||||
Swap To Native V... | 18713206 | 418 days ago | IN | 0 ETH | 0.00779708 | ||||
Swap Native To V... | 18691254 | 421 days ago | IN | 0.077217 ETH | 0.00527328 | ||||
Swap Token V2 | 18651648 | 427 days ago | IN | 0.00032048 ETH | 0.00462111 | ||||
Swap Native To V... | 18650291 | 427 days ago | IN | 0.975819 ETH | 0.00416706 | ||||
Swap Native To V... | 18646173 | 427 days ago | IN | 0.2273554 ETH | 0.00353648 | ||||
Swap Native To V... | 18644388 | 428 days ago | IN | 0.044369 ETH | 0.00515416 | ||||
Swap To Native V... | 18636771 | 429 days ago | IN | 0 ETH | 0.0041965 | ||||
Swap Native To V... | 18634588 | 429 days ago | IN | 0.04198 ETH | 0.00547085 | ||||
Swap Token V2 | 18632062 | 429 days ago | IN | 0.0009004 ETH | 0.00812274 | ||||
Swap Native To V... | 18631417 | 429 days ago | IN | 0.019837 ETH | 0.00688201 | ||||
Swap Native To V... | 18631321 | 429 days ago | IN | 0.113756 ETH | 0.0051144 | ||||
Swap Native To V... | 18627348 | 430 days ago | IN | 0.04068 ETH | 0.00551997 | ||||
Swap Native To V... | 18620011 | 431 days ago | IN | 0.071048 ETH | 0.00418829 | ||||
Swap Native To V... | 18619881 | 431 days ago | IN | 0.09364228 ETH | 0.00422758 | ||||
Swap Native To V... | 18618884 | 431 days ago | IN | 0.09517 ETH | 0.0064352 | ||||
Swap Native To V... | 18615347 | 432 days ago | IN | 0.04932 ETH | 0.00475894 | ||||
Swap Native To V... | 18611927 | 432 days ago | IN | 0.04956948 ETH | 0.00933514 | ||||
Swap Token V2 | 18610250 | 432 days ago | IN | 0.00018507 ETH | 0.00459962 | ||||
Swap Native To V... | 18608308 | 433 days ago | IN | 0.017888 ETH | 0.0049159 | ||||
Swap Native To V... | 18602681 | 433 days ago | IN | 0.26 ETH | 0.00288296 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|
21233749 | 65 days ago | 0 ETH | |||||
21233749 | 65 days ago | 0 ETH | |||||
21233749 | 65 days ago | 0 ETH | |||||
21233749 | 65 days ago | 0 ETH | |||||
21233749 | 65 days ago | 0 ETH | |||||
21233749 | 65 days ago | 0.06677454 ETH | |||||
21233749 | 65 days ago | 0.06726491 ETH | |||||
21233749 | 65 days ago | 0 ETH | |||||
21233749 | 65 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0.08841547 ETH | |||||
21103925 | 83 days ago | 0.08906476 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
21103925 | 83 days ago | 0 ETH | |||||
20818281 | 123 days ago | 0 ETH | |||||
20818281 | 123 days ago | 0 ETH | |||||
20818281 | 123 days ago | 0 ETH | |||||
20818281 | 123 days ago | 0 ETH | |||||
20818281 | 123 days ago | 0 ETH | |||||
20818281 | 123 days ago | 0.00775053 ETH | |||||
20818281 | 123 days ago | 0.00780745 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
InternetMoneySwapRouter
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./OracleReader.sol"; import "./interfaces/IWETH.sol"; import "./Migratable.sol"; import "./Utils.sol"; /** * @title contract for swapping tokens * @notice use this contract for only the most basic simulation * @dev function calls are currently implemented without side effects * @notice multicall was not included here because sender * is less relevant outside of a swap * which already allows for multiple swaps */ contract InternetMoneySwapRouter is Ownable, Migratable, Utils, OracleReader { using Address for address payable; using SafeERC20 for IERC20; /** a single dex entry */ struct Dex { uint64 id; address router; bool disabled; string name; } Dex[] public dexInfo; error DexConflict(uint256 dexIndex); error DexDisabled(); error NativeMissing(uint256 pathIndex); error FeeMissing(uint256 expected, uint256 provided, string message); error DestinationMissing(); /** * returns all relevant dex info needed to render clients * @return _dexInfo the array of dexes as a DexInfo array * @return _wNative the wrapped native address * @return _destination destination of fees * @return _fee fee numerator as an int constant * @return _feeDenominator constant at 100_000 */ function allDexInfo() public view returns( Dex[] memory _dexInfo, address _wNative, address _destination, uint256 _fee, uint256 _feeDenominator ) { _dexInfo = dexInfo; _wNative = wNative; _destination = destination; _fee = fee; _feeDenominator = feeDenominator; } /** * where the fees will end up * @notice this address cannot be updated after it is set during constructor * @notice the destination must be payable + have a receive function * that has gas consumption less than limit */ address payable public immutable destination; /** * @notice map a router to a dex to check * if the router was already added, the addition should fail */ mapping(address => uint256) public routerToDex; event AddDex(address indexed executor, uint256 indexed dexId); event UpdateDex(address indexed executor, uint256 indexed dexId); /** * sets up the wallet swap contract * @param _destination where native currency will be sent * @param _wNative the address that is used to wrap and unwrap tokens * @notice wNative does not have to have the name wNative * it is just a placeholder for wrapped native currency * @notice the destination address must have a receive / fallback method * to receive native currency */ constructor( address payable _destination, address payable _wNative, uint96 _fee ) OracleReader(_wNative, _destination == address(0) ? 0 : _fee) { destination = _destination; } receive() external payable { // the protocol thanks you for your donation if (destination == address(0)) { revert DestinationMissing(); } } /** * @notice Add new Dex * @dev This also generate id of the Dex * @param _dexName Name of the Dex * @param _router address of the dex router */ function addDex( string calldata _dexName, address _router ) external payable onlyOwner { uint256 id = dexInfo.length; dexInfo.push(Dex({ name: _dexName, router: _router, id: uint64(id), disabled: false })); if (routerToDex[_router] != 0) { revert DexConflict(routerToDex[_router]); } routerToDex[_router] = dexInfo.length; emit AddDex(msg.sender, id); } /** * Updates dex info * @param id the id to update in dexInfo array * @param _name pass anything other than an empty string to update the name * @notice _factory is not used in these contracts * it is held for external services to utilize */ function updateDex( uint256 id, string memory _name ) external payable onlyOwner { if (bytes(_name).length == 0) { return; } dexInfo[id].name = _name; emit UpdateDex(msg.sender, id); } /** * sets disabled flag on a dex * @param id the dex id to disable * @param disabled the boolean denoting whether to disable or enable */ function disableDex(uint256 id, bool disabled) external payable onlyOwner { if (dexInfo[id].disabled == disabled) { return; } dexInfo[id].disabled = disabled; emit UpdateDex(msg.sender, id); } /** * distributes all fees, after withdrawing wrapped native balance * @notice if the amount is 0, all funds will be drained * @notice if an amount is provided, the method will only unwrap * the wNative token if it does not have enough native balance to cover the amount * @notice the balance will change in the middle of the function * if the appropriate conditions are met. however, we do not use that updated balance * because the whole amount may not have been asked for */ function distributeAll(uint256 amount) external payable { (uint256 nativeBalance, uint256 wNativeBalance) = pendingDistributionSegmented(); if ((amount == 0 || nativeBalance < amount) && wNativeBalance > 0) { IWETH(wNative).withdraw(wNativeBalance); } amount = clamp(amount, nativeBalance + wNativeBalance); if (amount == 0) { return; } destination.sendValue(amount); } /** * A public method to distribute fees * @param amount the amount of ether to distribute * @notice failure in receipt will cause this tx to fail as well */ function distribute(uint256 amount) external payable { uint256 balance = address(this).balance; if (balance == 0) { return; } destination.sendValue(clamp(amount, balance)); } /** * returns the balance in wNative token and native token as two separate numbers */ function pendingDistributionSegmented() public view returns(uint256, uint256) { return (address(this).balance, IWETH(wNative).balanceOf(address(this))); } /** * returns the balance of wNative token and native token, * treating them as an aggregate balance for ease */ function pendingDistribution() public view returns(uint256) { (uint256 nativeBalance, uint256 wNativeBalance) = pendingDistributionSegmented(); return nativeBalance + wNativeBalance; } /** * this method transfers funds from the sending address * and returns the delta of the balance of this contracat * @param sourceTokenId is the token id to transfer from the sender * @param amountIn is the amount that you desire to transfer from the sender * @return delta the amount that was actually transferred, using a `balanceOf` check */ function collectFunds(address sourceTokenId, uint256 amountIn) internal returns(uint256) { address self = address(this); uint256 balanceBefore = IERC20(sourceTokenId).balanceOf(self); IERC20(sourceTokenId).safeTransferFrom(_msgSender(), self, amountIn); return IERC20(sourceTokenId).balanceOf(self) - balanceBefore; } /** * @notice Swap erc20 token, end with erc20 token * @param _dexId ID of the Dex * @param recipient address to receive funds * @param _path Token address array * @param _amountIn Input amount * @param _minAmountOut Output token amount * @param _deadline the time at which this transaction can no longer be run * @notice anything extra in msg.value is treated as a donation * @notice anyone using this method will be costing themselves more * than simply going through the router they wish to swap through * so anything that comes through really acts like a high yeilding voluntary donation box * @notice if wNative is passed in as the first or last step of the path * then fees will be calculated from that number available at that time * @notice fee is only paid via msg.value if and only if the * first and last of the path are not a wrapped token * @notice if first or last of the path is wNative * then msg.value is required to be zero */ function swapTokenV2( uint256 _dexId, address recipient, address[] calldata _path, uint256 _amountIn, uint256 _minAmountOut, uint256 _deadline ) external payable { address first = _path[0]; address last = _path[_path.length - 1]; address _wNative = wNative; uint256 nativeFee = 0; if (first == _wNative) { nativeFee = (_amountIn * fee) / feeDenominator; if (msg.value != 0) { revert FeeMissing(0, msg.value, "fees paid from input"); } } else if (last != _wNative && fee > 0) { (, uint256 minimum) = getFeeMinimum( IUniswapV2Router02(dexInfo[_dexId].router).factory(), _amountIn, _path ); // introduce fee tolerance here minimum = (minimum * 9) / 10; if (minimum == 0) { revert FeeMissing(0, msg.value, "unable to compute fees"); } if (msg.value < minimum) { revert FeeMissing(minimum, msg.value, "not enough fee value"); } } // run transfer as normal uint256 actualAmountIn = collectFunds(first, _amountIn) - nativeFee; uint256 actualAmountOut = swapExactTokenForTokenV2( _dexId, _path, actualAmountIn, _minAmountOut, _deadline ); uint256 actualAmountOutAfterFees = actualAmountOut; if (last == _wNative) { actualAmountOutAfterFees -= (actualAmountOut * fee) / feeDenominator; if (fee != 0 && msg.value != 0) { revert FeeMissing(0, msg.value, "fees paid from output"); } } IERC20(last).safeTransfer(recipient, actualAmountOutAfterFees); } /** * @notice Swap native currency, end with erc20 token * @param _dexId ID of the Dex * @param recipient address to receive funds * @param _path Token address array * @param _amountIn Input amount * @param _minAmountOut Output token amount * @param _deadline the time at which this transaction can no longer be run * @notice anything extra in msg.value is treated as a donation * @notice this method does not require an approval step from the user */ function swapNativeToV2( uint256 _dexId, address recipient, address[] calldata _path, uint256 _amountIn, uint256 _minAmountOut, uint256 _deadline ) external payable { uint256 minimal = (msg.value * fee) / feeDenominator; address payable _wNative = wNative; if (msg.value != _amountIn + minimal) { revert FeeMissing(_amountIn + minimal, msg.value, "amount + fees must = total"); } if (_path[0] != _wNative) { revert NativeMissing(0); } // convert native to wNative IWETH(_wNative).deposit{value: _amountIn}(); uint256 actualAmountOut = swapExactTokenForTokenV2(_dexId, _path, _amountIn, _minAmountOut, _deadline); IERC20(_path[_path.length - 1]).safeTransfer(recipient, actualAmountOut); } /** * @notice Swap ERC-20 Token, end with native currency * @param _dexId ID of the Dex * @param recipient address to receive funds * @param _path Token address array * @param _amountIn Input amount * @param _minAmountOut Output token amount * @param _deadline the time at which this transaction can no longer be run * @notice anything extra in msg.value is treated as a donation */ function swapToNativeV2( uint256 _dexId, address payable recipient, address[] calldata _path, uint256 _amountIn, uint256 _minAmountOut, uint256 _deadline ) external payable { address payable _wNative = wNative; if (_path[_path.length - 1] != _wNative) { revert NativeMissing(_path.length - 1); } uint256 actualAmountIn = collectFunds(_path[0], _amountIn); uint256 actualAmountOut = swapExactTokenForTokenV2(_dexId, _path, actualAmountIn, _minAmountOut, _deadline); uint256 minimal = (actualAmountOut * fee) / feeDenominator; uint256 actualAmountOutAfterFee = actualAmountOut - minimal; if (actualAmountOut > 0) { IWETH(_wNative).withdraw(actualAmountOut); } recipient.sendValue(actualAmountOutAfterFee); } function swapExactTokenForTokenV2( uint256 dexId, address[] calldata _path, uint256 _amountIn, // this value has been checked uint256 _minAmountOut, // this value will be met uint256 _deadline ) internal returns (uint256) { Dex memory dex = dexInfo[dexId]; if (dex.disabled) { revert DexDisabled(); } address last = _path[_path.length - 1]; // approve router to swap tokens IERC20(_path[0]).approve(dex.router, _amountIn); // call to swap exact tokens uint256 balanceBefore = IERC20(last).balanceOf(address(this)); IUniswapV2Router02(dex.router).swapExactTokensForTokensSupportingFeeOnTransferTokens( _amountIn, _minAmountOut, _path, address(this), _deadline ); return IERC20(last).balanceOf(address(this)) - balanceBefore; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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); } }
// 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 (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.8.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.8.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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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; } }
pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint 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 (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint 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 (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); 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 (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
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, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
pragma solidity >=0.6.2; import './IUniswapV2Router01.sol'; interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Callback for IUniswapV3PoolActions#swap /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface interface IUniswapV3SwapCallback { /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. /// @dev In the implementation you must pay the pool tokens owed for the swap. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; pragma abicoder v2; import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; /// @title Router token swapping functionality /// @notice Functions for swapping tokens via Uniswap V3 interface ISwapRouter is IUniswapV3SwapCallback { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } /// @notice Swaps `amountIn` of one token for as much as possible of another token /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata /// @return amountOut The amount of the received token function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); struct ExactInputParams { bytes path; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; } /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata /// @return amountOut The amount of the received token function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); struct ExactOutputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; uint160 sqrtPriceLimitX96; } /// @notice Swaps as little as possible of one token for `amountOut` of another token /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata /// @return amountIn The amount of the input token function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); struct ExactOutputParams { bytes path; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; } /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata /// @return amountIn The amount of the input token function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); }
// SPDX-License-Identifier: UNLICENSED // !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.6.6. SEE SOURCE BELOW. !! pragma solidity 0.8.17; interface IWETH { function name() external view returns (string memory); function approve(address guy, uint256 wad) external returns (bool); function totalSupply() external view returns (uint256); function transferFrom( address src, address dst, uint256 wad ) external returns (bool); function withdraw(uint256 wad) external; function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint256); function symbol() external view returns (string memory); function transfer(address dst, uint256 wad) external returns (bool); function deposit() external payable; function allowance(address, address) external view returns (uint256); receive() external payable; event Approval(address indexed src, address indexed guy, uint256 wad); event Transfer(address indexed src, address indexed dst, uint256 wad); event Deposit(address indexed dst, uint256 wad); event Withdrawal(address indexed src, uint256 wad); } // THIS FILE WAS AUTOGENERATED FROM THE FOLLOWING ABI JSON: /* [{"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"name":"guy","type":"address"},{"name":"wad","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"name":"src","type":"address"},{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"wad","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"guy","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Withdrawal","type":"event"}] */
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import "@openzeppelin/contracts/access/Ownable.sol"; abstract contract Migratable is Ownable { address[] public migrationAddresses; event UpdateMigrationAddresses(address indexed executor, address[] addresses); function setMigrationAddress(address[] calldata _migrationAddresses) external onlyOwner { migrationAddresses = _migrationAddresses; emit UpdateMigrationAddresses(_msgSender(), _migrationAddresses); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import "@openzeppelin/contracts/utils/Address.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; abstract contract OracleReader { using Address for address; // fee = 0.729% Fee uint256 public constant feeDenominator = 100_000; uint256 public immutable fee; /** * the native address to deposit and withdraw from in the swap methods * @notice this address cannot be updated after it is set during constructor */ address payable public immutable wNative; constructor(address payable _wNative, uint96 _fee) { wNative = _wNative; fee = _fee; } /** * checks the exchange factory pair for a pair with weth and its reserves * @param factory the factory to check for a pair and fee of the market * @param _amountIn the amount to simulate trading through the market * @param path the tokens being traded from and to */ function getFeeMinimum( address factory, uint256 _amountIn, address[] calldata path ) public view returns(address, uint256) { for (uint256 i = 0; i < path.length; ++i) { address target = path[i]; uint256 minimum = getSingleFeeMinimum(factory, _amountIn, target); if (minimum > 0) { return (target, minimum); } if (i != path.length - 1) { _amountIn = amountOutFrom(factory, target, path[i + 1], _amountIn); } } return (address(0), 0); } /** * get the amount out from reserves * does not take into account fees charged along the way * @param factory the factory to derive a pair against * @param tokenIn the token being pushed into the pair * @param tokenOut the token to be pulled out * @param amountIn the magnitude of the swap */ function amountOutFrom(address factory, address tokenIn, address tokenOut, uint256 amountIn) public view returns(uint256) { address pair = IUniswapV2Factory(factory).getPair(tokenIn, tokenOut); bool inIs0 = IUniswapV2Pair(pair).token0() == tokenIn; (uint256 reserveA, uint256 reserveB, ) = IUniswapV2Pair(pair).getReserves(); if (inIs0) { return (reserveB * amountIn) / reserveA; } return (reserveA * amountIn) / reserveB; } /** * gets the fee for a single token from the exchange factory pair * @param factory the factory to check for a pair * @param _amountIn the amount of tokens being moved through the market * @param source the token to check against wNative * @notice the number returned from this method does not check * the fee for the market so the calculation will be off by ~0.3% for most markets */ function getSingleFeeMinimum( address factory, uint256 _amountIn, address source ) public view returns(uint256 minimum) { (uint256 tokenAmount, uint256 wethAmount) = checkPairForValidPrice(factory, source); if (wethAmount > 1 ether) { return (_amountIn * wethAmount * fee) / (feeDenominator * tokenAmount); } } /** * pull a token and weth reserve out of a provided token and factory to derive a market * @param factory the address of the factory to derive a pair from (token + wNative) * @param token the token to derive against a wNative token * @return tokenReserve the amount of token in reserve * @return wethReserve the amount of weth in reserve */ function checkPairForValidPrice(address factory, address token) public view returns(uint256 tokenReserve, uint256 wethReserve) { IUniswapV2Factory uniFactory = IUniswapV2Factory(factory); address _wNative = wNative; address pair = uniFactory.getPair(token, _wNative); if (pair.isContract()) { (uint256 _reserveA, uint256 _reserveB, ) = IUniswapV2Pair(pair).getReserves(); address token0 = IUniswapV2Pair(pair).token0(); bool zeroIsWeth = token0 == _wNative; tokenReserve = zeroIsWeth ? _reserveB : _reserveA; wethReserve = zeroIsWeth ? _reserveA : _reserveB; } // weth is always returned as denominator } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; abstract contract Utils { /** clamp the amount provided to a maximum, defaulting to provided maximum if 0 provided */ function clamp(uint256 amount, uint256 max) pure public returns(uint256) { uint256 min = amount < max ? amount : max; return min == 0 ? max : min; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address payable","name":"_destination","type":"address"},{"internalType":"address payable","name":"_wNative","type":"address"},{"internalType":"uint96","name":"_fee","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DestinationMissing","type":"error"},{"inputs":[{"internalType":"uint256","name":"dexIndex","type":"uint256"}],"name":"DexConflict","type":"error"},{"inputs":[],"name":"DexDisabled","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"provided","type":"uint256"},{"internalType":"string","name":"message","type":"string"}],"name":"FeeMissing","type":"error"},{"inputs":[{"internalType":"uint256","name":"pathIndex","type":"uint256"}],"name":"NativeMissing","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":true,"internalType":"uint256","name":"dexId","type":"uint256"}],"name":"AddDex","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":true,"internalType":"uint256","name":"dexId","type":"uint256"}],"name":"UpdateDex","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"UpdateMigrationAddresses","type":"event"},{"inputs":[{"internalType":"string","name":"_dexName","type":"string"},{"internalType":"address","name":"_router","type":"address"}],"name":"addDex","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"allDexInfo","outputs":[{"components":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"router","type":"address"},{"internalType":"bool","name":"disabled","type":"bool"},{"internalType":"string","name":"name","type":"string"}],"internalType":"struct InternetMoneySwapRouter.Dex[]","name":"_dexInfo","type":"tuple[]"},{"internalType":"address","name":"_wNative","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint256","name":"_feeDenominator","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"amountOutFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"checkPairForValidPrice","outputs":[{"internalType":"uint256","name":"tokenReserve","type":"uint256"},{"internalType":"uint256","name":"wethReserve","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"clamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"destination","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dexInfo","outputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"router","type":"address"},{"internalType":"bool","name":"disabled","type":"bool"},{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"disabled","type":"bool"}],"name":"disableDex","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"distributeAll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getFeeMinimum","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"source","type":"address"}],"name":"getSingleFeeMinimum","outputs":[{"internalType":"uint256","name":"minimum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"migrationAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDistributionSegmented","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"routerToDex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_migrationAddresses","type":"address[]"}],"name":"setMigrationAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dexId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address[]","name":"_path","type":"address[]"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"swapNativeToV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dexId","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address[]","name":"_path","type":"address[]"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"swapToNativeV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dexId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address[]","name":"_path","type":"address[]"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"}],"name":"swapTokenV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"_name","type":"string"}],"name":"updateDex","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"wNative","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60e06040523480156200001157600080fd5b506040516200306d3803806200306d8339810160408190526200003491620000f1565b816001600160a01b038416156200004c57816200004f565b60005b6200005a3362000084565b6001600160a01b0391821660a0526001600160601b03166080529290921660c052506200014b9050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000ec57600080fd5b919050565b6000806000606084860312156200010757600080fd5b6200011284620000d4565b92506200012260208501620000d4565b60408501519092506001600160601b03811681146200014057600080fd5b809150509250925092565b60805160a05160c051612e6d62000200600039600081816101b70152818161048e015281816111d10152818161134e01526115eb0152600081816102d60152818161060901528181610cda015281816111ae0152818161125a015281816113760152818161155c015261199401526000818161051201528181610646015281816106fe015281816108ed0152818161092a01528181610aa4015281816111f40152818161145701526119610152612e6d6000f3fe6080604052600436106101b05760003560e01c806386f9bfa8116100ec578063b269681d1161008a578063ddca3f4311610064578063ddca3f4314610500578063e329c80d14610534578063f2fde38b14610573578063fdf59b8e1461059357600080fd5b8063b269681d1461047c578063bdf70686146104b0578063d63a4d5c146104e057600080fd5b80639321111d116100c65780639321111d1461042e57806394c176e4146104415780639c22b9a614610454578063b231d68b1461046957600080fd5b806386f9bfa8146103dd5780638da5cb5b146103fd57806391c05b0b1461041b57600080fd5b8063394ce9c7116101595780636990b582116101335780636990b5821461037a5780636d965fcc1461038d578063715018a6146103b357806372f23fd9146103c857600080fd5b8063394ce9c7146102f85780635517b46e146103185780635d39ba9b1461034557600080fd5b806323668e981161018a57806323668e98146102915780632d596977146102a45780632d68efc9146102c457600080fd5b8063012e74a31461021c578063180b0d7e1461022f578063235b77dc1461025957600080fd5b36610217577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610215576040517f79dd500900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b61021561022a3660046125a8565b6105a6565b34801561023b57600080fd5b50610246620186a081565b6040519081526020015b60405180910390f35b34801561026557600080fd5b5061027961027436600461261f565b6109d5565b6040516001600160a01b039091168152602001610250565b61021561029f36600461264e565b6109ff565b3480156102b057600080fd5b506102466102bf366004612709565b610a72565b3480156102d057600080fd5b506102797f000000000000000000000000000000000000000000000000000000000000000081565b34801561030457600080fd5b5061024661031336600461274b565b610af4565b34801561032457600080fd5b5061024661033336600461279c565b60036020526000908152604090205481565b34801561035157600080fd5b506103656103603660046127b9565b610cbb565b60408051928352602083019190915201610250565b6102156103883660046127f2565b610e96565b34801561039957600080fd5b506103a2611076565b6040516102509594939291906128ba565b3480156103bf57600080fd5b50610215611222565b3480156103d457600080fd5b50610365611236565b3480156103e957600080fd5b506102156103f836600461298f565b6112cd565b34801561040957600080fd5b506000546001600160a01b0316610279565b61021561042936600461261f565b611329565b61021561043c3660046125a8565b611374565b61021561044f36600461261f565b611518565b34801561046057600080fd5b50610246611616565b6102156104773660046129df565b611639565b34801561048857600080fd5b506102797f000000000000000000000000000000000000000000000000000000000000000081565b3480156104bc57600080fd5b506104d06104cb36600461261f565b6116e6565b6040516102509493929190612a04565b3480156104ec57600080fd5b506102466104fb366004612a48565b6117cb565b34801561050c57600080fd5b506102467f000000000000000000000000000000000000000000000000000000000000000081565b34801561054057600080fd5b5061055461054f366004612a6a565b6117f7565b604080516001600160a01b039093168352602083019190915201610250565b34801561057f57600080fd5b5061021561058e36600461279c565b6118c6565b6102156105a13660046125a8565b611956565b6000858560008181106105bb576105bb612ac6565b90506020020160208101906105d0919061279c565b9050600086866105e1600182612af2565b8181106105f0576105f0612ac6565b9050602002016020810190610605919061279c565b90507f000000000000000000000000000000000000000000000000000000000000000060006001600160a01b03808316908516036106dd57620186a061066b7f000000000000000000000000000000000000000000000000000000000000000089612b05565b6106759190612b1c565b905034156106d857604051630a09945f60e21b81526000600482015234602482015260606044820152601460648201527f6665657320706169642066726f6d20696e707574000000000000000000000000608482015260a4015b60405180910390fd5b6108a5565b816001600160a01b0316836001600160a01b03161415801561071f575060007f0000000000000000000000000000000000000000000000000000000000000000115b156108a55760006107ca60028d8154811061073c5761073c612ac6565b906000526020600020906002020160000160089054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c29190612b3e565b898c8c6117f7565b9150600a90506107db826009612b05565b6107e59190612b1c565b90508060000361084557604051630a09945f60e21b81526000600482015234602482015260606044820152601660648201527f756e61626c6520746f20636f6d70757465206665657300000000000000000000608482015260a4016106cf565b803410156108a357604051630a09945f60e21b81526004810182905234602482015260606044820152601460648201527f6e6f7420656e6f756768206665652076616c7565000000000000000000000000608482015260a4016106cf565b505b6000816108b2868a611b38565b6108bc9190612af2565b905060006108ce8d8c8c858c8c611c3e565b9050806001600160a01b03808616908716036109b157620186a06109127f000000000000000000000000000000000000000000000000000000000000000084612b05565b61091c9190612b1c565b6109269082612af2565b90507f00000000000000000000000000000000000000000000000000000000000000001580159061095657503415155b156109b157604051630a09945f60e21b81526000600482015234602482015260606044820152601560648201527f6665657320706169642066726f6d206f75747075740000000000000000000000608482015260a4016106cf565b6109c56001600160a01b0387168e83611fea565b5050505050505050505050505050565b600181815481106109e557600080fd5b6000918252602090912001546001600160a01b0316905081565b610a07612093565b805115610a6e578060028381548110610a2257610a22612ac6565b90600052602060002090600202016001019081610a3f9190612be3565b50604051829033907ff46467fbac738ac4d46eb7aff18d9f1e807be9993f9a05f54ca83b066b8ce64090600090a35b5050565b6000806000610a818685610cbb565b91509150670de0b6b3a7640000811115610aea57610aa282620186a0612b05565b7f0000000000000000000000000000000000000000000000000000000000000000610acd8388612b05565b610ad79190612b05565b610ae19190612b1c565b92505050610aed565b50505b9392505050565b60405163e6a4390560e01b81526001600160a01b0384811660048301528381166024830152600091829187169063e6a4390590604401602060405180830381865afa158015610b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6b9190612b3e565b90506000856001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb9190612b3e565b6001600160a01b0316149050600080836001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610c28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4c9190612cc6565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508215610c975781610c828783612b05565b610c8c9190612b1c565b945050505050610cb3565b80610ca28784612b05565b610cac9190612b1c565b9450505050505b949350505050565b60405163e6a4390560e01b81526001600160a01b0382811660048301527f000000000000000000000000000000000000000000000000000000000000000081811660248401526000928392869291849184169063e6a4390590604401602060405180830381865afa158015610d34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d589190612b3e565b90506001600160a01b0381163b15610e8c57600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610dab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcf9190612cc6565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506000836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e589190612b3e565b90506001600160a01b038082169086161480610e745783610e76565b825b985080610e835782610e85565b835b9750505050505b5050509250929050565b610e9e612093565b60006002805490509050600260405180608001604052808367ffffffffffffffff168152602001846001600160a01b0316815260200160001515815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939094525050835460018181018655948252602091829020845160029092020180549285015160408601511515600160e01b0260ff60e01b196001600160a01b0390921668010000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090951667ffffffffffffffff9094169390931793909317929092161781556060830151929390929083019150610fb59082612be3565b5050506001600160a01b03821660009081526003602052604090205415611026576001600160a01b038216600090815260036020526040908190205490517f456c0cff00000000000000000000000000000000000000000000000000000000815260048101919091526024016106cf565b6002546001600160a01b038316600090815260036020526040808220929092559051829133917fca0cc3028eb486c2abb71c1a6f38d1e617ce1079f1be55c5cf422abfb2e4f4689190a350505050565b60606000806000806002805480602002602001604051908101604052809291908181526020016000905b828210156111a95760008481526020908190206040805160808101825260028602909201805467ffffffffffffffff811684526801000000000000000081046001600160a01b031694840194909452600160e01b90930460ff1615159082015260018201805491929160608401919061111890612b5b565b80601f016020809104026020016040519081016040528092919081815260200182805461114490612b5b565b80156111915780601f1061116657610100808354040283529160200191611191565b820191906000526020600020905b81548152906001019060200180831161117457829003601f168201915b505050505081525050815260200190600101906110a0565b5092987f000000000000000000000000000000000000000000000000000000000000000098507f000000000000000000000000000000000000000000000000000000000000000097507f00000000000000000000000000000000000000000000000000000000000000009650620186a095509350505050565b61122a612093565b61123460006120ed565b565b6040516370a0823160e01b8152306004820152600090819047906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190612d0b565b915091509091565b6112d5612093565b6112e1600183836124c2565b50336001600160a01b03167f43a7b7252c812355611a4161c33c1026045c1a89763cfaef223712907d805d8b838360405161131d929190612d6d565b60405180910390a25050565b476000819003611337575050565b610a6e61134483836117cb565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169061214a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811686866113ac600182612af2565b8181106113bb576113bb612ac6565b90506020020160208101906113d0919061279c565b6001600160a01b031614611405576113e9600186612af2565b604051631b02683560e31b81526004016106cf91815260200190565b60006114388787600081811061141d5761141d612ac6565b9050602002016020810190611432919061279c565b86611b38565b9050600061144a8a8989858989611c3e565b90506000620186a061147c7f000000000000000000000000000000000000000000000000000000000000000084612b05565b6114869190612b1c565b905060006114948284612af2565b905082156114f757604051632e1a7d4d60e01b8152600481018490526001600160a01b03861690632e1a7d4d90602401600060405180830381600087803b1580156114de57600080fd5b505af11580156114f2573d6000803e3d6000fd5b505050505b61150a6001600160a01b038c168261214a565b505050505050505050505050565b600080611523611236565b91509150826000148061153557508282105b80156115415750600081115b156115c157604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156115a857600080fd5b505af11580156115bc573d6000803e3d6000fd5b505050505b6115cf836104fb8385612d81565b9250826000036115de57505050565b6116116001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168461214a565b505050565b6000806000611623611236565b90925090506116328183612d81565b9250505090565b611641612093565b8015156002838154811061165757611657612ac6565b6000918252602090912060029091020154600160e01b900460ff16151514610a6e57806002838154811061168d5761168d612ac6565b6000918252602082206002909102018054921515600160e01b0260ff60e01b1990931692909217909155604051839133917ff46467fbac738ac4d46eb7aff18d9f1e807be9993f9a05f54ca83b066b8ce6409190a35050565b600281815481106116f657600080fd5b60009182526020909120600290910201805460018201805467ffffffffffffffff831694506801000000000000000083046001600160a01b031693600160e01b90930460ff1692919061174890612b5b565b80601f016020809104026020016040519081016040528092919081815260200182805461177490612b5b565b80156117c15780601f10611796576101008083540402835291602001916117c1565b820191906000526020600020905b8154815290600101906020018083116117a457829003601f168201915b5050505050905084565b6000808284106117db57826117dd565b835b905080156117eb57806117ed565b825b9150505b92915050565b60008060005b838110156118b457600085858381811061181957611819612ac6565b905060200201602081019061182e919061279c565b9050600061183d898984610a72565b905080156118515790935091506118bd9050565b61185c600187612af2565b83146118a15761189e89838989611874886001612d81565b81811061188357611883612ac6565b9050602002016020810190611898919061279c565b8b610af4565b97505b5050806118ad90612d94565b90506117fd565b50600080915091505b94509492505050565b6118ce612093565b6001600160a01b03811661194a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106cf565b611953816120ed565b50565b6000620186a06119867f000000000000000000000000000000000000000000000000000000000000000034612b05565b6119909190612b1c565b90507f00000000000000000000000000000000000000000000000000000000000000006119bd8286612d81565b3414611a24576119cd8286612d81565b604051630a09945f60e21b8152600481019190915234602482015260606044820152601a60648201527f616d6f756e74202b2066656573206d757374203d20746f74616c000000000000608482015260a4016106cf565b806001600160a01b031687876000818110611a4157611a41612ac6565b9050602002016020810190611a56919061279c565b6001600160a01b031614611a8057604051631b02683560e31b8152600060048201526024016106cf565b806001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b50505050506000611ae48a8989898989611c3e565b9050611b2c89828a8a611af8600182612af2565b818110611b0757611b07612ac6565b9050602002016020810190611b1c919061279c565b6001600160a01b03169190611fea565b50505050505050505050565b6040516370a0823160e01b8152306004820181905260009182906001600160a01b038616906370a0823190602401602060405180830381865afa158015611b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba79190612d0b565b9050611bbe6001600160a01b038616338487612263565b6040516370a0823160e01b81526001600160a01b0383811660048301528291908716906370a0823190602401602060405180830381865afa158015611c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2b9190612d0b565b611c359190612af2565b95945050505050565b60008060028881548110611c5457611c54612ac6565b600091825260209182902060408051608081018252600293909302909101805467ffffffffffffffff811684526801000000000000000081046001600160a01b031694840194909452600160e01b90930460ff16151590820152600182018054919291606084019190611cc690612b5b565b80601f0160208091040260200160405190810160405280929190818152602001828054611cf290612b5b565b8015611d3f5780601f10611d1457610100808354040283529160200191611d3f565b820191906000526020600020905b815481529060010190602001808311611d2257829003601f168201915b5050505050815250509050806040015115611d86576040517f3d8c23c900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008787611d95600182612af2565b818110611da457611da4612ac6565b9050602002016020810190611db9919061279c565b905087876000818110611dce57611dce612ac6565b9050602002016020810190611de3919061279c565b60208301516040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526024810189905291169063095ea7b3906044016020604051808303816000875af1158015611e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e749190612dad565b506040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee09190612d0b565b60208401516040517f5c11d7950000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690635c11d79590611f36908a908a908e908e9030908d90600401612dca565b600060405180830381600087803b158015611f5057600080fd5b505af1158015611f64573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201528392506001600160a01b03851691506370a0823190602401602060405180830381865afa158015611fae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd29190612d0b565b611fdc9190612af2565b9a9950505050505050505050565b6040516001600160a01b0383166024820152604481018290526116119084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526122ba565b6000546001600160a01b031633146112345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106cf565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8047101561219a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106cf565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146121e7576040519150601f19603f3d011682016040523d82523d6000602084013e6121ec565b606091505b50509050806116115760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106cf565b6040516001600160a01b03808516602483015283166044820152606481018290526122b49085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161202f565b50505050565b600061230f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661239f9092919063ffffffff16565b805190915015611611578080602001905181019061232d9190612dad565b6116115760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106cf565b6060610cb3848460008585600080866001600160a01b031685876040516123c69190612e08565b60006040518083038185875af1925050503d8060008114612403576040519150601f19603f3d011682016040523d82523d6000602084013e612408565b606091505b509150915061241987838387612424565b979650505050505050565b6060831561249357825160000361248c576001600160a01b0385163b61248c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106cf565b5081610cb3565b610cb383838151156124a85781518083602001fd5b8060405162461bcd60e51b81526004016106cf9190612e24565b828054828255906000526020600020908101928215612522579160200282015b8281111561252257815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038435161782556020909201916001909101906124e2565b5061252e929150612532565b5090565b5b8082111561252e5760008155600101612533565b6001600160a01b038116811461195357600080fd5b60008083601f84011261256e57600080fd5b50813567ffffffffffffffff81111561258657600080fd5b6020830191508360208260051b85010111156125a157600080fd5b9250929050565b600080600080600080600060c0888a0312156125c357600080fd5b8735965060208801356125d581612547565b9550604088013567ffffffffffffffff8111156125f157600080fd5b6125fd8a828b0161255c565b989b979a50986060810135976080820135975060a09091013595509350505050565b60006020828403121561263157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561266157600080fd5b82359150602083013567ffffffffffffffff8082111561268057600080fd5b818501915085601f83011261269457600080fd5b8135818111156126a6576126a6612638565b604051601f8201601f19908116603f011681019083821181831017156126ce576126ce612638565b816040528281528860208487010111156126e757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006060848603121561271e57600080fd5b833561272981612547565b925060208401359150604084013561274081612547565b809150509250925092565b6000806000806080858703121561276157600080fd5b843561276c81612547565b9350602085013561277c81612547565b9250604085013561278c81612547565b9396929550929360600135925050565b6000602082840312156127ae57600080fd5b8135610aed81612547565b600080604083850312156127cc57600080fd5b82356127d781612547565b915060208301356127e781612547565b809150509250929050565b60008060006040848603121561280757600080fd5b833567ffffffffffffffff8082111561281f57600080fd5b818601915086601f83011261283357600080fd5b81358181111561284257600080fd5b87602082850101111561285457600080fd5b6020928301955093505084013561274081612547565b60005b8381101561288557818101518382015260200161286d565b50506000910152565b600081518084526128a681602086016020860161286a565b601f01601f19169290920160200192915050565b600060a0820160a0835280885180835260c08501915060c08160051b86010192506020808b0160005b838110156129505787860360bf190185528151805167ffffffffffffffff168752838101516001600160a01b03168488015260408082015115159088015260609081015160809188018290529061293c8189018361288e565b9750505093820193908201906001016128e3565b50508394506129698187018b6001600160a01b03169052565b5050506001600160a01b0386166040840152506060820193909352608001529392505050565b600080602083850312156129a257600080fd5b823567ffffffffffffffff8111156129b957600080fd5b6129c58582860161255c565b90969095509350505050565b801515811461195357600080fd5b600080604083850312156129f257600080fd5b8235915060208301356127e7816129d1565b67ffffffffffffffff851681526001600160a01b03841660208201528215156040820152608060608201526000612a3e608083018461288e565b9695505050505050565b60008060408385031215612a5b57600080fd5b50508035926020909101359150565b60008060008060608587031215612a8057600080fd5b8435612a8b81612547565b935060208501359250604085013567ffffffffffffffff811115612aae57600080fd5b612aba8782880161255c565b95989497509550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156117f1576117f1612adc565b80820281158282048414176117f1576117f1612adc565b600082612b3957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612b5057600080fd5b8151610aed81612547565b600181811c90821680612b6f57607f821691505b602082108103612b8f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561161157600081815260208120601f850160051c81016020861015612bbc5750805b601f850160051c820191505b81811015612bdb57828155600101612bc8565b505050505050565b815167ffffffffffffffff811115612bfd57612bfd612638565b612c1181612c0b8454612b5b565b84612b95565b602080601f831160018114612c465760008415612c2e5750858301515b600019600386901b1c1916600185901b178555612bdb565b600085815260208120601f198616915b82811015612c7557888601518255948401946001909101908401612c56565b5085821015612c935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80516dffffffffffffffffffffffffffff81168114612cc157600080fd5b919050565b600080600060608486031215612cdb57600080fd5b612ce484612ca3565b9250612cf260208501612ca3565b9150604084015163ffffffff8116811461274057600080fd5b600060208284031215612d1d57600080fd5b5051919050565b8183526000602080850194508260005b85811015612d62578135612d4781612547565b6001600160a01b031687529582019590820190600101612d34565b509495945050505050565b602081526000610cb3602083018486612d24565b808201808211156117f1576117f1612adc565b600060018201612da657612da6612adc565b5060010190565b600060208284031215612dbf57600080fd5b8151610aed816129d1565b86815285602082015260a060408201526000612dea60a083018688612d24565b6001600160a01b039490941660608301525060800152949350505050565b60008251612e1a81846020870161286a565b9190910192915050565b602081526000610aed602083018461288e56fea26469706673582212200eb2ffc6bb5f5f5b4d80809272d52d1bc4a9306ca577a552d0f34f7ad304606a64736f6c63430008110033000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000002d9
Deployed Bytecode
0x6080604052600436106101b05760003560e01c806386f9bfa8116100ec578063b269681d1161008a578063ddca3f4311610064578063ddca3f4314610500578063e329c80d14610534578063f2fde38b14610573578063fdf59b8e1461059357600080fd5b8063b269681d1461047c578063bdf70686146104b0578063d63a4d5c146104e057600080fd5b80639321111d116100c65780639321111d1461042e57806394c176e4146104415780639c22b9a614610454578063b231d68b1461046957600080fd5b806386f9bfa8146103dd5780638da5cb5b146103fd57806391c05b0b1461041b57600080fd5b8063394ce9c7116101595780636990b582116101335780636990b5821461037a5780636d965fcc1461038d578063715018a6146103b357806372f23fd9146103c857600080fd5b8063394ce9c7146102f85780635517b46e146103185780635d39ba9b1461034557600080fd5b806323668e981161018a57806323668e98146102915780632d596977146102a45780632d68efc9146102c457600080fd5b8063012e74a31461021c578063180b0d7e1461022f578063235b77dc1461025957600080fd5b36610217577f000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac6001600160a01b0316610215576040517f79dd500900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b61021561022a3660046125a8565b6105a6565b34801561023b57600080fd5b50610246620186a081565b6040519081526020015b60405180910390f35b34801561026557600080fd5b5061027961027436600461261f565b6109d5565b6040516001600160a01b039091168152602001610250565b61021561029f36600461264e565b6109ff565b3480156102b057600080fd5b506102466102bf366004612709565b610a72565b3480156102d057600080fd5b506102797f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b34801561030457600080fd5b5061024661031336600461274b565b610af4565b34801561032457600080fd5b5061024661033336600461279c565b60036020526000908152604090205481565b34801561035157600080fd5b506103656103603660046127b9565b610cbb565b60408051928352602083019190915201610250565b6102156103883660046127f2565b610e96565b34801561039957600080fd5b506103a2611076565b6040516102509594939291906128ba565b3480156103bf57600080fd5b50610215611222565b3480156103d457600080fd5b50610365611236565b3480156103e957600080fd5b506102156103f836600461298f565b6112cd565b34801561040957600080fd5b506000546001600160a01b0316610279565b61021561042936600461261f565b611329565b61021561043c3660046125a8565b611374565b61021561044f36600461261f565b611518565b34801561046057600080fd5b50610246611616565b6102156104773660046129df565b611639565b34801561048857600080fd5b506102797f000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac81565b3480156104bc57600080fd5b506104d06104cb36600461261f565b6116e6565b6040516102509493929190612a04565b3480156104ec57600080fd5b506102466104fb366004612a48565b6117cb565b34801561050c57600080fd5b506102467f00000000000000000000000000000000000000000000000000000000000002d981565b34801561054057600080fd5b5061055461054f366004612a6a565b6117f7565b604080516001600160a01b039093168352602083019190915201610250565b34801561057f57600080fd5b5061021561058e36600461279c565b6118c6565b6102156105a13660046125a8565b611956565b6000858560008181106105bb576105bb612ac6565b90506020020160208101906105d0919061279c565b9050600086866105e1600182612af2565b8181106105f0576105f0612ac6565b9050602002016020810190610605919061279c565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260006001600160a01b03808316908516036106dd57620186a061066b7f00000000000000000000000000000000000000000000000000000000000002d989612b05565b6106759190612b1c565b905034156106d857604051630a09945f60e21b81526000600482015234602482015260606044820152601460648201527f6665657320706169642066726f6d20696e707574000000000000000000000000608482015260a4015b60405180910390fd5b6108a5565b816001600160a01b0316836001600160a01b03161415801561071f575060007f00000000000000000000000000000000000000000000000000000000000002d9115b156108a55760006107ca60028d8154811061073c5761073c612ac6565b906000526020600020906002020160000160089054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c29190612b3e565b898c8c6117f7565b9150600a90506107db826009612b05565b6107e59190612b1c565b90508060000361084557604051630a09945f60e21b81526000600482015234602482015260606044820152601660648201527f756e61626c6520746f20636f6d70757465206665657300000000000000000000608482015260a4016106cf565b803410156108a357604051630a09945f60e21b81526004810182905234602482015260606044820152601460648201527f6e6f7420656e6f756768206665652076616c7565000000000000000000000000608482015260a4016106cf565b505b6000816108b2868a611b38565b6108bc9190612af2565b905060006108ce8d8c8c858c8c611c3e565b9050806001600160a01b03808616908716036109b157620186a06109127f00000000000000000000000000000000000000000000000000000000000002d984612b05565b61091c9190612b1c565b6109269082612af2565b90507f00000000000000000000000000000000000000000000000000000000000002d91580159061095657503415155b156109b157604051630a09945f60e21b81526000600482015234602482015260606044820152601560648201527f6665657320706169642066726f6d206f75747075740000000000000000000000608482015260a4016106cf565b6109c56001600160a01b0387168e83611fea565b5050505050505050505050505050565b600181815481106109e557600080fd5b6000918252602090912001546001600160a01b0316905081565b610a07612093565b805115610a6e578060028381548110610a2257610a22612ac6565b90600052602060002090600202016001019081610a3f9190612be3565b50604051829033907ff46467fbac738ac4d46eb7aff18d9f1e807be9993f9a05f54ca83b066b8ce64090600090a35b5050565b6000806000610a818685610cbb565b91509150670de0b6b3a7640000811115610aea57610aa282620186a0612b05565b7f00000000000000000000000000000000000000000000000000000000000002d9610acd8388612b05565b610ad79190612b05565b610ae19190612b1c565b92505050610aed565b50505b9392505050565b60405163e6a4390560e01b81526001600160a01b0384811660048301528381166024830152600091829187169063e6a4390590604401602060405180830381865afa158015610b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6b9190612b3e565b90506000856001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb9190612b3e565b6001600160a01b0316149050600080836001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610c28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4c9190612cc6565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508215610c975781610c828783612b05565b610c8c9190612b1c565b945050505050610cb3565b80610ca28784612b05565b610cac9190612b1c565b9450505050505b949350505050565b60405163e6a4390560e01b81526001600160a01b0382811660048301527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281811660248401526000928392869291849184169063e6a4390590604401602060405180830381865afa158015610d34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d589190612b3e565b90506001600160a01b0381163b15610e8c57600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610dab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcf9190612cc6565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506000836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e589190612b3e565b90506001600160a01b038082169086161480610e745783610e76565b825b985080610e835782610e85565b835b9750505050505b5050509250929050565b610e9e612093565b60006002805490509050600260405180608001604052808367ffffffffffffffff168152602001846001600160a01b0316815260200160001515815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939094525050835460018181018655948252602091829020845160029092020180549285015160408601511515600160e01b0260ff60e01b196001600160a01b0390921668010000000000000000027fffffffff0000000000000000000000000000000000000000000000000000000090951667ffffffffffffffff9094169390931793909317929092161781556060830151929390929083019150610fb59082612be3565b5050506001600160a01b03821660009081526003602052604090205415611026576001600160a01b038216600090815260036020526040908190205490517f456c0cff00000000000000000000000000000000000000000000000000000000815260048101919091526024016106cf565b6002546001600160a01b038316600090815260036020526040808220929092559051829133917fca0cc3028eb486c2abb71c1a6f38d1e617ce1079f1be55c5cf422abfb2e4f4689190a350505050565b60606000806000806002805480602002602001604051908101604052809291908181526020016000905b828210156111a95760008481526020908190206040805160808101825260028602909201805467ffffffffffffffff811684526801000000000000000081046001600160a01b031694840194909452600160e01b90930460ff1615159082015260018201805491929160608401919061111890612b5b565b80601f016020809104026020016040519081016040528092919081815260200182805461114490612b5b565b80156111915780601f1061116657610100808354040283529160200191611191565b820191906000526020600020905b81548152906001019060200180831161117457829003601f168201915b505050505081525050815260200190600101906110a0565b5092987f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc298507f000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac97507f00000000000000000000000000000000000000000000000000000000000002d99650620186a095509350505050565b61122a612093565b61123460006120ed565b565b6040516370a0823160e01b8152306004820152600090819047906001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216906370a0823190602401602060405180830381865afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190612d0b565b915091509091565b6112d5612093565b6112e1600183836124c2565b50336001600160a01b03167f43a7b7252c812355611a4161c33c1026045c1a89763cfaef223712907d805d8b838360405161131d929190612d6d565b60405180910390a25050565b476000819003611337575050565b610a6e61134483836117cb565b6001600160a01b037f000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac169061214a565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03811686866113ac600182612af2565b8181106113bb576113bb612ac6565b90506020020160208101906113d0919061279c565b6001600160a01b031614611405576113e9600186612af2565b604051631b02683560e31b81526004016106cf91815260200190565b60006114388787600081811061141d5761141d612ac6565b9050602002016020810190611432919061279c565b86611b38565b9050600061144a8a8989858989611c3e565b90506000620186a061147c7f00000000000000000000000000000000000000000000000000000000000002d984612b05565b6114869190612b1c565b905060006114948284612af2565b905082156114f757604051632e1a7d4d60e01b8152600481018490526001600160a01b03861690632e1a7d4d90602401600060405180830381600087803b1580156114de57600080fd5b505af11580156114f2573d6000803e3d6000fd5b505050505b61150a6001600160a01b038c168261214a565b505050505050505050505050565b600080611523611236565b91509150826000148061153557508282105b80156115415750600081115b156115c157604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156115a857600080fd5b505af11580156115bc573d6000803e3d6000fd5b505050505b6115cf836104fb8385612d81565b9250826000036115de57505050565b6116116001600160a01b037f000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac168461214a565b505050565b6000806000611623611236565b90925090506116328183612d81565b9250505090565b611641612093565b8015156002838154811061165757611657612ac6565b6000918252602090912060029091020154600160e01b900460ff16151514610a6e57806002838154811061168d5761168d612ac6565b6000918252602082206002909102018054921515600160e01b0260ff60e01b1990931692909217909155604051839133917ff46467fbac738ac4d46eb7aff18d9f1e807be9993f9a05f54ca83b066b8ce6409190a35050565b600281815481106116f657600080fd5b60009182526020909120600290910201805460018201805467ffffffffffffffff831694506801000000000000000083046001600160a01b031693600160e01b90930460ff1692919061174890612b5b565b80601f016020809104026020016040519081016040528092919081815260200182805461177490612b5b565b80156117c15780601f10611796576101008083540402835291602001916117c1565b820191906000526020600020905b8154815290600101906020018083116117a457829003601f168201915b5050505050905084565b6000808284106117db57826117dd565b835b905080156117eb57806117ed565b825b9150505b92915050565b60008060005b838110156118b457600085858381811061181957611819612ac6565b905060200201602081019061182e919061279c565b9050600061183d898984610a72565b905080156118515790935091506118bd9050565b61185c600187612af2565b83146118a15761189e89838989611874886001612d81565b81811061188357611883612ac6565b9050602002016020810190611898919061279c565b8b610af4565b97505b5050806118ad90612d94565b90506117fd565b50600080915091505b94509492505050565b6118ce612093565b6001600160a01b03811661194a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106cf565b611953816120ed565b50565b6000620186a06119867f00000000000000000000000000000000000000000000000000000000000002d934612b05565b6119909190612b1c565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26119bd8286612d81565b3414611a24576119cd8286612d81565b604051630a09945f60e21b8152600481019190915234602482015260606044820152601a60648201527f616d6f756e74202b2066656573206d757374203d20746f74616c000000000000608482015260a4016106cf565b806001600160a01b031687876000818110611a4157611a41612ac6565b9050602002016020810190611a56919061279c565b6001600160a01b031614611a8057604051631b02683560e31b8152600060048201526024016106cf565b806001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b50505050506000611ae48a8989898989611c3e565b9050611b2c89828a8a611af8600182612af2565b818110611b0757611b07612ac6565b9050602002016020810190611b1c919061279c565b6001600160a01b03169190611fea565b50505050505050505050565b6040516370a0823160e01b8152306004820181905260009182906001600160a01b038616906370a0823190602401602060405180830381865afa158015611b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba79190612d0b565b9050611bbe6001600160a01b038616338487612263565b6040516370a0823160e01b81526001600160a01b0383811660048301528291908716906370a0823190602401602060405180830381865afa158015611c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2b9190612d0b565b611c359190612af2565b95945050505050565b60008060028881548110611c5457611c54612ac6565b600091825260209182902060408051608081018252600293909302909101805467ffffffffffffffff811684526801000000000000000081046001600160a01b031694840194909452600160e01b90930460ff16151590820152600182018054919291606084019190611cc690612b5b565b80601f0160208091040260200160405190810160405280929190818152602001828054611cf290612b5b565b8015611d3f5780601f10611d1457610100808354040283529160200191611d3f565b820191906000526020600020905b815481529060010190602001808311611d2257829003601f168201915b5050505050815250509050806040015115611d86576040517f3d8c23c900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008787611d95600182612af2565b818110611da457611da4612ac6565b9050602002016020810190611db9919061279c565b905087876000818110611dce57611dce612ac6565b9050602002016020810190611de3919061279c565b60208301516040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526024810189905291169063095ea7b3906044016020604051808303816000875af1158015611e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e749190612dad565b506040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee09190612d0b565b60208401516040517f5c11d7950000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690635c11d79590611f36908a908a908e908e9030908d90600401612dca565b600060405180830381600087803b158015611f5057600080fd5b505af1158015611f64573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201528392506001600160a01b03851691506370a0823190602401602060405180830381865afa158015611fae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd29190612d0b565b611fdc9190612af2565b9a9950505050505050505050565b6040516001600160a01b0383166024820152604481018290526116119084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526122ba565b6000546001600160a01b031633146112345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106cf565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8047101561219a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106cf565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146121e7576040519150601f19603f3d011682016040523d82523d6000602084013e6121ec565b606091505b50509050806116115760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106cf565b6040516001600160a01b03808516602483015283166044820152606481018290526122b49085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161202f565b50505050565b600061230f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661239f9092919063ffffffff16565b805190915015611611578080602001905181019061232d9190612dad565b6116115760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106cf565b6060610cb3848460008585600080866001600160a01b031685876040516123c69190612e08565b60006040518083038185875af1925050503d8060008114612403576040519150601f19603f3d011682016040523d82523d6000602084013e612408565b606091505b509150915061241987838387612424565b979650505050505050565b6060831561249357825160000361248c576001600160a01b0385163b61248c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106cf565b5081610cb3565b610cb383838151156124a85781518083602001fd5b8060405162461bcd60e51b81526004016106cf9190612e24565b828054828255906000526020600020908101928215612522579160200282015b8281111561252257815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038435161782556020909201916001909101906124e2565b5061252e929150612532565b5090565b5b8082111561252e5760008155600101612533565b6001600160a01b038116811461195357600080fd5b60008083601f84011261256e57600080fd5b50813567ffffffffffffffff81111561258657600080fd5b6020830191508360208260051b85010111156125a157600080fd5b9250929050565b600080600080600080600060c0888a0312156125c357600080fd5b8735965060208801356125d581612547565b9550604088013567ffffffffffffffff8111156125f157600080fd5b6125fd8a828b0161255c565b989b979a50986060810135976080820135975060a09091013595509350505050565b60006020828403121561263157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561266157600080fd5b82359150602083013567ffffffffffffffff8082111561268057600080fd5b818501915085601f83011261269457600080fd5b8135818111156126a6576126a6612638565b604051601f8201601f19908116603f011681019083821181831017156126ce576126ce612638565b816040528281528860208487010111156126e757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006060848603121561271e57600080fd5b833561272981612547565b925060208401359150604084013561274081612547565b809150509250925092565b6000806000806080858703121561276157600080fd5b843561276c81612547565b9350602085013561277c81612547565b9250604085013561278c81612547565b9396929550929360600135925050565b6000602082840312156127ae57600080fd5b8135610aed81612547565b600080604083850312156127cc57600080fd5b82356127d781612547565b915060208301356127e781612547565b809150509250929050565b60008060006040848603121561280757600080fd5b833567ffffffffffffffff8082111561281f57600080fd5b818601915086601f83011261283357600080fd5b81358181111561284257600080fd5b87602082850101111561285457600080fd5b6020928301955093505084013561274081612547565b60005b8381101561288557818101518382015260200161286d565b50506000910152565b600081518084526128a681602086016020860161286a565b601f01601f19169290920160200192915050565b600060a0820160a0835280885180835260c08501915060c08160051b86010192506020808b0160005b838110156129505787860360bf190185528151805167ffffffffffffffff168752838101516001600160a01b03168488015260408082015115159088015260609081015160809188018290529061293c8189018361288e565b9750505093820193908201906001016128e3565b50508394506129698187018b6001600160a01b03169052565b5050506001600160a01b0386166040840152506060820193909352608001529392505050565b600080602083850312156129a257600080fd5b823567ffffffffffffffff8111156129b957600080fd5b6129c58582860161255c565b90969095509350505050565b801515811461195357600080fd5b600080604083850312156129f257600080fd5b8235915060208301356127e7816129d1565b67ffffffffffffffff851681526001600160a01b03841660208201528215156040820152608060608201526000612a3e608083018461288e565b9695505050505050565b60008060408385031215612a5b57600080fd5b50508035926020909101359150565b60008060008060608587031215612a8057600080fd5b8435612a8b81612547565b935060208501359250604085013567ffffffffffffffff811115612aae57600080fd5b612aba8782880161255c565b95989497509550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156117f1576117f1612adc565b80820281158282048414176117f1576117f1612adc565b600082612b3957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612b5057600080fd5b8151610aed81612547565b600181811c90821680612b6f57607f821691505b602082108103612b8f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561161157600081815260208120601f850160051c81016020861015612bbc5750805b601f850160051c820191505b81811015612bdb57828155600101612bc8565b505050505050565b815167ffffffffffffffff811115612bfd57612bfd612638565b612c1181612c0b8454612b5b565b84612b95565b602080601f831160018114612c465760008415612c2e5750858301515b600019600386901b1c1916600185901b178555612bdb565b600085815260208120601f198616915b82811015612c7557888601518255948401946001909101908401612c56565b5085821015612c935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80516dffffffffffffffffffffffffffff81168114612cc157600080fd5b919050565b600080600060608486031215612cdb57600080fd5b612ce484612ca3565b9250612cf260208501612ca3565b9150604084015163ffffffff8116811461274057600080fd5b600060208284031215612d1d57600080fd5b5051919050565b8183526000602080850194508260005b85811015612d62578135612d4781612547565b6001600160a01b031687529582019590820190600101612d34565b509495945050505050565b602081526000610cb3602083018486612d24565b808201808211156117f1576117f1612adc565b600060018201612da657612da6612adc565b5060010190565b600060208284031215612dbf57600080fd5b8151610aed816129d1565b86815285602082015260a060408201526000612dea60a083018688612d24565b6001600160a01b039490941660608301525060800152949350505050565b60008251612e1a81846020870161286a565b9190910192915050565b602081526000610aed602083018461288e56fea26469706673582212200eb2ffc6bb5f5f5b4d80809272d52d1bc4a9306ca577a552d0f34f7ad304606a64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000002d9
-----Decoded View---------------
Arg [0] : _destination (address): 0xd08481058399490B83a72676901d4e9dB70E75aC
Arg [1] : _wNative (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _fee (uint96): 729
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d08481058399490b83a72676901d4e9db70e75ac
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 00000000000000000000000000000000000000000000000000000000000002d9
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,339.18 | 0.00193253 | $6.45 |
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.