false
false

Contract Address Details

0xD09C7954711CD8597c6462dC3817Fe4b22F8b5eA

Contract Name
XYDexAggregatorAdaptor
Creator
0x013261–3cce0b at 0xe32388–91e8ac
Balance
0 KCS
Tokens
Fetching tokens...
Transactions
3 Transactions
Transfers
7,370 Transfers
Gas Used
117,758
Last Balance Update
43175673
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
XYDexAggregatorAdaptor




Optimization enabled
true
Compiler version
v0.8.2+commit.661d1103




Optimization runs
200
Verified at
2022-09-02T04:14:06.233851Z

Constructor Arguments

0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b0000000000000000000000009c6179a266e137e1d8ea51efe1aa6cea79f32c7d

Arg [0] (address) : 0x0132613b3a1061816f4661ad301612910e3cce0b
Arg [1] (address) : 0x0132613b3a1061816f4661ad301612910e3cce0b
Arg [2] (address) : 0x9c6179a266e137e1d8ea51efe1aa6cea79f32c7d

              

XYDexAggregatorAdaptor.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.2;
import { Address } from "Address.sol";
import "SafeERC20.sol";
import "ERC20.sol";
import "SafeMath.sol";
import "AccessControl.sol";
import "ReentrancyGuard.sol";
import "IDexAggregatorAdaptor.sol";
import "UniERC20.sol";
/// @title XYDexAggregatorAdaptor is to help exchange assets based on swap description struct
/// @notice Users can call `swap` method to swap assets
/// XYDexAggregatorAdaptor will forward the swap description to `caller` contract to perform multi-swap of assets
contract XYDexAggregatorAdaptor is IDexAggregatorAdaptor, AccessControl, ReentrancyGuard {
using SafeERC20 for IERC20;
using UniERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
// ROLE_OWNER is superior to ROLE_STAFF
bytes32 public constant ROLE_OWNER = keccak256("ROLE_OWNER");
bytes32 public constant ROLE_STAFF = keccak256("ROLE_STAFF");
bytes32 public constant ROLE_SWAPPER = keccak256("ROLE_SWAPPER");
/// A contract that performs multi-swap according to given input data
/// See Multicaller.sol for more info
address payable public aggregator;
/* ========== CONSTRUCTOR ========== */
/// @dev Constuctor with owner / staff / caller
/// @param owner The owner address
/// @param staff The staff address
/// @param _aggregator The caller contract address (MUST be a contract)
constructor(address owner, address staff, address payable _aggregator) {
_setRoleAdmin(ROLE_OWNER, ROLE_OWNER);
_setRoleAdmin(ROLE_STAFF, ROLE_OWNER);
_setRoleAdmin(ROLE_SWAPPER, ROLE_OWNER);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IDexAggregatorAdaptor.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.2;
pragma experimental ABIEncoderV2;
import { IERC20 } from "ERC20.sol";
interface IDexAggregatorAdaptor {
struct SwapDescription {
IERC20 fromToken;
IERC20 toToken;
address receiver;
uint256 amount;
uint256 minReturnAmount;
}
// spec:
// (revert if any of the following steps fails)
// 1. IDexAggregatorAdaptor receives `amountIn` `fromToken` where `amountIn >= amount`.
// 2. IDexAggregatorAdaptor receives `amountOut` `toToken` where `amountOut >= minReturnAmount`.
// 3. `receiver` receives `amountOut` `toToken`.
function swap(SwapDescription calldata desc, bytes calldata data) external payable returns (uint256 returnAmount);
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IERC165.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

AccessControl.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IAccessControl.sol";
import "Context.sol";
import "Strings.sol";
import "ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Address.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Context.sol

// SPDX-License-Identifier: MIT
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;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ERC165.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC20.sol";
import "IERC20Metadata.sol";
import "Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IAccessControl.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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.
*
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IERC20Metadata.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
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;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

SafeERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC20.sol";
import "Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

SafeMath.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Strings.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

UniERC20.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.2;
import "ERC20.sol";
/// @title Library for unifying getting balance in one interface
/// @notice Use `uniBalanceOf` to get amount of the desired token or native token balance
library UniERC20 {
// native token addresses
address private constant _ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address private constant _ZERO_ADDRESS = address(0);
/// @notice Check if the given token address is native token
/// @param token The token address to be checked
/// @return `true` if native token, otherwise `false`
function isETH(IERC20 token) internal pure returns (bool) {
return (address(token) == _ZERO_ADDRESS || address(token) == _ETH_ADDRESS);
}
/// @notice Get balance of the desired account address of the given token
/// @param token The token address to be checked
/// @param account The address to be checked
/// @return The token balance of the desired account address
function uniBalanceOf(IERC20 token, address account) internal view returns (uint256) {
if (isETH(token)) {
return account.balance;
} else {
return token.balanceOf(account);
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"staff","internalType":"address"},{"type":"address","name":"_aggregator","internalType":"address payable"}]},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Swapped","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":false},{"type":"address","name":"fromToken","internalType":"contract IERC20","indexed":false},{"type":"address","name":"toToken","internalType":"contract IERC20","indexed":false},{"type":"address","name":"receiver","internalType":"address","indexed":false},{"type":"uint256","name":"spentAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"returnAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"ROLE_OWNER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"ROLE_STAFF","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"ROLE_SWAPPER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"aggregator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapper","inputs":[{"type":"address","name":"swapper","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"swap","inputs":[{"type":"tuple","name":"desc","internalType":"struct IDexAggregatorAdaptor.SwapDescription","components":[{"type":"address","name":"fromToken","internalType":"contract IERC20"},{"type":"address","name":"toToken","internalType":"contract IERC20"},{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"minReturnAmount","internalType":"uint256"}]},{"type":"bytes","name":"data","internalType":"bytes"}]}]
              

Contract Creation Code

0x60806040523480156200001157600080fd5b50604051620017de380380620017de83398101604081905262000034916200027f565b6001805562000053600080516020620017be833981519152806200017e565b6200007d6000805160206200179e833981519152600080516020620017be8339815191526200017e565b620000b87fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab00600080516020620017be8339815191526200017e565b620000d3600080516020620017be83398151915284620001c9565b620000ee6000805160206200179e83398151915283620001c9565b6200010481620001d960201b620009a61760201c565b620001555760405162461bcd60e51b815260206004820152601f60248201527f41676772656761746f722073686f756c64206265206120636f6e747261637400604482015260640160405180910390fd5b600280546001600160a01b0319166001600160a01b039290921691909117905550620002eb9050565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b620001d58282620001df565b5050565b3b151590565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001d5576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200023b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008060006060848603121562000294578283fd5b8351620002a181620002d2565b6020850151909350620002b481620002d2565b6040850151909250620002c781620002d2565b809150509250925092565b6001600160a01b0381168114620002e857600080fd5b50565b6114a380620002fb6000396000f3fe6080604052600436106100c25760003560e01c80638218b58f1161007f5780639c82f2a4116100595780639c82f2a41461024f578063a217fddf1461026f578063d547741f14610284578063f5c957a5146102a4576100c2565b80638218b58f146101e85780638ad682af146101fb57806391d148541461022f576100c2565b806301ffc9a7146100c757806322bf2e24146100fc578063245a7bfc1461013e578063248a9ca3146101765780632f2ff15d146101a657806336568abe146101c8575b600080fd5b3480156100d357600080fd5b506100e76100e2366004611225565b6102d8565b60405190151581526020015b60405180910390f35b34801561010857600080fd5b506101307f358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd81565b6040519081526020016100f3565b34801561014a57600080fd5b5060025461015e906001600160a01b031681565b6040516001600160a01b0390911681526020016100f3565b34801561018257600080fd5b506101306101913660046111de565b60009081526020819052604090206001015490565b3480156101b257600080fd5b506101c66101c13660046111f6565b61030f565b005b3480156101d457600080fd5b506101c66101e33660046111f6565b61033b565b6101306101f636600461124d565b6103be565b34801561020757600080fd5b506101307f9f4e1c871d5fdd0aee1cd182666698a4492b24c6832aac230d07b11046af5a8981565b34801561023b57600080fd5b506100e761024a3660046111f6565b6108b4565b34801561025b57600080fd5b506101c661026a3660046111a2565b6108dd565b34801561027b57600080fd5b50610130600081565b34801561029057600080fd5b506101c661029f3660046111f6565b610980565b3480156102b057600080fd5b506101307fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab0081565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008281526020819052604090206001015461032c81335b6109ac565b6103368383610a10565b505050565b6001600160a01b03811633146103b05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103ba8282610a94565b5050565b60007fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab006103eb8133610327565b6002600154141561043e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103a7565b600260015560808501356104945760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016103a7565b60006104a660608701604088016111a2565b6001600160a01b031614156104f05760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103932b1b2b4bb32b960811b60448201526064016103a7565b8261053d5760405162461bcd60e51b815260206004820152601760248201527f646174612073686f756c64206265206e6f74207a65726f00000000000000000060448201526064016103a7565b600061054c60208701876111a2565b9050600061056060408801602089016111a2565b9050610574826001600160a01b0316610af9565b61057f576000610585565b86606001355b34146105c75760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206d73672e76616c756560781b60448201526064016103a7565b60006105db836001600160a01b0316610af9565b610716576040516370a0823160e01b81523060048201526001600160a01b038416906370a082319060240160206040518083038186803b15801561061e57600080fd5b505afa158015610632573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065691906112d2565b90506106716001600160a01b038416333060608c0135610b2f565b6040516370a0823160e01b815230600482015281906001600160a01b038516906370a082319060240160206040518083038186803b1580156106b257600080fd5b505afa1580156106c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ea91906112d2565b6106f491906113e5565b600254909150610711906001600160a01b03858116911683610ba0565b61071d565b5060608701355b600061072f60608a0160408b016111a2565b905060006107466001600160a01b03851683610cc4565b600254604080516020601f8d018190048102820181019092528b81529293506107cc926001600160a01b0390921691908c908c90819084018382808284376000920191909152505060408051808201909152601e81527f63616c6c20746f20585944657841676772656761746f72206661696c6564000060208201523492509050610d65565b506000816107e36001600160a01b03871685610cc4565b6107ed91906113e5565b90508a608001358110156108435760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016103a7565b604080513381526001600160a01b03888116602083015287811682840152851660608201526080810186905260a0810183905290517fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f89181900360c00190a1600180559a9950505050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7f358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd6109088133610327565b813b6109565760405162461bcd60e51b815260206004820152601c60248201527f537761707065722073686f756c64206265206120636f6e74726163740000000060448201526064016103a7565b6103ba7fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab0083610e8d565b60008281526020819052604090206001015461099c8133610327565b6103368383610a94565b3b151590565b6109b682826108b4565b6103ba576109ce816001600160a01b03166014610e97565b6109d9836020610e97565b6040516020016109ea929190611306565b60408051601f198184030181529082905262461bcd60e51b82526103a79160040161137b565b610a1a82826108b4565b6103ba576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a503390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610a9e82826108b4565b156103ba576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006001600160a01b03821615806103095750506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b6040516001600160a01b0380851660248301528316604482015260648101829052610b9a9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611080565b50505050565b801580610c295750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015610bef57600080fd5b505afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2791906112d2565b155b610c945760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016103a7565b6040516001600160a01b03831660248201526044810182905261033690849063095ea7b360e01b90606401610b63565b6000610ccf83610af9565b15610ce557506001600160a01b03811631610309565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015610d2657600080fd5b505afa158015610d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5e91906112d2565b9050610309565b606082471015610dc65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103a7565b843b610e145760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103a7565b600080866001600160a01b03168587604051610e3091906112ea565b60006040518083038185875af1925050503d8060008114610e6d576040519150601f19603f3d011682016040523d82523d6000602084013e610e72565b606091505b5091509150610e82828286611152565b979650505050505050565b6103ba8282610a10565b60606000610ea68360026113c6565b610eb19060026113ae565b67ffffffffffffffff811115610ed757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610f01576020820181803683370190505b509050600360fc1b81600081518110610f2a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f6757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000610f8b8460026113c6565b610f969060016113ae565b90505b600181111561102a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610fd857634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110610ffc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361102381611428565b9050610f99565b5083156110795760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103a7565b9392505050565b60006110d5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661118b9092919063ffffffff16565b80519091501561033657808060200190518101906110f391906111be565b6103365760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103a7565b60608315611161575081611079565b8251156111715782518084602001fd5b8160405162461bcd60e51b81526004016103a7919061137b565b606061119a8484600085610d65565b949350505050565b6000602082840312156111b3578081fd5b813561107981611455565b6000602082840312156111cf578081fd5b81518015158114611079578182fd5b6000602082840312156111ef578081fd5b5035919050565b60008060408385031215611208578081fd5b82359150602083013561121a81611455565b809150509250929050565b600060208284031215611236578081fd5b81356001600160e01b031981168114611079578182fd5b600080600083850360c0811215611262578182fd5b60a081121561126f578182fd5b5083925060a084013567ffffffffffffffff8082111561128d578283fd5b818601915086601f8301126112a0578283fd5b8135818111156112ae578384fd5b8760208285010111156112bf578384fd5b6020830194508093505050509250925092565b6000602082840312156112e3578081fd5b5051919050565b600082516112fc8184602087016113fc565b9190910192915050565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161133e8160178501602088016113fc565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161136f8160288401602088016113fc565b01602801949350505050565b600060208252825180602084015261139a8160408501602087016113fc565b601f01601f19169190910160400192915050565b600082198211156113c1576113c161143f565b500190565b60008160001904831182151516156113e0576113e061143f565b500290565b6000828210156113f7576113f761143f565b500390565b60005b838110156114175781810151838201526020016113ff565b83811115610b9a5750506000910152565b6000816114375761143761143f565b506000190190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461146a57600080fd5b5056fea2646970667358221220cfa9aca6f4b9440a9f6377744b887591da02c63705a86f10ce98bda94bac4d9464736f6c63430008020033358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd9f4e1c871d5fdd0aee1cd182666698a4492b24c6832aac230d07b11046af5a890000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b0000000000000000000000000132613b3a1061816f4661ad301612910e3cce0b0000000000000000000000009c6179a266e137e1d8ea51efe1aa6cea79f32c7d

Deployed ByteCode

0x6080604052600436106100c25760003560e01c80638218b58f1161007f5780639c82f2a4116100595780639c82f2a41461024f578063a217fddf1461026f578063d547741f14610284578063f5c957a5146102a4576100c2565b80638218b58f146101e85780638ad682af146101fb57806391d148541461022f576100c2565b806301ffc9a7146100c757806322bf2e24146100fc578063245a7bfc1461013e578063248a9ca3146101765780632f2ff15d146101a657806336568abe146101c8575b600080fd5b3480156100d357600080fd5b506100e76100e2366004611225565b6102d8565b60405190151581526020015b60405180910390f35b34801561010857600080fd5b506101307f358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd81565b6040519081526020016100f3565b34801561014a57600080fd5b5060025461015e906001600160a01b031681565b6040516001600160a01b0390911681526020016100f3565b34801561018257600080fd5b506101306101913660046111de565b60009081526020819052604090206001015490565b3480156101b257600080fd5b506101c66101c13660046111f6565b61030f565b005b3480156101d457600080fd5b506101c66101e33660046111f6565b61033b565b6101306101f636600461124d565b6103be565b34801561020757600080fd5b506101307f9f4e1c871d5fdd0aee1cd182666698a4492b24c6832aac230d07b11046af5a8981565b34801561023b57600080fd5b506100e761024a3660046111f6565b6108b4565b34801561025b57600080fd5b506101c661026a3660046111a2565b6108dd565b34801561027b57600080fd5b50610130600081565b34801561029057600080fd5b506101c661029f3660046111f6565b610980565b3480156102b057600080fd5b506101307fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab0081565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008281526020819052604090206001015461032c81335b6109ac565b6103368383610a10565b505050565b6001600160a01b03811633146103b05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103ba8282610a94565b5050565b60007fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab006103eb8133610327565b6002600154141561043e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103a7565b600260015560808501356104945760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016103a7565b60006104a660608701604088016111a2565b6001600160a01b031614156104f05760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103932b1b2b4bb32b960811b60448201526064016103a7565b8261053d5760405162461bcd60e51b815260206004820152601760248201527f646174612073686f756c64206265206e6f74207a65726f00000000000000000060448201526064016103a7565b600061054c60208701876111a2565b9050600061056060408801602089016111a2565b9050610574826001600160a01b0316610af9565b61057f576000610585565b86606001355b34146105c75760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206d73672e76616c756560781b60448201526064016103a7565b60006105db836001600160a01b0316610af9565b610716576040516370a0823160e01b81523060048201526001600160a01b038416906370a082319060240160206040518083038186803b15801561061e57600080fd5b505afa158015610632573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065691906112d2565b90506106716001600160a01b038416333060608c0135610b2f565b6040516370a0823160e01b815230600482015281906001600160a01b038516906370a082319060240160206040518083038186803b1580156106b257600080fd5b505afa1580156106c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ea91906112d2565b6106f491906113e5565b600254909150610711906001600160a01b03858116911683610ba0565b61071d565b5060608701355b600061072f60608a0160408b016111a2565b905060006107466001600160a01b03851683610cc4565b600254604080516020601f8d018190048102820181019092528b81529293506107cc926001600160a01b0390921691908c908c90819084018382808284376000920191909152505060408051808201909152601e81527f63616c6c20746f20585944657841676772656761746f72206661696c6564000060208201523492509050610d65565b506000816107e36001600160a01b03871685610cc4565b6107ed91906113e5565b90508a608001358110156108435760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016103a7565b604080513381526001600160a01b03888116602083015287811682840152851660608201526080810186905260a0810183905290517fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f89181900360c00190a1600180559a9950505050505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7f358933fb1b4f9e62c7cd3651025ad8825acb20ebbb23b09160e3867d71501ddd6109088133610327565b813b6109565760405162461bcd60e51b815260206004820152601c60248201527f537761707065722073686f756c64206265206120636f6e74726163740000000060448201526064016103a7565b6103ba7fc13d37bfcf41098972f2d4627d2af2a53325662ae966c26de9b2a1fd5315ab0083610e8d565b60008281526020819052604090206001015461099c8133610327565b6103368383610a94565b3b151590565b6109b682826108b4565b6103ba576109ce816001600160a01b03166014610e97565b6109d9836020610e97565b6040516020016109ea929190611306565b60408051601f198184030181529082905262461bcd60e51b82526103a79160040161137b565b610a1a82826108b4565b6103ba576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a503390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610a9e82826108b4565b156103ba576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006001600160a01b03821615806103095750506001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b6040516001600160a01b0380851660248301528316604482015260648101829052610b9a9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611080565b50505050565b801580610c295750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015610bef57600080fd5b505afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2791906112d2565b155b610c945760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016103a7565b6040516001600160a01b03831660248201526044810182905261033690849063095ea7b360e01b90606401610b63565b6000610ccf83610af9565b15610ce557506001600160a01b03811631610309565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015610d2657600080fd5b505afa158015610d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5e91906112d2565b9050610309565b606082471015610dc65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103a7565b843b610e145760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103a7565b600080866001600160a01b03168587604051610e3091906112ea565b60006040518083038185875af1925050503d8060008114610e6d576040519150601f19603f3d011682016040523d82523d6000602084013e610e72565b606091505b5091509150610e82828286611152565b979650505050505050565b6103ba8282610a10565b60606000610ea68360026113c6565b610eb19060026113ae565b67ffffffffffffffff811115610ed757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610f01576020820181803683370190505b509050600360fc1b81600081518110610f2a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f6757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000610f8b8460026113c6565b610f969060016113ae565b90505b600181111561102a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610fd857634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110610ffc57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361102381611428565b9050610f99565b5083156110795760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103a7565b9392505050565b60006110d5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661118b9092919063ffffffff16565b80519091501561033657808060200190518101906110f391906111be565b6103365760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103a7565b60608315611161575081611079565b8251156111715782518084602001fd5b8160405162461bcd60e51b81526004016103a7919061137b565b606061119a8484600085610d65565b949350505050565b6000602082840312156111b3578081fd5b813561107981611455565b6000602082840312156111cf578081fd5b81518015158114611079578182fd5b6000602082840312156111ef578081fd5b5035919050565b60008060408385031215611208578081fd5b82359150602083013561121a81611455565b809150509250929050565b600060208284031215611236578081fd5b81356001600160e01b031981168114611079578182fd5b600080600083850360c0811215611262578182fd5b60a081121561126f578182fd5b5083925060a084013567ffffffffffffffff8082111561128d578283fd5b818601915086601f8301126112a0578283fd5b8135818111156112ae578384fd5b8760208285010111156112bf578384fd5b6020830194508093505050509250925092565b6000602082840312156112e3578081fd5b5051919050565b600082516112fc8184602087016113fc565b9190910192915050565b60007f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008252835161133e8160178501602088016113fc565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161136f8160288401602088016113fc565b01602801949350505050565b600060208252825180602084015261139a8160408501602087016113fc565b601f01601f19169190910160400192915050565b600082198211156113c1576113c161143f565b500190565b60008160001904831182151516156113e0576113e061143f565b500290565b6000828210156113f7576113f761143f565b500390565b60005b838110156114175781810151838201526020016113ff565b83811115610b9a5750506000910152565b6000816114375761143761143f565b506000190190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461146a57600080fd5b5056fea2646970667358221220cfa9aca6f4b9440a9f6377744b887591da02c63705a86f10ce98bda94bac4d9464736f6c63430008020033