Source Code
Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 489 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer By Orbi... | 20651397 | 142 days ago | IN | 0 ETH | 0.00000002 | ||||
| Transfer By Orbi... | 17638775 | 183 days ago | IN | 0 ETH | 0.00000202 | ||||
| Swap By Orbiter | 14116318 | 311 days ago | IN | 0 ETH | 0.00007921 | ||||
| Transfer By Orbi... | 12953505 | 365 days ago | IN | 0.022 ETH | 0.00014154 | ||||
| Transfer By Orbi... | 12894622 | 367 days ago | IN | 0.0055 ETH | 0.00001322 | ||||
| Swap By Orbiter | 12003684 | 403 days ago | IN | 0 ETH | 0.00004266 | ||||
| Swap By Orbiter | 11424035 | 425 days ago | IN | 0 ETH | 0.00012965 | ||||
| Transfer By Orbi... | 11009131 | 440 days ago | IN | 0.0025 ETH | 0.00002108 | ||||
| Transfer By Orbi... | 10920675 | 443 days ago | IN | 0.009 ETH | 0.00001177 | ||||
| Swap By Orbiter | 10917689 | 443 days ago | IN | 0 ETH | 0.00003806 | ||||
| Swap By Orbiter | 10567648 | 455 days ago | IN | 0 ETH | 0.00005108 | ||||
| Swap By Orbiter | 10538054 | 456 days ago | IN | 0 ETH | 0.00002532 | ||||
| Swap By Orbiter | 10480196 | 458 days ago | IN | 0 ETH | 0.00001989 | ||||
| Transfer By Orbi... | 10437317 | 459 days ago | IN | 0.02 ETH | 0.00000695 | ||||
| Swap By Orbiter | 10435331 | 459 days ago | IN | 0 ETH | 0.00004371 | ||||
| Transfer By Orbi... | 10407253 | 460 days ago | IN | 0.05525 ETH | 0.00000862 | ||||
| Transfer By Orbi... | 10407111 | 460 days ago | IN | 0.0517 ETH | 0.00000862 | ||||
| Transfer By Orbi... | 10323569 | 462 days ago | IN | 0.99 ETH | 0.00001184 | ||||
| Swap By Orbiter | 10319304 | 463 days ago | IN | 0 ETH | 0.0000274 | ||||
| Transfer By Orbi... | 10318805 | 463 days ago | IN | 0 ETH | 0.00001654 | ||||
| Transfer By Orbi... | 10300989 | 463 days ago | IN | 0.0392 ETH | 0.00000835 | ||||
| Swap By Orbiter | 10300325 | 463 days ago | IN | 0 ETH | 0.00003533 | ||||
| Transfer By Orbi... | 10296435 | 463 days ago | IN | 0.005 ETH | 0.00001085 | ||||
| Swap By Orbiter | 10289473 | 464 days ago | IN | 0 ETH | 0.00006031 | ||||
| Swap By Orbiter | 10289472 | 464 days ago | IN | 0 ETH | 0.00005089 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 12953505 | 365 days ago | 0.0216304 ETH | ||||
| 12953505 | 365 days ago | 0.0003696 ETH | ||||
| 12894622 | 367 days ago | 0.0055 ETH | ||||
| 12003684 | 403 days ago | 0.03205684 ETH | ||||
| 12003684 | 403 days ago | 0.03205684 ETH | ||||
| 12003684 | 403 days ago | 0.03205684 ETH | ||||
| 11424035 | 425 days ago | 0.53245004 ETH | ||||
| 11424035 | 425 days ago | 0.53245004 ETH | ||||
| 11424035 | 425 days ago | 0.53245004 ETH | ||||
| 11009131 | 440 days ago | 0.002185 ETH | ||||
| 11009131 | 440 days ago | 0.000315 ETH | ||||
| 10920675 | 443 days ago | 0.0086319 ETH | ||||
| 10920675 | 443 days ago | 0.0003681 ETH | ||||
| 10917689 | 443 days ago | 0.09973771 ETH | ||||
| 10917689 | 443 days ago | 0.09973771 ETH | ||||
| 10917689 | 443 days ago | 0.09973771 ETH | ||||
| 10567648 | 455 days ago | 0.80033173 ETH | ||||
| 10567648 | 455 days ago | 0.80033173 ETH | ||||
| 10567648 | 455 days ago | 0.80033173 ETH | ||||
| 10480196 | 458 days ago | 0.02319878 ETH | ||||
| 10480196 | 458 days ago | 0.02319878 ETH | ||||
| 10480196 | 458 days ago | 0.02319878 ETH | ||||
| 10437317 | 459 days ago | 0.02 ETH | ||||
| 10435331 | 459 days ago | 0.04197437 ETH | ||||
| 10435331 | 459 days ago | 0.04197437 ETH |
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xdC81B70a...D4155eb9e The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SwitchOrbiter
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import { IOrbiterRouter } from "../interfaces/IOrbiterRouter.sol";
import "../lib/DataTypes.sol";
import "../dexs/SwitchV2.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract SwitchOrbiter is SwitchV2 {
using UniversalERC20 for IERC20;
using SafeERC20 for IERC20;
address public orbiterRouter;
address public nativeWrap;
struct TransferArgsOrbiter {
address fromToken;
address destToken;
address orbiterMaker;
address partner;
uint256 partnerFeeRate;
uint256 amount;
uint256 estimatedDstTokenAmount;
uint64 dstChainId;
bytes32 id;
bytes32 bridge;
bytes orbiterData;
}
struct SwapArgsOrbiter {
address fromToken;
address bridgeToken;
address destToken;
address orbiterMaker;
address partner;
uint256 partnerFeeRate;
uint256 amount;
uint256 estimatedDstTokenAmount;
uint256 dstChainId;
uint256[] srcDistribution;
bytes32 id;
bytes32 bridge;
bytes orbiterData;
bytes aggregatorInfo;
}
event OrbiterRouterSet(address orbiterRouter);
event NativeWrapSet(address _nativeWrap);
constructor(
address _weth,
address _otherToken,
uint256[] memory _pathCountAndSplit,
address[] memory _factories,
address _switchViewAddress,
address _switchEventAddress,
address _orbiterRouter,
address _feeCollector
) SwitchV2(
_weth,
_otherToken,
_pathCountAndSplit[0],
_pathCountAndSplit[1],
_factories,
_switchViewAddress,
_switchEventAddress,
_feeCollector
)
public
{
orbiterRouter = _orbiterRouter;
nativeWrap = _weth;
}
function setOrbiterRouter(address _orbiterRouter) external onlyOwner {
orbiterRouter = _orbiterRouter;
emit OrbiterRouterSet(_orbiterRouter);
}
function setNativeWrap(address _newNativeWrap) external onlyOwner {
nativeWrap = _newNativeWrap;
emit NativeWrapSet(nativeWrap);
}
function transferByOrbiter(
TransferArgsOrbiter calldata transferArgs
)
external
payable
nonReentrant
{
require(transferArgs.amount > 0, "The amount must be greater than zero");
require(block.chainid != transferArgs.dstChainId, "Cannot bridge to same network");
IERC20(transferArgs.fromToken).universalTransferFrom(msg.sender, address(this), transferArgs.amount);
uint256 amountAfterFee = _getAmountAfterFee(
IERC20(transferArgs.fromToken),
transferArgs.amount,
transferArgs.partner,
transferArgs.partnerFeeRate
);
bool isNative = IERC20(transferArgs.fromToken).isETH();
if (isNative) {
IOrbiterRouter(orbiterRouter).transfer{ value: amountAfterFee }(
transferArgs.orbiterMaker,
transferArgs.orbiterData
);
} else {
// Give Orbiter bridge approval
IERC20(transferArgs.fromToken).safeApprove(orbiterRouter, 0);
IERC20(transferArgs.fromToken).safeApprove(orbiterRouter, amountAfterFee);
IOrbiterRouter(orbiterRouter).transferToken(
IERC20(transferArgs.fromToken),
transferArgs.orbiterMaker,
amountAfterFee,
transferArgs.orbiterData
);
}
_emitCrossChainTransferRequest(
transferArgs,
bytes32(0),
amountAfterFee,
msg.sender,
DataTypes.SwapStatus.Succeeded
);
}
function swapByOrbiter(
SwapArgsOrbiter calldata swapArgs
)
external
payable
nonReentrant
{
require(swapArgs.amount > 0, "The amount must be greater than zero");
require(block.chainid != swapArgs.dstChainId, "Cannot bridge to same network");
IERC20(swapArgs.fromToken).universalTransferFrom(msg.sender, address(this), swapArgs.amount);
uint256 returnAmount = 0;
uint256 amountAfterFee = _getAmountAfterFee(
IERC20(swapArgs.fromToken),
swapArgs.amount,
swapArgs.partner,
swapArgs.partnerFeeRate
);
address bridgeToken = swapArgs.bridgeToken;
if (swapArgs.fromToken == swapArgs.bridgeToken) {
returnAmount = amountAfterFee;
} else {
if (swapArgs.aggregatorInfo.length > 0) {
returnAmount = _swapThruAggregator(swapArgs, amountAfterFee);
} else {
(returnAmount, ) = _swapBeforeOrbiter(swapArgs, amountAfterFee);
}
}
bool isNativeBridgeToken = IERC20(swapArgs.bridgeToken).isETH();
if (isNativeBridgeToken) {
IOrbiterRouter(orbiterRouter).transfer{ value: returnAmount }(
swapArgs.orbiterMaker,
swapArgs.orbiterData
);
} else {
IERC20(bridgeToken).universalApprove(orbiterRouter, returnAmount);
IOrbiterRouter(orbiterRouter).transferToken(
IERC20(swapArgs.bridgeToken),
swapArgs.orbiterMaker,
returnAmount,
swapArgs.orbiterData
);
}
_emitCrossChainSwapRequest(
swapArgs,
bytes32(0),
returnAmount,
msg.sender,
DataTypes.SwapStatus.Succeeded
);
}
function _swapBeforeOrbiter(
SwapArgsOrbiter calldata swapArgs,
uint256 amount
)
private
returns
(
uint256 returnAmount,
uint256 parts
)
{
parts = 0;
uint256 lastNonZeroIndex = 0;
for (uint i = 0; i < swapArgs.srcDistribution.length; i++) {
if (swapArgs.srcDistribution[i] > 0) {
parts += swapArgs.srcDistribution[i];
lastNonZeroIndex = i;
}
}
require(parts > 0, "invalid distribution param");
// break function to avoid stack too deep error
returnAmount = _swapInternalForSingleSwap(
swapArgs.srcDistribution,
amount,
parts,
lastNonZeroIndex,
IERC20(swapArgs.fromToken),
IERC20(swapArgs.bridgeToken)
);
require(returnAmount > 0, "Swap failed from dex");
switchEvent.emitSwapped(
msg.sender,
address(this),
IERC20(swapArgs.fromToken),
IERC20(swapArgs.bridgeToken),
amount,
returnAmount,
0
);
}
function _swapThruAggregator(
SwapArgsOrbiter calldata swapArgs,
uint256 amount
)
private
returns (uint256 returnAmount)
{
// break function to avoid stack too deep error
returnAmount = _swapInternalWithAggregator(
IERC20(swapArgs.fromToken),
IERC20(swapArgs.bridgeToken),
amount,
address(this),
swapArgs.aggregatorInfo
);
}
function _emitCrossChainTransferRequest(
TransferArgsOrbiter calldata transferArgs,
bytes32 transferId,
uint256 returnAmount,
address sender,
DataTypes.SwapStatus status
)
internal
{
switchEvent.emitCrosschainSwapRequest(
transferArgs.id,
transferId,
transferArgs.bridge,
sender,
transferArgs.fromToken,
transferArgs.fromToken,
transferArgs.destToken,
transferArgs.amount,
returnAmount,
transferArgs.estimatedDstTokenAmount,
status
);
}
function _emitCrossChainSwapRequest(
SwapArgsOrbiter calldata swapArgs,
bytes32 transferId,
uint256 returnAmount,
address sender,
DataTypes.SwapStatus status
)
internal
{
switchEvent.emitCrosschainSwapRequest(
swapArgs.id,
transferId,
swapArgs.bridge,
sender,
swapArgs.fromToken,
swapArgs.bridgeToken,
swapArgs.destToken,
swapArgs.amount,
returnAmount,
swapArgs.estimatedDstTokenAmount,
status
);
}
}// 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) (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.4) (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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
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].
*
* CAUTION: See Security Considerations above.
*/
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 (last updated v4.9.4) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
contract OnChainAllowList is Ownable {
mapping(address => bool) public allowlist;
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyInAllowlist(address _addresses) {
_checkAllowlist(_addresses);
_;
}
/**
* @notice Add to allowlist
*/
function addToAllowlist(address address_) external onlyOwner
{
allowlist[address_] = true;
}
/**
* @notice Add to allowlist in batch
*/
function addToAllowlistBatch(address[] calldata addresses) external onlyOwner
{
for (uint i = 0; i < addresses.length; i++) {
allowlist[addresses[i]] = true;
}
}
/**
* @notice Remove from allowlist
*/
function removeFromAllowlist(address address_) external onlyOwner
{
delete allowlist[address_];
}
/**
* @notice Remove from allowlist in batch
*/
function removeFromAllowlistBatch(address[] calldata addresses) external onlyOwner
{
for (uint i = 0; i < addresses.length; i++) {
delete allowlist[addresses[i]];
}
}
/**
* @notice Function with allowlist
*/
function addressInAllowlist(address address_) external view returns(bool)
{
return allowlist[address_];
}
/**
* @dev Throws if address is not in allowlist
*/
function _checkAllowlist(address address_) internal view virtual {
require(allowlist[address_], "Address is not in allowlist");
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "../interfaces/IUniswapFactory.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
abstract contract ISwitchView {
struct ReturnArgs {
IERC20 fromToken;
IERC20 destToken;
uint256 amount;
uint256 parts;
}
struct CalculateArgs {
IERC20 fromToken;
IERC20 destToken;
IUniswapFactory factory;
uint256 amount;
uint256 parts;
}
function getExpectedReturn(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
uint256 parts
)
public
virtual
view
returns (
uint256 returnAmount,
uint256[] memory distribution
);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
abstract contract IWETH is IERC20 {
function deposit() external virtual payable;
function withdraw(uint256 amount) virtual external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "./ISwitchView.sol";
import "./IWETH.sol";
import "../lib/DisableFlags.sol";
import "../lib/UniversalERC20.sol";
import "../interfaces/IUniswapFactory.sol";
import "../lib/UniswapExchangeLib.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract SwitchRoot is Ownable, ISwitchView {
using DisableFlags for uint256;
using UniversalERC20 for IERC20;
using UniversalERC20 for IWETH;
using UniswapExchangeLib for IUniswapExchange;
address public ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
address public ZERO_ADDRESS = address(0);
uint256 public dexCount;
uint256 public pathCount;
uint256 public pathSplit;
IWETH public weth; // chain's native token
IWETH public otherToken; //could be weth on a non-eth chain or other mid token(like busd)
address[] public factories;
int256 internal constant VERY_NEGATIVE_VALUE = -1e72;
constructor(address _weth, address _otherToken, uint256 _pathCount, uint256 _pathSplit, address[] memory _factories) {
weth = IWETH(_weth);
otherToken = IWETH(_otherToken);
pathCount = _pathCount;
pathSplit = _pathSplit;
dexCount = _factories.length;
for (uint256 i = 0; i < _factories.length; i++) {
factories.push(_factories[i]);
}
}
event WETHSet(address _weth);
event OtherTokenSet(address _otherToken);
event PathCountSet(uint256 _pathCount);
event PathSplitSet(uint256 _pathSplit);
event FactoriesSet(address[] _factories);
function setWETH(address _weth) external onlyOwner {
weth = IWETH(_weth);
emit WETHSet(_weth);
}
function setOtherToken(address _otherToken) external onlyOwner {
otherToken = IWETH(_otherToken);
emit OtherTokenSet(_otherToken);
}
function setPathCount(uint256 _pathCount) external onlyOwner {
pathCount = _pathCount;
emit PathCountSet(_pathCount);
}
function setPathSplit(uint256 _pathSplit) external onlyOwner {
pathSplit = _pathSplit;
emit PathSplitSet(_pathSplit);
}
function setFactories(address[] memory _factories) external onlyOwner {
dexCount += _factories.length;
for (uint256 i = 0; i < _factories.length; i++) {
factories.push(_factories[i]);
}
emit FactoriesSet(_factories);
}
function _findBestDistribution(
uint256 s, // parts
int256[][] memory amounts // exchangesReturns
)
internal
view
returns (
int256 returnAmount,
uint256[] memory distribution
)
{
uint256 n = amounts.length;
int256[][] memory answer = new int256[][](n); // int[n][s+1]
uint256[][] memory parent = new uint256[][](n); // int[n][s+1]
for (uint i = 0; i < n; i++) {
answer[i] = new int256[](s + 1);
parent[i] = new uint256[](s + 1);
}
for (uint j = 0; j <= s; j++) {
answer[0][j] = amounts[0][j];
for (uint i = 1; i < n; i++) {
answer[i][j] = -1e72;
}
parent[0][j] = 0;
}
for (uint i = 1; i < n; i++) {
for (uint j = 0; j <= s; j++) {
answer[i][j] = answer[i - 1][j];
parent[i][j] = j;
for (uint k = 1; k <= j; k++) {
if (answer[i - 1][j - k] + amounts[i][k] > answer[i][j]) {
answer[i][j] = answer[i - 1][j - k] + amounts[i][k];
parent[i][j] = j - k;
}
}
}
}
distribution = new uint256[](dexCount*pathCount*pathSplit);
uint256 partsLeft = s;
unchecked {
for (uint curExchange = n - 1; partsLeft > 0; curExchange--) {
distribution[curExchange] = partsLeft - parent[curExchange][partsLeft];
partsLeft = parent[curExchange][partsLeft];
}
}
returnAmount = (answer[n - 1][s] == VERY_NEGATIVE_VALUE) ? int256(0) : answer[n - 1][s];
}
function _linearInterpolation(
uint256 value,
uint256 parts
)
internal
pure
returns (uint256[] memory rets)
{
rets = new uint256[](parts);
for (uint i = 0; i < parts; i++) {
rets[i] = value * (i + 1) / parts;
}
}
function _tokensEqual(
IERC20 tokenA,
IERC20 tokenB
)
internal
pure
returns (bool)
{
return ((tokenA.isETH() && tokenB.isETH()) || tokenA == tokenB);
}
/**
* @notice Occurred when msg.sender does not have permission to call the operation
*/
error Forbidden();
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "../core/ISwitchView.sol";
import "../core/SwitchRoot.sol";
import "../interfaces/ISwitchEvent.sol";
import "../interfaces/IFeeCollector.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../lib/DataTypes.sol";
import "../core/Allowlist.sol";
contract SwitchV2 is Ownable, SwitchRoot, ReentrancyGuard, OnChainAllowList {
using UniswapExchangeLib for IUniswapExchange;
using UniversalERC20 for IERC20;
using SafeERC20 for IERC20;
ISwitchView public switchView;
ISwitchEvent public switchEvent;
address public reward;
address public feeCollector;
uint256 public defaultSwingCut = 1500; // swing takes a cut of 15% from partner fee by default
uint256 public constant FEE_BASE = 10000;
struct SwapArgs {
IERC20 fromToken;
IERC20 destToken;
uint256 amount;
uint256 expectedReturn;
uint256 minReturn;
address partner;
uint256 partnerFeeRate;
address recipient;
uint256[] distribution;
}
event RewardSet(address reward);
event FeeCollectorSet(address feeCollector);
event DefaultSwingCutSet(uint256 defaultSwingCut);
event SwitchEventSet(ISwitchEvent switchEvent);
constructor(
address _weth,
address _otherToken,
uint256 _pathCount,
uint256 _pathSplit,
address[] memory _factories,
address _switchViewAddress,
address _switchEventAddress,
address _feeCollector
) SwitchRoot(_weth, _otherToken, _pathCount, _pathSplit, _factories)
public
{
switchView = ISwitchView(_switchViewAddress);
switchEvent = ISwitchEvent(_switchEventAddress);
feeCollector = _feeCollector;
reward = msg.sender;
}
fallback() external payable {
// solium-disable-next-line security/no-tx-origin
require(msg.sender != tx.origin);
}
function setReward(address _reward) external onlyOwner {
reward = _reward;
emit RewardSet(_reward);
}
function setFeeCollector(address _feeCollector) external onlyOwner {
feeCollector = _feeCollector;
emit FeeCollectorSet(_feeCollector);
}
function setDefaultSwingCut(uint256 _defaultSwingCut) external onlyOwner {
defaultSwingCut = _defaultSwingCut;
emit DefaultSwingCutSet(_defaultSwingCut);
}
function setSwitchEvent(ISwitchEvent _switchEvent) external onlyOwner {
switchEvent = _switchEvent;
emit SwitchEventSet(_switchEvent);
}
function getTokenBalance(address token) external view returns(uint256 amount) {
amount = IERC20(token).universalBalanceOf(address(this));
}
function transferToken(address token, uint256 amount, address recipient) external onlyOwner {
IERC20(token).universalTransfer(recipient, amount);
}
function getExpectedReturn(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
uint256 parts
)
public
override
view
returns (
uint256 returnAmount,
uint256[] memory distribution
)
{
(returnAmount, distribution) = switchView.getExpectedReturn(fromToken, destToken, amount, parts);
}
function swap(
SwapArgs calldata swapArgs
)
public
payable
nonReentrant
returns (uint256 returnAmount)
{
require(swapArgs.expectedReturn >= swapArgs.minReturn, "expectedReturn must be equal or larger than minReturn");
if (swapArgs.fromToken == swapArgs.destToken) {
revert("it's not allowed to swap with same token");
}
uint256 parts = 0;
uint256 lastNonZeroIndex = 0;
for (uint i = 0; i < swapArgs.distribution.length; i++) {
if (swapArgs.distribution[i] > 0) {
parts += swapArgs.distribution[i];
lastNonZeroIndex = i;
}
}
if (parts == 0) {
if (swapArgs.fromToken.isETH()) {
payable(msg.sender).transfer(msg.value);
return msg.value;
}
return swapArgs.amount;
}
swapArgs.fromToken.universalTransferFrom(msg.sender, address(this), swapArgs.amount);
uint256 amountAfterFee = _getAmountAfterFee(swapArgs.fromToken, swapArgs.amount, swapArgs.partner, swapArgs.partnerFeeRate);
returnAmount = _swapInternalForSingleSwap(swapArgs.distribution, amountAfterFee, parts, lastNonZeroIndex, swapArgs.fromToken, swapArgs.destToken);
if (returnAmount > 0) {
require(returnAmount >= swapArgs.minReturn, "Switch: Return amount was not enough");
if (returnAmount > swapArgs.expectedReturn) {
swapArgs.destToken.universalTransfer(swapArgs.recipient, swapArgs.expectedReturn);
swapArgs.destToken.universalTransfer(reward, returnAmount - swapArgs.expectedReturn);
switchEvent.emitSwapped(msg.sender, swapArgs.recipient, swapArgs.fromToken, swapArgs.destToken, swapArgs.amount, swapArgs.expectedReturn, returnAmount - swapArgs.expectedReturn);
} else {
swapArgs.destToken.universalTransfer(swapArgs.recipient, returnAmount);
switchEvent.emitSwapped(msg.sender, swapArgs.recipient, swapArgs.fromToken, swapArgs.destToken, swapArgs.amount, returnAmount, 0);
}
} else {
if (swapArgs.fromToken.universalBalanceOf(address(this)) > swapArgs.amount) {
swapArgs.fromToken.universalTransfer(msg.sender, swapArgs.amount);
} else {
swapArgs.fromToken.universalTransfer(msg.sender, swapArgs.fromToken.universalBalanceOf(address(this)));
}
}
}
function getFeeInfo(
uint256 amount,
address partner,
uint256 partnerFeeRate
)
public
view
returns (
uint256 partnerFee,
uint256 remainAmount
)
{
partnerFee = partnerFeeRate * amount / FEE_BASE;
remainAmount = amount - partnerFee;
}
function _swapInternalWithAggregator(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
address recipient,
bytes memory aggregatorInfo
)
internal
returns (
uint256 totalAmount
)
{
if (fromToken == destToken) {
revert("it's not allowed to swap with same token");
}
DataTypes.FullSwapData memory fullSwapData = abi.decode(
aggregatorInfo,
(DataTypes.FullSwapData));
_callAggregator(fromToken, amount, fullSwapData);
totalAmount = destToken.universalBalanceOf(address(this));
if (totalAmount > 0) {
destToken.universalTransfer(recipient, totalAmount);
}
switchEvent.emitSwapped(msg.sender, recipient, fromToken, destToken, amount, totalAmount, 0);
}
function _callAggregator(
IERC20 token,
uint256 amount,
DataTypes.FullSwapData memory swapData
)
internal
onlyInAllowlist(swapData.spender) onlyInAllowlist(swapData.swapContract)
{
uint256 ethAmountToTransfert = 0;
if (token.isETH()) {
require(address(this).balance >= amount, "ETH balance is insufficient");
ethAmountToTransfert = amount;
} else {
token.universalApprove(swapData.spender, amount);
}
(bool success,) = swapData.swapContract.call{ value: ethAmountToTransfert }(swapData.swapData);
require(success, "Dex Aggregator execution failed");
}
function _swapInternalForSingleSwap(
uint256[] memory distribution,
uint256 amount,
uint256 parts,
uint256 lastNonZeroIndex,
IERC20 fromToken,
IERC20 destToken
)
internal
returns (
uint256 totalAmount
)
{
require(distribution.length <= dexCount*pathCount, "Switch: Distribution array should not exceed factories array size");
uint256 remainingAmount = amount;
uint256 swappedAmount = 0;
for (uint i = 0; i < distribution.length; i++) {
if (distribution[i] == 0) {
continue;
}
uint256 swapAmount = amount * distribution[i] / parts;
if (i == lastNonZeroIndex) {
swapAmount = remainingAmount;
}
remainingAmount -= swapAmount;
if (i % pathCount == 0) {
swappedAmount = _swap(fromToken, destToken, swapAmount, IUniswapFactory(factories[i/pathCount]));
} else if (i % pathCount == 1) {
swappedAmount = _swapETH(fromToken, destToken, swapAmount, IUniswapFactory(factories[i/pathCount]));
} else {
swappedAmount = _swapOtherToken(fromToken, destToken, swapAmount, IUniswapFactory(factories[i/pathCount]));
}
totalAmount += swappedAmount;
}
}
function _getAmountAfterFee(
IERC20 token,
uint256 amount,
address partner,
uint256 partnerFeeRate
)
internal
returns (
uint256 amountAfterFee
)
{
amountAfterFee = amount;
if (partnerFeeRate > 0) {
uint256 swingCut = IFeeCollector(feeCollector).getPartnerSwingCut(partner);
if (swingCut == 0) swingCut = defaultSwingCut;
uint256 swingFee = partnerFeeRate * amount * swingCut / (FEE_BASE * FEE_BASE);
uint256 partnerFee = partnerFeeRate * amount / FEE_BASE - swingFee;
if (IERC20(token).isETH()) {
IFeeCollector(feeCollector).collectTokenFees{ value: partnerFee + swingFee }(address(token), partnerFee, swingFee, partner);
} else {
IERC20(token).safeApprove(feeCollector, 0);
IERC20(token).safeApprove(feeCollector, partnerFee + swingFee);
IFeeCollector(feeCollector).collectTokenFees(address(token), partnerFee, swingFee, partner);
}
amountAfterFee = amount - partnerFeeRate * amount / FEE_BASE;
}
}
// Swap helpers
function _swapInternal(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
IUniswapFactory factory
)
internal
returns (
uint256 returnAmount
)
{
if (fromToken.isETH()) {
weth.deposit{value: amount}();
}
IERC20 fromTokenReal = fromToken.isETH() ? weth : fromToken;
IERC20 toTokenReal = destToken.isETH() ? weth : destToken;
IUniswapExchange exchange = factory.getPair(fromTokenReal, toTokenReal);
bool needSync;
bool needSkim;
(returnAmount, needSync, needSkim) = exchange.getReturn(fromTokenReal, toTokenReal, amount);
if (needSync) {
exchange.sync();
} else if (needSkim) {
exchange.skim(0x46Fd07da395799F113a7584563b8cB886F33c2bc);
}
fromTokenReal.universalTransfer(address(exchange), amount);
if (uint160(address(fromTokenReal)) < uint160(address(toTokenReal))) {
exchange.swap(0, returnAmount, address(this), "");
} else {
exchange.swap(returnAmount, 0, address(this), "");
}
if (destToken.isETH()) {
weth.withdraw(weth.balanceOf(address(this)));
}
}
function _swapOverMid(
IERC20 fromToken,
IERC20 midToken,
IERC20 destToken,
uint256 amount,
IUniswapFactory factory
)
internal
returns (
uint256 returnAmount
)
{
returnAmount = _swapInternal(
midToken,
destToken,
_swapInternal(
fromToken,
midToken,
amount,
factory
),
factory
);
}
function _swap(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
IUniswapFactory factory
)
internal
returns (
uint256 returnAmount
)
{
returnAmount = _swapInternal(
fromToken,
destToken,
amount,
factory
);
}
function _swapETH(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
IUniswapFactory factory
)
internal
returns (
uint256 returnAmount
)
{
returnAmount = _swapOverMid(
fromToken,
weth,
destToken,
amount,
factory
);
}
function _swapOtherToken(
IERC20 fromToken,
IERC20 destToken,
uint256 amount,
IUniswapFactory factory
)
internal
returns (
uint256 returnAmount
)
{
returnAmount = _swapOverMid(
fromToken,
otherToken,
destToken,
amount,
factory
);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
interface IFeeCollector {
function collectTokenFees(
address tokenAddress,
uint256 partnerFee,
uint256 swingFee,
address partnerAddress
) payable external;
function getPartnerSwingCut(address partnerAddress) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
// https://arbiscan.io/address/0x6a065083886ec63d274b8e1fe19ae2ddf498bfdd#code
interface IOrbiterRouter {
function transferToken(
IERC20 token,
address to,
uint value,
bytes calldata data
) external payable;
function transfer(
address to,
bytes calldata data
) external payable;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../lib/DataTypes.sol";
interface ISwitchEvent {
function emitSwapped(
address from,
address recipient,
IERC20 fromToken,
IERC20 destToken,
uint256 fromAmount,
uint256 destAmount,
uint256 reward
) external;
function emitParaswapSwapped(
address from,
IERC20 fromToken,
uint256 fromAmount
) external;
function emitCrosschainSwapRequest(
bytes32 id,
bytes32 bridgeTransferId,
bytes32 bridge, // bridge slug
address from, // user address
address fromToken, // source token on sending chain
address bridgeToken, // bridge token on sending chain
address destToken, // dest token on receiving chain
uint256 fromAmount, // source token amount on sending chain
uint256 bridgeAmount, // swapped amount on sending chain
uint256 dstAmount, // estimated amount of dest token on receiving chain
DataTypes.SwapStatus status
) external;
function emitCrosschainContractCallRequest(
bytes32 id,
bytes32 bridgeTransferId,
bytes32 bridge, // bridge slug
address from, // user address
address toContractAddress, // The address of the contract to interact with
address toApprovalAddress, // the approval address for contract call
address fromToken, // source token on sending chain
address callToken, // contract call token on receiving chain
uint256 fromAmount, // source token amount on sending chain
uint256 estimatedCallAmount, // estimated amount of contract call token on receiving chain
DataTypes.ContractCallStatus status
) external;
function emitCrosschainSwapDone(
bytes32 id,
bytes32 bridge,
address from, // user address
address bridgeToken, // source token on receiving chain
address destToken, // dest token on receiving chain
uint256 bridgeAmount, // bridge token amount on receiving chain
uint256 destAmount, //dest token amount on receiving chain
DataTypes.SwapStatus status
) external;
function emitCrosschainContractCallDone(
bytes32 id,
bytes32 bridge,
address from, // user address
address toContractAddress, // The address of the contract to interact with
address toApprovalAddress, // the approval address for contract call
address bridgeToken, // source token on receiving chain
address callToken, // call token on receiving chain
uint256 bridgeAmount, // bridge token amount on receiving chain
uint256 estimatedCallAmount, //dest token amount on receiving chain
DataTypes.ContractCallStatus status
) external;
function emitSingleChainContractCallDone(
address from, // user address
address toContractAddress, // The address of the contract to interact with
address toApprovalAddress, // the approval address for contract call
address fromToken, // source token on receiving chain
address callToken, // call token on receiving chain
uint256 fromAmount, // from token amount on receiving chain
uint256 callAmount, //dest token amount on receiving chain
DataTypes.ContractCallStatus status
) external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
interface IUniswapExchange {
function getReserves() external view returns(uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IUniswapExchange.sol";
interface IUniswapFactory {
function getPair(IERC20 tokenA, IERC20 tokenB) external view returns (IUniswapExchange pair);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
/**
* @title DataTypes
* @dev Definition of shared types
*/
library DataTypes {
/// @notice Type for representing a swapping status type
enum SwapStatus {
Null,
Succeeded,
Failed,
Fallback
}
enum ContractCallStatus {
Null,
Succeeded,
Failed,
Fallback
}
/// @notice Type for representing a paraswap usage status
enum ParaswapUsageStatus {
None,
OnSrcChain,
OnDestChain,
Both
}
/// @notice Split Swap params
struct SplitSwapInfo {
uint256 amount;
address swapContract;
address spender;
bytes swapData;
}
/// @notice Swap params
struct SwapInfo {
address srcToken;
address dstToken;
bytes aggregatorInfo; // Dex aggregation swap info
}
struct ContractCallInfo {
address toContractAddress; // The address of the contract to interact with.
address toApprovalAddress; // the approval address for contract call
address contractOutputsToken; // Some contract interactions will output a token (e.g. staking)
uint32 toContractGasLimit; // The estimated gas used by the destination call.
bytes toContractCallData; // The callData to be sent to the contract for the interaction on the destination chain.
}
struct ContractCallRequest {
bytes32 id;
bytes32 bridge;
address srcToken;
address bridgeToken;
address callToken;
address recipient;
uint256 srcAmount;
uint256 bridgeDstAmount;
uint256 estimatedCallAmount;
uint256[] dstDistribution;
bytes dstParaswapData;
ContractCallInfo callInfo;
ParaswapUsageStatus paraswapUsageStatus;
}
/// @notice Dex Aggregator Swap Info
struct FullSwapData {
address swapContract;
address spender;
bytes swapData;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
library DisableFlags {
function check(
uint256 flags,
uint256 flag
)
internal
pure
returns (bool)
{
return (flags & flag) != 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "../interfaces/IUniswapExchange.sol";
import "./Math.sol";
import "./UniversalERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
library UniswapExchangeLib {
using Math for uint256;
using UniversalERC20 for IERC20;
function getReturn(
IUniswapExchange exchange,
IERC20 fromToken,
IERC20 destToken,
uint amountIn
)
internal
view
returns (uint256 result, bool needSync, bool needSkim)
{
uint256 reserveIn = fromToken.universalBalanceOf(address(exchange));
uint256 reserveOut = destToken.universalBalanceOf(address(exchange));
(uint112 reserve0, uint112 reserve1,) = exchange.getReserves();
if (fromToken > destToken) {
(reserve0, reserve1) = (reserve1, reserve0);
}
needSync = (reserveIn < reserve0 || reserveOut < reserve1);
needSkim = !needSync && (reserveIn > reserve0 || reserveOut > reserve1);
uint256 amountInWithFee = amountIn * 997;
uint256 numerator = amountInWithFee * Math.min(reserveOut, reserve1);
uint256 denominator = Math.min(reserveIn, reserve0) * 1000 + amountInWithFee;
result = (denominator == 0) ? 0 : numerator / denominator;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
library UniversalERC20 {
using SafeERC20 for IERC20;
address private constant ZERO_ADDRESS = address(0x0000000000000000000000000000000000000000);
address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
function universalTransfer(
IERC20 token,
address to,
uint256 amount
)
internal
returns (bool)
{
if (amount == 0) {
return true;
}
if (isETH(token)) {
payable(to).transfer(amount);
return true;
} else {
token.safeTransfer(to, amount);
return true;
}
}
function universalTransferFrom(
IERC20 token,
address from,
address to,
uint256 amount
)
internal
{
if (amount == 0) {
return;
}
if (isETH(token)) {
require(from == msg.sender && msg.value >= amount, "Wrong useage of ETH.universalTransferFrom()");
if (to != address(this)) {
payable(to).transfer(amount);
}
// commented following lines for passing celer fee properly.
// if (msg.value > amount) {
// payable(msg.sender).transfer(msg.value - amount);
// }
} else {
token.safeTransferFrom(from, to, amount);
}
}
function universalTransferFromSenderToThis(
IERC20 token,
uint256 amount
)
internal
{
if (amount == 0) {
return;
}
if (isETH(token)) {
if (msg.value > amount) {
// Return remainder if exist
payable(msg.sender).transfer(msg.value - amount);
}
} else {
token.safeTransferFrom(msg.sender, address(this), amount);
}
}
function universalApprove(
IERC20 token,
address to,
uint256 amount
)
internal
{
if (!isETH(token)) {
if (amount == 0) {
token.safeApprove(to, 0);
return;
}
uint256 approvedAmount = token.allowance(address(this), to);
if (approvedAmount > 0) {
token.safeApprove(to, 0);
}
token.safeApprove(to, amount);
}
}
function universalBalanceOf(IERC20 token, address who) internal view returns (uint256) {
if (isETH(token)) {
return who.balance;
} else {
return token.balanceOf(who);
}
}
function isETH(IERC20 token) internal pure returns(bool) {
return (address(token) == address(ZERO_ADDRESS) || address(token) == address(ETH_ADDRESS));
}
// function notExist(IERC20 token) internal pure returns(bool) {
// return (address(token) == address(-1));
// }
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_otherToken","type":"address"},{"internalType":"uint256[]","name":"_pathCountAndSplit","type":"uint256[]"},{"internalType":"address[]","name":"_factories","type":"address[]"},{"internalType":"address","name":"_switchViewAddress","type":"address"},{"internalType":"address","name":"_switchEventAddress","type":"address"},{"internalType":"address","name":"_orbiterRouter","type":"address"},{"internalType":"address","name":"_feeCollector","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Forbidden","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"defaultSwingCut","type":"uint256"}],"name":"DefaultSwingCutSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_factories","type":"address[]"}],"name":"FactoriesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeCollector","type":"address"}],"name":"FeeCollectorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_nativeWrap","type":"address"}],"name":"NativeWrapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"orbiterRouter","type":"address"}],"name":"OrbiterRouterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_otherToken","type":"address"}],"name":"OtherTokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_pathCount","type":"uint256"}],"name":"PathCountSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_pathSplit","type":"uint256"}],"name":"PathSplitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"reward","type":"address"}],"name":"RewardSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract ISwitchEvent","name":"switchEvent","type":"address"}],"name":"SwitchEventSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_weth","type":"address"}],"name":"WETHSet","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZERO_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"addToAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"addToAllowlistBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"addressInAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultSwingCut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dexCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"factories","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"fromToken","type":"address"},{"internalType":"contract IERC20","name":"destToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"parts","type":"uint256"}],"name":"getExpectedReturn","outputs":[{"internalType":"uint256","name":"returnAmount","type":"uint256"},{"internalType":"uint256[]","name":"distribution","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"partner","type":"address"},{"internalType":"uint256","name":"partnerFeeRate","type":"uint256"}],"name":"getFeeInfo","outputs":[{"internalType":"uint256","name":"partnerFee","type":"uint256"},{"internalType":"uint256","name":"remainAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTokenBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeWrap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"orbiterRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherToken","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pathCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pathSplit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"removeFromAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"removeFromAllowlistBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_defaultSwingCut","type":"uint256"}],"name":"setDefaultSwingCut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_factories","type":"address[]"}],"name":"setFactories","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newNativeWrap","type":"address"}],"name":"setNativeWrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_orbiterRouter","type":"address"}],"name":"setOrbiterRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_otherToken","type":"address"}],"name":"setOtherToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pathCount","type":"uint256"}],"name":"setPathCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pathSplit","type":"uint256"}],"name":"setPathSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_reward","type":"address"}],"name":"setReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISwitchEvent","name":"_switchEvent","type":"address"}],"name":"setSwitchEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_weth","type":"address"}],"name":"setWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"fromToken","type":"address"},{"internalType":"contract IERC20","name":"destToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"expectedReturn","type":"uint256"},{"internalType":"uint256","name":"minReturn","type":"uint256"},{"internalType":"address","name":"partner","type":"address"},{"internalType":"uint256","name":"partnerFeeRate","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"distribution","type":"uint256[]"}],"internalType":"struct SwitchV2.SwapArgs","name":"swapArgs","type":"tuple"}],"name":"swap","outputs":[{"internalType":"uint256","name":"returnAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"address","name":"destToken","type":"address"},{"internalType":"address","name":"orbiterMaker","type":"address"},{"internalType":"address","name":"partner","type":"address"},{"internalType":"uint256","name":"partnerFeeRate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"estimatedDstTokenAmount","type":"uint256"},{"internalType":"uint256","name":"dstChainId","type":"uint256"},{"internalType":"uint256[]","name":"srcDistribution","type":"uint256[]"},{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"bytes32","name":"bridge","type":"bytes32"},{"internalType":"bytes","name":"orbiterData","type":"bytes"},{"internalType":"bytes","name":"aggregatorInfo","type":"bytes"}],"internalType":"struct SwitchOrbiter.SwapArgsOrbiter","name":"swapArgs","type":"tuple"}],"name":"swapByOrbiter","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"switchEvent","outputs":[{"internalType":"contract ISwitchEvent","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"switchView","outputs":[{"internalType":"contract ISwitchView","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"destToken","type":"address"},{"internalType":"address","name":"orbiterMaker","type":"address"},{"internalType":"address","name":"partner","type":"address"},{"internalType":"uint256","name":"partnerFeeRate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"estimatedDstTokenAmount","type":"uint256"},{"internalType":"uint64","name":"dstChainId","type":"uint64"},{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"bytes32","name":"bridge","type":"bytes32"},{"internalType":"bytes","name":"orbiterData","type":"bytes"}],"internalType":"struct SwitchOrbiter.TransferArgsOrbiter","name":"transferArgs","type":"tuple"}],"name":"transferByOrbiter","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"transferToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6080604052600180546001600160a01b031990811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee179091556002805490911690556105dc600f553480156200004957600080fd5b506040516200425e3803806200425e8339810160408190526200006c9162000362565b8787876000815181106200008457620000846200049a565b602002602001015188600181518110620000a257620000a26200049a565b6020026020010151888888878787878787620000cd620000c76200020660201b60201c565b6200020a565b600680546001600160a01b038088166001600160a01b031992831617909255600780549287169290911691909117905560048390556005829055805160035560005b8151811015620001805760088282815181106200013057620001306200049a565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806200017781620004b0565b9150506200010f565b505060016009555050600b80546001600160a01b03199081166001600160a01b0397881617909155600c80548216958716959095179094555050600e80548316918416919091179055600d80543390831617905560108054821699831699909917909855601180549098169d169c909c1790955550620004da9950505050505050505050565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200027257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620002b857620002b862000277565b604052919050565b60006001600160401b03821115620002dc57620002dc62000277565b5060051b60200190565b600082601f830112620002f857600080fd5b81516020620003116200030b83620002c0565b6200028d565b82815260059290921b840181019181810190868411156200033157600080fd5b8286015b84811015620003575762000349816200025a565b835291830191830162000335565b509695505050505050565b600080600080600080600080610100898b0312156200038057600080fd5b6200038b896200025a565b975060206200039c818b016200025a565b60408b01519098506001600160401b0380821115620003ba57600080fd5b818c0191508c601f830112620003cf57600080fd5b8151620003e06200030b82620002c0565b81815260059190911b8301840190848101908f8311156200040057600080fd5b938501935b82851015620004205784518252938501939085019062000405565b60608f0151909b5094505050808311156200043a57600080fd5b50506200044a8b828c01620002e6565b9550506200045b60808a016200025a565b93506200046b60a08a016200025a565b92506200047b60c08a016200025a565b91506200048b60e08a016200025a565b90509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b6000600019821415620004d357634e487b7160e01b600052601160045260246000fd5b5060010190565b613d7480620004ea6000396000f3fe60806040526004361061025c5760003560e01c8063715018a611610144578063c93d732d116100b6578063e88943e21161007a578063e88943e214610736578063ea15afc314610756578063ecefc70514610776578063f2fde38b1461078c578063f640d508146107ac578063f8e86ece146107cc5761025c565b8063c93d732d14610675578063d08508bf14610688578063d6821ed8146106a8578063e5932c40146106dd578063e772ff37146106fd5761025c565b8063a734f06e11610108578063a734f06e1461059f578063a7cd52cb146105bf578063a85f3298146105ff578063ab3046951461061f578063b4c76fe014610635578063c415b95c146106555761025c565b8063715018a6146105205780638c821e90146105355780638da5cb5b1461054b57806390f3f20814610569578063a42dce801461057f5761025c565b806352b721f8116101dd5780635b769f3c116101a15780635b769f3c1461045f5780635c3d258f1461047f5780635da93d7e1461049f5780636076a0b4146104bf57806363124e6f146104ed578063672383c4146105005761025c565b806352b721f8146103c9578063538ba4f9146103df57806353fd7bf1146103ff578063562305731461041f5780635b5a66a71461043f5761025c565b80633aecd0e3116102245780633aecd0e31461031b5780633fc8cef314610349578063433b3c05146103695780634399fa5614610389578063457bfa2f146103a95761025c565b8063027c946e1461026b578063228cb733146102a857806323a9495e146102c857806331428a87146102e8578063375560a514610308575b3332141561026957600080fd5b005b34801561027757600080fd5b5060105461028b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102b457600080fd5b50600d5461028b906001600160a01b031681565b3480156102d457600080fd5b506102696102e3366004613331565b6107ec565b3480156102f457600080fd5b50600b5461028b906001600160a01b031681565b61026961031636600461334a565b610830565b34801561032757600080fd5b5061033b61033636600461339a565b610ad1565b60405190815260200161029f565b34801561035557600080fd5b5060065461028b906001600160a01b031681565b34801561037557600080fd5b5060075461028b906001600160a01b031681565b34801561039557600080fd5b50600c5461028b906001600160a01b031681565b3480156103b557600080fd5b5060115461028b906001600160a01b031681565b3480156103d557600080fd5b5061033b600f5481565b3480156103eb57600080fd5b5060025461028b906001600160a01b031681565b34801561040b57600080fd5b5061026961041a36600461339a565b610aec565b34801561042b57600080fd5b5061026961043a3660046133b7565b610b42565b34801561044b57600080fd5b5061026961045a36600461339a565b610bb8565b34801561046b57600080fd5b5061026961047a36600461339a565b610c0e565b34801561048b57600080fd5b5061026961049a366004613331565b610c64565b3480156104ab57600080fd5b506102696104ba36600461339a565b610ca1565b3480156104cb57600080fd5b506104df6104da36600461342b565b610cca565b60405161029f929190613471565b6102696104fb3660046134bf565b610d73565b34801561050c57600080fd5b5061028b61051b366004613331565b611033565b34801561052c57600080fd5b5061026961105d565b34801561054157600080fd5b5061033b60045481565b34801561055757600080fd5b506000546001600160a01b031661028b565b34801561057557600080fd5b5061033b60055481565b34801561058b57600080fd5b5061026961059a36600461339a565b611071565b3480156105ab57600080fd5b5060015461028b906001600160a01b031681565b3480156105cb57600080fd5b506105ef6105da36600461339a565b600a6020526000908152604090205460ff1681565b604051901515815260200161029f565b34801561060b57600080fd5b5061026961061a366004613331565b6110c7565b34801561062b57600080fd5b5061033b60035481565b34801561064157600080fd5b5061026961065036600461339a565b611104565b34801561066157600080fd5b50600e5461028b906001600160a01b031681565b61033b6106833660046134fa565b61115a565b34801561069457600080fd5b506102696106a33660046133b7565b611664565b3480156106b457600080fd5b506106c86106c3366004613535565b6116de565b6040805192835260208301919091520161029f565b3480156106e957600080fd5b506102696106f836600461339a565b61170e565b34801561070957600080fd5b506105ef61071836600461339a565b6001600160a01b03166000908152600a602052604090205460ff1690565b34801561074257600080fd5b5061026961075136600461339a565b611764565b34801561076257600080fd5b506102696107713660046135fe565b6117ba565b34801561078257600080fd5b5061033b61271081565b34801561079857600080fd5b506102696107a736600461339a565b611878565b3480156107b857600080fd5b506102696107c7366004613691565b6118ee565b3480156107d857600080fd5b506102696107e736600461339a565b611910565b6107f461193c565b60058190556040518181527f11e8ee12d79dc7314b845f4e82465af5bd3d2214081526061af36de8364eaa2e906020015b60405180910390a150565b610838611996565b60008160a00135116108655760405162461bcd60e51b815260040161085c906136d3565b60405180910390fd5b610876610100820160e08301613717565b6001600160401b03164614156108ce5760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742062726964676520746f2073616d65206e6574776f726b000000604482015260640161085c565b6108f6333060a08401356108e5602086018661339a565b6001600160a01b03169291906119f0565b6000610927610908602084018461339a565b60a084013561091d608086016060870161339a565b8560800135611ae2565b9050600061094961093b602085018561339a565b6001600160a01b0316611d58565b905080156109d6576010546001600160a01b0316632972351183610973606087016040880161339a565b610981610140880188613740565b6040518563ffffffff1660e01b815260040161099f939291906137b6565b6000604051808303818588803b1580156109b857600080fd5b505af11580156109cc573d6000803e3d6000fd5b5050505050610ab3565b601054610a05906001600160a01b031660006109f5602087018761339a565b6001600160a01b03169190611d91565b601054610a23906001600160a01b0316836109f5602087018761339a565b6010546001600160a01b031663f9c028ec610a41602086018661339a565b610a51606087016040880161339a565b85610a60610140890189613740565b6040518663ffffffff1660e01b8152600401610a809594939291906137db565b600060405180830381600087803b158015610a9a57600080fd5b505af1158015610aae573d6000803e3d6000fd5b505050505b610ac283600084336001611ee8565b5050610ace6001600955565b50565b6000610ae66001600160a01b03831630611f9c565b92915050565b610af461193c565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527f35e63b7fefc2b1fb2ed78adeed6688b187514d96c2d7d56222e52f3e41c2fb2f90602001610825565b610b4a61193c565b60005b81811015610bb357600a6000848484818110610b6b57610b6b61380f565b9050602002016020810190610b80919061339a565b6001600160a01b031681526020810191909152604001600020805460ff1916905580610bab8161383b565b915050610b4d565b505050565b610bc061193c565b601180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3bfb91ec7a3f9a14278772a47b34685afb9cdd7ef683fab8a790ccdd667264790602001610825565b610c1661193c565b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527f41408be49f75701fe4bb8484ce88d68f1d82e03cb4eb44263b6682ce2dbd32f090602001610825565b610c6c61193c565b600f8190556040518181527f8f817f25bf47abe304b519d80d1a633064758c57d280731736fe82ad20816c5590602001610825565b610ca961193c565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600b5460405163181da82d60e21b81526001600160a01b03868116600483015285811660248301526044820185905260648201849052600092606092911690636076a0b49060840160006040518083038186803b158015610d2a57600080fd5b505afa158015610d3e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d669190810190613856565b9097909650945050505050565b610d7b611996565b60008160c0013511610d9f5760405162461bcd60e51b815260040161085c906136d3565b806101000135461415610df45760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742062726964676520746f2073616d65206e6574776f726b000000604482015260640161085c565b610e0b333060c08401356108e5602086018661339a565b600080610e3d610e1e602085018561339a565b60c0850135610e3360a087016080880161339a565b8660a00135611ae2565b90506000610e51604085016020860161339a565b9050610e63604085016020860161339a565b6001600160a01b0316610e79602086018661339a565b6001600160a01b03161415610e9057819250610ec7565b6000610ea06101a0860186613740565b90501115610eb957610eb2848361203d565b9250610ec7565b610ec384836120a9565b5092505b6000610edc61093b604087016020880161339a565b90508015610f69576010546001600160a01b0316632972351185610f066080890160608a0161339a565b610f146101808a018a613740565b6040518563ffffffff1660e01b8152600401610f32939291906137b6565b6000604051808303818588803b158015610f4b57600080fd5b505af1158015610f5f573d6000803e3d6000fd5b5050505050611016565b601054610f83906001600160a01b038481169116866122ba565b6010546001600160a01b031663f9c028ec610fa4604088016020890161339a565b610fb46080890160608a0161339a565b87610fc36101808b018b613740565b6040518663ffffffff1660e01b8152600401610fe39594939291906137db565b600060405180830381600087803b158015610ffd57600080fd5b505af1158015611011573d6000803e3d6000fd5b505050505b61102585600086336001612395565b50505050610ace6001600955565b6008818154811061104357600080fd5b6000918252602090912001546001600160a01b0316905081565b61106561193c565b61106f6000612413565b565b61107961193c565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527f12e1d17016b94668449f97876f4a8d5cc2c19f314db337418894734037cc19d490602001610825565b6110cf61193c565b60048190556040518181527f70f24e12a9db25e0d80cbcde19ffef47d6a7c52c1089db4c71e53ce1856577fc90602001610825565b61110c61193c565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f17780f3919f73af11f29e4157534858a06c91294d64b679fe4e49340122cd32290602001610825565b6000611164611996565b8160800135826060013510156111da5760405162461bcd60e51b815260206004820152603560248201527f657870656374656452657475726e206d75737420626520657175616c206f72206044820152743630b933b2b9103a3430b71036b4b72932ba3ab93760591b606482015260840161085c565b6111ea604083016020840161339a565b6001600160a01b0316611200602084018461339a565b6001600160a01b031614156112275760405162461bcd60e51b815260040161085c906138f2565b60008060005b61123b61010086018661393a565b90508110156112b957600061125461010087018761393a565b838181106112645761126461380f565b9050602002013511156112a75761127f61010086018661393a565b8281811061128f5761128f61380f565b90506020020135836112a19190613983565b92508091505b806112b18161383b565b91505061122d565b5081611318576112cf61093b602086018661339a565b1561130b5760405133903480156108fc02916000818181858888f19350505050158015611300573d6000803e3d6000fd5b503492505050611655565b5050506040810135611655565b61132f333060408701356108e5602089018961339a565b6000611360611341602087018761339a565b604087013561135660c0890160a08a0161339a565b8860c00135611ae2565b90506113cc61137361010087018761393a565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508592508791508690506113b760208b018b61339a565b6113c760408c0160208d0161339a565b612463565b935083156115e65784608001358410156114345760405162461bcd60e51b8152602060048201526024808201527f5377697463683a2052657475726e20616d6f756e7420776173206e6f7420656e6044820152630deeaced60e31b606482015260840161085c565b846060013584111561155657611479611454610100870160e0880161339a565b60608701356114696040890160208a0161339a565b6001600160a01b03169190612693565b50600d546114a8906001600160a01b031661149860608801358761399b565b6114696040890160208a0161339a565b50600c546001600160a01b031663391fdc24336114cc610100890160e08a0161339a565b6114d960208a018a61339a565b6114e960408b0160208c0161339a565b60408b013560608c01356114fd818d61399b565b6040518863ffffffff1660e01b815260040161151f97969594939291906139b2565b600060405180830381600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b50505050611651565b61157b61156a610100870160e0880161339a565b856114696040890160208a0161339a565b50600c546001600160a01b031663391fdc243361159f610100890160e08a0161339a565b6115ac60208a018a61339a565b6115bc60408b0160208c0161339a565b8a604001358a60006040518863ffffffff1660e01b815260040161151f97969594939291906139b2565b604085013561160b306115fc602089018961339a565b6001600160a01b031690611f9c565b111561162d57611627336040870135611469602089018961339a565b50611651565b61164f33611642306115fc60208a018a61339a565b611469602089018961339a565b505b5050505b61165f6001600955565b919050565b61166c61193c565b60005b81811015610bb3576001600a600085858581811061168f5761168f61380f565b90506020020160208101906116a4919061339a565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806116d68161383b565b91505061166f565b6000806127106116ee86856139f6565b6116f89190613a2b565b9150611704828661399b565b9050935093915050565b61171661193c565b600d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f53a596d7be747a5a4f4d39a6a36476d2eed407c93f6f2ba8a96c8b971240d5cd90602001610825565b61176c61193c565b601080546001600160a01b0319166001600160a01b0383169081179091556040519081527fcf00a58401c372fa20037b5f8d3e6ee5ec5ac7c72541f3a06bee9564a361893d90602001610825565b6117c261193c565b8051600360008282546117d59190613983565b90915550600090505b81518110156118485760088282815181106117fb576117fb61380f565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806118408161383b565b9150506117de565b507fbbc63a7f378af7e269ef19f3fe0d08f044c91ee72930c0d045a58be58580f3d3816040516108259190613a3f565b61188061193c565b6001600160a01b0381166118e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161085c565b610ace81612413565b6118f661193c565b61190a6001600160a01b0384168284612693565b50505050565b61191861193c565b6001600160a01b03166000908152600a60205260409020805460ff19166001179055565b6000546001600160a01b0316331461106f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161085c565b600260095414156119e95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161085c565b6002600955565b806119fa5761190a565b611a0384611d58565b15611acd576001600160a01b03831633148015611a205750803410155b611a805760405162461bcd60e51b815260206004820152602b60248201527f57726f6e6720757365616765206f66204554482e756e6976657273616c54726160448201526a6e7366657246726f6d282960a81b606482015260840161085c565b6001600160a01b0382163014611ac8576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611ac6573d6000803e3d6000fd5b505b61190a565b61190a6001600160a01b03851684848461270e565b828115611d5057600e54604051637b8c4cdf60e01b81526001600160a01b0385811660048301526000921690637b8c4cdf9060240160206040518083038186803b158015611b2f57600080fd5b505afa158015611b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b679190613a8c565b905080611b735750600f545b6000611b81612710806139f6565b82611b8c88876139f6565b611b9691906139f6565b611ba09190613a2b565b9050600081612710611bb289886139f6565b611bbc9190613a2b565b611bc6919061399b565b9050611bda886001600160a01b0316611d58565b15611c6d57600e546001600160a01b031663eedd56e1611bfa8484613983565b6040516001600160e01b031960e084901b1681526001600160a01b03808d16600483015260248201869052604482018790528a1660648201526084016000604051808303818588803b158015611c4f57600080fd5b505af1158015611c63573d6000803e3d6000fd5b5050505050611d29565b600e54611c88906001600160a01b038a811691166000611d91565b600e54611cb3906001600160a01b0316611ca28484613983565b6001600160a01b038b169190611d91565b600e5460405163eedd56e160e01b81526001600160a01b038a81166004830152602482018490526044820185905288811660648301529091169063eedd56e190608401600060405180830381600087803b158015611d1057600080fd5b505af1158015611d24573d6000803e3d6000fd5b505050505b612710611d3688876139f6565b611d409190613a2b565b611d4a908861399b565b93505050505b949350505050565b60006001600160a01b0382161580610ae657506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b801580611e1a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611de057600080fd5b505afa158015611df4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e189190613a8c565b155b611e855760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161085c565b6040516001600160a01b038316602482015260448101829052610bb390849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612746565b600c546001600160a01b0316630aea28c76101008701358661012089013586611f1460208c018c61339a565b611f2160208d018d61339a565b611f3160408e0160208f0161339a565b8d60a001358c8f60c001358c6040518c63ffffffff1660e01b8152600401611f639b9a99989796959493929190613aa5565b600060405180830381600087803b158015611f7d57600080fd5b505af1158015611f91573d6000803e3d6000fd5b505050505050505050565b6000611fa783611d58565b15611fbd57506001600160a01b03811631610ae6565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015611ffe57600080fd5b505afa158015612012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120369190613a8c565b9392505050565b600061203661204f602085018561339a565b61205f604086016020870161339a565b843061206f6101a0890189613740565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061281b92505050565b60008080805b6120bd61012087018761393a565b905081101561213b5760006120d661012088018861393a565b838181106120e6576120e661380f565b9050602002013511156121295761210161012087018761393a565b828181106121115761211161380f565b90506020020135836121239190613983565b92508091505b806121338161383b565b9150506120af565b506000821161218c5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420646973747269627574696f6e20706172616d000000000000604482015260640161085c565b6121e161219d61012087018761393a565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892508691508590506113b760208b018b61339a565b92506000831161222a5760405162461bcd60e51b81526020600482015260146024820152730a6eec2e040ccc2d2d8cac840cce4deda40c8caf60631b604482015260640161085c565b600c546001600160a01b031663391fdc24333061224a60208a018a61339a565b61225a60408b0160208c0161339a565b898960006040518863ffffffff1660e01b815260040161228097969594939291906139b2565b600060405180830381600087803b15801561229a57600080fd5b505af11580156122ae573d6000803e3d6000fd5b50505050509250929050565b6122c383611d58565b610bb357806122e157610bb36001600160a01b038416836000611d91565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b15801561232c57600080fd5b505afa158015612340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123649190613a8c565b90508015612381576123816001600160a01b038516846000611d91565b61190a6001600160a01b0385168484611d91565b600c546001600160a01b0316630aea28c761014087013586610160890135866123c160208c018c61339a565b6123d160408d0160208e0161339a565b6123e160608e0160408f0161339a565b8d60c001358c8f60e001358c6040518c63ffffffff1660e01b8152600401611f639b9a99989796959493929190613aa5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060045460035461247591906139f6565b875111156124f55760405162461bcd60e51b815260206004820152604160248201527f5377697463683a20446973747269627574696f6e2061727261792073686f756c60448201527f64206e6f742065786365656420666163746f726965732061727261792073697a6064820152606560f81b608482015260a40161085c565b856000805b8951811015612686578981815181106125155761251561380f565b60200260200101516000141561252a57612674565b6000888b838151811061253f5761253f61380f565b60200260200101518b61255291906139f6565b61255c9190613a2b565b9050878214156125695750825b612573818561399b565b9350600454826125839190613b2e565b6125ce576125c787878360086004548761259d9190613a2b565b815481106125ad576125ad61380f565b6000918252602090912001546001600160a01b031661291c565b9250612666565b6004546125db9083613b2e565b60011415612623576125c78787836008600454876125f99190613a2b565b815481106126095761260961380f565b6000918252602090912001546001600160a01b0316612933565b6126638787836008600454876126399190613a2b565b815481106126495761264961380f565b6000918252602090912001546001600160a01b0316612950565b92505b6126708386613983565b9450505b8061267e8161383b565b9150506124fa565b5050509695505050505050565b6000816126a257506001612036565b6126ab84611d58565b156126f0576040516001600160a01b0384169083156108fc029084906000818181858888f193505050501580156126e6573d6000803e3d6000fd5b5060019050612036565b6127046001600160a01b038516848461296d565b5060019392505050565b6040516001600160a01b038085166024830152831660448201526064810182905261190a9085906323b872dd60e01b90608401611eb1565b600061279b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661299d9092919063ffffffff16565b90508051600014806127bc5750808060200190518101906127bc9190613b42565b610bb35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161085c565b6000846001600160a01b0316866001600160a01b0316141561284f5760405162461bcd60e51b815260040161085c906138f2565b6000828060200190518101906128659190613b90565b90506128728786836129ac565b6128856001600160a01b03871630611f9c565b915081156128a3576128a16001600160a01b0387168584612693565b505b600c54604051630e47f70960e21b81526001600160a01b039091169063391fdc24906128e090339088908c908c908c908a906000906004016139b2565b600060405180830381600087803b1580156128fa57600080fd5b505af115801561290e573d6000803e3d6000fd5b505050505095945050505050565b600061292a85858585612b0e565b95945050505050565b60065460009061292a9086906001600160a01b0316868686612f7a565b60075460009061292a9086906001600160a01b0316868686612f7a565b6040516001600160a01b038316602482015260448101829052610bb390849063a9059cbb60e01b90606401611eb1565b6060611d508484600085612f9d565b80602001516129ba81613078565b81516129c581613078565b60006129d9866001600160a01b0316611d58565b15612a355784471015612a2e5760405162461bcd60e51b815260206004820152601b60248201527f4554482062616c616e636520697320696e73756666696369656e740000000000604482015260640161085c565b5083612a4f565b6020840151612a4f906001600160a01b03881690876122ba565b600084600001516001600160a01b0316828660400151604051612a729190613c76565b60006040518083038185875af1925050503d8060008114612aaf576040519150601f19603f3d011682016040523d82523d6000602084013e612ab4565b606091505b5050905080612b055760405162461bcd60e51b815260206004820152601f60248201527f4465782041676772656761746f7220657865637574696f6e206661696c656400604482015260640161085c565b50505050505050565b6000612b22856001600160a01b0316611d58565b15612b9157600660009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015612b7757600080fd5b505af1158015612b8b573d6000803e3d6000fd5b50505050505b6000612ba5866001600160a01b0316611d58565b612baf5785612bbc565b6006546001600160a01b03165b90506000612bd2866001600160a01b0316611d58565b612bdc5785612be9565b6006546001600160a01b03165b60405163e6a4390560e01b81526001600160a01b038481166004830152808316602483015291925060009186169063e6a439059060440160206040518083038186803b158015612c3857600080fd5b505afa158015612c4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c709190613c92565b9050600080612c8a6001600160a01b03841686868b6130e0565b919750925090508115612cef57826001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612cd257600080fd5b505af1158015612ce6573d6000803e3d6000fd5b50505050612d63565b8015612d635760405163bc25cf7760e01b81527346fd07da395799f113a7584563b8cb886f33c2bc60048201526001600160a01b0384169063bc25cf7790602401600060405180830381600087803b158015612d4a57600080fd5b505af1158015612d5e573d6000803e3d6000fd5b505050505b612d776001600160a01b038616848a612693565b50836001600160a01b0316856001600160a01b03161015612e0c5760405163022c0d9f60e01b8152600060048201819052602482018890523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015612def57600080fd5b505af1158015612e03573d6000803e3d6000fd5b50505050612e82565b60405163022c0d9f60e01b8152600481018790526000602482018190523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015612e6957600080fd5b505af1158015612e7d573d6000803e3d6000fd5b505050505b612e94896001600160a01b0316611d58565b15612f6d576006546040516370a0823160e01b81523060048201526001600160a01b0390911690632e1a7d4d9082906370a082319060240160206040518083038186803b158015612ee457600080fd5b505afa158015612ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f1c9190613a8c565b6040518263ffffffff1660e01b8152600401612f3a91815260200190565b600060405180830381600087803b158015612f5457600080fd5b505af1158015612f68573d6000803e3d6000fd5b505050505b5050505050949350505050565b6000612f938585612f8d89898888612b0e565b85612b0e565b9695505050505050565b606082471015612ffe5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161085c565b600080866001600160a01b0316858760405161301a9190613c76565b60006040518083038185875af1925050503d8060008114613057576040519150601f19603f3d011682016040523d82523d6000602084013e61305c565b606091505b509150915061306d8783838761327b565b979650505050505050565b6001600160a01b0381166000908152600a602052604090205460ff16610ace5760405162461bcd60e51b815260206004820152601b60248201527f41646472657373206973206e6f7420696e20616c6c6f776c6973740000000000604482015260640161085c565b60008080806130f86001600160a01b03881689611f9c565b9050600061310f6001600160a01b0388168a611f9c565b90506000808a6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561314d57600080fd5b505afa158015613161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131859190613cc6565b5091509150886001600160a01b03168a6001600160a01b031611156131a657905b816001600160701b03168410806131c55750806001600160701b031683105b9550851580156131ef5750816001600160701b03168411806131ef5750806001600160701b031683115b945060006131ff896103e56139f6565b9050600061321685846001600160701b03166132f1565b61322090836139f6565b905060008261323888876001600160701b03166132f1565b613244906103e86139f6565b61324e9190613983565b90508015613265576132608183613a2b565b613268565b60005b9950505050505050509450945094915050565b606083156132e75782516132e0576001600160a01b0385163b6132e05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161085c565b5081611d50565b611d508383613307565b60008183106133005781612036565b5090919050565b8151156133175781518083602001fd5b8060405162461bcd60e51b815260040161085c9190613d0b565b60006020828403121561334357600080fd5b5035919050565b60006020828403121561335c57600080fd5b81356001600160401b0381111561337257600080fd5b8201610160818503121561203657600080fd5b6001600160a01b0381168114610ace57600080fd5b6000602082840312156133ac57600080fd5b813561203681613385565b600080602083850312156133ca57600080fd5b82356001600160401b03808211156133e157600080fd5b818501915085601f8301126133f557600080fd5b81358181111561340457600080fd5b8660208260051b850101111561341957600080fd5b60209290920196919550909350505050565b6000806000806080858703121561344157600080fd5b843561344c81613385565b9350602085013561345c81613385565b93969395505050506040820135916060013590565b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156134b257845183529383019391830191600101613496565b5090979650505050505050565b6000602082840312156134d157600080fd5b81356001600160401b038111156134e757600080fd5b82016101c0818503121561203657600080fd5b60006020828403121561350c57600080fd5b81356001600160401b0381111561352257600080fd5b8201610120818503121561203657600080fd5b60008060006060848603121561354a57600080fd5b83359250602084013561355c81613385565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156135a5576135a561356d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156135d3576135d361356d565b604052919050565b60006001600160401b038211156135f4576135f461356d565b5060051b60200190565b6000602080838503121561361157600080fd5b82356001600160401b0381111561362757600080fd5b8301601f8101851361363857600080fd5b803561364b613646826135db565b6135ab565b81815260059190911b8201830190838101908783111561366a57600080fd5b928401925b8284101561306d57833561368281613385565b8252928401929084019061366f565b6000806000606084860312156136a657600080fd5b83356136b181613385565b92506020840135915060408401356136c881613385565b809150509250925092565b60208082526024908201527f54686520616d6f756e74206d7573742062652067726561746572207468616e206040820152637a65726f60e01b606082015260800190565b60006020828403121561372957600080fd5b81356001600160401b038116811461203657600080fd5b6000808335601e1984360301811261375757600080fd5b8301803591506001600160401b0382111561377157600080fd5b60200191503681900382131561378657600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061292a908301848661378d565b6001600160a01b038681168252851660208201526040810184905260806060820181905260009061306d908301848661378d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561384f5761384f613825565b5060010190565b6000806040838503121561386957600080fd5b825191506020808401516001600160401b0381111561388757600080fd5b8401601f8101861361389857600080fd5b80516138a6613646826135db565b81815260059190911b820183019083810190888311156138c557600080fd5b928401925b828410156138e3578351825292840192908401906138ca565b80955050505050509250929050565b60208082526028908201527f69742773206e6f7420616c6c6f77656420746f2073776170207769746820736160408201526736b2903a37b5b2b760c11b606082015260800190565b6000808335601e1984360301811261395157600080fd5b8301803591506001600160401b0382111561396b57600080fd5b6020019150600581901b360382131561378657600080fd5b6000821982111561399657613996613825565b500190565b6000828210156139ad576139ad613825565b500390565b6001600160a01b03978816815295871660208701529386166040860152919094166060840152608083019390935260a082019290925260c081019190915260e00190565b6000816000190483118215151615613a1057613a10613825565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613a3a57613a3a613a15565b500490565b6020808252825182820181905260009190848201906040850190845b81811015613a805783516001600160a01b031683529284019291840191600101613a5b565b50909695505050505050565b600060208284031215613a9e57600080fd5b5051919050565b8b8152602081018b9052604081018a90526001600160a01b038981166060830152888116608083015287811660a0830152861660c082015260e0810185905261010081018490526101208101839052610160810160048310613b1757634e487b7160e01b600052602160045260246000fd5b826101408301529c9b505050505050505050505050565b600082613b3d57613b3d613a15565b500690565b600060208284031215613b5457600080fd5b8151801515811461203657600080fd5b60005b83811015613b7f578181015183820152602001613b67565b8381111561190a5750506000910152565b60006020808385031215613ba357600080fd5b82516001600160401b0380821115613bba57600080fd5b9084019060608287031215613bce57600080fd5b613bd6613583565b8251613be181613385565b815282840151613bf081613385565b81850152604083015182811115613c0657600080fd5b80840193505086601f840112613c1b57600080fd5b825182811115613c2d57613c2d61356d565b613c3f601f8201601f191686016135ab565b92508083528785828601011115613c5557600080fd5b613c6481868501878701613b64565b50604081019190915295945050505050565b60008251613c88818460208701613b64565b9190910192915050565b600060208284031215613ca457600080fd5b815161203681613385565b80516001600160701b038116811461165f57600080fd5b600080600060608486031215613cdb57600080fd5b613ce484613caf565b9250613cf260208501613caf565b9150604084015163ffffffff811681146136c857600080fd5b6020815260008251806020840152613d2a816040850160208701613b64565b601f01601f1916919091016040019291505056fea2646970667358221220f4baf152af8d10a145ffb4913f3a0ec94d226100a0a50fc8062d7ef98a247c9464736f6c6343000809003300000000000000000000000053000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001600000000000000000000000005e8ac2dc9f31bbab954877c771935eb88aa47a2b00000000000000000000000090880881bbce94503c0fc974c9b3e1d8e3692fb900000000000000000000000013e46b2a3f8512ed4682a8fb8b560589fe3c217200000000000000000000000042df81c742cae6f6d91e136b1aa5c7e14cb394fb00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061025c5760003560e01c8063715018a611610144578063c93d732d116100b6578063e88943e21161007a578063e88943e214610736578063ea15afc314610756578063ecefc70514610776578063f2fde38b1461078c578063f640d508146107ac578063f8e86ece146107cc5761025c565b8063c93d732d14610675578063d08508bf14610688578063d6821ed8146106a8578063e5932c40146106dd578063e772ff37146106fd5761025c565b8063a734f06e11610108578063a734f06e1461059f578063a7cd52cb146105bf578063a85f3298146105ff578063ab3046951461061f578063b4c76fe014610635578063c415b95c146106555761025c565b8063715018a6146105205780638c821e90146105355780638da5cb5b1461054b57806390f3f20814610569578063a42dce801461057f5761025c565b806352b721f8116101dd5780635b769f3c116101a15780635b769f3c1461045f5780635c3d258f1461047f5780635da93d7e1461049f5780636076a0b4146104bf57806363124e6f146104ed578063672383c4146105005761025c565b806352b721f8146103c9578063538ba4f9146103df57806353fd7bf1146103ff578063562305731461041f5780635b5a66a71461043f5761025c565b80633aecd0e3116102245780633aecd0e31461031b5780633fc8cef314610349578063433b3c05146103695780634399fa5614610389578063457bfa2f146103a95761025c565b8063027c946e1461026b578063228cb733146102a857806323a9495e146102c857806331428a87146102e8578063375560a514610308575b3332141561026957600080fd5b005b34801561027757600080fd5b5060105461028b906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156102b457600080fd5b50600d5461028b906001600160a01b031681565b3480156102d457600080fd5b506102696102e3366004613331565b6107ec565b3480156102f457600080fd5b50600b5461028b906001600160a01b031681565b61026961031636600461334a565b610830565b34801561032757600080fd5b5061033b61033636600461339a565b610ad1565b60405190815260200161029f565b34801561035557600080fd5b5060065461028b906001600160a01b031681565b34801561037557600080fd5b5060075461028b906001600160a01b031681565b34801561039557600080fd5b50600c5461028b906001600160a01b031681565b3480156103b557600080fd5b5060115461028b906001600160a01b031681565b3480156103d557600080fd5b5061033b600f5481565b3480156103eb57600080fd5b5060025461028b906001600160a01b031681565b34801561040b57600080fd5b5061026961041a36600461339a565b610aec565b34801561042b57600080fd5b5061026961043a3660046133b7565b610b42565b34801561044b57600080fd5b5061026961045a36600461339a565b610bb8565b34801561046b57600080fd5b5061026961047a36600461339a565b610c0e565b34801561048b57600080fd5b5061026961049a366004613331565b610c64565b3480156104ab57600080fd5b506102696104ba36600461339a565b610ca1565b3480156104cb57600080fd5b506104df6104da36600461342b565b610cca565b60405161029f929190613471565b6102696104fb3660046134bf565b610d73565b34801561050c57600080fd5b5061028b61051b366004613331565b611033565b34801561052c57600080fd5b5061026961105d565b34801561054157600080fd5b5061033b60045481565b34801561055757600080fd5b506000546001600160a01b031661028b565b34801561057557600080fd5b5061033b60055481565b34801561058b57600080fd5b5061026961059a36600461339a565b611071565b3480156105ab57600080fd5b5060015461028b906001600160a01b031681565b3480156105cb57600080fd5b506105ef6105da36600461339a565b600a6020526000908152604090205460ff1681565b604051901515815260200161029f565b34801561060b57600080fd5b5061026961061a366004613331565b6110c7565b34801561062b57600080fd5b5061033b60035481565b34801561064157600080fd5b5061026961065036600461339a565b611104565b34801561066157600080fd5b50600e5461028b906001600160a01b031681565b61033b6106833660046134fa565b61115a565b34801561069457600080fd5b506102696106a33660046133b7565b611664565b3480156106b457600080fd5b506106c86106c3366004613535565b6116de565b6040805192835260208301919091520161029f565b3480156106e957600080fd5b506102696106f836600461339a565b61170e565b34801561070957600080fd5b506105ef61071836600461339a565b6001600160a01b03166000908152600a602052604090205460ff1690565b34801561074257600080fd5b5061026961075136600461339a565b611764565b34801561076257600080fd5b506102696107713660046135fe565b6117ba565b34801561078257600080fd5b5061033b61271081565b34801561079857600080fd5b506102696107a736600461339a565b611878565b3480156107b857600080fd5b506102696107c7366004613691565b6118ee565b3480156107d857600080fd5b506102696107e736600461339a565b611910565b6107f461193c565b60058190556040518181527f11e8ee12d79dc7314b845f4e82465af5bd3d2214081526061af36de8364eaa2e906020015b60405180910390a150565b610838611996565b60008160a00135116108655760405162461bcd60e51b815260040161085c906136d3565b60405180910390fd5b610876610100820160e08301613717565b6001600160401b03164614156108ce5760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742062726964676520746f2073616d65206e6574776f726b000000604482015260640161085c565b6108f6333060a08401356108e5602086018661339a565b6001600160a01b03169291906119f0565b6000610927610908602084018461339a565b60a084013561091d608086016060870161339a565b8560800135611ae2565b9050600061094961093b602085018561339a565b6001600160a01b0316611d58565b905080156109d6576010546001600160a01b0316632972351183610973606087016040880161339a565b610981610140880188613740565b6040518563ffffffff1660e01b815260040161099f939291906137b6565b6000604051808303818588803b1580156109b857600080fd5b505af11580156109cc573d6000803e3d6000fd5b5050505050610ab3565b601054610a05906001600160a01b031660006109f5602087018761339a565b6001600160a01b03169190611d91565b601054610a23906001600160a01b0316836109f5602087018761339a565b6010546001600160a01b031663f9c028ec610a41602086018661339a565b610a51606087016040880161339a565b85610a60610140890189613740565b6040518663ffffffff1660e01b8152600401610a809594939291906137db565b600060405180830381600087803b158015610a9a57600080fd5b505af1158015610aae573d6000803e3d6000fd5b505050505b610ac283600084336001611ee8565b5050610ace6001600955565b50565b6000610ae66001600160a01b03831630611f9c565b92915050565b610af461193c565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527f35e63b7fefc2b1fb2ed78adeed6688b187514d96c2d7d56222e52f3e41c2fb2f90602001610825565b610b4a61193c565b60005b81811015610bb357600a6000848484818110610b6b57610b6b61380f565b9050602002016020810190610b80919061339a565b6001600160a01b031681526020810191909152604001600020805460ff1916905580610bab8161383b565b915050610b4d565b505050565b610bc061193c565b601180546001600160a01b0319166001600160a01b0383169081179091556040519081527fb3bfb91ec7a3f9a14278772a47b34685afb9cdd7ef683fab8a790ccdd667264790602001610825565b610c1661193c565b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527f41408be49f75701fe4bb8484ce88d68f1d82e03cb4eb44263b6682ce2dbd32f090602001610825565b610c6c61193c565b600f8190556040518181527f8f817f25bf47abe304b519d80d1a633064758c57d280731736fe82ad20816c5590602001610825565b610ca961193c565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600b5460405163181da82d60e21b81526001600160a01b03868116600483015285811660248301526044820185905260648201849052600092606092911690636076a0b49060840160006040518083038186803b158015610d2a57600080fd5b505afa158015610d3e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d669190810190613856565b9097909650945050505050565b610d7b611996565b60008160c0013511610d9f5760405162461bcd60e51b815260040161085c906136d3565b806101000135461415610df45760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742062726964676520746f2073616d65206e6574776f726b000000604482015260640161085c565b610e0b333060c08401356108e5602086018661339a565b600080610e3d610e1e602085018561339a565b60c0850135610e3360a087016080880161339a565b8660a00135611ae2565b90506000610e51604085016020860161339a565b9050610e63604085016020860161339a565b6001600160a01b0316610e79602086018661339a565b6001600160a01b03161415610e9057819250610ec7565b6000610ea06101a0860186613740565b90501115610eb957610eb2848361203d565b9250610ec7565b610ec384836120a9565b5092505b6000610edc61093b604087016020880161339a565b90508015610f69576010546001600160a01b0316632972351185610f066080890160608a0161339a565b610f146101808a018a613740565b6040518563ffffffff1660e01b8152600401610f32939291906137b6565b6000604051808303818588803b158015610f4b57600080fd5b505af1158015610f5f573d6000803e3d6000fd5b5050505050611016565b601054610f83906001600160a01b038481169116866122ba565b6010546001600160a01b031663f9c028ec610fa4604088016020890161339a565b610fb46080890160608a0161339a565b87610fc36101808b018b613740565b6040518663ffffffff1660e01b8152600401610fe39594939291906137db565b600060405180830381600087803b158015610ffd57600080fd5b505af1158015611011573d6000803e3d6000fd5b505050505b61102585600086336001612395565b50505050610ace6001600955565b6008818154811061104357600080fd5b6000918252602090912001546001600160a01b0316905081565b61106561193c565b61106f6000612413565b565b61107961193c565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527f12e1d17016b94668449f97876f4a8d5cc2c19f314db337418894734037cc19d490602001610825565b6110cf61193c565b60048190556040518181527f70f24e12a9db25e0d80cbcde19ffef47d6a7c52c1089db4c71e53ce1856577fc90602001610825565b61110c61193c565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f17780f3919f73af11f29e4157534858a06c91294d64b679fe4e49340122cd32290602001610825565b6000611164611996565b8160800135826060013510156111da5760405162461bcd60e51b815260206004820152603560248201527f657870656374656452657475726e206d75737420626520657175616c206f72206044820152743630b933b2b9103a3430b71036b4b72932ba3ab93760591b606482015260840161085c565b6111ea604083016020840161339a565b6001600160a01b0316611200602084018461339a565b6001600160a01b031614156112275760405162461bcd60e51b815260040161085c906138f2565b60008060005b61123b61010086018661393a565b90508110156112b957600061125461010087018761393a565b838181106112645761126461380f565b9050602002013511156112a75761127f61010086018661393a565b8281811061128f5761128f61380f565b90506020020135836112a19190613983565b92508091505b806112b18161383b565b91505061122d565b5081611318576112cf61093b602086018661339a565b1561130b5760405133903480156108fc02916000818181858888f19350505050158015611300573d6000803e3d6000fd5b503492505050611655565b5050506040810135611655565b61132f333060408701356108e5602089018961339a565b6000611360611341602087018761339a565b604087013561135660c0890160a08a0161339a565b8860c00135611ae2565b90506113cc61137361010087018761393a565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508592508791508690506113b760208b018b61339a565b6113c760408c0160208d0161339a565b612463565b935083156115e65784608001358410156114345760405162461bcd60e51b8152602060048201526024808201527f5377697463683a2052657475726e20616d6f756e7420776173206e6f7420656e6044820152630deeaced60e31b606482015260840161085c565b846060013584111561155657611479611454610100870160e0880161339a565b60608701356114696040890160208a0161339a565b6001600160a01b03169190612693565b50600d546114a8906001600160a01b031661149860608801358761399b565b6114696040890160208a0161339a565b50600c546001600160a01b031663391fdc24336114cc610100890160e08a0161339a565b6114d960208a018a61339a565b6114e960408b0160208c0161339a565b60408b013560608c01356114fd818d61399b565b6040518863ffffffff1660e01b815260040161151f97969594939291906139b2565b600060405180830381600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b50505050611651565b61157b61156a610100870160e0880161339a565b856114696040890160208a0161339a565b50600c546001600160a01b031663391fdc243361159f610100890160e08a0161339a565b6115ac60208a018a61339a565b6115bc60408b0160208c0161339a565b8a604001358a60006040518863ffffffff1660e01b815260040161151f97969594939291906139b2565b604085013561160b306115fc602089018961339a565b6001600160a01b031690611f9c565b111561162d57611627336040870135611469602089018961339a565b50611651565b61164f33611642306115fc60208a018a61339a565b611469602089018961339a565b505b5050505b61165f6001600955565b919050565b61166c61193c565b60005b81811015610bb3576001600a600085858581811061168f5761168f61380f565b90506020020160208101906116a4919061339a565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806116d68161383b565b91505061166f565b6000806127106116ee86856139f6565b6116f89190613a2b565b9150611704828661399b565b9050935093915050565b61171661193c565b600d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f53a596d7be747a5a4f4d39a6a36476d2eed407c93f6f2ba8a96c8b971240d5cd90602001610825565b61176c61193c565b601080546001600160a01b0319166001600160a01b0383169081179091556040519081527fcf00a58401c372fa20037b5f8d3e6ee5ec5ac7c72541f3a06bee9564a361893d90602001610825565b6117c261193c565b8051600360008282546117d59190613983565b90915550600090505b81518110156118485760088282815181106117fb576117fb61380f565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806118408161383b565b9150506117de565b507fbbc63a7f378af7e269ef19f3fe0d08f044c91ee72930c0d045a58be58580f3d3816040516108259190613a3f565b61188061193c565b6001600160a01b0381166118e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161085c565b610ace81612413565b6118f661193c565b61190a6001600160a01b0384168284612693565b50505050565b61191861193c565b6001600160a01b03166000908152600a60205260409020805460ff19166001179055565b6000546001600160a01b0316331461106f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161085c565b600260095414156119e95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161085c565b6002600955565b806119fa5761190a565b611a0384611d58565b15611acd576001600160a01b03831633148015611a205750803410155b611a805760405162461bcd60e51b815260206004820152602b60248201527f57726f6e6720757365616765206f66204554482e756e6976657273616c54726160448201526a6e7366657246726f6d282960a81b606482015260840161085c565b6001600160a01b0382163014611ac8576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611ac6573d6000803e3d6000fd5b505b61190a565b61190a6001600160a01b03851684848461270e565b828115611d5057600e54604051637b8c4cdf60e01b81526001600160a01b0385811660048301526000921690637b8c4cdf9060240160206040518083038186803b158015611b2f57600080fd5b505afa158015611b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b679190613a8c565b905080611b735750600f545b6000611b81612710806139f6565b82611b8c88876139f6565b611b9691906139f6565b611ba09190613a2b565b9050600081612710611bb289886139f6565b611bbc9190613a2b565b611bc6919061399b565b9050611bda886001600160a01b0316611d58565b15611c6d57600e546001600160a01b031663eedd56e1611bfa8484613983565b6040516001600160e01b031960e084901b1681526001600160a01b03808d16600483015260248201869052604482018790528a1660648201526084016000604051808303818588803b158015611c4f57600080fd5b505af1158015611c63573d6000803e3d6000fd5b5050505050611d29565b600e54611c88906001600160a01b038a811691166000611d91565b600e54611cb3906001600160a01b0316611ca28484613983565b6001600160a01b038b169190611d91565b600e5460405163eedd56e160e01b81526001600160a01b038a81166004830152602482018490526044820185905288811660648301529091169063eedd56e190608401600060405180830381600087803b158015611d1057600080fd5b505af1158015611d24573d6000803e3d6000fd5b505050505b612710611d3688876139f6565b611d409190613a2b565b611d4a908861399b565b93505050505b949350505050565b60006001600160a01b0382161580610ae657506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b801580611e1a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611de057600080fd5b505afa158015611df4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e189190613a8c565b155b611e855760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161085c565b6040516001600160a01b038316602482015260448101829052610bb390849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612746565b600c546001600160a01b0316630aea28c76101008701358661012089013586611f1460208c018c61339a565b611f2160208d018d61339a565b611f3160408e0160208f0161339a565b8d60a001358c8f60c001358c6040518c63ffffffff1660e01b8152600401611f639b9a99989796959493929190613aa5565b600060405180830381600087803b158015611f7d57600080fd5b505af1158015611f91573d6000803e3d6000fd5b505050505050505050565b6000611fa783611d58565b15611fbd57506001600160a01b03811631610ae6565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015611ffe57600080fd5b505afa158015612012573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120369190613a8c565b9392505050565b600061203661204f602085018561339a565b61205f604086016020870161339a565b843061206f6101a0890189613740565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061281b92505050565b60008080805b6120bd61012087018761393a565b905081101561213b5760006120d661012088018861393a565b838181106120e6576120e661380f565b9050602002013511156121295761210161012087018761393a565b828181106121115761211161380f565b90506020020135836121239190613983565b92508091505b806121338161383b565b9150506120af565b506000821161218c5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420646973747269627574696f6e20706172616d000000000000604482015260640161085c565b6121e161219d61012087018761393a565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892508691508590506113b760208b018b61339a565b92506000831161222a5760405162461bcd60e51b81526020600482015260146024820152730a6eec2e040ccc2d2d8cac840cce4deda40c8caf60631b604482015260640161085c565b600c546001600160a01b031663391fdc24333061224a60208a018a61339a565b61225a60408b0160208c0161339a565b898960006040518863ffffffff1660e01b815260040161228097969594939291906139b2565b600060405180830381600087803b15801561229a57600080fd5b505af11580156122ae573d6000803e3d6000fd5b50505050509250929050565b6122c383611d58565b610bb357806122e157610bb36001600160a01b038416836000611d91565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b15801561232c57600080fd5b505afa158015612340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123649190613a8c565b90508015612381576123816001600160a01b038516846000611d91565b61190a6001600160a01b0385168484611d91565b600c546001600160a01b0316630aea28c761014087013586610160890135866123c160208c018c61339a565b6123d160408d0160208e0161339a565b6123e160608e0160408f0161339a565b8d60c001358c8f60e001358c6040518c63ffffffff1660e01b8152600401611f639b9a99989796959493929190613aa5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060045460035461247591906139f6565b875111156124f55760405162461bcd60e51b815260206004820152604160248201527f5377697463683a20446973747269627574696f6e2061727261792073686f756c60448201527f64206e6f742065786365656420666163746f726965732061727261792073697a6064820152606560f81b608482015260a40161085c565b856000805b8951811015612686578981815181106125155761251561380f565b60200260200101516000141561252a57612674565b6000888b838151811061253f5761253f61380f565b60200260200101518b61255291906139f6565b61255c9190613a2b565b9050878214156125695750825b612573818561399b565b9350600454826125839190613b2e565b6125ce576125c787878360086004548761259d9190613a2b565b815481106125ad576125ad61380f565b6000918252602090912001546001600160a01b031661291c565b9250612666565b6004546125db9083613b2e565b60011415612623576125c78787836008600454876125f99190613a2b565b815481106126095761260961380f565b6000918252602090912001546001600160a01b0316612933565b6126638787836008600454876126399190613a2b565b815481106126495761264961380f565b6000918252602090912001546001600160a01b0316612950565b92505b6126708386613983565b9450505b8061267e8161383b565b9150506124fa565b5050509695505050505050565b6000816126a257506001612036565b6126ab84611d58565b156126f0576040516001600160a01b0384169083156108fc029084906000818181858888f193505050501580156126e6573d6000803e3d6000fd5b5060019050612036565b6127046001600160a01b038516848461296d565b5060019392505050565b6040516001600160a01b038085166024830152831660448201526064810182905261190a9085906323b872dd60e01b90608401611eb1565b600061279b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661299d9092919063ffffffff16565b90508051600014806127bc5750808060200190518101906127bc9190613b42565b610bb35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161085c565b6000846001600160a01b0316866001600160a01b0316141561284f5760405162461bcd60e51b815260040161085c906138f2565b6000828060200190518101906128659190613b90565b90506128728786836129ac565b6128856001600160a01b03871630611f9c565b915081156128a3576128a16001600160a01b0387168584612693565b505b600c54604051630e47f70960e21b81526001600160a01b039091169063391fdc24906128e090339088908c908c908c908a906000906004016139b2565b600060405180830381600087803b1580156128fa57600080fd5b505af115801561290e573d6000803e3d6000fd5b505050505095945050505050565b600061292a85858585612b0e565b95945050505050565b60065460009061292a9086906001600160a01b0316868686612f7a565b60075460009061292a9086906001600160a01b0316868686612f7a565b6040516001600160a01b038316602482015260448101829052610bb390849063a9059cbb60e01b90606401611eb1565b6060611d508484600085612f9d565b80602001516129ba81613078565b81516129c581613078565b60006129d9866001600160a01b0316611d58565b15612a355784471015612a2e5760405162461bcd60e51b815260206004820152601b60248201527f4554482062616c616e636520697320696e73756666696369656e740000000000604482015260640161085c565b5083612a4f565b6020840151612a4f906001600160a01b03881690876122ba565b600084600001516001600160a01b0316828660400151604051612a729190613c76565b60006040518083038185875af1925050503d8060008114612aaf576040519150601f19603f3d011682016040523d82523d6000602084013e612ab4565b606091505b5050905080612b055760405162461bcd60e51b815260206004820152601f60248201527f4465782041676772656761746f7220657865637574696f6e206661696c656400604482015260640161085c565b50505050505050565b6000612b22856001600160a01b0316611d58565b15612b9157600660009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015612b7757600080fd5b505af1158015612b8b573d6000803e3d6000fd5b50505050505b6000612ba5866001600160a01b0316611d58565b612baf5785612bbc565b6006546001600160a01b03165b90506000612bd2866001600160a01b0316611d58565b612bdc5785612be9565b6006546001600160a01b03165b60405163e6a4390560e01b81526001600160a01b038481166004830152808316602483015291925060009186169063e6a439059060440160206040518083038186803b158015612c3857600080fd5b505afa158015612c4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c709190613c92565b9050600080612c8a6001600160a01b03841686868b6130e0565b919750925090508115612cef57826001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612cd257600080fd5b505af1158015612ce6573d6000803e3d6000fd5b50505050612d63565b8015612d635760405163bc25cf7760e01b81527346fd07da395799f113a7584563b8cb886f33c2bc60048201526001600160a01b0384169063bc25cf7790602401600060405180830381600087803b158015612d4a57600080fd5b505af1158015612d5e573d6000803e3d6000fd5b505050505b612d776001600160a01b038616848a612693565b50836001600160a01b0316856001600160a01b03161015612e0c5760405163022c0d9f60e01b8152600060048201819052602482018890523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015612def57600080fd5b505af1158015612e03573d6000803e3d6000fd5b50505050612e82565b60405163022c0d9f60e01b8152600481018790526000602482018190523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015612e6957600080fd5b505af1158015612e7d573d6000803e3d6000fd5b505050505b612e94896001600160a01b0316611d58565b15612f6d576006546040516370a0823160e01b81523060048201526001600160a01b0390911690632e1a7d4d9082906370a082319060240160206040518083038186803b158015612ee457600080fd5b505afa158015612ef8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f1c9190613a8c565b6040518263ffffffff1660e01b8152600401612f3a91815260200190565b600060405180830381600087803b158015612f5457600080fd5b505af1158015612f68573d6000803e3d6000fd5b505050505b5050505050949350505050565b6000612f938585612f8d89898888612b0e565b85612b0e565b9695505050505050565b606082471015612ffe5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161085c565b600080866001600160a01b0316858760405161301a9190613c76565b60006040518083038185875af1925050503d8060008114613057576040519150601f19603f3d011682016040523d82523d6000602084013e61305c565b606091505b509150915061306d8783838761327b565b979650505050505050565b6001600160a01b0381166000908152600a602052604090205460ff16610ace5760405162461bcd60e51b815260206004820152601b60248201527f41646472657373206973206e6f7420696e20616c6c6f776c6973740000000000604482015260640161085c565b60008080806130f86001600160a01b03881689611f9c565b9050600061310f6001600160a01b0388168a611f9c565b90506000808a6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561314d57600080fd5b505afa158015613161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131859190613cc6565b5091509150886001600160a01b03168a6001600160a01b031611156131a657905b816001600160701b03168410806131c55750806001600160701b031683105b9550851580156131ef5750816001600160701b03168411806131ef5750806001600160701b031683115b945060006131ff896103e56139f6565b9050600061321685846001600160701b03166132f1565b61322090836139f6565b905060008261323888876001600160701b03166132f1565b613244906103e86139f6565b61324e9190613983565b90508015613265576132608183613a2b565b613268565b60005b9950505050505050509450945094915050565b606083156132e75782516132e0576001600160a01b0385163b6132e05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161085c565b5081611d50565b611d508383613307565b60008183106133005781612036565b5090919050565b8151156133175781518083602001fd5b8060405162461bcd60e51b815260040161085c9190613d0b565b60006020828403121561334357600080fd5b5035919050565b60006020828403121561335c57600080fd5b81356001600160401b0381111561337257600080fd5b8201610160818503121561203657600080fd5b6001600160a01b0381168114610ace57600080fd5b6000602082840312156133ac57600080fd5b813561203681613385565b600080602083850312156133ca57600080fd5b82356001600160401b03808211156133e157600080fd5b818501915085601f8301126133f557600080fd5b81358181111561340457600080fd5b8660208260051b850101111561341957600080fd5b60209290920196919550909350505050565b6000806000806080858703121561344157600080fd5b843561344c81613385565b9350602085013561345c81613385565b93969395505050506040820135916060013590565b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156134b257845183529383019391830191600101613496565b5090979650505050505050565b6000602082840312156134d157600080fd5b81356001600160401b038111156134e757600080fd5b82016101c0818503121561203657600080fd5b60006020828403121561350c57600080fd5b81356001600160401b0381111561352257600080fd5b8201610120818503121561203657600080fd5b60008060006060848603121561354a57600080fd5b83359250602084013561355c81613385565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156135a5576135a561356d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156135d3576135d361356d565b604052919050565b60006001600160401b038211156135f4576135f461356d565b5060051b60200190565b6000602080838503121561361157600080fd5b82356001600160401b0381111561362757600080fd5b8301601f8101851361363857600080fd5b803561364b613646826135db565b6135ab565b81815260059190911b8201830190838101908783111561366a57600080fd5b928401925b8284101561306d57833561368281613385565b8252928401929084019061366f565b6000806000606084860312156136a657600080fd5b83356136b181613385565b92506020840135915060408401356136c881613385565b809150509250925092565b60208082526024908201527f54686520616d6f756e74206d7573742062652067726561746572207468616e206040820152637a65726f60e01b606082015260800190565b60006020828403121561372957600080fd5b81356001600160401b038116811461203657600080fd5b6000808335601e1984360301811261375757600080fd5b8301803591506001600160401b0382111561377157600080fd5b60200191503681900382131561378657600080fd5b9250929050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820181905260009061292a908301848661378d565b6001600160a01b038681168252851660208201526040810184905260806060820181905260009061306d908301848661378d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561384f5761384f613825565b5060010190565b6000806040838503121561386957600080fd5b825191506020808401516001600160401b0381111561388757600080fd5b8401601f8101861361389857600080fd5b80516138a6613646826135db565b81815260059190911b820183019083810190888311156138c557600080fd5b928401925b828410156138e3578351825292840192908401906138ca565b80955050505050509250929050565b60208082526028908201527f69742773206e6f7420616c6c6f77656420746f2073776170207769746820736160408201526736b2903a37b5b2b760c11b606082015260800190565b6000808335601e1984360301811261395157600080fd5b8301803591506001600160401b0382111561396b57600080fd5b6020019150600581901b360382131561378657600080fd5b6000821982111561399657613996613825565b500190565b6000828210156139ad576139ad613825565b500390565b6001600160a01b03978816815295871660208701529386166040860152919094166060840152608083019390935260a082019290925260c081019190915260e00190565b6000816000190483118215151615613a1057613a10613825565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613a3a57613a3a613a15565b500490565b6020808252825182820181905260009190848201906040850190845b81811015613a805783516001600160a01b031683529284019291840191600101613a5b565b50909695505050505050565b600060208284031215613a9e57600080fd5b5051919050565b8b8152602081018b9052604081018a90526001600160a01b038981166060830152888116608083015287811660a0830152861660c082015260e0810185905261010081018490526101208101839052610160810160048310613b1757634e487b7160e01b600052602160045260246000fd5b826101408301529c9b505050505050505050505050565b600082613b3d57613b3d613a15565b500690565b600060208284031215613b5457600080fd5b8151801515811461203657600080fd5b60005b83811015613b7f578181015183820152602001613b67565b8381111561190a5750506000910152565b60006020808385031215613ba357600080fd5b82516001600160401b0380821115613bba57600080fd5b9084019060608287031215613bce57600080fd5b613bd6613583565b8251613be181613385565b815282840151613bf081613385565b81850152604083015182811115613c0657600080fd5b80840193505086601f840112613c1b57600080fd5b825182811115613c2d57613c2d61356d565b613c3f601f8201601f191686016135ab565b92508083528785828601011115613c5557600080fd5b613c6481868501878701613b64565b50604081019190915295945050505050565b60008251613c88818460208701613b64565b9190910192915050565b600060208284031215613ca457600080fd5b815161203681613385565b80516001600160701b038116811461165f57600080fd5b600080600060608486031215613cdb57600080fd5b613ce484613caf565b9250613cf260208501613caf565b9150604084015163ffffffff811681146136c857600080fd5b6020815260008251806020840152613d2a816040850160208701613b64565b601f01601f1916919091016040019291505056fea2646970667358221220f4baf152af8d10a145ffb4913f3a0ec94d226100a0a50fc8062d7ef98a247c9464736f6c63430008090033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.