Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21580725 | 39 mins ago | 3.01698 ETH | ||||
21580725 | 39 mins ago | 3.01698 ETH | ||||
21580718 | 41 mins ago | 0.34965 ETH | ||||
21580718 | 41 mins ago | 0.34965 ETH | ||||
21580714 | 42 mins ago | 0.02 ETH | ||||
21580714 | 42 mins ago | 0.02 ETH | ||||
21580625 | 1 hrs ago | 3.34665 ETH | ||||
21580625 | 1 hrs ago | 3.34665 ETH | ||||
21580513 | 1 hr ago | 0.2390406 ETH | ||||
21580513 | 1 hr ago | 0.2390406 ETH | ||||
21580288 | 2 hrs ago | 2.038959 ETH | ||||
21580288 | 2 hrs ago | 2.038959 ETH | ||||
21580093 | 2 hrs ago | 1.14885 ETH | ||||
21580093 | 2 hrs ago | 1.14885 ETH | ||||
21580068 | 2 hrs ago | 4.67532 ETH | ||||
21580068 | 2 hrs ago | 4.67532 ETH | ||||
21580002 | 3 hrs ago | 0.04995 ETH | ||||
21580002 | 3 hrs ago | 0.04995 ETH | ||||
21579892 | 3 hrs ago | 0.01998 ETH | ||||
21579892 | 3 hrs ago | 0.01998 ETH | ||||
21579745 | 3 hrs ago | 2.9525445 ETH | ||||
21579745 | 3 hrs ago | 2.9525445 ETH | ||||
21578959 | 6 hrs ago | 4.6320397 ETH | ||||
21578959 | 6 hrs ago | 4.6320397 ETH | ||||
21578926 | 6 hrs ago | 0.27972 ETH |
Loading...
Loading
Contract Name:
SwapAdapter
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.20; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable2Step.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./lib/DexExecutor.sol"; import "./lib/Helper.sol"; // Be careful this contract contains unsafe call !. // Do not approve token or just approve the right amount before call it. // Clear approve in the same transaction if calling failed. contract SwapAdapter is Ownable2Step, ReentrancyGuard { using Address for address; using SafeERC20 for IERC20; struct Param { address srcToken; address dstToken; address receiver; address leftReceiver; uint256 minAmount; SwapData[] swaps; } struct SwapData { uint8 dexType; address callTo; address approveTo; uint256 fromAmount; bytes callData; } event SwapComplete( address indexed from, address indexed srcToken, uint256 indexed inputAmount, address outToken, uint256 outAmount, address receiver ); uint256 public immutable selfChainId = block.chainid; constructor(address _owner) { require(_owner != Helper.ZERO_ADDRESS, "ButterAgg: zero addr"); _transferOwnership(_owner); } // Not recommended for EOA call with token approve // Approve the amount you want to trade. // DexType 0 - AGG, 1 - UNIV2, 2 - UNIV3, 3 - CURVE function swap(Param calldata params) external payable nonReentrant returns (uint256 outAmount) { require(params.swaps.length > 0, "ButterAgg: empty swap data"); (uint256 amount, uint256 initInputTokenBalance) = _depositToken(params.srcToken); uint256 finalTokenAmount = Helper._getBalance(params.dstToken, address(this)); (uint256 amountAdjust, uint256 firstAdjust, bool isUp) = _reBuildSwaps(amount, params.swaps); bool isFirst = true; SwapData[] memory _swaps = params.swaps; for (uint256 i = 0; i < _swaps.length; i++) { if (_swaps[i].dexType > 0 && firstAdjust > 0) { if (isFirst) { isUp ? _swaps[i].fromAmount += firstAdjust : _swaps[i].fromAmount -= firstAdjust; isFirst = false; } else { isUp ? _swaps[i].fromAmount += amountAdjust : _swaps[i].fromAmount -= amountAdjust; } } bool isNative = Helper._isNative(params.srcToken); if (!isNative) { IERC20(params.srcToken).safeApprove(_swaps[i].approveTo, 0); IERC20(params.srcToken).safeApprove(_swaps[i].approveTo, _swaps[i].fromAmount); } DexExecutor.execute( _swaps[i].dexType, _swaps[i].callTo, params.srcToken, params.dstToken, _swaps[i].fromAmount, _swaps[i].callData ); if (!isNative) { IERC20(params.srcToken).safeApprove(_swaps[i].approveTo, 0); } } outAmount = Helper._getBalance(params.dstToken, address(this)) - finalTokenAmount; require(outAmount >= params.minAmount, "ButterAgg: swap received too low"); uint256 left = Helper._getBalance(params.srcToken, address(this)) - initInputTokenBalance; if (left > 0) { Helper._transfer(selfChainId, params.srcToken, params.leftReceiver, left); } address receiver = params.receiver == address(0) ? msg.sender : params.receiver; Helper._transfer(selfChainId, params.dstToken, receiver, outAmount); emit SwapComplete(msg.sender, params.srcToken, amount, params.dstToken, outAmount, receiver); } function _depositToken(address _token) private returns (uint256 amount, uint256 initInputTokenBalance) { initInputTokenBalance = Helper._getBalance(_token, address(this)); if (Helper._isNative(_token)) { initInputTokenBalance -= msg.value; amount = msg.value; } else { amount = IERC20(_token).allowance(msg.sender, address(this)); SafeERC20.safeTransferFrom(IERC20(_token), msg.sender, address(this), amount); } require(amount > 0, "ButterAgg: zero input"); } function _reBuildSwaps( uint256 _amount, SwapData[] memory _swaps ) private pure returns (uint256 amountAdjust, uint256 firstAdjust, bool isUp) { uint256 total = 0; uint256 count = 0; for (uint256 i = 0; i < _swaps.length; i++) { total += _swaps[i].fromAmount; if (_swaps[i].dexType > 0) { count++; } } if (total > _amount) { require(count > 0, "ButterAgg: cannot adjust"); isUp = false; uint256 margin = total - _amount; amountAdjust = margin / count; firstAdjust = amountAdjust + (margin - amountAdjust * count); } else if (total < _amount) { if (count > 0) { isUp = true; uint256 margin = _amount - total; amountAdjust = margin / count; firstAdjust = amountAdjust + (margin - amountAdjust * count); } } } function rescueFunds(address _token, address _receiver, uint256 _amount) external onlyOwner { require(_receiver != address(0)); Helper._transfer(selfChainId, _token, _receiver, _amount); } receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides 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} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; // EIP-2612 is Final as of 2022-11-01. This file is deprecated. import "./IERC20Permit.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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.9.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.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/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; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ 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)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ 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"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ 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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/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: MIT pragma solidity 0.8.20; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./Helper.sol"; library DexExecutor { using SafeERC20 for IERC20; enum DexType { AGG, UNIV2, UNIV3, CURVE, FILL, MIX } function execute( uint8 _dexType, address _router, address _srcToken, address _dstToken, uint256 _amount, bytes memory _swap ) internal { bool _result; bool _isNative = Helper._isNative(_srcToken); DexType dexType = DexType(_dexType); if (dexType == DexType.AGG) { (_result) = _makeAggSwap(_router, _amount, _isNative, _swap); } else if (dexType == DexType.UNIV2) { (_result) = _makeUniV2Swap(_router, _dstToken, _amount, _isNative, _swap); } else if (dexType == DexType.UNIV3) { (_result) = _makeUniV3Swap(_router, _dstToken, _amount, _isNative, _swap); } else if (dexType == DexType.CURVE) { (_result) = _makeCurveSwap(_router, _amount, _isNative, _swap); } else if (dexType == DexType.FILL) { (_result) = _makeAggFill(_router, _amount, _isNative, _swap); } else if (dexType == DexType.MIX) { (_result) = _makeMixSwap(_srcToken, _amount, _swap); } else { require(false, "DexExecutor: unsupported dex type"); } require(_result, "DexExecutor: swap fail"); } struct MixSwap { uint256 offset; address srcToken; address callTo; address approveTo; bytes callData; } function _makeMixSwap(address _srcToken, uint256 _amount, bytes memory _swap) internal returns (bool _result) { MixSwap[] memory mixSwaps = abi.decode(_swap, (MixSwap[])); for (uint256 i = 0; i < mixSwaps.length; i++) { if (i != 0) { _amount = Helper._getBalance(mixSwaps[i].srcToken, address(this)); _srcToken = mixSwaps[i].srcToken; } bytes memory callDatas = mixSwaps[i].callData; uint256 offset = mixSwaps[i].offset; if (offset != 0) { assembly { mstore(add(callDatas, offset), _amount) } } if (Helper._isNative(_srcToken)) { (_result, ) = mixSwaps[i].callTo.call{value: _amount}(callDatas); } else { if (i != 0) { IERC20(_srcToken).safeIncreaseAllowance(mixSwaps[i].approveTo, _amount); } (_result, ) = mixSwaps[i].callTo.call(callDatas); if (i != 0) { IERC20(_srcToken).safeApprove(mixSwaps[i].approveTo, 0); } } if (!_result) { break; } } } function _makeAggSwap( address _router, uint256 _amount, bool _isNative, bytes memory _swap ) internal returns (bool _result) { if (_isNative) { (_result, ) = _router.call{value: _amount}(_swap); } else { (_result, ) = _router.call(_swap); } } function _makeAggFill( address _router, uint256 _amount, bool _isNative, bytes memory _swap ) internal returns (bool _result) { (uint256[] memory offsets, bytes memory callDatas) = abi.decode(_swap, (uint256[], bytes)); uint256 len = offsets.length; for (uint i = 0; i < len; i++) { uint256 offset = offsets[i]; if (offset != 0) { assembly { mstore(add(callDatas, offset), _amount) } } } if (_isNative) { (_result, ) = _router.call{value: _amount}(callDatas); } else { (_result, ) = _router.call(callDatas); } } function _makeUniV2Swap( address _router, address _dstToken, uint256 _amount, bool _isNative, bytes memory _swap ) internal returns (bool _result) { (uint256 amountOutMin, address[] memory path) = abi.decode(_swap, (uint256, address[])); if (_isNative) { (_result, ) = _router.call{value: _amount}( abi.encodeWithSignature( "swapExactETHForTokens(uint256,address[],address,uint256)", amountOutMin, path, address(this), block.timestamp + 100 ) ); } else if (Helper._isNative(_dstToken)) { (_result, ) = _router.call( abi.encodeWithSignature( "swapExactTokensForETH(uint256,uint256,address[],address,uint256)", _amount, amountOutMin, path, address(this), block.timestamp + 100 ) ); } else { (_result, ) = _router.call( abi.encodeWithSignature( "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)", _amount, amountOutMin, path, address(this), block.timestamp + 100 ) ); } } struct ExactInputParams { bytes path; address recipient; uint256 amountIn; uint256 amountOutMinimum; } function _makeUniV3Swap( address _router, address _dstToken, uint256 _amount, bool _isNative, bytes memory _swap ) internal returns (bool _result) { (uint256 amountOutMin, bytes memory path) = abi.decode(_swap, (uint256, bytes)); address receiver = Helper._isNative(_dstToken) ? _router : address(this); ExactInputParams memory params = ExactInputParams(path, receiver, _amount, amountOutMin); bytes memory swapData = abi.encodeWithSignature("exactInput((bytes,address,uint256,uint256))", params); uint256 value = _isNative ? _amount : 0; if (Helper._isNative(_dstToken)) { bytes[] memory c = new bytes[](2); c[0] = swapData; c[1] = abi.encodeWithSignature("unwrapWETH9(uint256,address)", amountOutMin, address(this)); (_result, ) = _router.call{value: value}(abi.encodeWithSignature("multicall(bytes[])", c)); } else { (_result, ) = _router.call{value: value}(swapData); } } function _makeCurveSwap( address _router, uint256 _amount, bool _isNative, bytes memory _swap ) internal returns (bool _result) { (uint256 expected, address[9] memory routes, uint256[3][4] memory swap_params, address[4] memory pools) = abi .decode(_swap, (uint256, address[9], uint256[3][4], address[4])); uint256 value = _isNative ? _amount : 0; (_result, ) = _router.call{value: value}( abi.encodeWithSignature( "exchange_multiple(address[9],uint256[3][4],uint256,uint256,address[4],address)", routes, swap_params, _amount, expected, pools, address(this) ) ); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol"; library Helper { using SafeERC20 for IERC20; address internal constant ZERO_ADDRESS = address(0); address internal constant NATIVE_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; struct CallbackParam { address target; address approveTo; uint256 offset; uint256 extraNativeAmount; address receiver; bytes data; } struct SwapParam { uint8 dexType; address executor; address approveTo; address receiver; address dstToken; uint256 minReturnAmount; bytes data; } function _isNative(address token) internal pure returns (bool) { return (token == ZERO_ADDRESS || token == NATIVE_ADDRESS); } function _getBalance(address _token, address _account) internal view returns (uint256) { if (_isNative(_token)) { return _account.balance; } else { return IERC20(_token).balanceOf(_account); } } function _transfer(uint256 _chainId, address _token, address _to, uint256 _amount) internal { if (_isNative(_token)) { Address.sendValue(payable(_to), _amount); } else { if (_chainId == 728126428 && _token == 0xa614f803B6FD780986A42c78Ec9c7f77e6DeD13C) { // Tron USDT _token.call(abi.encodeWithSelector(0xa9059cbb, _to, _amount)); } else { IERC20(_token).safeTransfer(_to, _amount); } } } function _safeWithdraw(address _wToken, uint _value) internal returns (bool) { (bool success, bytes memory data) = _wToken.call(abi.encodeWithSelector(0x2e1a7d4d, _value)); return (success && (data.length == 0 || abi.decode(data, (bool)))); } function _getFirst4Bytes(bytes memory data) internal pure returns (bytes4 outBytes4) { if (data.length == 0) { return 0x0; } assembly { outBytes4 := mload(add(data, 32)) } } function _makeSwap( uint256 _amount, address _srcToken, SwapParam memory _swap ) internal returns (bool _result, address _dstToken, uint256 _returnAmount) { _dstToken = _swap.dstToken; uint256 nativeValue = 0; bool isNative = Helper._isNative(_srcToken); if (isNative) { nativeValue = _amount; } else { IERC20(_srcToken).safeApprove(_swap.approveTo, 0); IERC20(_srcToken).safeApprove(_swap.approveTo, _amount); } _returnAmount = Helper._getBalance(_dstToken, address(this)); (_result, ) = _swap.executor.call{value: nativeValue}(_swap.data); _returnAmount = Helper._getBalance(_dstToken, address(this)) - _returnAmount; if (!isNative) { IERC20(_srcToken).safeApprove(_swap.approveTo, 0); } } function _callBack( uint256 _amount, address _token, CallbackParam memory _callParam ) internal returns (bool _result, uint256 _callAmount) { _callAmount = Helper._getBalance(_token, address(this)); uint256 offset = _callParam.offset; bytes memory callDatas = _callParam.data; if (offset != 0) { assembly { mstore(add(callDatas, offset), _amount) } } if (Helper._isNative(_token)) { (_result, ) = _callParam.target.call{value: _amount}(callDatas); } else { if (_amount != 0) IERC20(_token).safeIncreaseAllowance(_callParam.approveTo, _amount); // this contract not save money make sure send value can cover this (_result, ) = _callParam.target.call{value: _callParam.extraNativeAmount}(callDatas); if (_amount != 0) IERC20(_token).safeApprove(_callParam.approveTo, 0); } _callAmount = _callAmount - Helper._getBalance(_token, address(this)); } function _permit(bytes memory _data) internal { ( address token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) = abi.decode(_data, (address, address, address, uint256, uint256, uint8, bytes32, bytes32)); SafeERC20.safePermit(IERC20Permit(token), owner, spender, value, deadline, v, r, s); } }
{ "evmVersion": "london", "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","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":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"srcToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"inputAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"outToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"outAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"SwapComplete","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"selfChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"leftReceiver","type":"address"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"components":[{"internalType":"uint8","name":"dexType","type":"uint8"},{"internalType":"address","name":"callTo","type":"address"},{"internalType":"address","name":"approveTo","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct SwapAdapter.SwapData[]","name":"swaps","type":"tuple[]"}],"internalType":"struct SwapAdapter.Param","name":"params","type":"tuple"}],"name":"swap","outputs":[{"internalType":"uint256","name":"outAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a0604052466080523480156200001557600080fd5b5060405162002d2838038062002d28833981016040819052620000389162000123565b6200004333620000b5565b60016002556001600160a01b038116620000a35760405162461bcd60e51b815260206004820152601460248201527f4275747465724167673a207a65726f2061646472000000000000000000000000604482015260640160405180910390fd5b620000ae81620000b5565b5062000155565b600180546001600160a01b0319169055620000d081620000d3565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200013657600080fd5b81516001600160a01b03811681146200014e57600080fd5b9392505050565b608051612ba26200018660003960008181610120015281816101c1015281816106bd01526107410152612ba26000f3fe60806040526004361061007f5760003560e01c8063cc9e3e891161004e578063cc9e3e891461010e578063e30c397814610150578063efa064651461016e578063f2fde38b1461018157600080fd5b80636ccae0541461008b578063715018a6146100ad57806379ba5097146100c25780638da5cb5b146100d757600080fd5b3661008657005b600080fd5b34801561009757600080fd5b506100ab6100a6366004611fc5565b6101a1565b005b3480156100b957600080fd5b506100ab6101ed565b3480156100ce57600080fd5b506100ab610201565b3480156100e357600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011a57600080fd5b506101427f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610105565b34801561015c57600080fd5b506001546001600160a01b03166100f1565b61014261017c366004612006565b610280565b34801561018d57600080fd5b506100ab61019c366004612047565b61081f565b6101a9610890565b6001600160a01b0382166101bc57600080fd5b6101e87f00000000000000000000000000000000000000000000000000000000000000008484846108ea565b505050565b6101f5610890565b6101ff60006109f6565b565b60015433906001600160a01b031681146102745760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61027d816109f6565b50565b600061028a610a0f565b600061029960a0840184612064565b9050116102e85760405162461bcd60e51b815260206004820152601a60248201527f4275747465724167673a20656d70747920737761702064617461000000000000604482015260640161026b565b6000806103006102fb6020860186612047565b610a66565b9092509050600061032061031a6040870160208801612047565b30610b60565b9050600080806103458661033760a08b018b612064565b61034091612206565b610bf4565b919450925090506001600061035d60a08b018b612064565b61036691612206565b905060005b815181101561061e576000828281518110610388576103886122f5565b60200260200101516000015160ff161180156103a45750600085115b1561049557821561042657836103ea57848282815181106103c7576103c76122f5565b60200260200101516060018181516103df9190612321565b91508181525061041c565b848282815181106103fd576103fd6122f5565b60200260200101516060018181516104159190612334565b9150818152505b5060009250610495565b83610461578582828151811061043e5761043e6122f5565b60200260200101516060018181516104569190612321565b915081815250610493565b85828281518110610474576104746122f5565b602002602001015160600181815161048c9190612334565b9150818152505b505b60006104ac6104a760208e018e612047565b610d6c565b90508061054b576104f98383815181106104c8576104c86122f5565b60200260200101516040015160008e60000160208101906104e99190612047565b6001600160a01b03169190610da5565b61054b83838151811061050e5761050e6122f5565b60200260200101516040015184848151811061052c5761052c6122f5565b6020026020010151606001518e60000160208101906104e99190612047565b6105f1838381518110610560576105606122f5565b60200260200101516000015184848151811061057e5761057e6122f5565b6020026020010151602001518e600001602081019061059d9190612047565b8f60200160208101906105b09190612047565b8787815181106105c2576105c26122f5565b6020026020010151606001518888815181106105e0576105e06122f5565b602002602001015160800151610eed565b8061060b5761060b8383815181106104c8576104c86122f5565b508061061681612347565b91505061036b565b508561063361031a60408d0160208e01612047565b61063d9190612321565b985089608001358910156106935760405162461bcd60e51b815260206004820181905260248201527f4275747465724167673a207377617020726563656976656420746f6f206c6f77604482015260640161026b565b6000876106a661031a60208e018e612047565b6106b09190612321565b90508015610702576107027f00000000000000000000000000000000000000000000000000000000000000006106e960208e018e612047565b8d60600160208101906106fc9190612047565b846108ea565b60008061071560608e0160408f01612047565b6001600160a01b0316146107385761073360608d0160408e01612047565b61073a565b335b905061077a7f00000000000000000000000000000000000000000000000000000000000000008d60200160208101906107739190612047565b838e6108ea565b8961078860208e018e612047565b6001600160a01b0316336001600160a01b03167f3d665fb91a05a4c30e7e5da7d4eb00bda6b3a5f9b69ffc766b80912c4438db198f60200160208101906107cf9190612047565b8f866040516107fe939291906001600160a01b0393841681526020810192909252909116604082015260600190565b60405180910390a45050505050505050505061081a6001600255565b919050565b610827610890565b600180546001600160a01b0383166001600160a01b031990911681179091556108586000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000546001600160a01b031633146101ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026b565b6108f383610d6c565b1561090757610902828261109d565b6109f0565b83632b6653dc148015610936575073a614f803b6fd780986a42c78ec9c7f77e6ded13c6001600160a01b038416145b156109dc57604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151918516916109929190612384565b6000604051808303816000865af19150503d80600081146109cf576040519150601f19603f3d011682016040523d82523d6000602084013e6109d4565b606091505b5050506109f0565b6109f06001600160a01b03841683836111b6565b50505050565b600180546001600160a01b031916905561027d816111e6565b6002805403610a605760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026b565b60028055565b600080610a738330610b60565b9050610a7e83610d6c565b15610a9757610a8d3482612321565b9050349150610b13565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa158015610ae1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0591906123a0565b9150610b1383333085611236565b60008211610b5b5760405162461bcd60e51b8152602060048201526015602482015274109d5d1d195c9059d9ce881e995c9bc81a5b9c1d5d605a1b604482015260640161026b565b915091565b6000610b6b83610d6c565b15610b8157506001600160a01b03811631610bee565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a0823190602401602060405180830381865afa158015610bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610beb91906123a0565b90505b92915050565b600080808080805b8651811015610c7957868181518110610c1757610c176122f5565b60200260200101516060015183610c2e9190612334565b92506000878281518110610c4457610c446122f5565b60200260200101516000015160ff161115610c675781610c6381612347565b9250505b80610c7181612347565b915050610bfc565b5086821115610d155760008111610cd25760405162461bcd60e51b815260206004820152601860248201527f4275747465724167673a2063616e6e6f742061646a7573740000000000000000604482015260640161026b565b6000925082610ce18884612321565b9050610ced82826123b9565b9550610cf982876123db565b610d039082612321565b610d0d9087612334565b945050610d63565b86821015610d63578015610d6357600192506000610d338389612321565b9050610d3f82826123b9565b9550610d4b82876123db565b610d559082612321565b610d5f9087612334565b9450505b50509250925092565b60006001600160a01b0382161580610bee57506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b801580610e1f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906123a0565b155b610e8a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161026b565b6040516001600160a01b0383166024820152604481018290526101e890849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261126e565b600080610ef986610d6c565b905060008860ff166005811115610f1257610f126123f2565b90506000816005811115610f2857610f286123f2565b03610f4057610f3988868487611343565b925061104c565b6001816005811115610f5457610f546123f2565b03610f6657610f398887878588611419565b6002816005811115610f7a57610f7a6123f2565b03610f8c57610f39888787858861164c565b6003816005811115610fa057610fa06123f2565b03610fb157610f39888684876118c9565b6004816005811115610fc557610fc56123f2565b03610fd657610f39888684876119ad565b6005816005811115610fea57610fea6123f2565b03610ffa57610f39878686611aef565b60405162461bcd60e51b815260206004820152602160248201527f4465784578656375746f723a20756e737570706f7274656420646578207479706044820152606560f81b606482015260840161026b565b826110925760405162461bcd60e51b815260206004820152601660248201527511195e115e1958dd5d1bdc8e881cddd85c0819985a5b60521b604482015260640161026b565b505050505050505050565b804710156110ed5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161026b565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461113a576040519150601f19603f3d011682016040523d82523d6000602084013e61113f565b606091505b50509050806101e85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161026b565b6040516001600160a01b0383166024820152604481018290526101e890849063a9059cbb60e01b90606401610eb6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526109f09085906323b872dd60e01b90608401610eb6565b60006112c3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611d709092919063ffffffff16565b90508051600014806112e45750808060200190518101906112e49190612408565b6101e85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161026b565b600082156113b157846001600160a01b031684836040516113649190612384565b60006040518083038185875af1925050503d80600081146113a1576040519150601f19603f3d011682016040523d82523d6000602084013e6113a6565b606091505b505080915050611411565b846001600160a01b0316826040516113c99190612384565b6000604051808303816000865af19150503d8060008114611406576040519150601f19603f3d011682016040523d82523d6000602084013e61140b565b606091505b50909150505b949350505050565b600080600083806020019051810190611432919061242a565b9150915084156114ea576001600160a01b03881686838330611455426064612334565b6040516024016114689493929190612513565b60408051601f198184030181529181526020820180516001600160e01b0316637ff36ab560e01b1790525161149d9190612384565b60006040518083038185875af1925050503d80600081146114da576040519150601f19603f3d011682016040523d82523d6000602084013e6114df565b606091505b505080935050611641565b6114f387610d6c565b15611597576001600160a01b03881686838330611511426064612334565b604051602401611525959493929190612548565b60408051601f198184030181529181526020820180516001600160e01b03166318cbafe560e01b1790525161155a9190612384565b6000604051808303816000865af19150503d80600081146114da576040519150601f19603f3d011682016040523d82523d6000602084013e6114df565b6001600160a01b038816868383306115b0426064612334565b6040516024016115c4959493929190612548565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b179052516115f99190612384565b6000604051808303816000865af19150503d8060008114611636576040519150601f19603f3d011682016040523d82523d6000602084013e61163b565b606091505b50909350505b505095945050505050565b60008060008380602001905181019061166591906125c9565b91509150600061167488610d6c565b61167e5730611680565b885b905060006040518060800160405280848152602001836001600160a01b031681526020018981526020018581525090506000816040516024016116c3919061263b565b60408051601f198184030181529190526020810180516001600160e01b031663b858183f60e01b17905290506000886116fd5760006116ff565b895b905061170a8b610d6c565b156118595760408051600280825260608201909252600091816020015b60608152602001906001900390816117275790505090508281600081518110611752576117526122f5565b60209081029190910101526040516024810188905230604482015260640160408051601f198184030181529190526020810180516001600160e01b031663125012df60e21b1790528151829060019081106117af576117af6122f5565b60200260200101819052508c6001600160a01b031682826040516024016117d69190612689565b60408051601f198184030181529181526020820180516001600160e01b0316631592ca1b60e31b1790525161180b9190612384565b60006040518083038185875af1925050503d8060008114611848576040519150601f19603f3d011682016040523d82523d6000602084013e61184d565b606091505b505080985050506118ba565b8b6001600160a01b031681836040516118729190612384565b60006040518083038185875af1925050503d80600081146118af576040519150601f19603f3d011682016040523d82523d6000602084013e6118b4565b606091505b50909750505b50505050505095945050505050565b6000806000806000858060200190518101906118e591906127ad565b93509350935093506000876118fb5760006118fd565b885b9050896001600160a01b03168185858c898730604051602401611925969594939291906128be565b60408051601f198184030181529181526020820180516001600160e01b0316630651cb3560e01b1790525161195a9190612384565b60006040518083038185875af1925050503d8060008114611997576040519150601f19603f3d011682016040523d82523d6000602084013e61199c565b606091505b50909b9a5050505050505050505050565b6000806000838060200190518101906119c6919061297d565b8151919350915060005b81811015611a175760008482815181106119ec576119ec6122f5565b6020026020010151905080600014611a045788818501525b5080611a0f81612347565b9150506119d0565b508515611a8457876001600160a01b03168783604051611a379190612384565b60006040518083038185875af1925050503d8060008114611a74576040519150601f19603f3d011682016040523d82523d6000602084013e611a79565b606091505b505080945050611ae4565b876001600160a01b031682604051611a9c9190612384565b6000604051808303816000865af19150503d8060008114611ad9576040519150601f19603f3d011682016040523d82523d6000602084013e611ade565b606091505b50909450505b505050949350505050565b60008082806020019051810190611b069190612a2e565b905060005b8151811015611d67578015611b6457611b41828281518110611b2f57611b2f6122f5565b60200260200101516020015130610b60565b9450818181518110611b5557611b556122f5565b60200260200101516020015195505b6000828281518110611b7857611b786122f5565b60200260200101516080015190506000838381518110611b9a57611b9a6122f5565b602002602001015160000151905080600014611bb65786818301525b611bbf88610d6c565b15611c4757838381518110611bd657611bd66122f5565b6020026020010151604001516001600160a01b03168783604051611bfa9190612384565b60006040518083038185875af1925050503d8060008114611c37576040519150601f19603f3d011682016040523d82523d6000602084013e611c3c565b606091505b505080955050611d46565b8215611c8857611c88848481518110611c6257611c626122f5565b602002602001015160600151888a6001600160a01b0316611d7f9092919063ffffffff16565b838381518110611c9a57611c9a6122f5565b6020026020010151604001516001600160a01b031682604051611cbd9190612384565b6000604051808303816000865af19150503d8060008114611cfa576040519150601f19603f3d011682016040523d82523d6000602084013e611cff565b606091505b50909550508215611d4657611d46848481518110611d1f57611d1f6122f5565b60200260200101516060015160008a6001600160a01b0316610da59092919063ffffffff16565b84611d52575050611d67565b50508080611d5f90612347565b915050611b0b565b50509392505050565b60606114118484600085611e2c565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df391906123a0565b90506109f08463095ea7b360e01b85611e0c8686612334565b6040516001600160a01b0390921660248301526044820152606401610eb6565b606082471015611e8d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161026b565b600080866001600160a01b03168587604051611ea99190612384565b60006040518083038185875af1925050503d8060008114611ee6576040519150601f19603f3d011682016040523d82523d6000602084013e611eeb565b606091505b5091509150611efc87838387611f07565b979650505050505050565b60608315611f76578251600003611f6f576001600160a01b0385163b611f6f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161026b565b5081611411565b6114118383815115611f8b5781518083602001fd5b8060405162461bcd60e51b815260040161026b9190612b59565b6001600160a01b038116811461027d57600080fd5b803561081a81611fa5565b600080600060608486031215611fda57600080fd5b8335611fe581611fa5565b92506020840135611ff581611fa5565b929592945050506040919091013590565b60006020828403121561201857600080fd5b81356001600160401b0381111561202e57600080fd5b820160c0818503121561204057600080fd5b9392505050565b60006020828403121561205957600080fd5b813561204081611fa5565b6000808335601e1984360301811261207b57600080fd5b8301803591506001600160401b0382111561209557600080fd5b6020019150600581901b36038213156120ad57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b03811182821017156120ec576120ec6120b4565b60405290565b604051608081016001600160401b03811182821017156120ec576120ec6120b4565b604051606081016001600160401b03811182821017156120ec576120ec6120b4565b604051601f8201601f191681016001600160401b038111828210171561215e5761215e6120b4565b604052919050565b60006001600160401b0382111561217f5761217f6120b4565b5060051b60200190565b60006001600160401b038211156121a2576121a26120b4565b50601f01601f191660200190565b600082601f8301126121c157600080fd5b81356121d46121cf82612189565b612136565b8181528460208386010111156121e957600080fd5b816020850160208301376000918101602001919091529392505050565b60006122146121cf84612166565b80848252602080830192508560051b85013681111561223257600080fd5b855b818110156122e95780356001600160401b03808211156122545760008081fd5b818901915060a0823603121561226a5760008081fd5b6122726120ca565b823560ff811681146122845760008081fd5b81528286013561229381611fa5565b8187015260406122a4848201611fba565b9082015260608381013590820152608080840135838111156122c65760008081fd5b6122d2368287016121b0565b918301919091525087525050938201938201612234565b50919695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610bee57610bee61230b565b80820180821115610bee57610bee61230b565b6000600182016123595761235961230b565b5060010190565b60005b8381101561237b578181015183820152602001612363565b50506000910152565b60008251612396818460208701612360565b9190910192915050565b6000602082840312156123b257600080fd5b5051919050565b6000826123d657634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610bee57610bee61230b565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561241a57600080fd5b8151801515811461204057600080fd5b6000806040838503121561243d57600080fd5b825191506020808401516001600160401b0381111561245b57600080fd5b8401601f8101861361246c57600080fd5b805161247a6121cf82612166565b81815260059190911b8201830190838101908883111561249957600080fd5b928401925b828410156124c05783516124b181611fa5565b8252928401929084019061249e565b80955050505050509250929050565b600081518084526020808501945080840160005b838110156125085781516001600160a01b0316875295820195908201906001016124e3565b509495945050505050565b84815260806020820152600061252c60808301866124cf565b6001600160a01b03949094166040830152506060015292915050565b85815284602082015260a06040820152600061256760a08301866124cf565b6001600160a01b0394909416606083015250608001529392505050565b600082601f83011261259557600080fd5b81516125a36121cf82612189565b8181528460208386010111156125b857600080fd5b611411826020830160208701612360565b600080604083850312156125dc57600080fd5b8251915060208301516001600160401b038111156125f957600080fd5b61260585828601612584565b9150509250929050565b60008151808452612627816020860160208601612360565b601f01601f19169290920160200192915050565b60208152600082516080602084015261265760a084018261260f565b905060018060a01b03602085015116604084015260408401516060840152606084015160808401528091505092915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156126de57603f198886030184526126cc85835161260f565b945092850192908501906001016126b0565b5092979650505050505050565b60006040516101208082018281106001600160401b0382111715612711576127116120b4565b604052909150819083018481111561272857600080fd5b835b8181101561274b57805161273d81611fa5565b83526020928301920161272a565b50505092915050565b600082601f83011261276557600080fd5b61276d6120f2565b80608084018581111561277f57600080fd5b845b818110156127a257805161279481611fa5565b845260209384019301612781565b509095945050505050565b60008060008061034085870312156127c457600080fd5b84519350602086603f8701126127d957600080fd5b6127e5878288016126eb565b93508661015f8701126127f757600080fd5b6127ff6120f2565b806102c088018981111561281257600080fd5b61014089015b81811015612875578a601f8201126128305760008081fd5b612838612114565b80606083018d81111561284b5760008081fd5b835b81811015612864578051845292880192880161284d565b505085525092840192606001612818565b508195506128838a82612754565b94505050505092959194509250565b8060005b60048110156109f05781516001600160a01b0316845260209384019390910190600101612896565b6103808101818860005b60098110156128f05781516001600160a01b03168352602092830192909101906001016128c8565b50505061012082018760005b60048110156129435781518360005b600381101561292a57825182526020928301929091019060010161290b565b50505060609290920191602091909101906001016128fc565b505050856102a0830152846102c08301526129626102e0830185612892565b6001600160a01b038316610360830152979650505050505050565b6000806040838503121561299057600080fd5b82516001600160401b03808211156129a757600080fd5b818501915085601f8301126129bb57600080fd5b815160206129cb6121cf83612166565b82815260059290921b840181019181810190898411156129ea57600080fd5b948201945b83861015612a08578551825294820194908201906129ef565b91880151919650909350505080821115612a2157600080fd5b5061260585828601612584565b60006020808385031215612a4157600080fd5b82516001600160401b0380821115612a5857600080fd5b818501915085601f830112612a6c57600080fd5b8151612a7a6121cf82612166565b81815260059190911b83018401908481019088831115612a9957600080fd5b8585015b83811015612b4c57805185811115612ab55760008081fd5b860160a0818c03601f1901811315612acd5760008081fd5b612ad56120ca565b898301518152604080840151612aea81611fa5565b828c0152606084810151612afd81611fa5565b8083850152506080915081850151612b1481611fa5565b90830152918301519188831115612b2b5760008081fd5b612b398e8c85870101612584565b9082015285525050918601918601612a9d565b5098975050505050505050565b602081526000612040602083018461260f56fea264697066735822122028600b468f9f878e5fcd4e156005605f70dfb75011b9c252620921e499ffcd4364736f6c63430008140033000000000000000000000000df3f1ee5baf55055980887aad79f6fe6e3302d93
Deployed Bytecode
0x60806040526004361061007f5760003560e01c8063cc9e3e891161004e578063cc9e3e891461010e578063e30c397814610150578063efa064651461016e578063f2fde38b1461018157600080fd5b80636ccae0541461008b578063715018a6146100ad57806379ba5097146100c25780638da5cb5b146100d757600080fd5b3661008657005b600080fd5b34801561009757600080fd5b506100ab6100a6366004611fc5565b6101a1565b005b3480156100b957600080fd5b506100ab6101ed565b3480156100ce57600080fd5b506100ab610201565b3480156100e357600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011a57600080fd5b506101427f000000000000000000000000000000000000000000000000000000000000000181565b604051908152602001610105565b34801561015c57600080fd5b506001546001600160a01b03166100f1565b61014261017c366004612006565b610280565b34801561018d57600080fd5b506100ab61019c366004612047565b61081f565b6101a9610890565b6001600160a01b0382166101bc57600080fd5b6101e87f00000000000000000000000000000000000000000000000000000000000000018484846108ea565b505050565b6101f5610890565b6101ff60006109f6565b565b60015433906001600160a01b031681146102745760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61027d816109f6565b50565b600061028a610a0f565b600061029960a0840184612064565b9050116102e85760405162461bcd60e51b815260206004820152601a60248201527f4275747465724167673a20656d70747920737761702064617461000000000000604482015260640161026b565b6000806103006102fb6020860186612047565b610a66565b9092509050600061032061031a6040870160208801612047565b30610b60565b9050600080806103458661033760a08b018b612064565b61034091612206565b610bf4565b919450925090506001600061035d60a08b018b612064565b61036691612206565b905060005b815181101561061e576000828281518110610388576103886122f5565b60200260200101516000015160ff161180156103a45750600085115b1561049557821561042657836103ea57848282815181106103c7576103c76122f5565b60200260200101516060018181516103df9190612321565b91508181525061041c565b848282815181106103fd576103fd6122f5565b60200260200101516060018181516104159190612334565b9150818152505b5060009250610495565b83610461578582828151811061043e5761043e6122f5565b60200260200101516060018181516104569190612321565b915081815250610493565b85828281518110610474576104746122f5565b602002602001015160600181815161048c9190612334565b9150818152505b505b60006104ac6104a760208e018e612047565b610d6c565b90508061054b576104f98383815181106104c8576104c86122f5565b60200260200101516040015160008e60000160208101906104e99190612047565b6001600160a01b03169190610da5565b61054b83838151811061050e5761050e6122f5565b60200260200101516040015184848151811061052c5761052c6122f5565b6020026020010151606001518e60000160208101906104e99190612047565b6105f1838381518110610560576105606122f5565b60200260200101516000015184848151811061057e5761057e6122f5565b6020026020010151602001518e600001602081019061059d9190612047565b8f60200160208101906105b09190612047565b8787815181106105c2576105c26122f5565b6020026020010151606001518888815181106105e0576105e06122f5565b602002602001015160800151610eed565b8061060b5761060b8383815181106104c8576104c86122f5565b508061061681612347565b91505061036b565b508561063361031a60408d0160208e01612047565b61063d9190612321565b985089608001358910156106935760405162461bcd60e51b815260206004820181905260248201527f4275747465724167673a207377617020726563656976656420746f6f206c6f77604482015260640161026b565b6000876106a661031a60208e018e612047565b6106b09190612321565b90508015610702576107027f00000000000000000000000000000000000000000000000000000000000000016106e960208e018e612047565b8d60600160208101906106fc9190612047565b846108ea565b60008061071560608e0160408f01612047565b6001600160a01b0316146107385761073360608d0160408e01612047565b61073a565b335b905061077a7f00000000000000000000000000000000000000000000000000000000000000018d60200160208101906107739190612047565b838e6108ea565b8961078860208e018e612047565b6001600160a01b0316336001600160a01b03167f3d665fb91a05a4c30e7e5da7d4eb00bda6b3a5f9b69ffc766b80912c4438db198f60200160208101906107cf9190612047565b8f866040516107fe939291906001600160a01b0393841681526020810192909252909116604082015260600190565b60405180910390a45050505050505050505061081a6001600255565b919050565b610827610890565b600180546001600160a01b0383166001600160a01b031990911681179091556108586000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000546001600160a01b031633146101ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026b565b6108f383610d6c565b1561090757610902828261109d565b6109f0565b83632b6653dc148015610936575073a614f803b6fd780986a42c78ec9c7f77e6ded13c6001600160a01b038416145b156109dc57604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151918516916109929190612384565b6000604051808303816000865af19150503d80600081146109cf576040519150601f19603f3d011682016040523d82523d6000602084013e6109d4565b606091505b5050506109f0565b6109f06001600160a01b03841683836111b6565b50505050565b600180546001600160a01b031916905561027d816111e6565b6002805403610a605760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161026b565b60028055565b600080610a738330610b60565b9050610a7e83610d6c565b15610a9757610a8d3482612321565b9050349150610b13565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa158015610ae1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0591906123a0565b9150610b1383333085611236565b60008211610b5b5760405162461bcd60e51b8152602060048201526015602482015274109d5d1d195c9059d9ce881e995c9bc81a5b9c1d5d605a1b604482015260640161026b565b915091565b6000610b6b83610d6c565b15610b8157506001600160a01b03811631610bee565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a0823190602401602060405180830381865afa158015610bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610beb91906123a0565b90505b92915050565b600080808080805b8651811015610c7957868181518110610c1757610c176122f5565b60200260200101516060015183610c2e9190612334565b92506000878281518110610c4457610c446122f5565b60200260200101516000015160ff161115610c675781610c6381612347565b9250505b80610c7181612347565b915050610bfc565b5086821115610d155760008111610cd25760405162461bcd60e51b815260206004820152601860248201527f4275747465724167673a2063616e6e6f742061646a7573740000000000000000604482015260640161026b565b6000925082610ce18884612321565b9050610ced82826123b9565b9550610cf982876123db565b610d039082612321565b610d0d9087612334565b945050610d63565b86821015610d63578015610d6357600192506000610d338389612321565b9050610d3f82826123b9565b9550610d4b82876123db565b610d559082612321565b610d5f9087612334565b9450505b50509250925092565b60006001600160a01b0382161580610bee57506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b801580610e1f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906123a0565b155b610e8a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161026b565b6040516001600160a01b0383166024820152604481018290526101e890849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261126e565b600080610ef986610d6c565b905060008860ff166005811115610f1257610f126123f2565b90506000816005811115610f2857610f286123f2565b03610f4057610f3988868487611343565b925061104c565b6001816005811115610f5457610f546123f2565b03610f6657610f398887878588611419565b6002816005811115610f7a57610f7a6123f2565b03610f8c57610f39888787858861164c565b6003816005811115610fa057610fa06123f2565b03610fb157610f39888684876118c9565b6004816005811115610fc557610fc56123f2565b03610fd657610f39888684876119ad565b6005816005811115610fea57610fea6123f2565b03610ffa57610f39878686611aef565b60405162461bcd60e51b815260206004820152602160248201527f4465784578656375746f723a20756e737570706f7274656420646578207479706044820152606560f81b606482015260840161026b565b826110925760405162461bcd60e51b815260206004820152601660248201527511195e115e1958dd5d1bdc8e881cddd85c0819985a5b60521b604482015260640161026b565b505050505050505050565b804710156110ed5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161026b565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461113a576040519150601f19603f3d011682016040523d82523d6000602084013e61113f565b606091505b50509050806101e85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161026b565b6040516001600160a01b0383166024820152604481018290526101e890849063a9059cbb60e01b90606401610eb6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526109f09085906323b872dd60e01b90608401610eb6565b60006112c3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611d709092919063ffffffff16565b90508051600014806112e45750808060200190518101906112e49190612408565b6101e85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161026b565b600082156113b157846001600160a01b031684836040516113649190612384565b60006040518083038185875af1925050503d80600081146113a1576040519150601f19603f3d011682016040523d82523d6000602084013e6113a6565b606091505b505080915050611411565b846001600160a01b0316826040516113c99190612384565b6000604051808303816000865af19150503d8060008114611406576040519150601f19603f3d011682016040523d82523d6000602084013e61140b565b606091505b50909150505b949350505050565b600080600083806020019051810190611432919061242a565b9150915084156114ea576001600160a01b03881686838330611455426064612334565b6040516024016114689493929190612513565b60408051601f198184030181529181526020820180516001600160e01b0316637ff36ab560e01b1790525161149d9190612384565b60006040518083038185875af1925050503d80600081146114da576040519150601f19603f3d011682016040523d82523d6000602084013e6114df565b606091505b505080935050611641565b6114f387610d6c565b15611597576001600160a01b03881686838330611511426064612334565b604051602401611525959493929190612548565b60408051601f198184030181529181526020820180516001600160e01b03166318cbafe560e01b1790525161155a9190612384565b6000604051808303816000865af19150503d80600081146114da576040519150601f19603f3d011682016040523d82523d6000602084013e6114df565b6001600160a01b038816868383306115b0426064612334565b6040516024016115c4959493929190612548565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b179052516115f99190612384565b6000604051808303816000865af19150503d8060008114611636576040519150601f19603f3d011682016040523d82523d6000602084013e61163b565b606091505b50909350505b505095945050505050565b60008060008380602001905181019061166591906125c9565b91509150600061167488610d6c565b61167e5730611680565b885b905060006040518060800160405280848152602001836001600160a01b031681526020018981526020018581525090506000816040516024016116c3919061263b565b60408051601f198184030181529190526020810180516001600160e01b031663b858183f60e01b17905290506000886116fd5760006116ff565b895b905061170a8b610d6c565b156118595760408051600280825260608201909252600091816020015b60608152602001906001900390816117275790505090508281600081518110611752576117526122f5565b60209081029190910101526040516024810188905230604482015260640160408051601f198184030181529190526020810180516001600160e01b031663125012df60e21b1790528151829060019081106117af576117af6122f5565b60200260200101819052508c6001600160a01b031682826040516024016117d69190612689565b60408051601f198184030181529181526020820180516001600160e01b0316631592ca1b60e31b1790525161180b9190612384565b60006040518083038185875af1925050503d8060008114611848576040519150601f19603f3d011682016040523d82523d6000602084013e61184d565b606091505b505080985050506118ba565b8b6001600160a01b031681836040516118729190612384565b60006040518083038185875af1925050503d80600081146118af576040519150601f19603f3d011682016040523d82523d6000602084013e6118b4565b606091505b50909750505b50505050505095945050505050565b6000806000806000858060200190518101906118e591906127ad565b93509350935093506000876118fb5760006118fd565b885b9050896001600160a01b03168185858c898730604051602401611925969594939291906128be565b60408051601f198184030181529181526020820180516001600160e01b0316630651cb3560e01b1790525161195a9190612384565b60006040518083038185875af1925050503d8060008114611997576040519150601f19603f3d011682016040523d82523d6000602084013e61199c565b606091505b50909b9a5050505050505050505050565b6000806000838060200190518101906119c6919061297d565b8151919350915060005b81811015611a175760008482815181106119ec576119ec6122f5565b6020026020010151905080600014611a045788818501525b5080611a0f81612347565b9150506119d0565b508515611a8457876001600160a01b03168783604051611a379190612384565b60006040518083038185875af1925050503d8060008114611a74576040519150601f19603f3d011682016040523d82523d6000602084013e611a79565b606091505b505080945050611ae4565b876001600160a01b031682604051611a9c9190612384565b6000604051808303816000865af19150503d8060008114611ad9576040519150601f19603f3d011682016040523d82523d6000602084013e611ade565b606091505b50909450505b505050949350505050565b60008082806020019051810190611b069190612a2e565b905060005b8151811015611d67578015611b6457611b41828281518110611b2f57611b2f6122f5565b60200260200101516020015130610b60565b9450818181518110611b5557611b556122f5565b60200260200101516020015195505b6000828281518110611b7857611b786122f5565b60200260200101516080015190506000838381518110611b9a57611b9a6122f5565b602002602001015160000151905080600014611bb65786818301525b611bbf88610d6c565b15611c4757838381518110611bd657611bd66122f5565b6020026020010151604001516001600160a01b03168783604051611bfa9190612384565b60006040518083038185875af1925050503d8060008114611c37576040519150601f19603f3d011682016040523d82523d6000602084013e611c3c565b606091505b505080955050611d46565b8215611c8857611c88848481518110611c6257611c626122f5565b602002602001015160600151888a6001600160a01b0316611d7f9092919063ffffffff16565b838381518110611c9a57611c9a6122f5565b6020026020010151604001516001600160a01b031682604051611cbd9190612384565b6000604051808303816000865af19150503d8060008114611cfa576040519150601f19603f3d011682016040523d82523d6000602084013e611cff565b606091505b50909550508215611d4657611d46848481518110611d1f57611d1f6122f5565b60200260200101516060015160008a6001600160a01b0316610da59092919063ffffffff16565b84611d52575050611d67565b50508080611d5f90612347565b915050611b0b565b50509392505050565b60606114118484600085611e2c565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df391906123a0565b90506109f08463095ea7b360e01b85611e0c8686612334565b6040516001600160a01b0390921660248301526044820152606401610eb6565b606082471015611e8d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161026b565b600080866001600160a01b03168587604051611ea99190612384565b60006040518083038185875af1925050503d8060008114611ee6576040519150601f19603f3d011682016040523d82523d6000602084013e611eeb565b606091505b5091509150611efc87838387611f07565b979650505050505050565b60608315611f76578251600003611f6f576001600160a01b0385163b611f6f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161026b565b5081611411565b6114118383815115611f8b5781518083602001fd5b8060405162461bcd60e51b815260040161026b9190612b59565b6001600160a01b038116811461027d57600080fd5b803561081a81611fa5565b600080600060608486031215611fda57600080fd5b8335611fe581611fa5565b92506020840135611ff581611fa5565b929592945050506040919091013590565b60006020828403121561201857600080fd5b81356001600160401b0381111561202e57600080fd5b820160c0818503121561204057600080fd5b9392505050565b60006020828403121561205957600080fd5b813561204081611fa5565b6000808335601e1984360301811261207b57600080fd5b8301803591506001600160401b0382111561209557600080fd5b6020019150600581901b36038213156120ad57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b03811182821017156120ec576120ec6120b4565b60405290565b604051608081016001600160401b03811182821017156120ec576120ec6120b4565b604051606081016001600160401b03811182821017156120ec576120ec6120b4565b604051601f8201601f191681016001600160401b038111828210171561215e5761215e6120b4565b604052919050565b60006001600160401b0382111561217f5761217f6120b4565b5060051b60200190565b60006001600160401b038211156121a2576121a26120b4565b50601f01601f191660200190565b600082601f8301126121c157600080fd5b81356121d46121cf82612189565b612136565b8181528460208386010111156121e957600080fd5b816020850160208301376000918101602001919091529392505050565b60006122146121cf84612166565b80848252602080830192508560051b85013681111561223257600080fd5b855b818110156122e95780356001600160401b03808211156122545760008081fd5b818901915060a0823603121561226a5760008081fd5b6122726120ca565b823560ff811681146122845760008081fd5b81528286013561229381611fa5565b8187015260406122a4848201611fba565b9082015260608381013590820152608080840135838111156122c65760008081fd5b6122d2368287016121b0565b918301919091525087525050938201938201612234565b50919695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610bee57610bee61230b565b80820180821115610bee57610bee61230b565b6000600182016123595761235961230b565b5060010190565b60005b8381101561237b578181015183820152602001612363565b50506000910152565b60008251612396818460208701612360565b9190910192915050565b6000602082840312156123b257600080fd5b5051919050565b6000826123d657634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610bee57610bee61230b565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561241a57600080fd5b8151801515811461204057600080fd5b6000806040838503121561243d57600080fd5b825191506020808401516001600160401b0381111561245b57600080fd5b8401601f8101861361246c57600080fd5b805161247a6121cf82612166565b81815260059190911b8201830190838101908883111561249957600080fd5b928401925b828410156124c05783516124b181611fa5565b8252928401929084019061249e565b80955050505050509250929050565b600081518084526020808501945080840160005b838110156125085781516001600160a01b0316875295820195908201906001016124e3565b509495945050505050565b84815260806020820152600061252c60808301866124cf565b6001600160a01b03949094166040830152506060015292915050565b85815284602082015260a06040820152600061256760a08301866124cf565b6001600160a01b0394909416606083015250608001529392505050565b600082601f83011261259557600080fd5b81516125a36121cf82612189565b8181528460208386010111156125b857600080fd5b611411826020830160208701612360565b600080604083850312156125dc57600080fd5b8251915060208301516001600160401b038111156125f957600080fd5b61260585828601612584565b9150509250929050565b60008151808452612627816020860160208601612360565b601f01601f19169290920160200192915050565b60208152600082516080602084015261265760a084018261260f565b905060018060a01b03602085015116604084015260408401516060840152606084015160808401528091505092915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156126de57603f198886030184526126cc85835161260f565b945092850192908501906001016126b0565b5092979650505050505050565b60006040516101208082018281106001600160401b0382111715612711576127116120b4565b604052909150819083018481111561272857600080fd5b835b8181101561274b57805161273d81611fa5565b83526020928301920161272a565b50505092915050565b600082601f83011261276557600080fd5b61276d6120f2565b80608084018581111561277f57600080fd5b845b818110156127a257805161279481611fa5565b845260209384019301612781565b509095945050505050565b60008060008061034085870312156127c457600080fd5b84519350602086603f8701126127d957600080fd5b6127e5878288016126eb565b93508661015f8701126127f757600080fd5b6127ff6120f2565b806102c088018981111561281257600080fd5b61014089015b81811015612875578a601f8201126128305760008081fd5b612838612114565b80606083018d81111561284b5760008081fd5b835b81811015612864578051845292880192880161284d565b505085525092840192606001612818565b508195506128838a82612754565b94505050505092959194509250565b8060005b60048110156109f05781516001600160a01b0316845260209384019390910190600101612896565b6103808101818860005b60098110156128f05781516001600160a01b03168352602092830192909101906001016128c8565b50505061012082018760005b60048110156129435781518360005b600381101561292a57825182526020928301929091019060010161290b565b50505060609290920191602091909101906001016128fc565b505050856102a0830152846102c08301526129626102e0830185612892565b6001600160a01b038316610360830152979650505050505050565b6000806040838503121561299057600080fd5b82516001600160401b03808211156129a757600080fd5b818501915085601f8301126129bb57600080fd5b815160206129cb6121cf83612166565b82815260059290921b840181019181810190898411156129ea57600080fd5b948201945b83861015612a08578551825294820194908201906129ef565b91880151919650909350505080821115612a2157600080fd5b5061260585828601612584565b60006020808385031215612a4157600080fd5b82516001600160401b0380821115612a5857600080fd5b818501915085601f830112612a6c57600080fd5b8151612a7a6121cf82612166565b81815260059190911b83018401908481019088831115612a9957600080fd5b8585015b83811015612b4c57805185811115612ab55760008081fd5b860160a0818c03601f1901811315612acd5760008081fd5b612ad56120ca565b898301518152604080840151612aea81611fa5565b828c0152606084810151612afd81611fa5565b8083850152506080915081850151612b1481611fa5565b90830152918301519188831115612b2b5760008081fd5b612b398e8c85870101612584565b9082015285525050918601918601612a9d565b5098975050505050505050565b602081526000612040602083018461260f56fea264697066735822122028600b468f9f878e5fcd4e156005605f70dfb75011b9c252620921e499ffcd4364736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000df3f1ee5baf55055980887aad79f6fe6e3302d93
-----Decoded View---------------
Arg [0] : _owner (address): 0xdf3f1Ee5BAF55055980887AaD79F6fE6e3302D93
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000df3f1ee5baf55055980887aad79f6fe6e3302d93
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.