Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 21 internal transactions
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 30786259 | 20 days ago | 0.0001 ETH | ||||
| 30786259 | 20 days ago | 0.0001 ETH | ||||
| 30786169 | 20 days ago | 0.00019076 ETH | ||||
| 30786169 | 20 days ago | 0.00019076 ETH | ||||
| 29838990 | 31 days ago | 0.0003 ETH | ||||
| 29838990 | 31 days ago | 0.0003 ETH | ||||
| 29837988 | 31 days ago | 0.0001 ETH | ||||
| 29837988 | 31 days ago | 0.0001 ETH | ||||
| 29837920 | 31 days ago | 0.0001 ETH | ||||
| 29837920 | 31 days ago | 0.0001 ETH | ||||
| 29837054 | 31 days ago | 0.0002 ETH | ||||
| 29837054 | 31 days ago | 0.0002 ETH | ||||
| 29779568 | 32 days ago | 0.0001 ETH | ||||
| 29779568 | 32 days ago | 0.0001 ETH | ||||
| 29688113 | 33 days ago | 0.00009798 ETH | ||||
| 29688113 | 33 days ago | 0.00009798 ETH | ||||
| 29687989 | 33 days ago | 0.0001 ETH | ||||
| 29687989 | 33 days ago | 0.0001 ETH | ||||
| 29687525 | 33 days ago | 0.0001 ETH | ||||
| 29687525 | 33 days ago | 0.0001 ETH | ||||
| 29678784 | 33 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SwapAdapter
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
default 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).forceApprove(_swaps[i].approveTo, _swaps[i].fromAmount);
}
DexExecutor.execute(
_swaps[i].dexType,
_swaps[i].callTo,
params.srcToken,
params.dstToken,
_swaps[i].fromAmount,
_swaps[i].callData
);
}
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).forceApprove(mixSwaps[i].approveTo, _amount);
}
(_result, ) = mixSwaps[i].callTo.call(callDatas);
}
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);
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"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
60a06040524660805234801562000014575f80fd5b5060405162002aae38038062002aae833981016040819052620000379162000121565b6200004233620000b4565b60016002556001600160a01b038116620000a25760405162461bcd60e51b815260206004820152601460248201527f4275747465724167673a207a65726f2061646472000000000000000000000000604482015260640160405180910390fd5b620000ad81620000b4565b5062000150565b600180546001600160a01b0319169055620000cf81620000d2565b50565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f6020828403121562000132575f80fd5b81516001600160a01b038116811462000149575f80fd5b9392505050565b6080516129306200017e5f395f8181610116015281816101b40152818161064f01526106d201526129305ff3fe60806040526004361061007c575f3560e01c8063cc9e3e891161004c578063cc9e3e8914610105578063e30c397814610146578063efa0646514610163578063f2fde38b14610176575f80fd5b80636ccae05414610087578063715018a6146100a857806379ba5097146100bc5780638da5cb5b146100d0575f80fd5b3661008357005b5f80fd5b348015610092575f80fd5b506100a66100a1366004611db3565b610195565b005b3480156100b3575f80fd5b506100a66101e0565b3480156100c7575f80fd5b506100a66101f3565b3480156100db575f80fd5b505f546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b348015610110575f80fd5b506101387f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100fc565b348015610151575f80fd5b506001546001600160a01b03166100e8565b610138610171366004611df1565b610272565b348015610181575f80fd5b506100a6610190366004611e2e565b6107b0565b61019d610820565b6001600160a01b0382166101af575f80fd5b6101db7f0000000000000000000000000000000000000000000000000000000000000000848484610879565b505050565b6101e8610820565b6101f15f610981565b565b60015433906001600160a01b031681146102665760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61026f81610981565b50565b5f61027b61099a565b5f61028960a0840184611e49565b9050116102d85760405162461bcd60e51b815260206004820152601a60248201527f4275747465724167673a20656d70747920737761702064617461000000000000604482015260640161025d565b5f806102ef6102ea6020860186611e2e565b6109f1565b90925090505f61030e6103086040870160208801611e2e565b30610ae7565b90505f80806103328661032460a08b018b611e49565b61032d91611fdf565b610b78565b9194509250905060015f61034960a08b018b611e49565b61035291611fdf565b90505f5b81518110156105b1575f828281518110610372576103726120c8565b60200260200101515f015160ff1611801561038c57505f85115b1561047c57821561040d57836103d257848282815181106103af576103af6120c8565b60200260200101516060018181516103c791906120f0565b915081815250610404565b848282815181106103e5576103e56120c8565b60200260200101516060018181516103fd9190612103565b9150818152505b505f925061047c565b836104485785828281518110610425576104256120c8565b602002602001015160600181815161043d91906120f0565b91508181525061047a565b8582828151811061045b5761045b6120c8565b60200260200101516060018181516104739190612103565b9150818152505b505b5f61049261048d60208e018e611e2e565b610cea565b9050806104fa576104fa8383815181106104ae576104ae6120c8565b6020026020010151604001518484815181106104cc576104cc6120c8565b6020026020010151606001518e5f0160208101906104ea9190611e2e565b6001600160a01b03169190610d22565b61059e83838151811061050f5761050f6120c8565b60200260200101515f015184848151811061052c5761052c6120c8565b6020026020010151602001518e5f01602081019061054a9190611e2e565b8f602001602081019061055d9190611e2e565b87878151811061056f5761056f6120c8565b60200260200101516060015188888151811061058d5761058d6120c8565b602002602001015160800151610de3565b50806105a981612116565b915050610356565b50856105c661030860408d0160208e01611e2e565b6105d091906120f0565b985089608001358910156106265760405162461bcd60e51b815260206004820181905260248201527f4275747465724167673a207377617020726563656976656420746f6f206c6f77604482015260640161025d565b5f8761063861030860208e018e611e2e565b61064291906120f0565b90508015610694576106947f000000000000000000000000000000000000000000000000000000000000000061067b60208e018e611e2e565b8d606001602081019061068e9190611e2e565b84610879565b5f806106a660608e0160408f01611e2e565b6001600160a01b0316146106c9576106c460608d0160408e01611e2e565b6106cb565b335b905061070b7f00000000000000000000000000000000000000000000000000000000000000008d60200160208101906107049190611e2e565b838e610879565b8961071960208e018e611e2e565b6001600160a01b0316336001600160a01b03167f3d665fb91a05a4c30e7e5da7d4eb00bda6b3a5f9b69ffc766b80912c4438db198f60200160208101906107609190611e2e565b8f8660405161078f939291906001600160a01b0393841681526020810192909252909116604082015260600190565b60405180910390a4505050505050505050506107ab6001600255565b919050565b6107b8610820565b600180546001600160a01b0383166001600160a01b031990911681179091556107e85f546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b5f546001600160a01b031633146101f15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161025d565b61088283610cea565b15610896576108918282610f90565b61097b565b83632b6653dc1480156108c5575073a614f803b6fd780986a42c78ec9c7f77e6ded13c6001600160a01b038416145b1561096757604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151918516916109219190612150565b5f604051808303815f865af19150503d805f811461095a576040519150601f19603f3d011682016040523d82523d5f602084013e61095f565b606091505b50505061097b565b61097b6001600160a01b03841683836110a5565b50505050565b600180546001600160a01b031916905561026f816110d5565b60028054036109eb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161025d565b60028055565b5f806109fd8330610ae7565b9050610a0883610cea565b15610a2157610a1734826120f0565b9050349150610a9b565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa158015610a69573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8d919061216b565b9150610a9b83333085611124565b5f8211610ae25760405162461bcd60e51b8152602060048201526015602482015274109d5d1d195c9059d9ce881e995c9bc81a5b9c1d5d605a1b604482015260640161025d565b915091565b5f610af183610cea565b15610b0757506001600160a01b03811631610b72565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a0823190602401602060405180830381865afa158015610b4b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b6f919061216b565b90505b92915050565b5f80808080805b8651811015610bfa57868181518110610b9a57610b9a6120c8565b60200260200101516060015183610bb19190612103565b92505f878281518110610bc657610bc66120c8565b60200260200101515f015160ff161115610be85781610be481612116565b9250505b80610bf281612116565b915050610b7f565b5086821115610c94575f8111610c525760405162461bcd60e51b815260206004820152601860248201527f4275747465724167673a2063616e6e6f742061646a7573740000000000000000604482015260640161025d565b5f925082610c6088846120f0565b9050610c6c8282612182565b9550610c7882876121a1565b610c8290826120f0565b610c8c9087612103565b945050610ce1565b86821015610ce1578015610ce157600192505f610cb183896120f0565b9050610cbd8282612182565b9550610cc982876121a1565b610cd390826120f0565b610cdd9087612103565b9450505b50509250925092565b5f6001600160a01b0382161580610b7257506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610d73848261115c565b61097b576040516001600160a01b03841660248201525f6044820152610dd990859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111fd565b61097b84826111fd565b5f80610dee86610cea565b90505f8860ff166005811115610e0657610e066121b8565b90505f816005811115610e1b57610e1b6121b8565b03610e3357610e2c888684876112d0565b9250610f3f565b6001816005811115610e4757610e476121b8565b03610e5957610e2c888787858861139e565b6002816005811115610e6d57610e6d6121b8565b03610e7f57610e2c88878785886115c4565b6003816005811115610e9357610e936121b8565b03610ea457610e2c88868487611832565b6004816005811115610eb857610eb86121b8565b03610ec957610e2c8886848761190e565b6005816005811115610edd57610edd6121b8565b03610eed57610e2c878686611a44565b60405162461bcd60e51b815260206004820152602160248201527f4465784578656375746f723a20756e737570706f7274656420646578207479706044820152606560f81b606482015260840161025d565b82610f855760405162461bcd60e51b815260206004820152601660248201527511195e115e1958dd5d1bdc8e881cddd85c0819985a5b60521b604482015260640161025d565b505050505050505050565b80471015610fe05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161025d565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611029576040519150601f19603f3d011682016040523d82523d5f602084013e61102e565b606091505b50509050806101db5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161025d565b6040516001600160a01b0383166024820152604481018290526101db90849063a9059cbb60e01b90606401610da2565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038085166024830152831660448201526064810182905261097b9085906323b872dd60e01b90608401610da2565b5f805f846001600160a01b0316846040516111779190612150565b5f604051808303815f865af19150503d805f81146111b0576040519150601f19603f3d011682016040523d82523d5f602084013e6111b5565b606091505b50915091508180156111df5750805115806111df5750808060200190518101906111df91906121cc565b80156111f457506001600160a01b0385163b15155b95945050505050565b5f611251826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c779092919063ffffffff16565b905080515f148061127157508080602001905181019061127191906121cc565b6101db5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025d565b5f821561133a57846001600160a01b031684836040516112f09190612150565b5f6040518083038185875af1925050503d805f811461132a576040519150601f19603f3d011682016040523d82523d5f602084013e61132f565b606091505b505080915050611396565b846001600160a01b0316826040516113529190612150565b5f604051808303815f865af19150503d805f811461138b576040519150601f19603f3d011682016040523d82523d5f602084013e611390565b606091505b50909150505b949350505050565b5f805f838060200190518101906113b591906121eb565b91509150841561146a576001600160a01b038816868383306113d8426064612103565b6040516024016113eb94939291906122cd565b60408051601f198184030181529181526020820180516001600160e01b0316637ff36ab560e01b179052516114209190612150565b5f6040518083038185875af1925050503d805f811461145a576040519150601f19603f3d011682016040523d82523d5f602084013e61145f565b606091505b5050809350506115b9565b61147387610cea565b15611513576001600160a01b03881686838330611491426064612103565b6040516024016114a5959493929190612301565b60408051601f198184030181529181526020820180516001600160e01b03166318cbafe560e01b179052516114da9190612150565b5f604051808303815f865af19150503d805f811461145a576040519150601f19603f3d011682016040523d82523d5f602084013e61145f565b6001600160a01b0388168683833061152c426064612103565b604051602401611540959493929190612301565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b179052516115759190612150565b5f604051808303815f865af19150503d805f81146115ae576040519150601f19603f3d011682016040523d82523d5f602084013e6115b3565b606091505b50909350505b505095945050505050565b5f805f838060200190518101906115db919061237e565b915091505f6115e988610cea565b6115f357306115f5565b885b90505f6040518060800160405280848152602001836001600160a01b031681526020018981526020018581525090505f8160405160240161163691906123ec565b60408051601f198184030181529190526020810180516001600160e01b031663b858183f60e01b17905290505f8861166e575f611670565b895b905061167b8b610cea565b156117c557604080516002808252606082019092525f91816020015b606081526020019060019003908161169757905050905082815f815181106116c1576116c16120c8565b60209081029190910101526040516024810188905230604482015260640160408051601f198184030181529190526020810180516001600160e01b031663125012df60e21b17905281518290600190811061171e5761171e6120c8565b60200260200101819052508c6001600160a01b031682826040516024016117459190612439565b60408051601f198184030181529181526020820180516001600160e01b0316631592ca1b60e31b1790525161177a9190612150565b5f6040518083038185875af1925050503d805f81146117b4576040519150601f19603f3d011682016040523d82523d5f602084013e6117b9565b606091505b50508098505050611823565b8b6001600160a01b031681836040516117de9190612150565b5f6040518083038185875af1925050503d805f8114611818576040519150601f19603f3d011682016040523d82523d5f602084013e61181d565b606091505b50909750505b50505050505095945050505050565b5f805f805f8580602001905181019061184b9190612556565b93509350935093505f8761185f575f611861565b885b9050896001600160a01b03168185858c8987306040516024016118899695949392919061265e565b60408051601f198184030181529181526020820180516001600160e01b0316630651cb3560e01b179052516118be9190612150565b5f6040518083038185875af1925050503d805f81146118f8576040519150601f19603f3d011682016040523d82523d5f602084013e6118fd565b606091505b50909b9a5050505050505050505050565b5f805f83806020019051810190611925919061271a565b815191935091505f5b81811015611973575f848281518110611949576119496120c8565b60200260200101519050805f146119605788818501525b508061196b81612116565b91505061192e565b5085156119dd57876001600160a01b031687836040516119939190612150565b5f6040518083038185875af1925050503d805f81146119cd576040519150601f19603f3d011682016040523d82523d5f602084013e6119d2565b606091505b505080945050611a39565b876001600160a01b0316826040516119f59190612150565b5f604051808303815f865af19150503d805f8114611a2e576040519150601f19603f3d011682016040523d82523d5f602084013e611a33565b606091505b50909450505b505050949350505050565b5f8082806020019051810190611a5a91906127c5565b90505f5b8151811015611c6e578015611ab757611a94828281518110611a8257611a826120c8565b60200260200101516020015130610ae7565b9450818181518110611aa857611aa86120c8565b60200260200101516020015195505b5f828281518110611aca57611aca6120c8565b60200260200101516080015190505f838381518110611aeb57611aeb6120c8565b60200260200101515f01519050805f14611b055786818301525b611b0e88610cea565b15611b9357838381518110611b2557611b256120c8565b6020026020010151604001516001600160a01b03168783604051611b499190612150565b5f6040518083038185875af1925050503d805f8114611b83576040519150601f19603f3d011682016040523d82523d5f602084013e611b88565b606091505b505080955050611c4d565b8215611bd457611bd4848481518110611bae57611bae6120c8565b602002602001015160600151888a6001600160a01b0316610d229092919063ffffffff16565b838381518110611be657611be66120c8565b6020026020010151604001516001600160a01b031682604051611c099190612150565b5f604051808303815f865af19150503d805f8114611c42576040519150601f19603f3d011682016040523d82523d5f602084013e611c47565b606091505b50909550505b84611c59575050611c6e565b50508080611c6690612116565b915050611a5e565b50509392505050565b606061139684845f85855f80866001600160a01b03168587604051611c9c9190612150565b5f6040518083038185875af1925050503d805f8114611cd6576040519150601f19603f3d011682016040523d82523d5f602084013e611cdb565b606091505b5091509150611cec87838387611cf7565b979650505050505050565b60608315611d655782515f03611d5e576001600160a01b0385163b611d5e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025d565b5081611396565b6113968383815115611d7a5781518083602001fd5b8060405162461bcd60e51b815260040161025d91906128e8565b6001600160a01b038116811461026f575f80fd5b80356107ab81611d94565b5f805f60608486031215611dc5575f80fd5b8335611dd081611d94565b92506020840135611de081611d94565b929592945050506040919091013590565b5f60208284031215611e01575f80fd5b81356001600160401b03811115611e16575f80fd5b820160c08185031215611e27575f80fd5b9392505050565b5f60208284031215611e3e575f80fd5b8135611e2781611d94565b5f808335601e19843603018112611e5e575f80fd5b8301803591506001600160401b03821115611e77575f80fd5b6020019150600581901b3603821315611e8e575f80fd5b9250929050565b634e487b7160e01b5f52604160045260245ffd5b60405160a081016001600160401b0381118282101715611ecb57611ecb611e95565b60405290565b604051608081016001600160401b0381118282101715611ecb57611ecb611e95565b604051606081016001600160401b0381118282101715611ecb57611ecb611e95565b604051601f8201601f191681016001600160401b0381118282101715611f3d57611f3d611e95565b604052919050565b5f6001600160401b03821115611f5d57611f5d611e95565b5060051b60200190565b5f6001600160401b03821115611f7f57611f7f611e95565b50601f01601f191660200190565b5f82601f830112611f9c575f80fd5b8135611faf611faa82611f67565b611f15565b818152846020838601011115611fc3575f80fd5b816020850160208301375f918101602001919091529392505050565b5f611fec611faa84611f45565b80848252602080830192508560051b850136811115612009575f80fd5b855b818110156120bc5780356001600160401b038082111561202a575f8081fd5b818901915060a0823603121561203f575f8081fd5b612047611ea9565b823560ff81168114612058575f8081fd5b81528286013561206781611d94565b818701526040612078848201611da8565b908201526060838101359082015260808084013583811115612099575f8081fd5b6120a536828701611f8d565b91830191909152508752505093820193820161200b565b50919695505050505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115610b7257610b726120dc565b80820180821115610b7257610b726120dc565b5f60018201612127576121276120dc565b5060010190565b5f5b83811015612148578181015183820152602001612130565b50505f910152565b5f825161216181846020870161212e565b9190910192915050565b5f6020828403121561217b575f80fd5b5051919050565b5f8261219c57634e487b7160e01b5f52601260045260245ffd5b500490565b8082028115828204841417610b7257610b726120dc565b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156121dc575f80fd5b81518015158114611e27575f80fd5b5f80604083850312156121fc575f80fd5b825191506020808401516001600160401b03811115612219575f80fd5b8401601f81018613612229575f80fd5b8051612237611faa82611f45565b81815260059190911b82018301908381019088831115612255575f80fd5b928401925b8284101561227c57835161226d81611d94565b8252928401929084019061225a565b80955050505050509250929050565b5f8151808452602080850194508084015f5b838110156122c25781516001600160a01b03168752958201959082019060010161229d565b509495945050505050565b848152608060208201525f6122e5608083018661228b565b6001600160a01b03949094166040830152506060015292915050565b85815284602082015260a060408201525f61231f60a083018661228b565b6001600160a01b0394909416606083015250608001529392505050565b5f82601f83011261234b575f80fd5b8151612359611faa82611f67565b81815284602083860101111561236d575f80fd5b61139682602083016020870161212e565b5f806040838503121561238f575f80fd5b8251915060208301516001600160401b038111156123ab575f80fd5b6123b78582860161233c565b9150509250929050565b5f81518084526123d881602086016020860161212e565b601f01601f19169290920160200192915050565b602081525f82516080602084015261240760a08401826123c1565b905060018060a01b03602085015116604084015260408401516060840152606084015160808401528091505092915050565b5f602080830181845280855180835260408601915060408160051b87010192508387015f5b8281101561248c57603f1988860301845261247a8583516123c1565b9450928501929085019060010161245e565b5092979650505050505050565b5f6040516101208082018281106001600160401b03821117156124be576124be611e95565b60405290915081908301848111156124d4575f80fd5b835b818110156124f75780516124e981611d94565b8352602092830192016124d6565b50505092915050565b5f82601f83011261250f575f80fd5b612517611ed1565b806080840185811115612528575f80fd5b845b8181101561254b57805161253d81611d94565b84526020938401930161252a565b509095945050505050565b5f805f80610340858703121561256a575f80fd5b84519350602086603f87011261257e575f80fd5b61258a87828801612499565b93508661015f87011261259b575f80fd5b6125a3611ed1565b806102c08801898111156125b5575f80fd5b61014089015b81811015612616578a601f8201126125d2575f8081fd5b6125da611ef3565b80606083018d8111156125ec575f8081fd5b835b8181101561260557805184529288019288016125ee565b5050855250928401926060016125bb565b508195506126248a82612500565b94505050505092959194509250565b805f5b600481101561097b5781516001600160a01b0316845260209384019390910190600101612636565b610380810181885f5b600981101561268f5781516001600160a01b0316835260209283019290910190600101612667565b5050506101208201875f5b60048110156126e0578151835f5b60038110156126c75782518252602092830192909101906001016126a8565b505050606092909201916020919091019060010161269a565b505050856102a0830152846102c08301526126ff6102e0830185612633565b6001600160a01b038316610360830152979650505050505050565b5f806040838503121561272b575f80fd5b82516001600160401b0380821115612741575f80fd5b818501915085601f830112612754575f80fd5b81516020612764611faa83611f45565b82815260059290921b84018101918181019089841115612782575f80fd5b948201945b838610156127a057855182529482019490820190612787565b918801519196509093505050808211156127b8575f80fd5b506123b78582860161233c565b5f60208083850312156127d6575f80fd5b82516001600160401b03808211156127ec575f80fd5b818501915085601f8301126127ff575f80fd5b815161280d611faa82611f45565b81815260059190911b8301840190848101908883111561282b575f80fd5b8585015b838110156128db57805185811115612846575f8081fd5b860160a0818c03601f190181131561285d575f8081fd5b612865611ea9565b89830151815260408084015161287a81611d94565b828c015260608481015161288d81611d94565b80838501525060809150818501516128a481611d94565b908301529183015191888311156128ba575f8081fd5b6128c88e8c8587010161233c565b908201528552505091860191860161282f565b5098975050505050505050565b602081525f611e2760208301846123c156fea26469706673582212206dc74877cb29c1f68c5fbeefa44a2f859ab1d121da5bbff2c8d062be975184f864736f6c6343000814003300000000000000000000000026f71baa9dcda856c5612949cb01596c856a2cbb
Deployed Bytecode
0x60806040526004361061007c575f3560e01c8063cc9e3e891161004c578063cc9e3e8914610105578063e30c397814610146578063efa0646514610163578063f2fde38b14610176575f80fd5b80636ccae05414610087578063715018a6146100a857806379ba5097146100bc5780638da5cb5b146100d0575f80fd5b3661008357005b5f80fd5b348015610092575f80fd5b506100a66100a1366004611db3565b610195565b005b3480156100b3575f80fd5b506100a66101e0565b3480156100c7575f80fd5b506100a66101f3565b3480156100db575f80fd5b505f546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b348015610110575f80fd5b506101387f000000000000000000000000000000000000000000000000000000000000008281565b6040519081526020016100fc565b348015610151575f80fd5b506001546001600160a01b03166100e8565b610138610171366004611df1565b610272565b348015610181575f80fd5b506100a6610190366004611e2e565b6107b0565b61019d610820565b6001600160a01b0382166101af575f80fd5b6101db7f0000000000000000000000000000000000000000000000000000000000000082848484610879565b505050565b6101e8610820565b6101f15f610981565b565b60015433906001600160a01b031681146102665760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61026f81610981565b50565b5f61027b61099a565b5f61028960a0840184611e49565b9050116102d85760405162461bcd60e51b815260206004820152601a60248201527f4275747465724167673a20656d70747920737761702064617461000000000000604482015260640161025d565b5f806102ef6102ea6020860186611e2e565b6109f1565b90925090505f61030e6103086040870160208801611e2e565b30610ae7565b90505f80806103328661032460a08b018b611e49565b61032d91611fdf565b610b78565b9194509250905060015f61034960a08b018b611e49565b61035291611fdf565b90505f5b81518110156105b1575f828281518110610372576103726120c8565b60200260200101515f015160ff1611801561038c57505f85115b1561047c57821561040d57836103d257848282815181106103af576103af6120c8565b60200260200101516060018181516103c791906120f0565b915081815250610404565b848282815181106103e5576103e56120c8565b60200260200101516060018181516103fd9190612103565b9150818152505b505f925061047c565b836104485785828281518110610425576104256120c8565b602002602001015160600181815161043d91906120f0565b91508181525061047a565b8582828151811061045b5761045b6120c8565b60200260200101516060018181516104739190612103565b9150818152505b505b5f61049261048d60208e018e611e2e565b610cea565b9050806104fa576104fa8383815181106104ae576104ae6120c8565b6020026020010151604001518484815181106104cc576104cc6120c8565b6020026020010151606001518e5f0160208101906104ea9190611e2e565b6001600160a01b03169190610d22565b61059e83838151811061050f5761050f6120c8565b60200260200101515f015184848151811061052c5761052c6120c8565b6020026020010151602001518e5f01602081019061054a9190611e2e565b8f602001602081019061055d9190611e2e565b87878151811061056f5761056f6120c8565b60200260200101516060015188888151811061058d5761058d6120c8565b602002602001015160800151610de3565b50806105a981612116565b915050610356565b50856105c661030860408d0160208e01611e2e565b6105d091906120f0565b985089608001358910156106265760405162461bcd60e51b815260206004820181905260248201527f4275747465724167673a207377617020726563656976656420746f6f206c6f77604482015260640161025d565b5f8761063861030860208e018e611e2e565b61064291906120f0565b90508015610694576106947f000000000000000000000000000000000000000000000000000000000000008261067b60208e018e611e2e565b8d606001602081019061068e9190611e2e565b84610879565b5f806106a660608e0160408f01611e2e565b6001600160a01b0316146106c9576106c460608d0160408e01611e2e565b6106cb565b335b905061070b7f00000000000000000000000000000000000000000000000000000000000000828d60200160208101906107049190611e2e565b838e610879565b8961071960208e018e611e2e565b6001600160a01b0316336001600160a01b03167f3d665fb91a05a4c30e7e5da7d4eb00bda6b3a5f9b69ffc766b80912c4438db198f60200160208101906107609190611e2e565b8f8660405161078f939291906001600160a01b0393841681526020810192909252909116604082015260600190565b60405180910390a4505050505050505050506107ab6001600255565b919050565b6107b8610820565b600180546001600160a01b0383166001600160a01b031990911681179091556107e85f546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b5f546001600160a01b031633146101f15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161025d565b61088283610cea565b15610896576108918282610f90565b61097b565b83632b6653dc1480156108c5575073a614f803b6fd780986a42c78ec9c7f77e6ded13c6001600160a01b038416145b1561096757604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151918516916109219190612150565b5f604051808303815f865af19150503d805f811461095a576040519150601f19603f3d011682016040523d82523d5f602084013e61095f565b606091505b50505061097b565b61097b6001600160a01b03841683836110a5565b50505050565b600180546001600160a01b031916905561026f816110d5565b60028054036109eb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161025d565b60028055565b5f806109fd8330610ae7565b9050610a0883610cea565b15610a2157610a1734826120f0565b9050349150610a9b565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa158015610a69573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8d919061216b565b9150610a9b83333085611124565b5f8211610ae25760405162461bcd60e51b8152602060048201526015602482015274109d5d1d195c9059d9ce881e995c9bc81a5b9c1d5d605a1b604482015260640161025d565b915091565b5f610af183610cea565b15610b0757506001600160a01b03811631610b72565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a0823190602401602060405180830381865afa158015610b4b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b6f919061216b565b90505b92915050565b5f80808080805b8651811015610bfa57868181518110610b9a57610b9a6120c8565b60200260200101516060015183610bb19190612103565b92505f878281518110610bc657610bc66120c8565b60200260200101515f015160ff161115610be85781610be481612116565b9250505b80610bf281612116565b915050610b7f565b5086821115610c94575f8111610c525760405162461bcd60e51b815260206004820152601860248201527f4275747465724167673a2063616e6e6f742061646a7573740000000000000000604482015260640161025d565b5f925082610c6088846120f0565b9050610c6c8282612182565b9550610c7882876121a1565b610c8290826120f0565b610c8c9087612103565b945050610ce1565b86821015610ce1578015610ce157600192505f610cb183896120f0565b9050610cbd8282612182565b9550610cc982876121a1565b610cd390826120f0565b610cdd9087612103565b9450505b50509250925092565b5f6001600160a01b0382161580610b7257506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610d73848261115c565b61097b576040516001600160a01b03841660248201525f6044820152610dd990859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111fd565b61097b84826111fd565b5f80610dee86610cea565b90505f8860ff166005811115610e0657610e066121b8565b90505f816005811115610e1b57610e1b6121b8565b03610e3357610e2c888684876112d0565b9250610f3f565b6001816005811115610e4757610e476121b8565b03610e5957610e2c888787858861139e565b6002816005811115610e6d57610e6d6121b8565b03610e7f57610e2c88878785886115c4565b6003816005811115610e9357610e936121b8565b03610ea457610e2c88868487611832565b6004816005811115610eb857610eb86121b8565b03610ec957610e2c8886848761190e565b6005816005811115610edd57610edd6121b8565b03610eed57610e2c878686611a44565b60405162461bcd60e51b815260206004820152602160248201527f4465784578656375746f723a20756e737570706f7274656420646578207479706044820152606560f81b606482015260840161025d565b82610f855760405162461bcd60e51b815260206004820152601660248201527511195e115e1958dd5d1bdc8e881cddd85c0819985a5b60521b604482015260640161025d565b505050505050505050565b80471015610fe05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161025d565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611029576040519150601f19603f3d011682016040523d82523d5f602084013e61102e565b606091505b50509050806101db5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161025d565b6040516001600160a01b0383166024820152604481018290526101db90849063a9059cbb60e01b90606401610da2565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038085166024830152831660448201526064810182905261097b9085906323b872dd60e01b90608401610da2565b5f805f846001600160a01b0316846040516111779190612150565b5f604051808303815f865af19150503d805f81146111b0576040519150601f19603f3d011682016040523d82523d5f602084013e6111b5565b606091505b50915091508180156111df5750805115806111df5750808060200190518101906111df91906121cc565b80156111f457506001600160a01b0385163b15155b95945050505050565b5f611251826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c779092919063ffffffff16565b905080515f148061127157508080602001905181019061127191906121cc565b6101db5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025d565b5f821561133a57846001600160a01b031684836040516112f09190612150565b5f6040518083038185875af1925050503d805f811461132a576040519150601f19603f3d011682016040523d82523d5f602084013e61132f565b606091505b505080915050611396565b846001600160a01b0316826040516113529190612150565b5f604051808303815f865af19150503d805f811461138b576040519150601f19603f3d011682016040523d82523d5f602084013e611390565b606091505b50909150505b949350505050565b5f805f838060200190518101906113b591906121eb565b91509150841561146a576001600160a01b038816868383306113d8426064612103565b6040516024016113eb94939291906122cd565b60408051601f198184030181529181526020820180516001600160e01b0316637ff36ab560e01b179052516114209190612150565b5f6040518083038185875af1925050503d805f811461145a576040519150601f19603f3d011682016040523d82523d5f602084013e61145f565b606091505b5050809350506115b9565b61147387610cea565b15611513576001600160a01b03881686838330611491426064612103565b6040516024016114a5959493929190612301565b60408051601f198184030181529181526020820180516001600160e01b03166318cbafe560e01b179052516114da9190612150565b5f604051808303815f865af19150503d805f811461145a576040519150601f19603f3d011682016040523d82523d5f602084013e61145f565b6001600160a01b0388168683833061152c426064612103565b604051602401611540959493929190612301565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b179052516115759190612150565b5f604051808303815f865af19150503d805f81146115ae576040519150601f19603f3d011682016040523d82523d5f602084013e6115b3565b606091505b50909350505b505095945050505050565b5f805f838060200190518101906115db919061237e565b915091505f6115e988610cea565b6115f357306115f5565b885b90505f6040518060800160405280848152602001836001600160a01b031681526020018981526020018581525090505f8160405160240161163691906123ec565b60408051601f198184030181529190526020810180516001600160e01b031663b858183f60e01b17905290505f8861166e575f611670565b895b905061167b8b610cea565b156117c557604080516002808252606082019092525f91816020015b606081526020019060019003908161169757905050905082815f815181106116c1576116c16120c8565b60209081029190910101526040516024810188905230604482015260640160408051601f198184030181529190526020810180516001600160e01b031663125012df60e21b17905281518290600190811061171e5761171e6120c8565b60200260200101819052508c6001600160a01b031682826040516024016117459190612439565b60408051601f198184030181529181526020820180516001600160e01b0316631592ca1b60e31b1790525161177a9190612150565b5f6040518083038185875af1925050503d805f81146117b4576040519150601f19603f3d011682016040523d82523d5f602084013e6117b9565b606091505b50508098505050611823565b8b6001600160a01b031681836040516117de9190612150565b5f6040518083038185875af1925050503d805f8114611818576040519150601f19603f3d011682016040523d82523d5f602084013e61181d565b606091505b50909750505b50505050505095945050505050565b5f805f805f8580602001905181019061184b9190612556565b93509350935093505f8761185f575f611861565b885b9050896001600160a01b03168185858c8987306040516024016118899695949392919061265e565b60408051601f198184030181529181526020820180516001600160e01b0316630651cb3560e01b179052516118be9190612150565b5f6040518083038185875af1925050503d805f81146118f8576040519150601f19603f3d011682016040523d82523d5f602084013e6118fd565b606091505b50909b9a5050505050505050505050565b5f805f83806020019051810190611925919061271a565b815191935091505f5b81811015611973575f848281518110611949576119496120c8565b60200260200101519050805f146119605788818501525b508061196b81612116565b91505061192e565b5085156119dd57876001600160a01b031687836040516119939190612150565b5f6040518083038185875af1925050503d805f81146119cd576040519150601f19603f3d011682016040523d82523d5f602084013e6119d2565b606091505b505080945050611a39565b876001600160a01b0316826040516119f59190612150565b5f604051808303815f865af19150503d805f8114611a2e576040519150601f19603f3d011682016040523d82523d5f602084013e611a33565b606091505b50909450505b505050949350505050565b5f8082806020019051810190611a5a91906127c5565b90505f5b8151811015611c6e578015611ab757611a94828281518110611a8257611a826120c8565b60200260200101516020015130610ae7565b9450818181518110611aa857611aa86120c8565b60200260200101516020015195505b5f828281518110611aca57611aca6120c8565b60200260200101516080015190505f838381518110611aeb57611aeb6120c8565b60200260200101515f01519050805f14611b055786818301525b611b0e88610cea565b15611b9357838381518110611b2557611b256120c8565b6020026020010151604001516001600160a01b03168783604051611b499190612150565b5f6040518083038185875af1925050503d805f8114611b83576040519150601f19603f3d011682016040523d82523d5f602084013e611b88565b606091505b505080955050611c4d565b8215611bd457611bd4848481518110611bae57611bae6120c8565b602002602001015160600151888a6001600160a01b0316610d229092919063ffffffff16565b838381518110611be657611be66120c8565b6020026020010151604001516001600160a01b031682604051611c099190612150565b5f604051808303815f865af19150503d805f8114611c42576040519150601f19603f3d011682016040523d82523d5f602084013e611c47565b606091505b50909550505b84611c59575050611c6e565b50508080611c6690612116565b915050611a5e565b50509392505050565b606061139684845f85855f80866001600160a01b03168587604051611c9c9190612150565b5f6040518083038185875af1925050503d805f8114611cd6576040519150601f19603f3d011682016040523d82523d5f602084013e611cdb565b606091505b5091509150611cec87838387611cf7565b979650505050505050565b60608315611d655782515f03611d5e576001600160a01b0385163b611d5e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025d565b5081611396565b6113968383815115611d7a5781518083602001fd5b8060405162461bcd60e51b815260040161025d91906128e8565b6001600160a01b038116811461026f575f80fd5b80356107ab81611d94565b5f805f60608486031215611dc5575f80fd5b8335611dd081611d94565b92506020840135611de081611d94565b929592945050506040919091013590565b5f60208284031215611e01575f80fd5b81356001600160401b03811115611e16575f80fd5b820160c08185031215611e27575f80fd5b9392505050565b5f60208284031215611e3e575f80fd5b8135611e2781611d94565b5f808335601e19843603018112611e5e575f80fd5b8301803591506001600160401b03821115611e77575f80fd5b6020019150600581901b3603821315611e8e575f80fd5b9250929050565b634e487b7160e01b5f52604160045260245ffd5b60405160a081016001600160401b0381118282101715611ecb57611ecb611e95565b60405290565b604051608081016001600160401b0381118282101715611ecb57611ecb611e95565b604051606081016001600160401b0381118282101715611ecb57611ecb611e95565b604051601f8201601f191681016001600160401b0381118282101715611f3d57611f3d611e95565b604052919050565b5f6001600160401b03821115611f5d57611f5d611e95565b5060051b60200190565b5f6001600160401b03821115611f7f57611f7f611e95565b50601f01601f191660200190565b5f82601f830112611f9c575f80fd5b8135611faf611faa82611f67565b611f15565b818152846020838601011115611fc3575f80fd5b816020850160208301375f918101602001919091529392505050565b5f611fec611faa84611f45565b80848252602080830192508560051b850136811115612009575f80fd5b855b818110156120bc5780356001600160401b038082111561202a575f8081fd5b818901915060a0823603121561203f575f8081fd5b612047611ea9565b823560ff81168114612058575f8081fd5b81528286013561206781611d94565b818701526040612078848201611da8565b908201526060838101359082015260808084013583811115612099575f8081fd5b6120a536828701611f8d565b91830191909152508752505093820193820161200b565b50919695505050505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115610b7257610b726120dc565b80820180821115610b7257610b726120dc565b5f60018201612127576121276120dc565b5060010190565b5f5b83811015612148578181015183820152602001612130565b50505f910152565b5f825161216181846020870161212e565b9190910192915050565b5f6020828403121561217b575f80fd5b5051919050565b5f8261219c57634e487b7160e01b5f52601260045260245ffd5b500490565b8082028115828204841417610b7257610b726120dc565b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156121dc575f80fd5b81518015158114611e27575f80fd5b5f80604083850312156121fc575f80fd5b825191506020808401516001600160401b03811115612219575f80fd5b8401601f81018613612229575f80fd5b8051612237611faa82611f45565b81815260059190911b82018301908381019088831115612255575f80fd5b928401925b8284101561227c57835161226d81611d94565b8252928401929084019061225a565b80955050505050509250929050565b5f8151808452602080850194508084015f5b838110156122c25781516001600160a01b03168752958201959082019060010161229d565b509495945050505050565b848152608060208201525f6122e5608083018661228b565b6001600160a01b03949094166040830152506060015292915050565b85815284602082015260a060408201525f61231f60a083018661228b565b6001600160a01b0394909416606083015250608001529392505050565b5f82601f83011261234b575f80fd5b8151612359611faa82611f67565b81815284602083860101111561236d575f80fd5b61139682602083016020870161212e565b5f806040838503121561238f575f80fd5b8251915060208301516001600160401b038111156123ab575f80fd5b6123b78582860161233c565b9150509250929050565b5f81518084526123d881602086016020860161212e565b601f01601f19169290920160200192915050565b602081525f82516080602084015261240760a08401826123c1565b905060018060a01b03602085015116604084015260408401516060840152606084015160808401528091505092915050565b5f602080830181845280855180835260408601915060408160051b87010192508387015f5b8281101561248c57603f1988860301845261247a8583516123c1565b9450928501929085019060010161245e565b5092979650505050505050565b5f6040516101208082018281106001600160401b03821117156124be576124be611e95565b60405290915081908301848111156124d4575f80fd5b835b818110156124f75780516124e981611d94565b8352602092830192016124d6565b50505092915050565b5f82601f83011261250f575f80fd5b612517611ed1565b806080840185811115612528575f80fd5b845b8181101561254b57805161253d81611d94565b84526020938401930161252a565b509095945050505050565b5f805f80610340858703121561256a575f80fd5b84519350602086603f87011261257e575f80fd5b61258a87828801612499565b93508661015f87011261259b575f80fd5b6125a3611ed1565b806102c08801898111156125b5575f80fd5b61014089015b81811015612616578a601f8201126125d2575f8081fd5b6125da611ef3565b80606083018d8111156125ec575f8081fd5b835b8181101561260557805184529288019288016125ee565b5050855250928401926060016125bb565b508195506126248a82612500565b94505050505092959194509250565b805f5b600481101561097b5781516001600160a01b0316845260209384019390910190600101612636565b610380810181885f5b600981101561268f5781516001600160a01b0316835260209283019290910190600101612667565b5050506101208201875f5b60048110156126e0578151835f5b60038110156126c75782518252602092830192909101906001016126a8565b505050606092909201916020919091019060010161269a565b505050856102a0830152846102c08301526126ff6102e0830185612633565b6001600160a01b038316610360830152979650505050505050565b5f806040838503121561272b575f80fd5b82516001600160401b0380821115612741575f80fd5b818501915085601f830112612754575f80fd5b81516020612764611faa83611f45565b82815260059290921b84018101918181019089841115612782575f80fd5b948201945b838610156127a057855182529482019490820190612787565b918801519196509093505050808211156127b8575f80fd5b506123b78582860161233c565b5f60208083850312156127d6575f80fd5b82516001600160401b03808211156127ec575f80fd5b818501915085601f8301126127ff575f80fd5b815161280d611faa82611f45565b81815260059190911b8301840190848101908883111561282b575f80fd5b8585015b838110156128db57805185811115612846575f8081fd5b860160a0818c03601f190181131561285d575f8081fd5b612865611ea9565b89830151815260408084015161287a81611d94565b828c015260608481015161288d81611d94565b80838501525060809150818501516128a481611d94565b908301529183015191888311156128ba575f8081fd5b6128c88e8c8587010161233c565b908201528552505091860191860161282f565b5098975050505050505050565b602081525f611e2760208301846123c156fea26469706673582212206dc74877cb29c1f68c5fbeefa44a2f859ab1d121da5bbff2c8d062be975184f864736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000026f71baa9dcda856c5612949cb01596c856a2cbb
-----Decoded View---------------
Arg [0] : _owner (address): 0x26f71Baa9dcdA856C5612949cb01596c856A2cbb
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000026f71baa9dcda856c5612949cb01596c856a2cbb
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.