More Info
Private Name Tags
ContractCreator
Latest 22 from a total of 22 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Trade Single Hop | 17410408 | 682 days ago | IN | 0 ETH | 0.00297974 | ||||
Trade Single Hop | 17036352 | 735 days ago | IN | 0 ETH | 0.0066068 | ||||
Trade Single Hop | 17034528 | 735 days ago | IN | 0 ETH | 0.00759061 | ||||
Trade Single Hop | 17034339 | 735 days ago | IN | 0 ETH | 0.00844969 | ||||
Trade Single Hop | 16882369 | 757 days ago | IN | 0 ETH | 0.00345835 | ||||
Trade Single Hop | 16882358 | 757 days ago | IN | 0 ETH | 0.00427168 | ||||
Trade Single Hop | 16824698 | 765 days ago | IN | 0 ETH | 0.00599601 | ||||
Trade Single Hop | 16765226 | 773 days ago | IN | 0 ETH | 0.00393197 | ||||
Trade Single Hop | 16765179 | 773 days ago | IN | 0 ETH | 0.0049689 | ||||
Trade Single Hop | 16613306 | 795 days ago | IN | 0.0001 ETH | 0.00333078 | ||||
Trade Single Hop | 16607613 | 795 days ago | IN | 0 ETH | 0.00530303 | ||||
Trade Single Hop | 16607608 | 795 days ago | IN | 0 ETH | 0.00559706 | ||||
Trade Single Hop | 16607562 | 795 days ago | IN | 0 ETH | 0.00386096 | ||||
Trade Single Hop | 16607552 | 795 days ago | IN | 0.01326533 ETH | 0.0056721 | ||||
Trade Single Hop | 16607549 | 795 days ago | IN | 0.01327015 ETH | 0.00180075 | ||||
Trade Single Hop | 16607227 | 795 days ago | IN | 0 ETH | 0.00670056 | ||||
Trade Single Hop | 16605617 | 796 days ago | IN | 0 ETH | 0.0045872 | ||||
Trade Single Hop | 16604915 | 796 days ago | IN | 0 ETH | 0.00297258 | ||||
Trade Single Hop | 16604804 | 796 days ago | IN | 0 ETH | 0.00296699 | ||||
Trade Single Hop | 16604391 | 796 days ago | IN | 0 ETH | 0.00576075 | ||||
Trade Single Hop | 16602954 | 796 days ago | IN | 0 ETH | 0.00681522 | ||||
Trade Single Hop | 16602561 | 796 days ago | IN | 0 ETH | 0.00652625 |
Loading...
Loading
Contract Name:
Trader
Compiler Version
v0.8.16+commit.07a7930e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IHashflowQuote} from "../interfaces/IHashflowQuote.sol"; import {Sweepable} from "../utilities/Sweepable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract Trader is IHashflowQuote, Ownable, Sweepable, ReentrancyGuard { using SafeERC20 for IERC20; event SetConfig( IHashflowQuote router, uint256 feeBips ); event HashflowTradeSingleHop(IHashflowQuote.RFQTQuote quote); event HashflowTradeXChain(IHashflowQuote.XChainRFQTQuote quote, XChainMessageProtocol protocol); IHashflowQuote private router; uint256 private feeBips; constructor(IHashflowQuote _router, uint256 _feeBips, address payable _feeRecipient) Sweepable(_feeRecipient) { _setConfig(_router, _feeBips, _feeRecipient); } function getSplit(uint256 initialTotal) public view returns(uint256 baseTokenTotal, uint256 baseTokenAmount, uint256 baseTokenFee) { // calculate total, base, and fee token amounts exactly like they will be calculated during the trade baseTokenAmount = initialTotal * (10000 - feeBips) / 10000; baseTokenFee = getFee(baseTokenAmount); baseTokenTotal = baseTokenAmount + baseTokenFee; return (baseTokenTotal, baseTokenAmount, baseTokenFee); } function getFee(uint256 baseTokenAmount) public view returns(uint256 baseTokenFee) { baseTokenFee = baseTokenAmount * feeBips / (10000 - feeBips); } function tradeSingleHop(RFQTQuote calldata quote) public payable nonReentrant { // calculate the trade fee uint256 fee = getFee(quote.effectiveBaseTokenAmount); // transfer fee + effectiveBaseTokenAmount to contract so it can then transfer effectiveBaseTokenAmount to the maker if (quote.baseToken != address(0)) { // this is an ERC20 transfer: get all ERC20 tokens and approve the Hashflow router to withdraw the correct quantity IERC20(quote.baseToken).safeTransferFrom(msg.sender, address(this), quote.effectiveBaseTokenAmount + fee); IERC20(quote.baseToken).approve(address(router), quote.effectiveBaseTokenAmount); router.tradeSingleHop(quote); } else { // this is a native token transfer require(msg.value == quote.effectiveBaseTokenAmount + fee, "incorrect value"); // low level call to send along ETH in the internal tx (bool success,) = address(router).call{value: quote.effectiveBaseTokenAmount}(abi.encodeWithSignature("tradeSingleHop((address,address,address,address,address,address,uint256,uint256,uint256,uint256,uint256,bytes32,bytes))", quote)); require(success, "native base token trade failed"); } emit HashflowTradeSingleHop(quote); } function tradeXChain( XChainRFQTQuote calldata quote, XChainMessageProtocol protocol ) public payable nonReentrant { // calculate the trade fee uint256 fee = getFee(quote.baseTokenAmount); // transfer the trade fee to the fee recipient if (quote.baseToken != address(0)) { // this is an ERC20 transfer - pull in the base token including fee and approve Hashflow to pull the baseTokenAmount IERC20(quote.baseToken).safeTransferFrom(msg.sender, address(this), fee + quote.baseTokenAmount); IERC20(quote.baseToken).approve(address(router), quote.baseTokenAmount); // NOTE: for ERC20 base token trades, msg.value == xChainFeeEstimate (the fee is in ERC20) router.tradeXChain{value: msg.value}(quote, protocol); } else { // this is a native token transfer // NOTE: for native base token trades, msg.value == xChainFeeEstimate + quote.baseTokenAmount + fee router.tradeXChain{value: msg.value - fee}(quote, protocol); } emit HashflowTradeXChain(quote, protocol); } function _setConfig( IHashflowQuote _router, uint256 _feeBips, address payable _feeRecipient ) private { router = _router; feeBips = _feeBips; _setSweepRecipient(_feeRecipient); emit SetConfig(router, feeBips); } function setConfig ( IHashflowQuote _router, uint256 _feeBips, address payable _feeRecipient ) external onlyOwner { _setConfig(_router, _feeBips, _feeRecipient); } function getConfig () external view returns (IHashflowQuote, uint256, address payable) { return (router, feeBips, getSweepRecipient()); } }
// 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 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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 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.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; interface IHashflowQuote { 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; } struct XChainRFQTQuote { uint16 srcChainId; uint16 dstChainId; address srcPool; bytes32 dstPool; address srcExternalAccount; bytes32 dstExternalAccount; address trader; address baseToken; address quoteToken; uint256 baseTokenAmount; uint256 quoteTokenAmount; uint256 quoteExpiry; uint256 nonce; bytes32 txid; bytes signature; } enum XChainMessageProtocol { layerZero, wormhole } function tradeSingleHop (RFQTQuote calldata quote) external payable; function tradeXChain ( XChainRFQTQuote calldata quote, XChainMessageProtocol protocol ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; abstract contract Sweepable is Ownable { using SafeERC20 for IERC20; event SetSweepRecipient(address recipient); event SweepToken(address indexed token, uint256 amount); event SweepNative(uint256 amount); address payable private recipient; constructor(address payable _recipient) { _setSweepRecipient(_recipient); } // Sweep an ERC20 token to the owner function sweepToken(IERC20 token) external onlyOwner { uint256 amount = token.balanceOf(address(this)); token.safeTransfer(recipient, amount); emit SweepToken(address(token), amount); } function sweepToken(IERC20 token, uint256 amount) external onlyOwner { token.safeTransfer(recipient, amount); emit SweepToken(address(token), amount); } // sweep native token to the recipient (public function) function sweepNative() external { uint256 amount = address(this).balance; (bool success, ) = recipient.call{value: amount}(""); require(success, "Transfer failed."); emit SweepNative(amount); } function sweepNative(uint256 amount) external onlyOwner { (bool success, ) = recipient.call{value: amount}(""); require(success, "Transfer failed."); emit SweepNative(amount); } function getSweepRecipient() public view returns (address payable) { return recipient; } function _setSweepRecipient(address payable _recipient) internal { recipient = _recipient; emit SetSweepRecipient(recipient); } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IHashflowQuote","name":"_router","type":"address"},{"internalType":"uint256","name":"_feeBips","type":"uint256"},{"internalType":"address payable","name":"_feeRecipient","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"address","name":"externalAccount","type":"address"},{"internalType":"address","name":"trader","type":"address"},{"internalType":"address","name":"effectiveTrader","type":"address"},{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"effectiveBaseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"maxBaseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"maxQuoteTokenAmount","type":"uint256"},{"internalType":"uint256","name":"quoteExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes32","name":"txid","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"indexed":false,"internalType":"struct IHashflowQuote.RFQTQuote","name":"quote","type":"tuple"}],"name":"HashflowTradeSingleHop","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"uint16","name":"dstChainId","type":"uint16"},{"internalType":"address","name":"srcPool","type":"address"},{"internalType":"bytes32","name":"dstPool","type":"bytes32"},{"internalType":"address","name":"srcExternalAccount","type":"address"},{"internalType":"bytes32","name":"dstExternalAccount","type":"bytes32"},{"internalType":"address","name":"trader","type":"address"},{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"baseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"quoteTokenAmount","type":"uint256"},{"internalType":"uint256","name":"quoteExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes32","name":"txid","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"indexed":false,"internalType":"struct IHashflowQuote.XChainRFQTQuote","name":"quote","type":"tuple"},{"indexed":false,"internalType":"enum IHashflowQuote.XChainMessageProtocol","name":"protocol","type":"uint8"}],"name":"HashflowTradeXChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IHashflowQuote","name":"router","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeBips","type":"uint256"}],"name":"SetConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"SetSweepRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SweepNative","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SweepToken","type":"event"},{"inputs":[],"name":"getConfig","outputs":[{"internalType":"contract IHashflowQuote","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"baseTokenAmount","type":"uint256"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"baseTokenFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"initialTotal","type":"uint256"}],"name":"getSplit","outputs":[{"internalType":"uint256","name":"baseTokenTotal","type":"uint256"},{"internalType":"uint256","name":"baseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"baseTokenFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSweepRecipient","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","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":"contract IHashflowQuote","name":"_router","type":"address"},{"internalType":"uint256","name":"_feeBips","type":"uint256"},{"internalType":"address payable","name":"_feeRecipient","type":"address"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"address","name":"externalAccount","type":"address"},{"internalType":"address","name":"trader","type":"address"},{"internalType":"address","name":"effectiveTrader","type":"address"},{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"effectiveBaseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"maxBaseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"maxQuoteTokenAmount","type":"uint256"},{"internalType":"uint256","name":"quoteExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes32","name":"txid","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct IHashflowQuote.RFQTQuote","name":"quote","type":"tuple"}],"name":"tradeSingleHop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"uint16","name":"dstChainId","type":"uint16"},{"internalType":"address","name":"srcPool","type":"address"},{"internalType":"bytes32","name":"dstPool","type":"bytes32"},{"internalType":"address","name":"srcExternalAccount","type":"address"},{"internalType":"bytes32","name":"dstExternalAccount","type":"bytes32"},{"internalType":"address","name":"trader","type":"address"},{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"address","name":"quoteToken","type":"address"},{"internalType":"uint256","name":"baseTokenAmount","type":"uint256"},{"internalType":"uint256","name":"quoteTokenAmount","type":"uint256"},{"internalType":"uint256","name":"quoteExpiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes32","name":"txid","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct IHashflowQuote.XChainRFQTQuote","name":"quote","type":"tuple"},{"internalType":"enum IHashflowQuote.XChainMessageProtocol","name":"protocol","type":"uint8"}],"name":"tradeXChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620017ef380380620017ef83398101604081905262000034916200019e565b80620000403362000067565b6200004b81620000b7565b5060016002556200005e8383836200010b565b505050620001e6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fccdd1baf560d2682736fa25752c8ccc0c5fc4079b245b0acf7389776308d5b1f9060200160405180910390a150565b600380546001600160a01b0319166001600160a01b03851617905560048290556200013681620000b7565b600354600454604080516001600160a01b03909316835260208301919091527f2cf307a9b4b4038b7688388d90e62bab92dafa37f2d3de40f89afd489708342f910160405180910390a1505050565b6001600160a01b03811681146200019b57600080fd5b50565b600080600060608486031215620001b457600080fd5b8351620001c18162000185565b602085015160408601519194509250620001db8162000185565b809150509250925092565b6115f980620001f66000396000f3fe6080604052600436106100dd5760003560e01c8063c78d59851161007f578063ea1b8ccf11610059578063ea1b8ccf14610250578063f021092914610270578063f2fde38b14610283578063fcee45f4146102a357600080fd5b8063c78d5985146101ff578063e90a182f1461021d578063ea12c79f1461023d57600080fd5b8063715018a6116100bb578063715018a6146101645780638da5cb5b14610179578063ab803a76146101ab578063c3f909d4146101c057600080fd5b80631be19560146100e25780633cf3a02514610104578063514a681014610124575b600080fd5b3480156100ee57600080fd5b506101026100fd36600461101a565b6102d1565b005b34801561011057600080fd5b5061010261011f366004611037565b6103a8565b34801561013057600080fd5b5061014461013f366004611037565b610488565b604080519384526020840192909252908201526060015b60405180910390f35b34801561017057600080fd5b506101026104d3565b34801561018557600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161015b565b3480156101b757600080fd5b506101026104e7565b3480156101cc57600080fd5b506101d5610505565b604080516001600160a01b039485168152602081019390935292169181019190915260600161015b565b34801561020b57600080fd5b506001546001600160a01b0316610193565b34801561022957600080fd5b50610102610238366004611050565b610539565b61010261024b36600461107c565b61055b565b34801561025c57600080fd5b5061010261026b3660046110d8565b6107c0565b61010261027e36600461111a565b6107d8565b34801561028f57600080fd5b5061010261029e36600461101a565b610af1565b3480156102af57600080fd5b506102c36102be366004611037565b610b6a565b60405190815260200161015b565b6102d9610b99565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610320573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103449190611166565b600154909150610361906001600160a01b03848116911683610bf3565b816001600160a01b03167ff4a44a7f605c4971a27bcecb448108e6328b7fad34fab5bff4f69377294b826d8260405161039c91815260200190565b60405180910390a25050565b6103b0610b99565b6001546040516000916001600160a01b03169083905b60006040518083038185875af1925050503d8060008114610403576040519150601f19603f3d011682016040523d82523d6000602084013e610408565b606091505b50509050806104515760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064015b60405180910390fd5b6040518281527f3b381fdfc0e2729a70e8b26ae2397e9014f703a8235b557f5581c4ed47280fd29060200160405180910390a15050565b60008060006127106004546127106104a09190611195565b6104aa90866111a8565b6104b491906111c7565b91506104bf82610b6a565b90506104cb81836111e9565b949193509150565b6104db610b99565b6104e56000610c56565b565b60015460405147916000916001600160a01b039091169083906103c6565b600354600454600091829182916001600160a01b03169061052e6001546001600160a01b031690565b925092509250909192565b610541610b99565b600154610361906001600160a01b03848116911683610bf3565b60028054036105ac5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610448565b6002805560006105c0610120840135610b6a565b905060006105d5610100850160e0860161101a565b6001600160a01b0316146107105761061933306105f7610120870135856111e9565b610608610100880160e0890161101a565b6001600160a01b0316929190610ca6565b61062a610100840160e0850161101a565b60035460405163095ea7b360e01b81526001600160a01b039182166004820152610120860135602482015291169063095ea7b3906044016020604051808303816000875af1158015610680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a491906111fc565b5060035460405163ea12c79f60e01b81526001600160a01b039091169063ea12c79f9034906106d990879087906004016112c8565b6000604051808303818588803b1580156106f257600080fd5b505af1158015610706573d6000803e3d6000fd5b505050505061077d565b6003546001600160a01b031663ea12c79f61072b8334611195565b85856040518463ffffffff1660e01b815260040161074a9291906112c8565b6000604051808303818588803b15801561076357600080fd5b505af1158015610777573d6000803e3d6000fd5b50505050505b7fec906251b2cc7eb7700459f1729ef4d96ffe409cc6fd303ee2ebb868000ab73783836040516107ae9291906112c8565b60405180910390a15050600160025550565b6107c8610b99565b6107d3838383610ce4565b505050565b60028054036108295760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610448565b60028055600061083c60c0830135610b6a565b9050600061085060a084016080850161101a565b6001600160a01b0316146109725761088133306108718460c08701356111e9565b61060860a087016080880161101a565b61089160a083016080840161101a565b60035460405163095ea7b360e01b81526001600160a01b03918216600482015260c0850135602482015291169063095ea7b3906044016020604051808303816000875af11580156108e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a91906111fc565b5060035460405163f021092960e01b81526001600160a01b039091169063f02109299061093b90859060040161142c565b600060405180830381600087803b15801561095557600080fd5b505af1158015610969573d6000803e3d6000fd5b50505050610ab1565b6109808160c08401356111e9565b34146109c05760405162461bcd60e51b815260206004820152600f60248201526e696e636f72726563742076616c756560881b6044820152606401610448565b6003546040516000916001600160a01b03169060c0850135906109e790869060240161142c565b60408051601f198184030181529181526020820180516001600160e01b031663f021092960e01b17905251610a1c9190611574565b60006040518083038185875af1925050503d8060008114610a59576040519150601f19603f3d011682016040523d82523d6000602084013e610a5e565b606091505b5050905080610aaf5760405162461bcd60e51b815260206004820152601e60248201527f6e6174697665206261736520746f6b656e207472616465206661696c656400006044820152606401610448565b505b7fa4af96c7b491f2481566e33486c7c1a41da02cff1d127d98bb211499f1bae34682604051610ae0919061142c565b60405180910390a150506001600255565b610af9610b99565b6001600160a01b038116610b5e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610448565b610b6781610c56565b50565b6000600454612710610b7c9190611195565b600454610b8990846111a8565b610b9391906111c7565b92915050565b6000546001600160a01b031633146104e55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610448565b6040516001600160a01b0383166024820152604481018290526107d390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d5c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610cde9085906323b872dd60e01b90608401610c1f565b50505050565b600380546001600160a01b0319166001600160a01b0385161790556004829055610d0d81610e2e565b600354600454604080516001600160a01b03909316835260208301919091527f2cf307a9b4b4038b7688388d90e62bab92dafa37f2d3de40f89afd489708342f910160405180910390a1505050565b6000610db1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e829092919063ffffffff16565b8051909150156107d35780806020019051810190610dcf91906111fc565b6107d35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610448565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fccdd1baf560d2682736fa25752c8ccc0c5fc4079b245b0acf7389776308d5b1f9060200160405180910390a150565b6060610e918484600085610e9b565b90505b9392505050565b606082471015610efc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610448565b6001600160a01b0385163b610f535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610448565b600080866001600160a01b03168587604051610f6f9190611574565b60006040518083038185875af1925050503d8060008114610fac576040519150601f19603f3d011682016040523d82523d6000602084013e610fb1565b606091505b5091509150610fc1828286610fcc565b979650505050505050565b60608315610fdb575081610e94565b825115610feb5782518084602001fd5b8160405162461bcd60e51b81526004016104489190611590565b6001600160a01b0381168114610b6757600080fd5b60006020828403121561102c57600080fd5b8135610e9481611005565b60006020828403121561104957600080fd5b5035919050565b6000806040838503121561106357600080fd5b823561106e81611005565b946020939093013593505050565b6000806040838503121561108f57600080fd5b823567ffffffffffffffff8111156110a657600080fd5b83016101e081860312156110b957600080fd5b91506020830135600281106110cd57600080fd5b809150509250929050565b6000806000606084860312156110ed57600080fd5b83356110f881611005565b925060208401359150604084013561110f81611005565b809150509250925092565b60006020828403121561112c57600080fd5b813567ffffffffffffffff81111561114357600080fd5b82016101a08185031215610e9457600080fd5b803561116181611005565b919050565b60006020828403121561117857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b9357610b9361117f565b60008160001904831182151516156111c2576111c261117f565b500290565b6000826111e457634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610b9357610b9361117f565b60006020828403121561120e57600080fd5b81518015158114610e9457600080fd5b803561ffff8116811461116157600080fd5b6000808335601e1984360301811261124757600080fd5b830160208101925035905067ffffffffffffffff81111561126757600080fd5b80360382131561127657600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600281106112c457634e487b7160e01b600052602160045260246000fd5b9052565b604081526112e4604082016112dc8561121e565b61ffff169052565b60006112f26020850161121e565b61ffff16606083015261130760408501611156565b6001600160a01b038116608084015250606084013560a083015261132d60808501611156565b6001600160a01b03811660c08401525060a084013560e083015261135360c08501611156565b61010061136a818501836001600160a01b03169052565b61137660e08701611156565b915061012061138f818601846001600160a01b03169052565b61139a828801611156565b925061014091506113b5828601846001600160a01b03169052565b610160925080870135838601525061018081870135818601526101a0915082870135828601526101c092508087013583860152506101e0818701358186015261140083880188611230565b93509150806102008601525061141b6102208501838361127d565b92505050610e9460208301846112a6565b6020815261144d6020820161144084611156565b6001600160a01b03169052565b600061145b60208401611156565b6001600160a01b03811660408401525061147760408401611156565b6001600160a01b03811660608401525061149360608401611156565b6001600160a01b0381166080840152506114af60808401611156565b6001600160a01b03811660a0840152506114cb60a08401611156565b6001600160a01b03811660c08401525060c083013560e083015261010060e084013581840152610120818501358185015261014091508085013582850152506101608185013581850152610180915080850135828501525061152f81850185611230565b6101a08581015291506115476101c08501838361127d565b95945050505050565b60005b8381101561156b578181015183820152602001611553565b50506000910152565b60008251611586818460208701611550565b9190910192915050565b60208152600082518060208401526115af816040850160208701611550565b601f01601f1916919091016040019291505056fea2646970667358221220913d12eaffcded24b4ce538884749b59eb43c3bef81f524d87af757d5023b96864736f6c63430008100033000000000000000000000000f6a94dfd0e6ea9ddfdffe4762ad4236576136613000000000000000000000000000000000000000000000000000000000000003200000000000000000000000099c4a6e4dde61bc1dc1a8a8c9609ddfa9126817c
Deployed Bytecode
0x6080604052600436106100dd5760003560e01c8063c78d59851161007f578063ea1b8ccf11610059578063ea1b8ccf14610250578063f021092914610270578063f2fde38b14610283578063fcee45f4146102a357600080fd5b8063c78d5985146101ff578063e90a182f1461021d578063ea12c79f1461023d57600080fd5b8063715018a6116100bb578063715018a6146101645780638da5cb5b14610179578063ab803a76146101ab578063c3f909d4146101c057600080fd5b80631be19560146100e25780633cf3a02514610104578063514a681014610124575b600080fd5b3480156100ee57600080fd5b506101026100fd36600461101a565b6102d1565b005b34801561011057600080fd5b5061010261011f366004611037565b6103a8565b34801561013057600080fd5b5061014461013f366004611037565b610488565b604080519384526020840192909252908201526060015b60405180910390f35b34801561017057600080fd5b506101026104d3565b34801561018557600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161015b565b3480156101b757600080fd5b506101026104e7565b3480156101cc57600080fd5b506101d5610505565b604080516001600160a01b039485168152602081019390935292169181019190915260600161015b565b34801561020b57600080fd5b506001546001600160a01b0316610193565b34801561022957600080fd5b50610102610238366004611050565b610539565b61010261024b36600461107c565b61055b565b34801561025c57600080fd5b5061010261026b3660046110d8565b6107c0565b61010261027e36600461111a565b6107d8565b34801561028f57600080fd5b5061010261029e36600461101a565b610af1565b3480156102af57600080fd5b506102c36102be366004611037565b610b6a565b60405190815260200161015b565b6102d9610b99565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610320573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103449190611166565b600154909150610361906001600160a01b03848116911683610bf3565b816001600160a01b03167ff4a44a7f605c4971a27bcecb448108e6328b7fad34fab5bff4f69377294b826d8260405161039c91815260200190565b60405180910390a25050565b6103b0610b99565b6001546040516000916001600160a01b03169083905b60006040518083038185875af1925050503d8060008114610403576040519150601f19603f3d011682016040523d82523d6000602084013e610408565b606091505b50509050806104515760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064015b60405180910390fd5b6040518281527f3b381fdfc0e2729a70e8b26ae2397e9014f703a8235b557f5581c4ed47280fd29060200160405180910390a15050565b60008060006127106004546127106104a09190611195565b6104aa90866111a8565b6104b491906111c7565b91506104bf82610b6a565b90506104cb81836111e9565b949193509150565b6104db610b99565b6104e56000610c56565b565b60015460405147916000916001600160a01b039091169083906103c6565b600354600454600091829182916001600160a01b03169061052e6001546001600160a01b031690565b925092509250909192565b610541610b99565b600154610361906001600160a01b03848116911683610bf3565b60028054036105ac5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610448565b6002805560006105c0610120840135610b6a565b905060006105d5610100850160e0860161101a565b6001600160a01b0316146107105761061933306105f7610120870135856111e9565b610608610100880160e0890161101a565b6001600160a01b0316929190610ca6565b61062a610100840160e0850161101a565b60035460405163095ea7b360e01b81526001600160a01b039182166004820152610120860135602482015291169063095ea7b3906044016020604051808303816000875af1158015610680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a491906111fc565b5060035460405163ea12c79f60e01b81526001600160a01b039091169063ea12c79f9034906106d990879087906004016112c8565b6000604051808303818588803b1580156106f257600080fd5b505af1158015610706573d6000803e3d6000fd5b505050505061077d565b6003546001600160a01b031663ea12c79f61072b8334611195565b85856040518463ffffffff1660e01b815260040161074a9291906112c8565b6000604051808303818588803b15801561076357600080fd5b505af1158015610777573d6000803e3d6000fd5b50505050505b7fec906251b2cc7eb7700459f1729ef4d96ffe409cc6fd303ee2ebb868000ab73783836040516107ae9291906112c8565b60405180910390a15050600160025550565b6107c8610b99565b6107d3838383610ce4565b505050565b60028054036108295760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610448565b60028055600061083c60c0830135610b6a565b9050600061085060a084016080850161101a565b6001600160a01b0316146109725761088133306108718460c08701356111e9565b61060860a087016080880161101a565b61089160a083016080840161101a565b60035460405163095ea7b360e01b81526001600160a01b03918216600482015260c0850135602482015291169063095ea7b3906044016020604051808303816000875af11580156108e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a91906111fc565b5060035460405163f021092960e01b81526001600160a01b039091169063f02109299061093b90859060040161142c565b600060405180830381600087803b15801561095557600080fd5b505af1158015610969573d6000803e3d6000fd5b50505050610ab1565b6109808160c08401356111e9565b34146109c05760405162461bcd60e51b815260206004820152600f60248201526e696e636f72726563742076616c756560881b6044820152606401610448565b6003546040516000916001600160a01b03169060c0850135906109e790869060240161142c565b60408051601f198184030181529181526020820180516001600160e01b031663f021092960e01b17905251610a1c9190611574565b60006040518083038185875af1925050503d8060008114610a59576040519150601f19603f3d011682016040523d82523d6000602084013e610a5e565b606091505b5050905080610aaf5760405162461bcd60e51b815260206004820152601e60248201527f6e6174697665206261736520746f6b656e207472616465206661696c656400006044820152606401610448565b505b7fa4af96c7b491f2481566e33486c7c1a41da02cff1d127d98bb211499f1bae34682604051610ae0919061142c565b60405180910390a150506001600255565b610af9610b99565b6001600160a01b038116610b5e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610448565b610b6781610c56565b50565b6000600454612710610b7c9190611195565b600454610b8990846111a8565b610b9391906111c7565b92915050565b6000546001600160a01b031633146104e55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610448565b6040516001600160a01b0383166024820152604481018290526107d390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d5c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052610cde9085906323b872dd60e01b90608401610c1f565b50505050565b600380546001600160a01b0319166001600160a01b0385161790556004829055610d0d81610e2e565b600354600454604080516001600160a01b03909316835260208301919091527f2cf307a9b4b4038b7688388d90e62bab92dafa37f2d3de40f89afd489708342f910160405180910390a1505050565b6000610db1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610e829092919063ffffffff16565b8051909150156107d35780806020019051810190610dcf91906111fc565b6107d35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610448565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fccdd1baf560d2682736fa25752c8ccc0c5fc4079b245b0acf7389776308d5b1f9060200160405180910390a150565b6060610e918484600085610e9b565b90505b9392505050565b606082471015610efc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610448565b6001600160a01b0385163b610f535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610448565b600080866001600160a01b03168587604051610f6f9190611574565b60006040518083038185875af1925050503d8060008114610fac576040519150601f19603f3d011682016040523d82523d6000602084013e610fb1565b606091505b5091509150610fc1828286610fcc565b979650505050505050565b60608315610fdb575081610e94565b825115610feb5782518084602001fd5b8160405162461bcd60e51b81526004016104489190611590565b6001600160a01b0381168114610b6757600080fd5b60006020828403121561102c57600080fd5b8135610e9481611005565b60006020828403121561104957600080fd5b5035919050565b6000806040838503121561106357600080fd5b823561106e81611005565b946020939093013593505050565b6000806040838503121561108f57600080fd5b823567ffffffffffffffff8111156110a657600080fd5b83016101e081860312156110b957600080fd5b91506020830135600281106110cd57600080fd5b809150509250929050565b6000806000606084860312156110ed57600080fd5b83356110f881611005565b925060208401359150604084013561110f81611005565b809150509250925092565b60006020828403121561112c57600080fd5b813567ffffffffffffffff81111561114357600080fd5b82016101a08185031215610e9457600080fd5b803561116181611005565b919050565b60006020828403121561117857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b9357610b9361117f565b60008160001904831182151516156111c2576111c261117f565b500290565b6000826111e457634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610b9357610b9361117f565b60006020828403121561120e57600080fd5b81518015158114610e9457600080fd5b803561ffff8116811461116157600080fd5b6000808335601e1984360301811261124757600080fd5b830160208101925035905067ffffffffffffffff81111561126757600080fd5b80360382131561127657600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600281106112c457634e487b7160e01b600052602160045260246000fd5b9052565b604081526112e4604082016112dc8561121e565b61ffff169052565b60006112f26020850161121e565b61ffff16606083015261130760408501611156565b6001600160a01b038116608084015250606084013560a083015261132d60808501611156565b6001600160a01b03811660c08401525060a084013560e083015261135360c08501611156565b61010061136a818501836001600160a01b03169052565b61137660e08701611156565b915061012061138f818601846001600160a01b03169052565b61139a828801611156565b925061014091506113b5828601846001600160a01b03169052565b610160925080870135838601525061018081870135818601526101a0915082870135828601526101c092508087013583860152506101e0818701358186015261140083880188611230565b93509150806102008601525061141b6102208501838361127d565b92505050610e9460208301846112a6565b6020815261144d6020820161144084611156565b6001600160a01b03169052565b600061145b60208401611156565b6001600160a01b03811660408401525061147760408401611156565b6001600160a01b03811660608401525061149360608401611156565b6001600160a01b0381166080840152506114af60808401611156565b6001600160a01b03811660a0840152506114cb60a08401611156565b6001600160a01b03811660c08401525060c083013560e083015261010060e084013581840152610120818501358185015261014091508085013582850152506101608185013581850152610180915080850135828501525061152f81850185611230565b6101a08581015291506115476101c08501838361127d565b95945050505050565b60005b8381101561156b578181015183820152602001611553565b50506000910152565b60008251611586818460208701611550565b9190910192915050565b60208152600082518060208401526115af816040850160208701611550565b601f01601f1916919091016040019291505056fea2646970667358221220913d12eaffcded24b4ce538884749b59eb43c3bef81f524d87af757d5023b96864736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f6a94dfd0e6ea9ddfdffe4762ad4236576136613000000000000000000000000000000000000000000000000000000000000003200000000000000000000000099c4a6e4dde61bc1dc1a8a8c9609ddfa9126817c
-----Decoded View---------------
Arg [0] : _router (address): 0xF6a94dfD0E6ea9ddFdFfE4762Ad4236576136613
Arg [1] : _feeBips (uint256): 50
Arg [2] : _feeRecipient (address): 0x99c4a6E4ddE61bC1dC1A8a8C9609DdFA9126817c
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f6a94dfd0e6ea9ddfdffe4762ad4236576136613
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [2] : 00000000000000000000000099c4a6e4dde61bc1dc1a8a8c9609ddfa9126817c
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.