Contract
0x7adbbbe2da9ee040e6b41081c4b0d91a9db81c08
1
Contract Overview
Balance:
0 CRO
CRO Value:
$0.00
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 13 internal transactions
[ Download CSV Export ]
Contract Name:
WowmaxRouter
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint wad) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; interface IWowmaxRouter { struct ExchangeSubRoute { address from; address to; uint256 part; address addr; bytes32 family; uint256 fee; uint256 feeDenominator; bytes data; } struct ExchangeRoute { uint256 amountIn; uint256 parts; ExchangeSubRoute[][] subRoutes; } struct ExchangeRequest { address from; // from token uint256 amountIn; address[] to; // to tokens ExchangeRoute[] exchangeRoutes; uint256[] slippage; uint256[] amountOutExpected; } function exchange(ExchangeRequest calldata request) external payable returns (uint256[] memory amountsOut); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IWowmaxRouter.sol"; interface ICurvePool { function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external; } library Curve { using SafeERC20 for IERC20; function swap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { (int128 from, int128 to) = abi.decode(subRoute.data, (int128, int128)); uint256 balanceBefore = IERC20(subRoute.to).balanceOf(address(this)); IERC20(subRoute.from).approve(subRoute.addr, amountIn); ICurvePool(subRoute.addr).exchange(from, to, amountIn, 0); amountOut = IERC20(subRoute.to).balanceOf(address(this)) - balanceBefore; if (receiver != address(this)) { IERC20(subRoute.to).safeTransfer(receiver, amountOut); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IWowmaxRouter.sol"; interface DODOV2Pool { function sellBase(address to) external returns (uint256); function sellQuote(address to) external returns (uint256); function getPMMStateForCall() external view returns (uint256 i, uint256 K, uint256 B, uint256 Q, uint256 B0, uint256 Q0, uint256 R); function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate); } library DODOV2 { uint8 constant BASE_TO_QUOTE = 0; uint8 constant QUOTE_TO_BASE = 1; using SafeERC20 for IERC20; function swap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { IERC20(subRoute.from).safeTransfer(subRoute.addr, amountIn); uint8 direction = abi.decode(subRoute.data, (uint8)); if (direction == BASE_TO_QUOTE) { amountOut = DODOV2Pool(subRoute.addr).sellBase(receiver); } else { amountOut = DODOV2Pool(subRoute.addr).sellQuote(receiver); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IWowmaxRouter.sol"; interface IHashflowRouter { struct RFQTQuote { address pool; address externalAccount; address trader; address effectiveTrader; address baseToken; address quoteToken; uint256 effectiveBaseTokenAmount; uint256 maxBaseTokenAmount; uint256 maxQuoteTokenAmount; uint256 quoteExpiry; uint256 nonce; bytes32 txid; bytes signature; } function tradeSingleHop(RFQTQuote calldata quote) external payable; } library Hashflow { using SafeERC20 for IERC20; function swap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { IHashflowRouter.RFQTQuote memory quote = abi.decode(subRoute.data, (IHashflowRouter.RFQTQuote)); IERC20(subRoute.from).approve(subRoute.addr, amountIn); if (amountIn < quote.maxBaseTokenAmount) { quote.effectiveBaseTokenAmount = amountIn; } uint256 balanceBefore = IERC20(subRoute.to).balanceOf(address(this)); IHashflowRouter(subRoute.addr).tradeSingleHop(quote); amountOut = IERC20(subRoute.to).balanceOf(address(this)) - balanceBefore; if (receiver != address(this)) { IERC20(subRoute.to).safeTransfer(receiver, amountOut); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IWowmaxRouter.sol"; interface IPancakeStablePool { // Same as Curve but uses uint256 instead of int128 function exchange(uint256 i, uint256 j, uint256 dx, uint256 min_dy) external; function coins(uint256 i) external view returns (address); } library PancakeSwapStable { using SafeERC20 for IERC20; function swap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { (int128 from, int128 to) = abi.decode(subRoute.data, (int128, int128)); uint256 balanceBefore = IERC20(subRoute.to).balanceOf(address(this)); IERC20(subRoute.from).approve(subRoute.addr, amountIn); IPancakeStablePool(subRoute.addr).exchange(uint256(uint128(from)), uint256(uint128(to)), amountIn, 0); amountOut = IERC20(subRoute.to).balanceOf(address(this)) - balanceBefore; if (receiver != address(this)) { IERC20(subRoute.to).safeTransfer(receiver, amountOut); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IWowmaxRouter.sol"; interface ISaddlePool { function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external; } library Saddle { using SafeERC20 for IERC20; function swap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { (uint8 from, uint8 to) = abi.decode(subRoute.data, (uint8, uint8)); uint256 balanceBefore = IERC20(subRoute.to).balanceOf(address(this)); IERC20(subRoute.from).approve(subRoute.addr, amountIn); ISaddlePool(subRoute.addr).swap(from, to, amountIn, 0, type(uint256).max); amountOut = IERC20(subRoute.to).balanceOf(address(this)) - balanceBefore; if (receiver != address(this)) { IERC20(subRoute.to).safeTransfer(receiver, amountOut); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IWowmaxRouter.sol"; interface IUniswapV2Pair { function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function router() external returns (address); } interface IUniswapV2Router { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } library UniswapV2 { using SafeERC20 for IERC20; function swap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { IERC20(subRoute.from).safeTransfer(subRoute.addr, amountIn); bool directSwap = IUniswapV2Pair(subRoute.addr).token0() == subRoute.from; (uint112 reserveIn, uint112 reserveOut) = getReserves(subRoute.addr, directSwap); amountOut = getAmountOut(amountIn, reserveIn, reserveOut, subRoute.fee, subRoute.feeDenominator); if (amountOut > 0) { IUniswapV2Pair(subRoute.addr).swap( directSwap ? 0 : amountOut, directSwap ? amountOut : 0, receiver, new bytes(0) ); } } function routerSwap( uint256 amountIn, IWowmaxRouter.ExchangeSubRoute calldata subRoute, address receiver ) internal returns (uint256 amountOut) { IUniswapV2Router router = IUniswapV2Router(IUniswapV2Pair(subRoute.addr).router()); IERC20(subRoute.from).safeApprove(address(router), amountIn); address[] memory path = new address[](2); path[0] = subRoute.from; path[1] = subRoute.to; return router.swapExactTokensForTokens(amountIn, 0, path, receiver, type(uint256).max)[1]; } function getReserves(address pair, bool directSwap) private view returns (uint112 reserveIn, uint112 reserveOut) { (uint112 reserve0, uint112 reserve1, ) = IUniswapV2Pair(pair).getReserves(); return directSwap ? (reserve0, reserve1) : (reserve1, reserve0); } function getAmountOut( uint256 amountIn, uint112 reserveIn, uint112 reserveOut, uint256 fee, uint256 feeDenominator ) private pure returns (uint256 amountOut) { uint256 amountInWithFee = amountIn * (feeDenominator - fee); uint256 numerator = amountInWithFee * reserveOut; uint256 denominator = reserveIn * feeDenominator + amountInWithFee; amountOut = numerator / denominator; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.17; import "./interfaces/IWowmaxRouter.sol"; import "./interfaces/IWETH.sol"; import "./libraries/UniswapV2.sol"; import "./libraries/Curve.sol"; import "./libraries/PancakeSwapStable.sol"; import "./libraries/DODOV2.sol"; import "./libraries/Hashflow.sol"; import "./libraries/Saddle.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract WowmaxRouter is IWowmaxRouter, Ownable, ReentrancyGuard { IWETH public WETH; address public treasury; bytes32 constant UNISWAP_V2 = "UNISWAP_V2"; bytes32 constant UNISWAP_V2_ROUTER = "UNISWAP_V2_ROUTER"; bytes32 constant CURVE = "CURVE"; bytes32 constant DODO_V2 = "DODO_V2"; bytes32 constant HASHFLOW = "HASHFLOW"; bytes32 constant PANCAKESWAP_STABLE = "PANCAKESWAP_STABLE"; bytes32 constant SADDLE = "SADDLE"; using SafeERC20 for IERC20; constructor(address _weth, address _treasury) { require(_weth != address(0), "WOWMAX: Wrong WETH address"); require(_treasury != address(0), "WOWMAX: Wrong treasury address"); WETH = IWETH(_weth); treasury = _treasury; } receive() external payable { require(_msgSender() == payable(address(WETH)), "WOWMAX: Forbidden token transfer"); // only accept chain tokens via fallback from the wrapper contract } function exchange( ExchangeRequest calldata request ) external payable override nonReentrant returns (uint256[] memory amountsOut) { receiveTokens(request); for (uint256 i = 0; i < request.exchangeRoutes.length; i++) { exchange(request.exchangeRoutes[i]); } return transferTokens(request); } function receiveTokens(ExchangeRequest calldata request) private { if (msg.value > 0 && request.from == address(0) && request.amountIn == 0) { WETH.deposit{ value: msg.value }(); } else { if (request.amountIn > 0) { IERC20(request.from).safeTransferFrom(msg.sender, address(this), request.amountIn); } } } function transferTokens(ExchangeRequest calldata request) private returns (uint256[] memory amountsOut) { amountsOut = new uint256[](request.to.length); uint256 amountOut; IERC20 token; for (uint256 i = 0; i < request.to.length; i++) { token = IERC20(request.to[i]); amountOut = token.balanceOf(address(this)); uint256 amountExtra; if (amountOut > request.amountOutExpected[i]) { amountExtra = amountOut - request.amountOutExpected[i]; amountsOut[i] = request.amountOutExpected[i]; } else { require( amountOut >= (request.amountOutExpected[i] * (10000 - request.slippage[i])) / 10000, "WOWMAX: Insufficient output amount" ); amountsOut[i] = amountOut; } if (address(token) == address(WETH)) { WETH.withdraw(amountOut); } transfer(token, treasury, amountExtra); transfer(token, msg.sender, amountsOut[i]); } } function transfer(IERC20 token, address to, uint256 amount) internal { if (amount == 0) { return; } if (address(token) == address(WETH)) { payable(to).transfer(amount); } else { token.safeTransfer(to, amount); } } function exchange(ExchangeRoute calldata exchangeRoute) private { uint256 amountIn = exchangeRoute.amountIn; for (uint256 i = 0; i < exchangeRoute.subRoutes.length; i++) { amountIn = exchange(amountIn, exchangeRoute.parts, exchangeRoute.subRoutes[i]); } } function exchange( uint256 amountIn, uint256 parts, ExchangeSubRoute[] calldata subRoutes ) private returns (uint256 amountOut) { for (uint256 i = 0; i < subRoutes.length; i++) { amountOut += swap((amountIn * subRoutes[i].part) / parts, subRoutes[i], address(this)); } } function swap( uint256 amountIn, ExchangeSubRoute calldata subRoute, address receiver ) internal virtual returns (uint256) { if (subRoute.family == UNISWAP_V2) { return UniswapV2.swap(amountIn, subRoute, receiver); } else if (subRoute.family == UNISWAP_V2_ROUTER) { return UniswapV2.routerSwap(amountIn, subRoute, receiver); } else if (subRoute.family == CURVE) { return Curve.swap(amountIn, subRoute, receiver); } else if (subRoute.family == PANCAKESWAP_STABLE) { return PancakeSwapStable.swap(amountIn, subRoute, receiver); } else if (subRoute.family == DODO_V2) { return DODOV2.swap(amountIn, subRoute, receiver); } else if (subRoute.family == HASHFLOW) { return Hashflow.swap(amountIn, subRoute, receiver); } else if (subRoute.family == SADDLE) { return Saddle.swap(amountIn, subRoute, receiver); } else { revert("WOWMAX: Not implemented exchange family"); } } function withdraw(address token, uint256 amount) external onlyOwner { IERC20(token).safeTransfer(treasury, amount); } function withdrawETH(uint256 amount) external onlyOwner { (bool success, ) = payable(treasury).call{ value: amount }(new bytes(0)); require(success, "WOWMAX: ETH transfer failed"); } }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 800 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"to","type":"address[]"},{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"parts","type":"uint256"},{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"part","type":"uint256"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"bytes32","name":"family","type":"bytes32"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"feeDenominator","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IWowmaxRouter.ExchangeSubRoute[][]","name":"subRoutes","type":"tuple[][]"}],"internalType":"struct IWowmaxRouter.ExchangeRoute[]","name":"exchangeRoutes","type":"tuple[]"},{"internalType":"uint256[]","name":"slippage","type":"uint256[]"},{"internalType":"uint256[]","name":"amountOutExpected","type":"uint256[]"}],"internalType":"struct IWowmaxRouter.ExchangeRequest","name":"request","type":"tuple"}],"name":"exchange","outputs":[{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200299d3803806200299d833981016040819052620000349162000196565b6200003f3362000129565b600180556001600160a01b0382166200009f5760405162461bcd60e51b815260206004820152601a60248201527f574f574d41583a2057726f6e672057455448206164647265737300000000000060448201526064015b60405180910390fd5b6001600160a01b038116620000f75760405162461bcd60e51b815260206004820152601e60248201527f574f574d41583a2057726f6e6720747265617375727920616464726573730000604482015260640162000096565b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055620001ce565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200019157600080fd5b919050565b60008060408385031215620001aa57600080fd5b620001b58362000179565b9150620001c56020840162000179565b90509250929050565b6127bf80620001de6000396000f3fe60806040526004361061007f5760003560e01c8063f14210a61161004e578063f14210a614610183578063f2fde38b146101a3578063f3fef3a3146101c3578063f6d7fbd6146101e357600080fd5b806361d027b3146100f3578063715018a6146101305780638da5cb5b14610145578063ad5c46481461016357600080fd5b366100ee576002546001600160a01b0316336001600160a01b0316146100ec5760405162461bcd60e51b815260206004820181905260248201527f574f574d41583a20466f7262696464656e20746f6b656e207472616e7366657260448201526064015b60405180910390fd5b005b600080fd5b3480156100ff57600080fd5b50600354610113906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013c57600080fd5b506100ec610203565b34801561015157600080fd5b506000546001600160a01b0316610113565b34801561016f57600080fd5b50600254610113906001600160a01b031681565b34801561018f57600080fd5b506100ec61019e366004611f30565b610217565b3480156101af57600080fd5b506100ec6101be366004611f69565b6102e0565b3480156101cf57600080fd5b506100ec6101de366004611f86565b610370565b6101f66101f1366004611fb2565b610392565b6040516101279190611fed565b61020b610421565b610215600061047b565b565b61021f610421565b6003546040805160008082526020820192839052926001600160a01b03169184916102499161206b565b60006040518083038185875af1925050503d8060008114610286576040519150601f19603f3d011682016040523d82523d6000602084013e61028b565b606091505b50509050806102dc5760405162461bcd60e51b815260206004820152601b60248201527f574f574d41583a20455448207472616e73666572206661696c6564000000000060448201526064016100e3565b5050565b6102e8610421565b6001600160a01b0381166103645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016100e3565b61036d8161047b565b50565b610378610421565b6003546102dc906001600160a01b038481169116836104e3565b606061039c610560565b6103a5826105b9565b60005b6103b56060840184612087565b9050811015610407576103f56103ce6060850185612087565b838181106103de576103de6120d1565b90506020028101906103f091906120e7565b61068e565b806103ff81612113565b9150506103a8565b50610411826106fa565b905061041c60018055565b919050565b6000546001600160a01b031633146102155760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016100e3565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03831660248201526044810182905261055b90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152610a61565b505050565b6002600154036105b25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016100e3565b6002600155565b6000341180156105de575060006105d36020830183611f69565b6001600160a01b0316145b80156105ec57506020810135155b1561065d57600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561064157600080fd5b505af1158015610655573d6000803e3d6000fd5b505050505050565b60208101351561036d5761036d33306020840180359061067d9086611f69565b6001600160a01b0316929190610b46565b803560005b6106a06040840184612087565b905081101561055b576106e68260208501356106bf6040870187612087565b858181106106cf576106cf6120d1565b90506020028101906106e19190612087565b610b84565b9150806106f281612113565b915050610693565b60606107096040830183612087565b905067ffffffffffffffff81111561072357610723612031565b60405190808252806020026020018201604052801561074c578160200160208202803683370190505b50905060008060005b6107626040860186612087565b9050811015610a59576107786040860186612087565b82818110610788576107886120d1565b905060200201602081019061079d9190611f69565b6040516370a0823160e01b81523060048201529092506001600160a01b038316906370a0823190602401602060405180830381865afa1580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610808919061212c565b9250600061081960a0870187612087565b83818110610829576108296120d1565b905060200201358411156108af5761084460a0870187612087565b83818110610854576108546120d1565b90506020020135846108669190612145565b905061087560a0870187612087565b83818110610885576108856120d1565b9050602002013585838151811061089e5761089e6120d1565b602002602001018181525050610995565b6127106108bf6080880188612087565b848181106108cf576108cf6120d1565b905060200201356127106108e39190612145565b6108f060a0890189612087565b85818110610900576109006120d1565b90506020020135610911919061215e565b61091b9190612175565b8410156109755760405162461bcd60e51b815260206004820152602260248201527f574f574d41583a20496e73756666696369656e74206f757470757420616d6f756044820152611b9d60f21b60648201526084016100e3565b83858381518110610988576109886120d1565b6020026020010181815250505b6002546001600160a01b0390811690841603610a0a57600254604051632e1a7d4d60e01b8152600481018690526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b1580156109f157600080fd5b505af1158015610a05573d6000803e3d6000fd5b505050505b600354610a229084906001600160a01b031683610c21565b610a468333878581518110610a3957610a396120d1565b6020026020010151610c21565b5080610a5181612113565b915050610755565b505050919050565b6000610ab6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c8e9092919063ffffffff16565b80519091501561055b5780806020019051810190610ad49190612197565b61055b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016100e3565b6040516001600160a01b0380851660248301528316604482015260648101829052610b7e9085906323b872dd60e01b9060840161050f565b50505050565b6000805b82811015610c1857610bfa85858584818110610ba657610ba66120d1565b9050602002810190610bb891906121b9565b610bc690604001358961215e565b610bd09190612175565b858584818110610be257610be26120d1565b9050602002810190610bf491906121b9565b30610ca7565b610c0490836121cf565b915080610c1081612113565b915050610b88565b50949350505050565b80600003610c2e57505050565b6002546001600160a01b0390811690841603610c7a576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610b7e573d6000803e3d6000fd5b61055b6001600160a01b03841683836104e3565b6060610c9d8484600085610e98565b90505b9392505050565b60007f554e49535741505f563200000000000000000000000000000000000000000000836080013503610ce657610cdf848484610f8c565b9050610ca0565b7f554e49535741505f56325f524f55544552000000000000000000000000000000836080013503610d1c57610cdf84848461113b565b7f4355525645000000000000000000000000000000000000000000000000000000836080013503610d5257610cdf848484611302565b7f50414e43414b45535741505f535441424c450000000000000000000000000000836080013503610d8857610cdf848484611574565b7f444f444f5f563200000000000000000000000000000000000000000000000000836080013503610dbe57610cdf848484611718565b7f48415348464c4f57000000000000000000000000000000000000000000000000836080013503610df457610cdf848484611861565b7f534144444c450000000000000000000000000000000000000000000000000000836080013503610e2a57610cdf848484611ad3565b60405162461bcd60e51b815260206004820152602760248201527f574f574d41583a204e6f7420696d706c656d656e7465642065786368616e676560448201527f2066616d696c790000000000000000000000000000000000000000000000000060648201526084016100e3565b606082471015610f105760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016100e3565b600080866001600160a01b03168587604051610f2c919061206b565b60006040518083038185875af1925050503d8060008114610f69576040519150601f19603f3d011682016040523d82523d6000602084013e610f6e565b606091505b5091509150610f7f87838387611c70565b925050505b949350505050565b6000610fbf610fa16080850160608601611f69565b85610faf6020870187611f69565b6001600160a01b031691906104e3565b6000610fce6020850185611f69565b6001600160a01b0316610fe76080860160608701611f69565b6001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611024573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104891906121e2565b6001600160a01b031614905060008061107061106a6080880160608901611f69565b84611ce9565b915091506110898783838960a001358a60c00135611d73565b93508315611131576110a16080870160608801611f69565b6001600160a01b031663022c0d9f846110ba57856110bd565b60005b856110c95760006110cb565b865b604080516000815260208101918290526001600160e01b031960e086901b169091526110fe9291908a906024810161222b565b600060405180830381600087803b15801561111857600080fd5b505af115801561112c573d6000803e3d6000fd5b505050505b5050509392505050565b60008061114e6080850160608601611f69565b6001600160a01b031663f887ea406040518163ffffffff1660e01b81526004016020604051808303816000875af115801561118d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b191906121e2565b90506111d581866111c56020880188611f69565b6001600160a01b03169190611dea565b6040805160028082526060820183526000926020830190803683370190505090506112036020860186611f69565b81600081518110611216576112166120d1565b6001600160a01b0390921660209283029190910182015261123d9060408701908701611f69565b81600181518110611250576112506120d1565b6001600160a01b0392831660209182029290920101526040516338ed173960e01b8152908316906338ed17399061129690899060009086908a9060001990600401612263565b6000604051808303816000875af11580156112b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112dd919081019061232f565b6001815181106112ef576112ef6120d1565b6020026020010151925050509392505050565b6000808061131360e08601866123d5565b810190611320919061242e565b909250905060006113376040870160208801611f69565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561137d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a1919061212c565b90506113b06020870187611f69565b6001600160a01b031663095ea7b36113ce6080890160608a01611f69565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a90526044016020604051808303816000875af115801561141b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143f9190612197565b506114506080870160608801611f69565b604051630f7c084960e21b8152600f85810b600483015284900b602482015260448101899052600060648201526001600160a01b039190911690633df02124906084015b600060405180830381600087803b1580156114ae57600080fd5b505af11580156114c2573d6000803e3d6000fd5b508392506114d99150506040880160208901611f69565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561151f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611543919061212c565b61154d9190612145565b93506001600160a01b0385163014611131576111318585610faf60408a0160208b01611f69565b6000808061158560e08601866123d5565b810190611592919061242e565b909250905060006115a96040870160208801611f69565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156115ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611613919061212c565b90506116226020870187611f69565b6001600160a01b031663095ea7b36116406080890160608a01611f69565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a90526044016020604051808303816000875af115801561168d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b19190612197565b506116c26080870160608801611f69565b604051630b68372160e31b81526fffffffffffffffffffffffffffffffff80861660048301528416602482015260448101899052600060648201526001600160a01b039190911690635b41b90890608401611494565b600061172d610fa16080850160608601611f69565b600061173c60e08501856123d5565b8101906117499190612472565b905060ff81166117d8576117636080850160608601611f69565b604051632f58056d60e21b81526001600160a01b038581166004830152919091169063bd6015b4906024016020604051808303816000875af11580156117ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d1919061212c565b9150611859565b6117e86080850160608601611f69565b604051636ec9facd60e11b81526001600160a01b038581166004830152919091169063dd93f59a906024016020604051808303816000875af1158015611832573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611856919061212c565b91505b509392505050565b60008061187160e08501856123d5565b81019061187e91906124fd565b905061188d6020850185611f69565b6001600160a01b031663095ea7b36118ab6080870160608801611f69565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018890526044016020604051808303816000875af11580156118f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191c9190612197565b508060e001518510156119315760c081018590525b60006119436040860160208701611f69565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ad919061212c565b90506119bf6080860160608701611f69565b6001600160a01b031663f0210929836040518263ffffffff1660e01b81526004016119ea9190612615565b600060405180830381600087803b158015611a0457600080fd5b505af1158015611a18573d6000803e3d6000fd5b50839250611a2f9150506040870160208801611f69565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a99919061212c565b611aa39190612145565b92506001600160a01b0384163014611aca57611aca8484610faf6040890160208a01611f69565b50509392505050565b60008080611ae460e08601866123d5565b810190611af19190612707565b90925090506000611b086040870160208801611f69565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b72919061212c565b9050611b816020870187611f69565b6001600160a01b031663095ea7b3611b9f6080890160608a01611f69565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a90526044016020604051808303816000875af1158015611bec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c109190612197565b50611c216080870160608801611f69565b6040516348b4aac360e11b815260ff808616600483015284166024820152604481018990526000606482015260001960848201526001600160a01b03919091169063916955869060a401611494565b60608315611cdf578251600003611cd8576001600160a01b0385163b611cd85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100e3565b5081610f84565b610f848383611f06565b600080600080856001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d51919061274f565b509150915084611d62578082611d65565b81815b9350935050505b9250929050565b600080611d808484612145565b611d8a908861215e565b90506000611da86dffffffffffffffffffffffffffff87168361215e565b9050600082611dc7866dffffffffffffffffffffffffffff8b1661215e565b611dd191906121cf565b9050611ddd8183612175565b9998505050505050505050565b801580611e645750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e62919061212c565b155b611ed65760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016100e3565b6040516001600160a01b03831660248201526044810182905261055b90849063095ea7b360e01b9060640161050f565b815115611f165781518083602001fd5b8060405162461bcd60e51b81526004016100e3919061279f565b600060208284031215611f4257600080fd5b5035919050565b6001600160a01b038116811461036d57600080fd5b803561041c81611f49565b600060208284031215611f7b57600080fd5b8135610ca081611f49565b60008060408385031215611f9957600080fd5b8235611fa481611f49565b946020939093013593505050565b600060208284031215611fc457600080fd5b813567ffffffffffffffff811115611fdb57600080fd5b820160c08185031215610ca057600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561202557835183529284019291840191600101612009565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561206257818101518382015260200161204a565b50506000910152565b6000825161207d818460208701612047565b9190910192915050565b6000808335601e1984360301811261209e57600080fd5b83018035915067ffffffffffffffff8211156120b957600080fd5b6020019150600581901b3603821315611d6c57600080fd5b634e487b7160e01b600052603260045260246000fd5b60008235605e1983360301811261207d57600080fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612125576121256120fd565b5060010190565b60006020828403121561213e57600080fd5b5051919050565b81810381811115612158576121586120fd565b92915050565b8082028115828204841417612158576121586120fd565b60008261219257634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156121a957600080fd5b81518015158114610ca057600080fd5b6000823560fe1983360301811261207d57600080fd5b80820180821115612158576121586120fd565b6000602082840312156121f457600080fd5b8151610ca081611f49565b60008151808452612217816020860160208601612047565b601f01601f19169290920160200192915050565b8481528360208201526001600160a01b038316604082015260806060820152600061225960808301846121ff565b9695505050505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122b35784516001600160a01b03168352938301939183019160010161228e565b50506001600160a01b03969096166060850152505050608001529392505050565b6040516101a0810167ffffffffffffffff811182821017156122f8576122f8612031565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561232757612327612031565b604052919050565b6000602080838503121561234257600080fd5b825167ffffffffffffffff8082111561235a57600080fd5b818501915085601f83011261236e57600080fd5b81518181111561238057612380612031565b8060051b91506123918483016122fe565b81815291830184019184810190888411156123ab57600080fd5b938501935b838510156123c9578451825293850193908501906123b0565b98975050505050505050565b6000808335601e198436030181126123ec57600080fd5b83018035915067ffffffffffffffff82111561240757600080fd5b602001915036819003821315611d6c57600080fd5b8035600f81900b811461041c57600080fd5b6000806040838503121561244157600080fd5b61244a8361241c565b91506124586020840161241c565b90509250929050565b803560ff8116811461041c57600080fd5b60006020828403121561248457600080fd5b610ca082612461565b600082601f83011261249e57600080fd5b813567ffffffffffffffff8111156124b8576124b8612031565b6124cb601f8201601f19166020016122fe565b8181528460208386010111156124e057600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561250f57600080fd5b813567ffffffffffffffff8082111561252757600080fd5b908301906101a0828603121561253c57600080fd5b6125446122d4565b61254d83611f5e565b815261255b60208401611f5e565b602082015261256c60408401611f5e565b604082015261257d60608401611f5e565b606082015261258e60808401611f5e565b608082015261259f60a08401611f5e565b60a082015260c0838101359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401359082015261018080840135838111156125f857600080fd5b6126048882870161248d565b918301919091525095945050505050565b6020815261262f6020820183516001600160a01b03169052565b6000602083015161264b60408401826001600160a01b03169052565b5060408301516001600160a01b03811660608401525060608301516001600160a01b03811660808401525060808301516001600160a01b03811660a08401525060a08301516001600160a01b03811660c08401525060c083015160e08381019190915283015161010080840191909152830151610120808401919091528301516101408084019190915283015161016080840191909152830151610180808401919091528301516101a080840152610f846101c08401826121ff565b6000806040838503121561271a57600080fd5b61272383612461565b915061245860208401612461565b80516dffffffffffffffffffffffffffff8116811461041c57600080fd5b60008060006060848603121561276457600080fd5b61276d84612731565b925061277b60208501612731565b9150604084015163ffffffff8116811461279457600080fd5b809150509250925092565b602081526000610ca060208301846121ff56fea164736f6c6343000811000a0000000000000000000000005c7f8a570d578ed84e63fdfa7b1ee72deae1ae23000000000000000000000000bd4a0f12293c54e4e8ad221271cf0d395dd60a71
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005c7f8a570d578ed84e63fdfa7b1ee72deae1ae23000000000000000000000000bd4a0f12293c54e4e8ad221271cf0d395dd60a71
-----Decoded View---------------
Arg [0] : _weth (address): 0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23
Arg [1] : _treasury (address): 0xbd4a0f12293c54e4e8ad221271cf0d395dd60a71
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000005c7f8a570d578ed84e63fdfa7b1ee72deae1ae23
Arg [1] : 000000000000000000000000bd4a0f12293c54e4e8ad221271cf0d395dd60a71
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.