Overview
ETH Balance
ETH Value
$3.40 (@ $2,865.30/ETH)Latest 25 from a total of 859 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Swap No Split | 1277085 | 671 days ago | IN | 0 ETH | 0.00005714 | ||||
| Swap No Split | 1276921 | 671 days ago | IN | 0 ETH | 0.00005643 | ||||
| Swap No Split Fr... | 1271442 | 671 days ago | IN | 0.005 ETH | 0.00007397 | ||||
| Swap No Split Fr... | 1268863 | 671 days ago | IN | 0.33630591 ETH | 0.00005932 | ||||
| Swap No Split To... | 1263135 | 672 days ago | IN | 0 ETH | 0.00004748 | ||||
| Swap No Split Fr... | 1262872 | 672 days ago | IN | 0.0235959 ETH | 0.00005009 | ||||
| Swap No Split To... | 1260334 | 672 days ago | IN | 0 ETH | 0.0000504 | ||||
| Swap No Split To... | 1260003 | 672 days ago | IN | 0 ETH | 0.00005099 | ||||
| Swap No Split Fr... | 1257259 | 672 days ago | IN | 0.1565 ETH | 0.0000576 | ||||
| Swap No Split To... | 1253951 | 672 days ago | IN | 0 ETH | 0.00007245 | ||||
| Swap No Split Fr... | 1252925 | 672 days ago | IN | 0.15 ETH | 0.00006655 | ||||
| Swap No Split To... | 1250136 | 672 days ago | IN | 0 ETH | 0.00004841 | ||||
| Swap No Split To... | 1250127 | 672 days ago | IN | 0 ETH | 0.0000526 | ||||
| Swap No Split To... | 1250120 | 672 days ago | IN | 0 ETH | 0.00005569 | ||||
| Swap No Split Fr... | 1247977 | 672 days ago | IN | 0.019 ETH | 0.00007982 | ||||
| Swap No Split Fr... | 1246294 | 672 days ago | IN | 0.72047769 ETH | 0.0000731 | ||||
| Swap No Split To... | 1246141 | 672 days ago | IN | 0 ETH | 0.00005699 | ||||
| Swap No Split To... | 1245236 | 672 days ago | IN | 0 ETH | 0.00008106 | ||||
| Swap No Split To... | 1244510 | 672 days ago | IN | 0 ETH | 0.00005083 | ||||
| Swap No Split To... | 1242062 | 672 days ago | IN | 0 ETH | 0.00005973 | ||||
| Swap No Split Fr... | 1242040 | 672 days ago | IN | 0.033 ETH | 0.00006093 | ||||
| Swap No Split Fr... | 1242007 | 672 days ago | IN | 0.033 ETH | 0.00006327 | ||||
| Swap No Split To... | 1241148 | 672 days ago | IN | 0 ETH | 0.000063 | ||||
| Swap No Split Fr... | 1239411 | 672 days ago | IN | 0.25 ETH | 0.00006243 | ||||
| Swap No Split To... | 1238426 | 672 days ago | IN | 0 ETH | 0.00005966 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 1274240 | 671 days ago | 0.0000005 ETH | ||||
| 1274240 | 671 days ago | 0.0000995 ETH | ||||
| 1271442 | 671 days ago | 0.005 ETH | ||||
| 1268863 | 671 days ago | 0.33630591 ETH | ||||
| 1263135 | 672 days ago | 0.58207234 ETH | ||||
| 1263135 | 672 days ago | 0.58207234 ETH | ||||
| 1262872 | 672 days ago | 0.0235959 ETH | ||||
| 1260334 | 672 days ago | 0.09063113 ETH | ||||
| 1260334 | 672 days ago | 0.09063113 ETH | ||||
| 1260003 | 672 days ago | 0.01889603 ETH | ||||
| 1260003 | 672 days ago | 0.01889603 ETH | ||||
| 1257259 | 672 days ago | 0.1565 ETH | ||||
| 1253951 | 672 days ago | 0.15265515 ETH | ||||
| 1253951 | 672 days ago | 0.15265515 ETH | ||||
| 1252925 | 672 days ago | 0.15 ETH | ||||
| 1250136 | 672 days ago | 1.61428637 ETH | ||||
| 1250136 | 672 days ago | 1.61428637 ETH | ||||
| 1250127 | 672 days ago | 0.01489718 ETH | ||||
| 1250127 | 672 days ago | 0.01489718 ETH | ||||
| 1250120 | 672 days ago | 0.79989183 ETH | ||||
| 1250120 | 672 days ago | 0.79989183 ETH | ||||
| 1247977 | 672 days ago | 0.019 ETH | ||||
| 1246294 | 672 days ago | 0.72047769 ETH | ||||
| 1246141 | 672 days ago | 2.47426192 ETH | ||||
| 1246141 | 672 days ago | 2.47426192 ETH |
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
//
// __ ___ ___ __ _
// (_ | | |\/| |\/| | | (_ \ / /\ |_)
// __) |_| | | | | _|_ | __) \/\/ /--\ |
//
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import { Query, Offer, FormattedOffer, Trade, ISummitRouter } from "./interface/ISummitRouter.sol";
import { IAdapterV2 } from "./interface/IAdapterV2.sol";
import { IBlast } from "./interface/IBlast.sol";
import { IERC20, IERC20Permit, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IWETHV2 } from "./interface/IWETHV2.sol";
import { Maintainable } from "./lib/Maintainable.sol";
import { OfferUtils, FormattedOfferUtils } from "./lib/SummitViewUtils.sol";
import { Recoverable } from "./lib/Recoverable.sol";
import { ISummitVolumeAdapter } from "./interface/ISummitVolumeAdapter.sol";
contract SummitRouterV2 is Maintainable, Recoverable, ISummitRouter {
using SafeERC20 for IERC20;
using SafeERC20 for IERC20Permit;
using OfferUtils for Offer;
address public immutable WNATIVE;
address public constant NATIVE = address(0);
string public constant NAME = "SummitRouterV2";
uint256 public constant FEE_DENOMINATOR = 1e4;
uint256 public MIN_FEE = 0;
address public FEE_CLAIMER;
address[] public TRUSTED_TOKENS;
mapping(address => uint256) public TOKEN_VOLUME_MULTIPLIERS; // (token amount * tokenVolumeMultiplier[token]) / 1e12
mapping(address => uint256) public TOKEN_VOLUME_BONUS;
address[] public ADAPTERS;
address public VOLUME_ADAPTER;
error AlreadyInitialized();
error InvalidTradePath();
constructor(
address[] memory _adapters,
address[] memory _trustedTokens,
address _feeClaimer,
address _wrapped_native
) {
setAllowanceForWrapping(_wrapped_native);
setTrustedTokens(_trustedTokens);
setFeeClaimer(_feeClaimer);
setAdapters(_adapters);
WNATIVE = _wrapped_native;
}
bool public initialized = false;
address public governor;
function initialize(address _governor) public onlyMaintainer {
if (initialized) revert AlreadyInitialized();
initialized = true;
IBlast blast = IBlast(0x4300000000000000000000000000000000000002);
blast.configureClaimableGas();
blast.configureGovernor(_governor);
governor = _governor;
}
// -- SETTERS --
function setAllowanceForWrapping(address _wnative) public onlyMaintainer {
IERC20(_wnative).safeApprove(_wnative, type(uint256).max);
}
function setTrustedTokens(address[] memory _trustedTokens) public override onlyMaintainer {
emit UpdatedTrustedTokens(_trustedTokens);
TRUSTED_TOKENS = _trustedTokens;
}
function setTokenVolumeMultipliers(
address[] memory _tokens,
uint256[] memory _volumeMultipliers
) public onlyMaintainer {
require(_tokens.length == _volumeMultipliers.length, "SummitRouter: Array length mismatch");
emit UpdatedTokenVolumeMultipliers(_tokens, _volumeMultipliers);
for (uint256 i = 0; i < _tokens.length; i++) {
TOKEN_VOLUME_MULTIPLIERS[_tokens[i]] = _volumeMultipliers[i];
}
}
function setTokenBonusMultipliers(address[] memory _tokens, uint256[] memory _multipliers) public onlyMaintainer {
require(_tokens.length == _multipliers.length, "SummitRouter: Array length mismatch");
emit UpdatedTokenBonusMultipliers(_tokens, _multipliers);
for (uint256 i = 0; i < _tokens.length; i++) {
TOKEN_VOLUME_BONUS[_tokens[i]] = _multipliers[i];
}
}
function setAdapters(address[] memory _adapters) public override onlyMaintainer {
emit UpdatedAdapters(_adapters);
ADAPTERS = _adapters;
}
function setVolumeAdapter(address _volumeAdapter) public override onlyMaintainer {
emit UpdatedVolumeAdapter(_volumeAdapter);
VOLUME_ADAPTER = _volumeAdapter;
}
function setMinFee(uint256 _fee) external override onlyMaintainer {
emit UpdatedMinFee(MIN_FEE, _fee);
MIN_FEE = _fee;
}
function setFeeClaimer(address _claimer) public override onlyMaintainer {
emit UpdatedFeeClaimer(FEE_CLAIMER, _claimer);
FEE_CLAIMER = _claimer;
}
// -- GENERAL --
function trustedTokensCount() external view override returns (uint256) {
return TRUSTED_TOKENS.length;
}
function adaptersCount() external view override returns (uint256) {
return ADAPTERS.length;
}
// Fallback
receive() external payable {}
// -- HELPERS --
function _applyFee(uint256 _amountIn, uint256 _fee) internal view returns (uint256) {
require(_fee >= MIN_FEE, "SummitRouter: Insufficient fee");
return (_amountIn * (FEE_DENOMINATOR - _fee)) / FEE_DENOMINATOR;
}
function _wrap(uint256 _amount) internal {
IWETHV2(WNATIVE).deposit{ value: _amount }();
}
function _unwrap(uint256 _amount) internal {
IWETHV2(WNATIVE).withdraw(_amount);
}
/**
* @notice Return tokens to user
* @dev Pass address(0) for NATIVE
* @param _token address
* @param _amount tokens to return
* @param _to address where funds should be sent to
*/
function _returnTokensTo(address _token, uint256 _amount, address _to) internal {
if (address(this) != _to) {
if (_token == NATIVE) {
payable(_to).transfer(_amount);
} else {
IERC20(_token).safeTransfer(_to, _amount);
}
}
}
function _transferFrom(address token, address _from, address _to, uint _amount) internal {
if (_from != address(this)) IERC20(token).safeTransferFrom(_from, _to, _amount);
else IERC20(token).safeTransfer(_to, _amount);
}
// -- QUERIES --
/**
* Query single adapter
*/
function queryAdapter(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint8 _index
) external view override returns (uint256) {
IAdapterV2 _adapter = IAdapterV2(ADAPTERS[_index]);
uint256 amountOut = _adapter.query(_amountIn, _tokenIn, _tokenOut);
return amountOut;
}
/**
* Query specified adapters
*/
function queryNoSplit(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint8[] calldata _options
) public view override returns (Query memory) {
Query memory bestQuery;
for (uint8 i; i < _options.length; i++) {
address _adapter = ADAPTERS[_options[i]];
uint256 amountOut = IAdapterV2(_adapter).query(_amountIn, _tokenIn, _tokenOut);
if (i == 0 || amountOut > bestQuery.amountOut) {
bestQuery = Query(_adapter, _tokenIn, _tokenOut, amountOut);
}
}
return bestQuery;
}
/**
* Query all adapters
*/
function queryNoSplit(
uint256 _amountIn,
address _tokenIn,
address _tokenOut
) public view override returns (Query memory) {
Query memory bestQuery;
for (uint8 i; i < ADAPTERS.length; i++) {
address _adapter = ADAPTERS[i];
uint256 amountOut = IAdapterV2(_adapter).query(_amountIn, _tokenIn, _tokenOut);
if (i == 0 || amountOut > bestQuery.amountOut) {
bestQuery = Query(_adapter, _tokenIn, _tokenOut, amountOut);
}
}
return bestQuery;
}
/**
* Return path with best returns between two tokens
* Takes gas-cost into account
*/
function findBestPathWithGas(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint256 _maxSteps,
uint256 _gasPrice
) external view override returns (FormattedOffer memory) {
require(_maxSteps > 0 && _maxSteps < 5, "SummitRouter: Invalid max-steps");
Offer memory queries = OfferUtils.newOffer(_amountIn, _tokenIn);
uint256 gasPriceInExitTkn = _gasPrice > 0 ? getGasPriceInExitTkn(_gasPrice, _tokenOut) : 0;
queries = _findBestPath(_amountIn, _tokenIn, _tokenOut, _maxSteps, queries, gasPriceInExitTkn);
if (queries.adapters.length == 0) {
queries.amounts = "";
queries.path = "";
}
return queries.format();
}
// Find the market price between gas-asset(native) and token-out and express gas price in token-out
function getGasPriceInExitTkn(uint256 _gasPrice, address _tokenOut) internal view returns (uint256 price) {
// Avoid low-liquidity price appreciation (https://github.com/yieldsummit/summit-aggregator/issues/20)
FormattedOffer memory gasQuery = findBestPath(1e18, WNATIVE, _tokenOut, 2);
if (gasQuery.path.length != 0) {
// Leave result in nWei to preserve precision for assets with low decimal places
price = (gasQuery.amounts[gasQuery.amounts.length - 1] * _gasPrice) / 1e9;
}
}
/**
* Return path with best returns between two tokens
*/
function findBestPath(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint256 _maxSteps
) public view override returns (FormattedOffer memory) {
require(_maxSteps > 0 && _maxSteps < 5, "SummitRouter: Invalid max-steps");
Offer memory queries = OfferUtils.newOffer(_amountIn, _tokenIn);
queries = _findBestPath(_amountIn, _tokenIn, _tokenOut, _maxSteps, queries, 0);
// If no paths are found return empty struct
if (queries.adapters.length == 0) {
queries.amounts = "";
queries.path = "";
}
return queries.format();
}
function _findBestPath(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint256 _maxSteps,
Offer memory _queries,
uint256 _tknOutPriceNwei
) internal view returns (Offer memory) {
Offer memory bestOption = _queries.clone();
uint256 bestAmountOut;
uint256 gasEstimate;
bool withGas = _tknOutPriceNwei != 0;
// First check if there is a path directly from tokenIn to tokenOut
Query memory queryDirect = queryNoSplit(_amountIn, _tokenIn, _tokenOut);
if (queryDirect.amountOut != 0) {
if (withGas) {
gasEstimate = IAdapterV2(queryDirect.adapter).swapGasEstimate();
}
bestOption.addToTail(queryDirect.amountOut, queryDirect.adapter, queryDirect.tokenOut, gasEstimate);
bestAmountOut = queryDirect.amountOut;
}
// Only check the rest if they would go beyond step limit (Need at least 2 more steps)
if (_maxSteps > 1 && _queries.adapters.length / 32 <= _maxSteps - 2) {
// Check for paths that pass through trusted tokens
for (uint256 i = 0; i < TRUSTED_TOKENS.length; i++) {
if (_tokenIn == TRUSTED_TOKENS[i]) {
continue;
}
// Loop through all adapters to find the best one for swapping tokenIn for one of the trusted tokens
Query memory bestSwap = queryNoSplit(_amountIn, _tokenIn, TRUSTED_TOKENS[i]);
if (bestSwap.amountOut == 0) {
continue;
}
// Explore options that connect the current path to the tokenOut
Offer memory newOffer = _queries.clone();
if (withGas) {
gasEstimate = IAdapterV2(bestSwap.adapter).swapGasEstimate();
}
newOffer.addToTail(bestSwap.amountOut, bestSwap.adapter, bestSwap.tokenOut, gasEstimate);
newOffer = _findBestPath(
bestSwap.amountOut,
TRUSTED_TOKENS[i],
_tokenOut,
_maxSteps,
newOffer,
_tknOutPriceNwei
); // Recursive step
address tokenOut = newOffer.getTokenOut();
uint256 amountOut = newOffer.getAmountOut();
// Check that the last token in the path is the tokenOut and update the new best option if neccesary
if (_tokenOut == tokenOut && amountOut > bestAmountOut) {
if (newOffer.gasEstimate > bestOption.gasEstimate) {
uint256 gasCostDiff = (_tknOutPriceNwei * (newOffer.gasEstimate - bestOption.gasEstimate)) /
1e9;
uint256 priceDiff = amountOut - bestAmountOut;
if (gasCostDiff > priceDiff) {
continue;
}
}
bestAmountOut = amountOut;
bestOption = newOffer;
}
}
}
return bestOption;
}
// -- VOLUME --
function getTokenBonus(address _token) public view override returns (uint256) {
if (_token == address(0)) return 0;
return TOKEN_VOLUME_BONUS[_token];
}
function _applyUserVolume(
address _from,
address[] memory _path,
uint256[] memory _amounts
) internal returns (uint256) {
if (VOLUME_ADAPTER == address(0)) return 0;
uint256 volume = 0;
uint256 bonus = 0;
for (uint256 i = 0; i < _path.length; i++) {
if (bonus == 0 && TOKEN_VOLUME_BONUS[_path[i]] != 0) {
bonus = TOKEN_VOLUME_BONUS[_path[i]];
}
if (volume == 0 && TOKEN_VOLUME_MULTIPLIERS[_path[i]] != 0) {
volume = (TOKEN_VOLUME_MULTIPLIERS[_path[i]] * _amounts[i]) / 1e12;
}
}
if (volume > 0 && VOLUME_ADAPTER != address(0)) {
ISummitVolumeAdapter(VOLUME_ADAPTER).addVolume(_from, (volume * (10000 + bonus)) / 10000);
}
return volume;
}
function _applyAdapterVolume(address _adapter, uint256 _volume) internal {
if (_volume == 0 || VOLUME_ADAPTER == address(0)) return;
ISummitVolumeAdapter(VOLUME_ADAPTER).addAdapterVolume(_adapter, _volume);
}
// -- SWAPPERS --
function _swapNoSplit(Trade calldata _trade, address _from, address _to, uint256 _fee) internal returns (uint256) {
uint256[] memory amounts = new uint256[](_trade.path.length);
if (_fee > 0 || MIN_FEE > 0) {
// Transfer fees to the claimer account and decrease initial amount
amounts[0] = _applyFee(_trade.amountIn, _fee);
_transferFrom(_trade.path[0], _from, address(this), _trade.amountIn - amounts[0]);
_transferFrom(_trade.path[0], address(this), FEE_CLAIMER, _trade.amountIn - amounts[0]);
} else {
amounts[0] = _trade.amountIn;
}
if (_trade.path.length < 2) revert InvalidTradePath();
// Transfer to target address fetched from adapter
address targetAddress = IAdapterV2(_trade.adapters[0]).getTransferTarget(_trade.path[0], _trade.path[1]);
_transferFrom(_trade.path[0], _from, targetAddress, amounts[0]);
// Get amounts that will be swapped
for (uint256 i = 0; i < _trade.adapters.length; i++) {
amounts[i + 1] = IAdapterV2(_trade.adapters[i]).query(amounts[i], _trade.path[i], _trade.path[i + 1]);
}
// Add volume to user
uint256 volume = _applyUserVolume(msg.sender, _trade.path, amounts);
require(amounts[amounts.length - 1] >= _trade.amountOut, "SummitRouter: Insufficient output amount");
for (uint256 i = 0; i < _trade.adapters.length; i++) {
_applyAdapterVolume(_trade.adapters[i], volume);
// All adapters should transfer output token to the following target
// All targets are the next adapters target, expect for the last swap where tokens are sent out
targetAddress = i < _trade.adapters.length - 1
? IAdapterV2(_trade.adapters[i + 1]).getTransferTarget(_trade.path[i], _trade.path[i + 1])
: _to;
IAdapterV2(_trade.adapters[i]).swap(
amounts[i],
amounts[i + 1],
_trade.path[i],
_trade.path[i + 1],
targetAddress
);
}
emit SummitSwap(
_trade.path[0],
_trade.path[_trade.path.length - 1],
_trade.amountIn,
amounts[amounts.length - 1]
);
return amounts[amounts.length - 1];
}
function swapNoSplit(Trade calldata _trade, address _to, uint256 _fee) public override {
_swapNoSplit(_trade, msg.sender, _to, _fee);
}
function swapNoSplitFromNATIVE(Trade calldata _trade, address _to, uint256 _fee) external payable override {
require(_trade.path[0] == WNATIVE, "SummitRouter: Path needs to begin with WNATIVE");
_wrap(_trade.amountIn);
_swapNoSplit(_trade, address(this), _to, _fee);
}
function swapNoSplitToNATIVE(Trade calldata _trade, address _to, uint256 _fee) public override {
require(_trade.path[_trade.path.length - 1] == WNATIVE, "SummitRouter: Path needs to end with WNATIVE");
uint256 returnAmount = _swapNoSplit(_trade, msg.sender, address(this), _fee);
_unwrap(returnAmount);
_returnTokensTo(NATIVE, returnAmount, _to);
}
/**
* Swap token to token without the need to approve the first token
*/
function swapNoSplitWithPermit(
Trade calldata _trade,
address _to,
uint256 _fee,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external override {
IERC20Permit(_trade.path[0]).safePermit(msg.sender, address(this), _trade.amountIn, _deadline, _v, _r, _s);
swapNoSplit(_trade, _to, _fee);
}
/**
* Swap token to NATIVE without the need to approve the first token
*/
function swapNoSplitToNATIVEWithPermit(
Trade calldata _trade,
address _to,
uint256 _fee,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external override {
IERC20Permit(_trade.path[0]).safePermit(msg.sender, address(this), _trade.amountIn, _deadline, _v, _r, _s);
swapNoSplitToNATIVE(_trade, _to, _fee);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/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:
*
* ```solidity
* 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}:
*
* ```solidity
* 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
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
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);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// 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
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @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.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IAdapterV2 {
function name() external view returns (string memory);
function swapGasEstimate() external view returns (uint256);
function swap(uint256, uint256, address, address, address) external;
function getTransferTarget(address tokenIn, address tokenOut) external view returns (address);
function query(uint256, address, address) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.5.16;
interface IBlast {
enum GasMode {
VOID,
CLAIMABLE
}
function configureClaimableGas() external;
function configureGovernor(address governor) external;
function claimAllGas(
address contractAddress,
address recipientOfGas
) external returns (uint256);
function claimGasAtMinClaimRate(
address contractAddress,
address recipientOfGas,
uint256 minClaimRateBips
) external returns (uint256);
function claimMaxGas(
address contractAddress,
address recipientOfGas
) external returns (uint256);
function claimGas(
address contractAddress,
address recipientOfGas,
uint256 gasToClaim,
uint256 gasSecondsToConsume
) external returns (uint256);
function readGasParams(
address contractAddress
)
external
view
returns (
uint256 etherSeconds,
uint256 etherBalance,
uint256 lastUpdated,
GasMode
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
event Approval(address, address, uint256);
event Transfer(address, address, uint256);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function transferFrom(
address,
address,
uint256
) external returns (bool);
function allowance(address, address) external view returns (uint256);
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function nonces(address) external view returns (uint256); // Only tokens that support permit
function permit(
address,
address,
uint256,
uint256,
uint8,
bytes32,
bytes32
) external; // Only tokens that support permit
function swap(address, uint256) external; // Only Avalanche bridge tokens
function swapSupply(address) external view returns (uint256); // Only Avalanche bridge tokens
function totalSupply() external view returns (uint256);
}//
// __ ___ ___ __ _
// (_ | | |\/| |\/| | | (_ \ / /\ |_)
// __) |_| | | | | _|_ | __) \/\/ /--\ |
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
struct Query {
address adapter;
address tokenIn;
address tokenOut;
uint256 amountOut;
}
struct Offer {
bytes amounts;
bytes adapters;
bytes path;
uint256 gasEstimate;
}
struct FormattedOffer {
uint256[] amounts;
address[] adapters;
address[] path;
uint256 gasEstimate;
}
struct Trade {
uint256 amountIn;
uint256 amountOut;
address[] path;
address[] adapters;
}
interface ISummitRouter {
event UpdatedTrustedTokens(address[] _newTrustedTokens);
event UpdatedTokenVolumeMultipliers(address[] _tokens, uint256[] _pointMultipliers);
event UpdatedTokenBonusMultipliers(address [] _tokens, uint256[] _multipliers);
event UpdatedAdapters(address[] _newAdapters);
event UpdatedVolumeAdapter(address _volumeAdapter);
event UpdatedMinFee(uint256 _oldMinFee, uint256 _newMinFee);
event UpdatedFeeClaimer(address _oldFeeClaimer, address _newFeeClaimer);
event SummitSwap(address indexed _tokenIn, address indexed _tokenOut, uint256 _amountIn, uint256 _amountOut);
// admin
function setTrustedTokens(address[] memory _trustedTokens) external;
function setAdapters(address[] memory _adapters) external;
function setVolumeAdapter(address _volumeAdapter) external;
function setFeeClaimer(address _claimer) external;
function setMinFee(uint256 _fee) external;
// misc
function trustedTokensCount() external view returns (uint256);
function adaptersCount() external view returns (uint256);
function getTokenBonus(address _token) external view returns (uint256);
// query
function queryAdapter(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint8 _index
) external returns (uint256);
function queryNoSplit(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint8[] calldata _options
) external view returns (Query memory);
function queryNoSplit(
uint256 _amountIn,
address _tokenIn,
address _tokenOut
) external view returns (Query memory);
function findBestPathWithGas(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint256 _maxSteps,
uint256 _gasPrice
) external view returns (FormattedOffer memory);
function findBestPath(
uint256 _amountIn,
address _tokenIn,
address _tokenOut,
uint256 _maxSteps
) external view returns (FormattedOffer memory);
// swap
function swapNoSplit(
Trade calldata _trade,
address _to,
uint256 _fee
) external;
function swapNoSplitFromNATIVE(
Trade calldata _trade,
address _to,
uint256 _fee
) external payable;
function swapNoSplitToNATIVE(
Trade calldata _trade,
address _to,
uint256 _fee
) external;
function swapNoSplitWithPermit(
Trade calldata _trade,
address _to,
uint256 _fee,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external;
function swapNoSplitToNATIVEWithPermit(
Trade calldata _trade,
address _to,
uint256 _fee,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external;
}//
// __ ___ ___ __ _
// (_ | | |\/| |\/| | | (_ \ / /\ |_)
// __) |_| | | | | _|_ | __) \/\/ /--\ |
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ISummitVolumeAdapter {
event UpdatedRouter(address indexed _router);
event UpdatedPointsContract(address indexed _pointsContract);
function addVolume(address _add, uint256 _volume) external;
function addAdapterVolume(address _adapter, uint256 _volume) external;
function setRouter(address _router) external;
function setPointsContract(address _pointsContract) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
interface IWETHV2 is IERC20 {
function withdraw(uint256 amount) external;
function deposit() external payable;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControl.sol";
/**
* @dev Contract module which extends the basic access control mechanism of Ownable
* to include many maintainers, whom only the owner (DEFAULT_ADMIN_ROLE) may add and
* remove.
*
* 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 this modifier:
* `onlyMaintainer`, which can be applied to your functions to restrict their use to
* the accounts with the role of maintainer.
*/
abstract contract Maintainable is AccessControl {
bytes32 public constant MAINTAINER_ROLE = keccak256("MAINTAINER_ROLE");
constructor() {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setupRole(MAINTAINER_ROLE, msg.sender);
}
function addMaintainer(address addedMaintainer) public virtual {
grantRole(MAINTAINER_ROLE, addedMaintainer);
}
function removeMaintainer(address removedMaintainer) public virtual {
revokeRole(MAINTAINER_ROLE, removedMaintainer);
}
function renounceRole(bytes32 role) public virtual {
renounceRole(role, msg.sender);
}
function transferOwnership(address newOwner) public virtual {
grantRole(DEFAULT_ADMIN_ROLE, newOwner);
renounceRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
modifier onlyMaintainer() {
require(hasRole(MAINTAINER_ROLE, msg.sender), "Maintainable: Caller is not a maintainer");
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "./SafeERC20.sol";
import "./Maintainable.sol";
abstract contract Recoverable is Maintainable {
using SafeERC20 for IERC20;
event Recovered(
address indexed _asset,
uint amount
);
/**
* @notice Recover ERC20 from contract
* @param _tokenAddress token address
* @param _tokenAmount amount to recover
*/
function recoverERC20(address _tokenAddress, uint _tokenAmount) external onlyMaintainer {
require(_tokenAmount > 0, "Nothing to recover");
IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
emit Recovered(_tokenAddress, _tokenAmount);
}
/**
* @notice Recover native asset from contract
* @param _amount amount
*/
function recoverNATIVE(uint _amount) external onlyMaintainer {
require(_amount > 0, "Nothing to recover");
payable(msg.sender).transfer(_amount);
emit Recovered(address(0), _amount);
}
}// This is a simplified version of OpenZepplin's SafeERC20 library
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "../interface/IERC20.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 ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
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));
}
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'
// solhint-disable-next-line max-line-length
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 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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.4;
import { Offer, FormattedOffer } from "../interface/ISummitRouter.sol";
import "./TypeConversion.sol";
library OfferUtils {
using TypeConversion for address;
using TypeConversion for uint256;
using TypeConversion for bytes;
function newOffer(
uint _amountIn,
address _tokenIn
) internal pure returns (Offer memory offer) {
offer.amounts = _amountIn.toBytes();
offer.path = _tokenIn.toBytes();
}
/**
* Makes a deep copy of Offer struct
*/
function clone(Offer memory _queries) internal pure returns (Offer memory) {
return Offer(_queries.amounts, _queries.adapters, _queries.path, _queries.gasEstimate);
}
/**
* Appends new elements to the end of Offer struct
*/
function addToTail(
Offer memory _queries,
uint256 _amount,
address _adapter,
address _tokenOut,
uint256 _gasEstimate
) internal pure {
_queries.path = bytes.concat(_queries.path, _tokenOut.toBytes());
_queries.adapters = bytes.concat(_queries.adapters, _adapter.toBytes());
_queries.amounts = bytes.concat(_queries.amounts, _amount.toBytes());
_queries.gasEstimate += _gasEstimate;
}
/**
* Formats elements in the Offer object from byte-arrays to integers and addresses
*/
function format(Offer memory _queries) internal pure returns (FormattedOffer memory) {
return
FormattedOffer(
_queries.amounts.toUints(),
_queries.adapters.toAddresses(),
_queries.path.toAddresses(),
_queries.gasEstimate
);
}
function getTokenOut(
Offer memory _offer
) internal pure returns (address tokenOut) {
tokenOut = _offer.path.toAddress(_offer.path.length); // Last 32 bytes
}
function getAmountOut(
Offer memory _offer
) internal pure returns (uint amountOut) {
amountOut = _offer.amounts.toUint(_offer.path.length); // Last 32 bytes
}
}
library FormattedOfferUtils {
using TypeConversion for address;
using TypeConversion for uint256;
using TypeConversion for bytes;
/**
* Appends new elements to the end of FormattedOffer
*/
function addToTail(
FormattedOffer memory offer,
uint256 amountOut,
address wrapper,
address tokenOut,
uint256 gasEstimate
) internal pure {
offer.amounts = bytes.concat(abi.encodePacked(offer.amounts), amountOut.toBytes()).toUints();
offer.adapters = bytes.concat(abi.encodePacked(offer.adapters), wrapper.toBytes()).toAddresses();
offer.path = bytes.concat(abi.encodePacked(offer.path), tokenOut.toBytes()).toAddresses();
offer.gasEstimate += gasEstimate;
}
/**
* Appends new elements to the beginning of FormattedOffer
*/
function addToHead(
FormattedOffer memory offer,
uint256 amountOut,
address wrapper,
address tokenOut,
uint256 gasEstimate
) internal pure {
offer.amounts = bytes.concat(amountOut.toBytes(), abi.encodePacked(offer.amounts)).toUints();
offer.adapters = bytes.concat(wrapper.toBytes(), abi.encodePacked(offer.adapters)).toAddresses();
offer.path = bytes.concat(tokenOut.toBytes(), abi.encodePacked(offer.path)).toAddresses();
offer.gasEstimate += gasEstimate;
}
function getAmountOut(FormattedOffer memory offer) internal pure returns (uint256) {
return offer.amounts[offer.amounts.length - 1];
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
library TypeConversion {
function toBytes12(address x) internal pure returns (bytes12 y) {
assembly { y := x }
}
function toBytes32(address x) internal pure returns (bytes32 y) {
assembly { y := x }
}
function toAddress(bytes32 x) internal pure returns (address y) {
assembly { y := x }
}
function toBytes(address x) internal pure returns (bytes memory y) {
y = new bytes(32);
assembly { mstore(add(y, 32), x) }
}
function toBytes(bytes32 x) internal pure returns (bytes memory y) {
y = new bytes(32);
assembly { mstore(add(y, 32), x) }
}
function toBytes(uint x) internal pure returns (bytes memory y) {
y = new bytes(32);
assembly { mstore(add(y, 32), x) }
}
function toAddress(
bytes memory x,
uint offset
) internal pure returns (address y) {
assembly { y := mload(add(x, offset)) }
}
function toUint(
bytes memory x,
uint offset
) internal pure returns (uint y) {
assembly { y := mload(add(x, offset)) }
}
function toBytes12(
bytes memory x,
uint offset
) internal pure returns (bytes12 y) {
assembly { y := mload(add(x, offset)) }
}
function toBytes32(
bytes memory x,
uint offset
) internal pure returns (bytes32 y) {
assembly { y := mload(add(x, offset)) }
}
function toAddresses(
bytes memory xs
) internal pure returns (address[] memory ys) {
ys = new address[](xs.length/32);
for (uint i=0; i < xs.length/32; i++) {
ys[i] = toAddress(xs, i*32 + 32);
}
}
function toUints(
bytes memory xs
) internal pure returns (uint[] memory ys) {
ys = new uint[](xs.length/32);
for (uint i=0; i < xs.length/32; i++) {
ys[i] = toUint(xs, i*32 + 32);
}
}
function toBytes32s(
bytes memory xs
) internal pure returns (bytes32[] memory ys) {
ys = new bytes32[](xs.length/32);
for (uint i=0; i < xs.length/32; i++) {
ys[i] = toBytes32(xs, i*32 + 32);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address[]","name":"_adapters","type":"address[]"},{"internalType":"address[]","name":"_trustedTokens","type":"address[]"},{"internalType":"address","name":"_feeClaimer","type":"address"},{"internalType":"address","name":"_wrapped_native","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"InvalidTradePath","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"_tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amountOut","type":"uint256"}],"name":"SummitSwap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_newAdapters","type":"address[]"}],"name":"UpdatedAdapters","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldFeeClaimer","type":"address"},{"indexed":false,"internalType":"address","name":"_newFeeClaimer","type":"address"}],"name":"UpdatedFeeClaimer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_oldMinFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newMinFee","type":"uint256"}],"name":"UpdatedMinFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_tokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"_multipliers","type":"uint256[]"}],"name":"UpdatedTokenBonusMultipliers","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_tokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"_pointMultipliers","type":"uint256[]"}],"name":"UpdatedTokenVolumeMultipliers","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_newTrustedTokens","type":"address[]"}],"name":"UpdatedTrustedTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_volumeAdapter","type":"address"}],"name":"UpdatedVolumeAdapter","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ADAPTERS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_CLAIMER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTAINER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TOKEN_VOLUME_BONUS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TOKEN_VOLUME_MULTIPLIERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"TRUSTED_TOKENS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VOLUME_ADAPTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WNATIVE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adaptersCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addedMaintainer","type":"address"}],"name":"addMaintainer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_maxSteps","type":"uint256"}],"name":"findBestPath","outputs":[{"components":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"internalType":"struct FormattedOffer","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_maxSteps","type":"uint256"},{"internalType":"uint256","name":"_gasPrice","type":"uint256"}],"name":"findBestPathWithGas","outputs":[{"components":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"internalType":"struct FormattedOffer","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getTokenBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_governor","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint8","name":"_index","type":"uint8"}],"name":"queryAdapter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint8[]","name":"_options","type":"uint8[]"}],"name":"queryNoSplit","outputs":[{"components":[{"internalType":"address","name":"adapter","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"}],"internalType":"struct Query","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"}],"name":"queryNoSplit","outputs":[{"components":[{"internalType":"address","name":"adapter","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"}],"internalType":"struct Query","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverNATIVE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"removedMaintainer","type":"address"}],"name":"removeMaintainer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_adapters","type":"address[]"}],"name":"setAdapters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wnative","type":"address"}],"name":"setAllowanceForWrapping","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_claimer","type":"address"}],"name":"setFeeClaimer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setMinFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_multipliers","type":"uint256[]"}],"name":"setTokenBonusMultipliers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_volumeMultipliers","type":"uint256[]"}],"name":"setTokenVolumeMultipliers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_trustedTokens","type":"address[]"}],"name":"setTrustedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_volumeAdapter","type":"address"}],"name":"setVolumeAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"internalType":"struct Trade","name":"_trade","type":"tuple"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"swapNoSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"internalType":"struct Trade","name":"_trade","type":"tuple"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"swapNoSplitFromNATIVE","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"internalType":"struct Trade","name":"_trade","type":"tuple"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"swapNoSplitToNATIVE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"internalType":"struct Trade","name":"_trade","type":"tuple"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"swapNoSplitToNATIVEWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address[]","name":"adapters","type":"address[]"}],"internalType":"struct Trade","name":"_trade","type":"tuple"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"swapNoSplitWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"trustedTokensCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a060405260006001556007805460ff60a01b191690553480156200002357600080fd5b5060405162005c8a38038062005c8a833981016040819052620000469162000993565b62000053600033620000c5565b6200007f7f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9533620000c5565b6200008a81620000d5565b620000958362000172565b620000a0826200022f565b620000ab8462000307565b60601b6001600160601b0319166080525062000b4c915050565b620000d18282620003c4565b5050565b33600090815260008051602062005c4a833981519152602052604090205460ff16620001485760405162461bcd60e51b8152602060048201526028602482015260008051602062005c6a83398151915260448201526734b73a30b4b732b960c11b60648201526084015b60405180910390fd5b6200016f81600019836001600160a01b03166200046460201b620020ff179092919060201c565b50565b33600090815260008051602062005c4a833981519152602052604090205460ff16620001e15760405162461bcd60e51b8152602060048201526028602482015260008051602062005c6a83398151915260448201526734b73a30b4b732b960c11b60648201526084016200013f565b7f658ff1688002926d8f426cb10c052ec29003f50042df9652d8613484c1a586478160405162000212919062000a7f565b60405180910390a18051620000d190600390602084019062000845565b33600090815260008051602062005c4a833981519152602052604090205460ff166200029e5760405162461bcd60e51b8152602060048201526028602482015260008051602062005c6a83398151915260448201526734b73a30b4b732b960c11b60648201526084016200013f565b600254604080516001600160a01b03928316815291831660208301527fb2c853ac4d80d18d058c43d8018d077a036e542a79acae1647f5ad2a8c76f4e2910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b33600090815260008051602062005c4a833981519152602052604090205460ff16620003765760405162461bcd60e51b8152602060048201526028602482015260008051602062005c6a83398151915260448201526734b73a30b4b732b960c11b60648201526084016200013f565b7febf7325f48e05e5e38809c69f8b02a7c907ed31d8768e6c2d841b1296a9225fe81604051620003a7919062000a7f565b60405180910390a18051620000d190600690602084019062000845565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000d1576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620004203390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b801580620004f25750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015620004b557600080fd5b505afa158015620004ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004f0919062000a48565b155b620005665760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016200013f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152620005be918591620005c316565b505050565b60006200061f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620006a460201b620022a4179092919060201c565b90508051600014806200064357508080602001905181019062000643919062000a1f565b620005be5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200013f565b6060620006b58484600085620006bd565b949350505050565b606082471015620007205760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200013f565b600080866001600160a01b031685876040516200073e919062000a61565b60006040518083038185875af1925050503d80600081146200077d576040519150601f19603f3d011682016040523d82523d6000602084013e62000782565b606091505b5090925090506200079687838387620007a1565b979650505050505050565b60608315620008125782516200080a576001600160a01b0385163b6200080a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200013f565b5081620006b5565b620006b58383815115620008295781518083602001fd5b8060405162461bcd60e51b81526004016200013f919062000ace565b8280548282559060005260206000209081019282156200089d579160200282015b828111156200089d57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000866565b50620008ab929150620008af565b5090565b5b80821115620008ab5760008155600101620008b0565b80516001600160a01b0381168114620008de57600080fd5b919050565b600082601f830112620008f4578081fd5b815160206001600160401b038083111562000913576200091362000b36565b8260051b604051601f19603f830116810181811084821117156200093b576200093b62000b36565b604052848152838101925086840182880185018910156200095a578687fd5b8692505b8583101562000987576200097281620008c6565b8452928401926001929092019184016200095e565b50979650505050505050565b60008060008060808587031215620009a9578384fd5b84516001600160401b0380821115620009c0578586fd5b620009ce88838901620008e3565b95506020870151915080821115620009e4578485fd5b50620009f387828801620008e3565b93505062000a0460408601620008c6565b915062000a1460608601620008c6565b905092959194509250565b60006020828403121562000a31578081fd5b8151801515811462000a41578182fd5b9392505050565b60006020828403121562000a5a578081fd5b5051919050565b6000825162000a7581846020870162000b03565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101562000ac25783516001600160a01b03168352928401929184019160010162000a9b565b50909695505050505050565b602081526000825180602084015262000aef81604085016020870162000b03565b601f01601f19169190910160400192915050565b60005b8381101562000b2057818101518382015260200162000b06565b8381111562000b30576000848401525b50505050565b634e487b7160e01b600052604160045260246000fd5b60805160601c6150bc62000b8e6000396000818161087801528181610c8b015281816117460152818161231701528181613478015261385801526150bc6000f3fe6080604052600436106103215760003560e01c80638980f11f116101a5578063bece95c3116100ec578063d73792a911610095578063dede7f151161006f578063dede7f15146109a3578063eadb18ff146109c3578063f2fde38b146109e3578063f874225414610a0357600080fd5b8063d73792a91461094d578063d8baf7cf14610963578063dd8544b31461098357600080fd5b8063c4d66de8116100c6578063c4d66de8146108ed578063c8a3a5c61461090d578063d547741f1461092d57600080fd5b8063bece95c31461089a578063c2c52820146108ad578063c3accd48146108cd57600080fd5b8063952e90121161014e578063a217fddf11610128578063a217fddf146107fb578063a3f4df7e14610810578063b381cf401461086657600080fd5b8063952e9012146107a65780639e1e94bf146107c6578063a0cf0aea146107e657600080fd5b806391d148541161017f57806391d14854146106e25780639217a8aa1461072657806392f5d88a1461074657600080fd5b80638980f11f146106825780638bb9c5bf146106a25780638d2195ad146106c257600080fd5b80634c09cf4e116102695780636bf2df861161021257806376ebe69c116101ec57806376ebe69c146106385780637c7a561b1461064d578063809356aa1461066257600080fd5b80636bf2df86146105e257806375d199471461060257806376c7a3c71461062257600080fd5b806361a413b21161024357806361a413b214610575578063630e1cdd146105a25780636b453c1f146105c257600080fd5b80634c09cf4e1461051557806352a52ab0146105355780635bd5da1e1461055557600080fd5b8063248a9ca3116102cb57806334d5a8f7116102a557806334d5a8f7146104b557806336568abe146104d55780633a9a4081146104f557600080fd5b8063248a9ca3146104435780632f2ff15d1461047357806331ac99201461049557600080fd5b8063061b15e7116102fc578063061b15e7146103d55780630c340a2414610402578063158ef93e1461042257600080fd5b8062b99e361461032d57806301ffc9a71461036a578063049550ad1461039a57600080fd5b3661032857005b600080fd5b34801561033957600080fd5b5060025461034d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561037657600080fd5b5061038a610385366004614957565b610a37565b6040519015158152602001610361565b3480156103a657600080fd5b506103c76103b536600461479e565b60046020526000908152604090205481565b604051908152602001610361565b3480156103e157600080fd5b506103f56103f0366004614b99565b610aa0565b6040516103619190614e06565b34801561040e57600080fd5b5060085461034d906001600160a01b031681565b34801561042e57600080fd5b5060075461038a90600160a01b900460ff1681565b34801561044f57600080fd5b506103c761045e366004614910565b60009081526020819052604090206001015490565b34801561047f57600080fd5b5061049361048e366004614928565b610bab565b005b3480156104a157600080fd5b506104936104b0366004614910565b610bd5565b3480156104c157600080fd5b506104936104d036600461497f565b610c81565b3480156104e157600080fd5b506104936104f0366004614928565b610dab565b34801561050157600080fd5b50610493610510366004614801565b610e37565b34801561052157600080fd5b506103f5610530366004614b52565b610eec565b34801561054157600080fd5b5061034d610550366004614910565b610fd7565b34801561056157600080fd5b5060075461034d906001600160a01b031681565b34801561058157600080fd5b506103c761059036600461479e565b60056020526000908152604090205481565b3480156105ae57600080fd5b506104936105bd36600461479e565b611001565b3480156105ce57600080fd5b506104936105dd36600461479e565b6110d7565b3480156105ee57600080fd5b506104936105fd36600461497f565b611104565b34801561060e57600080fd5b5061049361061d3660046149d7565b611110565b34801561062e57600080fd5b506103c760015481565b34801561064457600080fd5b506003546103c7565b34801561065957600080fd5b506006546103c7565b34801561066e57600080fd5b506103c761067d366004614bea565b61118b565b34801561068e57600080fd5b5061049361069d3660046147d6565b611254565b3480156106ae57600080fd5b506104936106bd366004614910565b61136a565b3480156106ce57600080fd5b506104936106dd366004614834565b611374565b3480156106ee57600080fd5b5061038a6106fd366004614928565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561073257600080fd5b506103c761074136600461479e565b61150c565b34801561075257600080fd5b50610766610761366004614ab5565b611540565b6040805182516001600160a01b03908116825260208085015182169083015283830151169181019190915260609182015191810191909152608001610361565b3480156107b257600080fd5b5061034d6107c1366004614910565b611703565b3480156107d257600080fd5b506104936107e13660046149d7565b611713565b3480156107f257600080fd5b5061034d600081565b34801561080757600080fd5b506103c7600081565b34801561081c57600080fd5b506108596040518060400160405280600e81526020017f53756d6d6974526f75746572563200000000000000000000000000000000000081525081565b6040516103619190614dd3565b34801561087257600080fd5b5061034d7f000000000000000000000000000000000000000000000000000000000000000081565b6104936108a836600461497f565b61173c565b3480156108b957600080fd5b506104936108c8366004614910565b611839565b3480156108d957600080fd5b506104936108e836600461479e565b61195b565b3480156108f957600080fd5b5061049361090836600461479e565b611a3c565b34801561091957600080fd5b50610493610928366004614801565b611c3e565b34801561093957600080fd5b50610493610948366004614928565b611cf3565b34801561095957600080fd5b506103c761271081565b34801561096f57600080fd5b5061049361097e36600461479e565b611d18565b34801561098f57600080fd5b5061049361099e36600461479e565b611d42565b3480156109af57600080fd5b506107666109be366004614a74565b611dc3565b3480156109cf57600080fd5b506104936109de366004614834565b611f51565b3480156109ef57600080fd5b506104936109fe36600461479e565b6120e9565b348015610a0f57600080fd5b506103c77f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610a9a57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b610acb6040518060800160405280606081526020016060815260200160608152602001600081525090565b600083118015610adb5750600583105b610b2c5760405162461bcd60e51b815260206004820152601f60248201527f53756d6d6974526f757465723a20496e76616c6964206d61782d73746570730060448201526064015b60405180910390fd5b6000610b3887876122b3565b90506000808411610b4a576000610b54565b610b548487612306565b9050610b648888888886866123a9565b915081602001515160001415610b96576040805160208082018352600080835291855282519081018352908152908301525b610b9f8261273c565b98975050505050505050565b600082815260208190526040902060010154610bc6816127b7565b610bd083836127c1565b505050565b336000908152600080516020615047833981519152602052604090205460ff16610c405760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b60015460408051918252602082018390527f4bb8a6184424e4bb853a4836042f5a726e4e710873989bfc6abdab19966f5b70910160405180910390a1600155565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016610cb86040850185614e75565b6001610cc76040880188614e75565b610cd2929150614f70565b818110610cef57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610d04919061479e565b6001600160a01b031614610d805760405162461bcd60e51b815260206004820152602c60248201527f53756d6d6974526f757465723a2050617468206e6565647320746f20656e642060448201527f7769746820574e415449564500000000000000000000000000000000000000006064820152608401610b23565b6000610d8e8433308561285f565b9050610d9981613449565b610da5600082856134df565b50505050565b6001600160a01b0381163314610e295760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610b23565b610e338282613547565b5050565b336000908152600080516020615047833981519152602052604090205460ff16610ea25760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b7febf7325f48e05e5e38809c69f8b02a7c907ed31d8768e6c2d841b1296a9225fe81604051610ed19190614d92565b60405180910390a18051610e33906006906020840190614678565b610f176040518060800160405280606081526020016060815260200160608152602001600081525090565b600082118015610f275750600582105b610f735760405162461bcd60e51b815260206004820152601f60248201527f53756d6d6974526f757465723a20496e76616c6964206d61782d7374657073006044820152606401610b23565b6000610f7f86866122b3565b9050610f90868686868560006123a9565b905080602001515160001415610fc2576040805160208082018352600080835291845282519081018352908152908201525b610fcb8161273c565b9150505b949350505050565b60038181548110610fe757600080fd5b6000918252602090912001546001600160a01b0316905081565b336000908152600080516020615047833981519152602052604090205460ff1661106c5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b6040516001600160a01b03821681527f5c3c642a912516f738e0b09cf8144ccd5a4d6a90cc1f7691ad0e8746e62b27419060200160405180910390a16007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6111017f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582610bab565b50565b610da58333848461285f565b61117733308960000135878787878e806040019061112e9190614e75565b600081811061114d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611162919061479e565b6001600160a01b0316969594939291906135c6565b611182878787611104565b50505050505050565b60008060068360ff16815481106111b257634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516377ccc49d60e11b8152600481018990526001600160a01b03888116602483015287811660448301529091169250829063ef99893a9060640160206040518083038186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112499190614a5c565b979650505050505050565b336000908152600080516020615047833981519152602052604090205460ff166112bf5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b6000811161130f5760405162461bcd60e51b815260206004820152601260248201527f4e6f7468696e6720746f207265636f76657200000000000000000000000000006044820152606401610b23565b6113236001600160a01b03831633836137ef565b816001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288260405161135e91815260200190565b60405180910390a25050565b6111018133610dab565b336000908152600080516020615047833981519152602052604090205460ff166113df5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b805182511461143c5760405162461bcd60e51b815260206004820152602360248201527f53756d6d6974526f757465723a204172726179206c656e677468206d69736d616044820152620e8c6d60eb1b6064820152608401610b23565b7f4e5490d99048d681d03f0b9caac46920508a722b1b1dc4f3e2877fe4c7593d22828260405161146d929190614da5565b60405180910390a160005b8251811015610bd0578181815181106114a157634e487b7160e01b600052603260045260246000fd5b6020026020010151600460008584815181106114cd57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061150490614fca565b915050611478565b60006001600160a01b03821661152457506000919050565b506001600160a01b031660009081526005602052604090205490565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260005b60ff81168411156116f8576000600686868460ff168181106115bd57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906115d29190614c3a565b60ff16815481106115f357634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516377ccc49d60e11b8152600481018c90526001600160a01b038b811660248301528a811660448301529091169250829063ef99893a9060640160206040518083038186803b15801561165257600080fd5b505afa158015611666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168a9190614a5c565b905060ff8316158061169f5750836060015181115b156116e3576040518060800160405280836001600160a01b031681526020018a6001600160a01b03168152602001896001600160a01b031681526020018281525093505b505080806116f090614fe5565b91505061158b565b509695505050505050565b60068181548110610fe757600080fd5b61173133308960000135878787878e806040019061112e9190614e75565b611182878787610c81565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166117736040850185614e75565b600081811061179257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906117a7919061479e565b6001600160a01b0316146118235760405162461bcd60e51b815260206004820152602e60248201527f53756d6d6974526f757465723a2050617468206e6565647320746f206265676960448201527f6e207769746820574e41544956450000000000000000000000000000000000006064820152608401610b23565b61182d8335613856565b610da58330848461285f565b336000908152600080516020615047833981519152602052604090205460ff166118a45760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b600081116118f45760405162461bcd60e51b815260206004820152601260248201527f4e6f7468696e6720746f207265636f76657200000000000000000000000000006044820152606401610b23565b604051339082156108fc029083906000818181858888f19350505050158015611921573d6000803e3d6000fd5b506040518181526000907f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa289060200160405180910390a250565b336000908152600080516020615047833981519152602052604090205460ff166119c65760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b600254604080516001600160a01b03928316815291831660208301527fb2c853ac4d80d18d058c43d8018d077a036e542a79acae1647f5ad2a8c76f4e2910160405180910390a16002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b336000908152600080516020615047833981519152602052604090205460ff16611aa75760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b600754600160a01b900460ff1615611aeb576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b179055604080517f4e606c470000000000000000000000000000000000000000000000000000000081529051734300000000000000000000000000000000000002918291634e606c479160048082019260009290919082900301818387803b158015611b8157600080fd5b505af1158015611b95573d6000803e3d6000fd5b50506040517feb8646980000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528416925063eb8646989150602401600060405180830381600087803b158015611bf557600080fd5b505af1158015611c09573d6000803e3d6000fd5b50506008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039590951694909417909355505050565b336000908152600080516020615047833981519152602052604090205460ff16611ca95760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b7f658ff1688002926d8f426cb10c052ec29003f50042df9652d8613484c1a5864781604051611cd89190614d92565b60405180910390a18051610e33906003906020840190614678565b600082815260208190526040902060010154611d0e816127b7565b610bd08383613547565b6111017f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582611cf3565b336000908152600080516020615047833981519152602052604090205460ff16611dad5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b6111016001600160a01b038216826000196120ff565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260005b60065460ff82161015611f4657600060068260ff1681548110611e4157634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516377ccc49d60e11b8152600481018a90526001600160a01b03898116602483015288811660448301529091169250829063ef99893a9060640160206040518083038186803b158015611ea057600080fd5b505afa158015611eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed89190614a5c565b905060ff83161580611eed5750836060015181115b15611f31576040518060800160405280836001600160a01b03168152602001886001600160a01b03168152602001876001600160a01b031681526020018281525093505b50508080611f3e90614fe5565b915050611e0e565b5090505b9392505050565b336000908152600080516020615047833981519152602052604090205460ff16611fbc5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b80518251146120195760405162461bcd60e51b815260206004820152602360248201527f53756d6d6974526f757465723a204172726179206c656e677468206d69736d616044820152620e8c6d60eb1b6064820152608401610b23565b7f8aaacf02bdd064229fccef65121ef7693f2408b685ceeef8d9c6836a6cdac8e2828260405161204a929190614da5565b60405180910390a160005b8251811015610bd05781818151811061207e57634e487b7160e01b600052603260045260246000fd5b6020026020010151600560008584815181106120aa57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806120e190614fca565b915050612055565b6120f4600082610bab565b611101600033610dab565b8015806121a157506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561216757600080fd5b505afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190614a5c565b155b6122135760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610b23565b6040516001600160a01b038316602482015260448101829052610bd09084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092179091526138cd565b6060610fcf84846000856139a2565b6122de6040518060800160405280606081526020016060815260200160608152602001600081525090565b6122e783613a89565b81526122fb6001600160a01b038316613a89565b604082015292915050565b60008061233e670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000856002610eec565b90508060400151516000146123a25780518051633b9aca0091869161236590600190614f70565b8151811061238357634e487b7160e01b600052603260045260246000fd5b60200260200101516123959190614f51565b61239f9190614f31565b91505b5092915050565b6123d46040518060800160405280606081526020016060815260200160608152602001600081525090565b60006123df84613ab3565b9050600080841515816123f38c8c8c611dc3565b905080606001516000146124a157811561247f5780600001516001600160a01b03166369cff80d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561244457600080fd5b505afa158015612458573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061247c9190614a5c565b92505b606081015181516040830151612499928892909187613b16565b806060015193505b6001891180156124cc57506124b760028a614f70565b60208960200151516124c99190614f31565b11155b1561272c5760005b60035481101561272a57600381815481106124ff57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b038d81169116141561252357612718565b60006125658e8e6003858154811061254b57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316611dc3565b905080606001516000141561257a5750612718565b60006125858b613ab3565b905084156126055781600001516001600160a01b03166369cff80d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156125ca57600080fd5b505afa1580156125de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126029190614a5c565b95505b60608201518251604084015161261f92849290918a613b16565b61266682606001516003858154811061264857634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03168f8f858f6123a9565b9050600061267382613bda565b9050600061268083613bed565b9050816001600160a01b03168f6001600160a01b03161480156126a257508881115b156127135789606001518360600151111561270c576000633b9aca008b6060015185606001516126d29190614f70565b6126dc908f614f51565b6126e69190614f31565b905060006126f48b84614f70565b90508082111561270957505050505050612718565b50505b8098508299505b505050505b8061272281614fca565b9150506124d4565b505b50929a9950505050505050505050565b6127676040518060800160405280606081526020016060815260200160608152602001600081525090565b604051806080016040528061277f8460000151613c02565b81526020016127918460200151613cde565b81526020016127a38460400151613cde565b815260200183606001518152509050919050565b6111018133613db1565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610e33576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561281b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008061286f6040870187614e75565b905067ffffffffffffffff81111561289757634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156128c0578160200160208202803683370190505b50905060008311806128d457506000600154115b15612a0c576128e4863584613e24565b8160008151811061290557634e487b7160e01b600052603260045260246000fd5b60209081029190910101526129936129206040880188614e75565b600081811061293f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612954919061479e565b86308460008151811061297757634e487b7160e01b600052603260045260246000fd5b60200260200101518a6000013561298e9190614f70565b613e99565b612a076129a36040880188614e75565b60008181106129c257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906129d7919061479e565b600254835130916001600160a01b031690859060009061297757634e487b7160e01b600052603260045260246000fd5b612a3f565b856000013581600081518110612a3257634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b6002612a4e6040880188614e75565b90501015612a88576040517f1a534f1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612a976060880188614e75565b6000818110612ab657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612acb919061479e565b6001600160a01b031663f3467a9c612ae660408a018a614e75565b6000818110612b0557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612b1a919061479e565b612b2760408b018b614e75565b6001818110612b4657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612b5b919061479e565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b158015612ba157600080fd5b505afa158015612bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd991906147ba565b9050612c4f612beb6040890189614e75565b6000818110612c0a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612c1f919061479e565b878385600081518110612c4257634e487b7160e01b600052603260045260246000fd5b6020026020010151613e99565b60005b612c5f6060890189614e75565b9050811015612e3757612c756060890189614e75565b82818110612c9357634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612ca8919061479e565b6001600160a01b031663ef99893a848381518110612cd657634e487b7160e01b600052603260045260246000fd5b60200260200101518a8060400190612cee9190614e75565b85818110612d0c57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612d21919061479e565b612d2e60408d018d614e75565b612d39876001614f19565b818110612d5657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612d6b919061479e565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b03918216602484015216604482015260640160206040518083038186803b158015612db857600080fd5b505afa158015612dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df09190614a5c565b83612dfc836001614f19565b81518110612e1a57634e487b7160e01b600052603260045260246000fd5b602090810291909101015280612e2f81614fca565b915050612c52565b506000612e8433612e4b60408b018b614e75565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250889250613ed7915050565b905087602001358360018551612e9a9190614f70565b81518110612eb857634e487b7160e01b600052603260045260246000fd5b60200260200101511015612f345760405162461bcd60e51b815260206004820152602860248201527f53756d6d6974526f757465723a20496e73756666696369656e74206f7574707560448201527f7420616d6f756e740000000000000000000000000000000000000000000000006064820152608401610b23565b60005b612f4460608a018a614e75565b90508110156132e057612f96612f5d60608b018b614e75565b83818110612f7b57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612f90919061479e565b8361416f565b6001612fa560608b018b614e75565b612fb0929150614f70565b8110612fbc578661311c565b612fc960608a018a614e75565b612fd4836001614f19565b818110612ff157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613006919061479e565b6001600160a01b031663f3467a9c61302160408c018c614e75565b8481811061303f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613054919061479e565b61306160408d018d614e75565b61306c866001614f19565b81811061308957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061309e919061479e565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b1580156130e457600080fd5b505afa1580156130f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061311c91906147ba565b925061312b60608a018a614e75565b8281811061314957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061315e919061479e565b6001600160a01b031663eab90da685838151811061318c57634e487b7160e01b600052603260045260246000fd5b6020026020010151868460016131a29190614f19565b815181106131c057634e487b7160e01b600052603260045260246000fd5b60200260200101518c80604001906131d89190614e75565b868181106131f657634e487b7160e01b600052603260045260246000fd5b905060200201602081019061320b919061479e565b61321860408f018f614e75565b613223886001614f19565b81811061324057634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613255919061479e565b6040516001600160e01b031960e087901b168152600481019490945260248401929092526001600160a01b03908116604484015290811660648301528616608482015260a401600060405180830381600087803b1580156132b557600080fd5b505af11580156132c9573d6000803e3d6000fd5b5050505080806132d890614fca565b915050612f37565b506132ee6040890189614e75565b60016132fd60408c018c614e75565b613308929150614f70565b81811061332557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061333a919061479e565b6001600160a01b031661335060408a018a614e75565b600081811061336f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613384919061479e565b6001600160a01b03167f39644f3c14304131550526f45bd2401622464447f4b368c4f7133cc18c37b4cf8a6000013586600188516133c29190614f70565b815181106133e057634e487b7160e01b600052603260045260246000fd5b60200260200101516040516133ff929190918252602082015260400190565b60405180910390a382600184516134169190614f70565b8151811061343457634e487b7160e01b600052603260045260246000fd5b60200260200101519350505050949350505050565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156134c457600080fd5b505af11580156134d8573d6000803e3d6000fd5b5050505050565b306001600160a01b03821614610bd0576001600160a01b038316613533576040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015610da5573d6000803e3d6000fd5b610bd06001600160a01b03841682846141f5565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610e33576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604051623f675f60e91b81526001600160a01b038881166004830152600091908a1690637ecebe009060240160206040518083038186803b15801561360a57600080fd5b505afa15801561361e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136429190614a5c565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081526001600160a01b038a811660048301528981166024830152604482018990526064820188905260ff8716608483015260a4820186905260c48201859052919250908a169063d505accf9060e401600060405180830381600087803b1580156136cf57600080fd5b505af11580156136e3573d6000803e3d6000fd5b5050604051623f675f60e91b81526001600160a01b038b81166004830152600093508c169150637ecebe009060240160206040518083038186803b15801561372a57600080fd5b505afa15801561373e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137629190614a5c565b905061376f826001614f19565b81146137e35760405162461bcd60e51b815260206004820152602160248201527f5361666545524332303a207065726d697420646964206e6f742073756363656560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610b23565b50505050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610bd0908490614225565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156138b157600080fd5b505af11580156138c5573d6000803e3d6000fd5b505050505050565b6000613922826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122a49092919063ffffffff16565b905080516000148061394357508080602001905181019061394391906148f0565b610bd05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b23565b606082471015613a1a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b23565b600080866001600160a01b03168587604051613a369190614cc6565b60006040518083038185875af1925050503d8060008114613a73576040519150601f19603f3d011682016040523d82523d6000602084013e613a78565b606091505b50915091506112498783838761434e565b60408051602080825281830190925260609160208201818036833750505060208101929092525090565b613ade6040518060800160405280606081526020016060815260200160608152602001600081525090565b604051806080016040528083600001518152602001836020015181526020018360400151815260200183606001518152509050919050565b8460400151613b2d836001600160a01b0316613a89565b604051602001613b3e929190614ce2565b60408051601f198184030181529181528601526020850151613b686001600160a01b038516613a89565b604051602001613b79929190614ce2565b60408051601f1981840301815291905260208601528451613b9985613a89565b604051602001613baa929190614ce2565b60408051601f198184030181529190528552606085018051829190613bd0908390614f19565b9052505050505050565b60408101518051600091610a9a91613c96565b6040810151518151600091610a9a9190613c96565b606060208251613c129190614f31565b67ffffffffffffffff811115613c3857634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613c61578160200160208202803683370190505b50905060005b60208351613c759190614f31565b811015613cd857613c9b83613c8b836020614f51565b613c96906020614f19565b015190565b828281518110613cbb57634e487b7160e01b600052603260045260246000fd5b602090810291909101015280613cd081614fca565b915050613c67565b50919050565b606060208251613cee9190614f31565b67ffffffffffffffff811115613d1457634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613d3d578160200160208202803683370190505b50905060005b60208351613d519190614f31565b811015613cd857613d6783613c8b836020614f51565b828281518110613d8757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280613da981614fca565b915050613d43565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610e3357613de2816143c4565b613ded8360206143d6565b604051602001613dfe929190614d11565b60408051601f198184030181529082905262461bcd60e51b8252610b2391600401614dd3565b6000600154821015613e785760405162461bcd60e51b815260206004820152601e60248201527f53756d6d6974526f757465723a20496e73756666696369656e742066656500006044820152606401610b23565b612710613e858382614f70565b613e8f9085614f51565b611f4a9190614f31565b6001600160a01b0383163014613ec357613ebe6001600160a01b0385168484846145fd565b610da5565b610da56001600160a01b03851683836141f5565b6007546000906001600160a01b0316613ef257506000611f4a565b60008060005b85518110156140b55781158015613f5c575060056000878381518110613f2e57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054600014155b15613fb15760056000878381518110613f8557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205491505b8215801561400c575060046000878381518110613fde57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054600014155b156140a35764e8d4a5100085828151811061403757634e487b7160e01b600052603260045260246000fd5b60200260200101516004600089858151811061406357634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546140969190614f51565b6140a09190614f31565b92505b806140ad81614fca565b915050613ef8565b506000821180156140d057506007546001600160a01b031615155b15611f46576007546001600160a01b03166332102e3b876127106140f48582614f19565b6140fe9087614f51565b6141089190614f31565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561414e57600080fd5b505af1158015614162573d6000803e3d6000fd5b5050505050949350505050565b80158061418557506007546001600160a01b0316155b1561418e575050565b6007546040517fc9d0529b0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018490529091169063c9d0529b90604401600060405180830381600087803b1580156138b157600080fd5b6040516001600160a01b038316602482015260448101829052610bd090849063a9059cbb60e01b90606401612258565b600080836001600160a01b0316836040516142409190614cc6565b6000604051808303816000865af19150503d806000811461427d576040519150601f19603f3d011682016040523d82523d6000602084013e614282565b606091505b5091509150816142d45760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646044820152606401610b23565b805115610da557808060200190518101906142ef91906148f0565b610da55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b23565b606083156143ba5782516143b3576001600160a01b0385163b6143b35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b23565b5081610fcf565b610fcf838361464e565b6060610a9a6001600160a01b03831660145b606060006143e5836002614f51565b6143f0906002614f19565b67ffffffffffffffff81111561441657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015614440576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061448557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106144de57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000614502846002614f51565b61450d906001614f19565b90505b60018111156145ae577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061455c57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061458057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936145a781614fb3565b9050614510565b508315611f4a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b23565b6040516001600160a01b0380851660248301528316604482015260648101829052610da59085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612258565b81511561465e5781518083602001fd5b8060405162461bcd60e51b8152600401610b239190614dd3565b8280548282559060005260206000209081019282156146da579160200282015b828111156146da578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190614698565b506146e69291506146ea565b5090565b5b808211156146e657600081556001016146eb565b600082601f83011261470f578081fd5b8135602061472461471f83614ef5565b614ec4565b80838252828201915082860187848660051b8901011115614743578586fd5b855b8581101561476a57813561475881615031565b84529284019290840190600101614745565b5090979650505050505050565b600060808284031215613cd8578081fd5b803560ff8116811461479957600080fd5b919050565b6000602082840312156147af578081fd5b8135611f4a81615031565b6000602082840312156147cb578081fd5b8151611f4a81615031565b600080604083850312156147e8578081fd5b82356147f381615031565b946020939093013593505050565b600060208284031215614812578081fd5b813567ffffffffffffffff811115614828578182fd5b61239f848285016146ff565b60008060408385031215614846578182fd5b823567ffffffffffffffff8082111561485d578384fd5b614869868387016146ff565b935060209150818501358181111561487f578384fd5b85019050601f81018613614891578283fd5b803561489f61471f82614ef5565b80828252848201915084840189868560051b87010111156148be578687fd5b8694505b838510156148e05780358352600194909401939185019185016148c2565b5080955050505050509250929050565b600060208284031215614901578081fd5b81518015158114611f4a578182fd5b600060208284031215614921578081fd5b5035919050565b6000806040838503121561493a578182fd5b82359150602083013561494c81615031565b809150509250929050565b600060208284031215614968578081fd5b81356001600160e01b031981168114611f4a578182fd5b600080600060608486031215614993578081fd5b833567ffffffffffffffff8111156149a9578182fd5b6149b586828701614777565b93505060208401356149c681615031565b929592945050506040919091013590565b600080600080600080600060e0888a0312156149f1578283fd5b873567ffffffffffffffff811115614a07578384fd5b614a138a828b01614777565b9750506020880135614a2481615031565b95506040880135945060608801359350614a4060808901614788565b925060a0880135915060c0880135905092959891949750929550565b600060208284031215614a6d578081fd5b5051919050565b600080600060608486031215614a88578081fd5b833592506020840135614a9a81615031565b91506040840135614aaa81615031565b809150509250925092565b600080600080600060808688031215614acc578283fd5b853594506020860135614ade81615031565b93506040860135614aee81615031565b9250606086013567ffffffffffffffff80821115614b0a578283fd5b818801915088601f830112614b1d578283fd5b813581811115614b2b578384fd5b8960208260051b8501011115614b3f578384fd5b9699959850939650602001949392505050565b60008060008060808587031215614b67578182fd5b843593506020850135614b7981615031565b92506040850135614b8981615031565b9396929550929360600135925050565b600080600080600060a08688031215614bb0578283fd5b853594506020860135614bc281615031565b93506040860135614bd281615031565b94979396509394606081013594506080013592915050565b60008060008060808587031215614bff578182fd5b843593506020850135614c1181615031565b92506040850135614c2181615031565b9150614c2f60608601614788565b905092959194509250565b600060208284031215614c4b578081fd5b611f4a82614788565b6000815180845260208085019450808401835b83811015614c8c5781516001600160a01b031687529582019590820190600101614c67565b509495945050505050565b6000815180845260208085019450808401835b83811015614c8c57815187529582019590820190600101614caa565b60008251614cd8818460208701614f87565b9190910192915050565b60008351614cf4818460208801614f87565b835190830190614d08818360208801614f87565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614d49816017850160208801614f87565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614d86816028840160208801614f87565b01602801949350505050565b602081526000611f4a6020830184614c54565b604081526000614db86040830185614c54565b8281036020840152614dca8185614c97565b95945050505050565b6020815260008251806020840152614df2816040850160208701614f87565b601f01601f19169190910160400192915050565b602081526000825160806020840152614e2260a0840182614c97565b90506020840151601f1980858403016040860152614e408383614c54565b9250604086015191508085840301606086015250614e5e8282614c54565b915050606084015160808401528091505092915050565b6000808335601e19843603018112614e8b578283fd5b83018035915067ffffffffffffffff821115614ea5578283fd5b6020019150600581901b3603821315614ebd57600080fd5b9250929050565b604051601f8201601f1916810167ffffffffffffffff81118282101715614eed57614eed61501b565b604052919050565b600067ffffffffffffffff821115614f0f57614f0f61501b565b5060051b60200190565b60008219821115614f2c57614f2c615005565b500190565b600082614f4c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614f6b57614f6b615005565b500290565b600082821015614f8257614f82615005565b500390565b60005b83811015614fa2578181015183820152602001614f8a565b83811115610da55750506000910152565b600081614fc257614fc2615005565b506000190190565b6000600019821415614fde57614fde615005565b5060010190565b600060ff821660ff811415614ffc57614ffc615005565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461110157600080fdfea54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d394d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d61a2646970667358221220870d002372d4f773cdc75d76cabde7d80fa5c8800887f4683320339604bba31864736f6c63430008040033a54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d394d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d61000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000003a7679e3662bc7c2eb2b1e71fa221da430c6f64b00000000000000000000000043000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000043000000000000000000000000000000000000030000000000000000000000004300000000000000000000000000000000000004
Deployed Bytecode
0x6080604052600436106103215760003560e01c80638980f11f116101a5578063bece95c3116100ec578063d73792a911610095578063dede7f151161006f578063dede7f15146109a3578063eadb18ff146109c3578063f2fde38b146109e3578063f874225414610a0357600080fd5b8063d73792a91461094d578063d8baf7cf14610963578063dd8544b31461098357600080fd5b8063c4d66de8116100c6578063c4d66de8146108ed578063c8a3a5c61461090d578063d547741f1461092d57600080fd5b8063bece95c31461089a578063c2c52820146108ad578063c3accd48146108cd57600080fd5b8063952e90121161014e578063a217fddf11610128578063a217fddf146107fb578063a3f4df7e14610810578063b381cf401461086657600080fd5b8063952e9012146107a65780639e1e94bf146107c6578063a0cf0aea146107e657600080fd5b806391d148541161017f57806391d14854146106e25780639217a8aa1461072657806392f5d88a1461074657600080fd5b80638980f11f146106825780638bb9c5bf146106a25780638d2195ad146106c257600080fd5b80634c09cf4e116102695780636bf2df861161021257806376ebe69c116101ec57806376ebe69c146106385780637c7a561b1461064d578063809356aa1461066257600080fd5b80636bf2df86146105e257806375d199471461060257806376c7a3c71461062257600080fd5b806361a413b21161024357806361a413b214610575578063630e1cdd146105a25780636b453c1f146105c257600080fd5b80634c09cf4e1461051557806352a52ab0146105355780635bd5da1e1461055557600080fd5b8063248a9ca3116102cb57806334d5a8f7116102a557806334d5a8f7146104b557806336568abe146104d55780633a9a4081146104f557600080fd5b8063248a9ca3146104435780632f2ff15d1461047357806331ac99201461049557600080fd5b8063061b15e7116102fc578063061b15e7146103d55780630c340a2414610402578063158ef93e1461042257600080fd5b8062b99e361461032d57806301ffc9a71461036a578063049550ad1461039a57600080fd5b3661032857005b600080fd5b34801561033957600080fd5b5060025461034d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561037657600080fd5b5061038a610385366004614957565b610a37565b6040519015158152602001610361565b3480156103a657600080fd5b506103c76103b536600461479e565b60046020526000908152604090205481565b604051908152602001610361565b3480156103e157600080fd5b506103f56103f0366004614b99565b610aa0565b6040516103619190614e06565b34801561040e57600080fd5b5060085461034d906001600160a01b031681565b34801561042e57600080fd5b5060075461038a90600160a01b900460ff1681565b34801561044f57600080fd5b506103c761045e366004614910565b60009081526020819052604090206001015490565b34801561047f57600080fd5b5061049361048e366004614928565b610bab565b005b3480156104a157600080fd5b506104936104b0366004614910565b610bd5565b3480156104c157600080fd5b506104936104d036600461497f565b610c81565b3480156104e157600080fd5b506104936104f0366004614928565b610dab565b34801561050157600080fd5b50610493610510366004614801565b610e37565b34801561052157600080fd5b506103f5610530366004614b52565b610eec565b34801561054157600080fd5b5061034d610550366004614910565b610fd7565b34801561056157600080fd5b5060075461034d906001600160a01b031681565b34801561058157600080fd5b506103c761059036600461479e565b60056020526000908152604090205481565b3480156105ae57600080fd5b506104936105bd36600461479e565b611001565b3480156105ce57600080fd5b506104936105dd36600461479e565b6110d7565b3480156105ee57600080fd5b506104936105fd36600461497f565b611104565b34801561060e57600080fd5b5061049361061d3660046149d7565b611110565b34801561062e57600080fd5b506103c760015481565b34801561064457600080fd5b506003546103c7565b34801561065957600080fd5b506006546103c7565b34801561066e57600080fd5b506103c761067d366004614bea565b61118b565b34801561068e57600080fd5b5061049361069d3660046147d6565b611254565b3480156106ae57600080fd5b506104936106bd366004614910565b61136a565b3480156106ce57600080fd5b506104936106dd366004614834565b611374565b3480156106ee57600080fd5b5061038a6106fd366004614928565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561073257600080fd5b506103c761074136600461479e565b61150c565b34801561075257600080fd5b50610766610761366004614ab5565b611540565b6040805182516001600160a01b03908116825260208085015182169083015283830151169181019190915260609182015191810191909152608001610361565b3480156107b257600080fd5b5061034d6107c1366004614910565b611703565b3480156107d257600080fd5b506104936107e13660046149d7565b611713565b3480156107f257600080fd5b5061034d600081565b34801561080757600080fd5b506103c7600081565b34801561081c57600080fd5b506108596040518060400160405280600e81526020017f53756d6d6974526f75746572563200000000000000000000000000000000000081525081565b6040516103619190614dd3565b34801561087257600080fd5b5061034d7f000000000000000000000000430000000000000000000000000000000000000481565b6104936108a836600461497f565b61173c565b3480156108b957600080fd5b506104936108c8366004614910565b611839565b3480156108d957600080fd5b506104936108e836600461479e565b61195b565b3480156108f957600080fd5b5061049361090836600461479e565b611a3c565b34801561091957600080fd5b50610493610928366004614801565b611c3e565b34801561093957600080fd5b50610493610948366004614928565b611cf3565b34801561095957600080fd5b506103c761271081565b34801561096f57600080fd5b5061049361097e36600461479e565b611d18565b34801561098f57600080fd5b5061049361099e36600461479e565b611d42565b3480156109af57600080fd5b506107666109be366004614a74565b611dc3565b3480156109cf57600080fd5b506104936109de366004614834565b611f51565b3480156109ef57600080fd5b506104936109fe36600461479e565b6120e9565b348015610a0f57600080fd5b506103c77f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9581565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610a9a57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b610acb6040518060800160405280606081526020016060815260200160608152602001600081525090565b600083118015610adb5750600583105b610b2c5760405162461bcd60e51b815260206004820152601f60248201527f53756d6d6974526f757465723a20496e76616c6964206d61782d73746570730060448201526064015b60405180910390fd5b6000610b3887876122b3565b90506000808411610b4a576000610b54565b610b548487612306565b9050610b648888888886866123a9565b915081602001515160001415610b96576040805160208082018352600080835291855282519081018352908152908301525b610b9f8261273c565b98975050505050505050565b600082815260208190526040902060010154610bc6816127b7565b610bd083836127c1565b505050565b336000908152600080516020615047833981519152602052604090205460ff16610c405760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b60015460408051918252602082018390527f4bb8a6184424e4bb853a4836042f5a726e4e710873989bfc6abdab19966f5b70910160405180910390a1600155565b6001600160a01b037f000000000000000000000000430000000000000000000000000000000000000416610cb86040850185614e75565b6001610cc76040880188614e75565b610cd2929150614f70565b818110610cef57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610d04919061479e565b6001600160a01b031614610d805760405162461bcd60e51b815260206004820152602c60248201527f53756d6d6974526f757465723a2050617468206e6565647320746f20656e642060448201527f7769746820574e415449564500000000000000000000000000000000000000006064820152608401610b23565b6000610d8e8433308561285f565b9050610d9981613449565b610da5600082856134df565b50505050565b6001600160a01b0381163314610e295760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610b23565b610e338282613547565b5050565b336000908152600080516020615047833981519152602052604090205460ff16610ea25760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b7febf7325f48e05e5e38809c69f8b02a7c907ed31d8768e6c2d841b1296a9225fe81604051610ed19190614d92565b60405180910390a18051610e33906006906020840190614678565b610f176040518060800160405280606081526020016060815260200160608152602001600081525090565b600082118015610f275750600582105b610f735760405162461bcd60e51b815260206004820152601f60248201527f53756d6d6974526f757465723a20496e76616c6964206d61782d7374657073006044820152606401610b23565b6000610f7f86866122b3565b9050610f90868686868560006123a9565b905080602001515160001415610fc2576040805160208082018352600080835291845282519081018352908152908201525b610fcb8161273c565b9150505b949350505050565b60038181548110610fe757600080fd5b6000918252602090912001546001600160a01b0316905081565b336000908152600080516020615047833981519152602052604090205460ff1661106c5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b6040516001600160a01b03821681527f5c3c642a912516f738e0b09cf8144ccd5a4d6a90cc1f7691ad0e8746e62b27419060200160405180910390a16007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6111017f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582610bab565b50565b610da58333848461285f565b61117733308960000135878787878e806040019061112e9190614e75565b600081811061114d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611162919061479e565b6001600160a01b0316969594939291906135c6565b611182878787611104565b50505050505050565b60008060068360ff16815481106111b257634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516377ccc49d60e11b8152600481018990526001600160a01b03888116602483015287811660448301529091169250829063ef99893a9060640160206040518083038186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112499190614a5c565b979650505050505050565b336000908152600080516020615047833981519152602052604090205460ff166112bf5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b6000811161130f5760405162461bcd60e51b815260206004820152601260248201527f4e6f7468696e6720746f207265636f76657200000000000000000000000000006044820152606401610b23565b6113236001600160a01b03831633836137ef565b816001600160a01b03167f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288260405161135e91815260200190565b60405180910390a25050565b6111018133610dab565b336000908152600080516020615047833981519152602052604090205460ff166113df5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b805182511461143c5760405162461bcd60e51b815260206004820152602360248201527f53756d6d6974526f757465723a204172726179206c656e677468206d69736d616044820152620e8c6d60eb1b6064820152608401610b23565b7f4e5490d99048d681d03f0b9caac46920508a722b1b1dc4f3e2877fe4c7593d22828260405161146d929190614da5565b60405180910390a160005b8251811015610bd0578181815181106114a157634e487b7160e01b600052603260045260246000fd5b6020026020010151600460008584815181106114cd57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061150490614fca565b915050611478565b60006001600160a01b03821661152457506000919050565b506001600160a01b031660009081526005602052604090205490565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260005b60ff81168411156116f8576000600686868460ff168181106115bd57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906115d29190614c3a565b60ff16815481106115f357634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516377ccc49d60e11b8152600481018c90526001600160a01b038b811660248301528a811660448301529091169250829063ef99893a9060640160206040518083038186803b15801561165257600080fd5b505afa158015611666573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168a9190614a5c565b905060ff8316158061169f5750836060015181115b156116e3576040518060800160405280836001600160a01b031681526020018a6001600160a01b03168152602001896001600160a01b031681526020018281525093505b505080806116f090614fe5565b91505061158b565b509695505050505050565b60068181548110610fe757600080fd5b61173133308960000135878787878e806040019061112e9190614e75565b611182878787610c81565b6001600160a01b037f0000000000000000000000004300000000000000000000000000000000000004166117736040850185614e75565b600081811061179257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906117a7919061479e565b6001600160a01b0316146118235760405162461bcd60e51b815260206004820152602e60248201527f53756d6d6974526f757465723a2050617468206e6565647320746f206265676960448201527f6e207769746820574e41544956450000000000000000000000000000000000006064820152608401610b23565b61182d8335613856565b610da58330848461285f565b336000908152600080516020615047833981519152602052604090205460ff166118a45760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b600081116118f45760405162461bcd60e51b815260206004820152601260248201527f4e6f7468696e6720746f207265636f76657200000000000000000000000000006044820152606401610b23565b604051339082156108fc029083906000818181858888f19350505050158015611921573d6000803e3d6000fd5b506040518181526000907f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa289060200160405180910390a250565b336000908152600080516020615047833981519152602052604090205460ff166119c65760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b600254604080516001600160a01b03928316815291831660208301527fb2c853ac4d80d18d058c43d8018d077a036e542a79acae1647f5ad2a8c76f4e2910160405180910390a16002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b336000908152600080516020615047833981519152602052604090205460ff16611aa75760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b600754600160a01b900460ff1615611aeb576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b179055604080517f4e606c470000000000000000000000000000000000000000000000000000000081529051734300000000000000000000000000000000000002918291634e606c479160048082019260009290919082900301818387803b158015611b8157600080fd5b505af1158015611b95573d6000803e3d6000fd5b50506040517feb8646980000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528416925063eb8646989150602401600060405180830381600087803b158015611bf557600080fd5b505af1158015611c09573d6000803e3d6000fd5b50506008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039590951694909417909355505050565b336000908152600080516020615047833981519152602052604090205460ff16611ca95760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b7f658ff1688002926d8f426cb10c052ec29003f50042df9652d8613484c1a5864781604051611cd89190614d92565b60405180910390a18051610e33906003906020840190614678565b600082815260208190526040902060010154611d0e816127b7565b610bd08383613547565b6111017f339759585899103d2ace64958e37e18ccb0504652c81d4a1b8aa80fe2126ab9582611cf3565b336000908152600080516020615047833981519152602052604090205460ff16611dad5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b6111016001600160a01b038216826000196120ff565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260005b60065460ff82161015611f4657600060068260ff1681548110611e4157634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516377ccc49d60e11b8152600481018a90526001600160a01b03898116602483015288811660448301529091169250829063ef99893a9060640160206040518083038186803b158015611ea057600080fd5b505afa158015611eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed89190614a5c565b905060ff83161580611eed5750836060015181115b15611f31576040518060800160405280836001600160a01b03168152602001886001600160a01b03168152602001876001600160a01b031681526020018281525093505b50508080611f3e90614fe5565b915050611e0e565b5090505b9392505050565b336000908152600080516020615047833981519152602052604090205460ff16611fbc5760405162461bcd60e51b8152602060048201526028602482015260008051602061506783398151915260448201526734b73a30b4b732b960c11b6064820152608401610b23565b80518251146120195760405162461bcd60e51b815260206004820152602360248201527f53756d6d6974526f757465723a204172726179206c656e677468206d69736d616044820152620e8c6d60eb1b6064820152608401610b23565b7f8aaacf02bdd064229fccef65121ef7693f2408b685ceeef8d9c6836a6cdac8e2828260405161204a929190614da5565b60405180910390a160005b8251811015610bd05781818151811061207e57634e487b7160e01b600052603260045260246000fd5b6020026020010151600560008584815181106120aa57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080806120e190614fca565b915050612055565b6120f4600082610bab565b611101600033610dab565b8015806121a157506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561216757600080fd5b505afa15801561217b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219f9190614a5c565b155b6122135760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610b23565b6040516001600160a01b038316602482015260448101829052610bd09084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092179091526138cd565b6060610fcf84846000856139a2565b6122de6040518060800160405280606081526020016060815260200160608152602001600081525090565b6122e783613a89565b81526122fb6001600160a01b038316613a89565b604082015292915050565b60008061233e670de0b6b3a76400007f0000000000000000000000004300000000000000000000000000000000000004856002610eec565b90508060400151516000146123a25780518051633b9aca0091869161236590600190614f70565b8151811061238357634e487b7160e01b600052603260045260246000fd5b60200260200101516123959190614f51565b61239f9190614f31565b91505b5092915050565b6123d46040518060800160405280606081526020016060815260200160608152602001600081525090565b60006123df84613ab3565b9050600080841515816123f38c8c8c611dc3565b905080606001516000146124a157811561247f5780600001516001600160a01b03166369cff80d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561244457600080fd5b505afa158015612458573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061247c9190614a5c565b92505b606081015181516040830151612499928892909187613b16565b806060015193505b6001891180156124cc57506124b760028a614f70565b60208960200151516124c99190614f31565b11155b1561272c5760005b60035481101561272a57600381815481106124ff57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b038d81169116141561252357612718565b60006125658e8e6003858154811061254b57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316611dc3565b905080606001516000141561257a5750612718565b60006125858b613ab3565b905084156126055781600001516001600160a01b03166369cff80d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156125ca57600080fd5b505afa1580156125de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126029190614a5c565b95505b60608201518251604084015161261f92849290918a613b16565b61266682606001516003858154811061264857634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03168f8f858f6123a9565b9050600061267382613bda565b9050600061268083613bed565b9050816001600160a01b03168f6001600160a01b03161480156126a257508881115b156127135789606001518360600151111561270c576000633b9aca008b6060015185606001516126d29190614f70565b6126dc908f614f51565b6126e69190614f31565b905060006126f48b84614f70565b90508082111561270957505050505050612718565b50505b8098508299505b505050505b8061272281614fca565b9150506124d4565b505b50929a9950505050505050505050565b6127676040518060800160405280606081526020016060815260200160608152602001600081525090565b604051806080016040528061277f8460000151613c02565b81526020016127918460200151613cde565b81526020016127a38460400151613cde565b815260200183606001518152509050919050565b6111018133613db1565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610e33576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561281b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008061286f6040870187614e75565b905067ffffffffffffffff81111561289757634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156128c0578160200160208202803683370190505b50905060008311806128d457506000600154115b15612a0c576128e4863584613e24565b8160008151811061290557634e487b7160e01b600052603260045260246000fd5b60209081029190910101526129936129206040880188614e75565b600081811061293f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612954919061479e565b86308460008151811061297757634e487b7160e01b600052603260045260246000fd5b60200260200101518a6000013561298e9190614f70565b613e99565b612a076129a36040880188614e75565b60008181106129c257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906129d7919061479e565b600254835130916001600160a01b031690859060009061297757634e487b7160e01b600052603260045260246000fd5b612a3f565b856000013581600081518110612a3257634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b6002612a4e6040880188614e75565b90501015612a88576040517f1a534f1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612a976060880188614e75565b6000818110612ab657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612acb919061479e565b6001600160a01b031663f3467a9c612ae660408a018a614e75565b6000818110612b0557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612b1a919061479e565b612b2760408b018b614e75565b6001818110612b4657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612b5b919061479e565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b158015612ba157600080fd5b505afa158015612bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd991906147ba565b9050612c4f612beb6040890189614e75565b6000818110612c0a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612c1f919061479e565b878385600081518110612c4257634e487b7160e01b600052603260045260246000fd5b6020026020010151613e99565b60005b612c5f6060890189614e75565b9050811015612e3757612c756060890189614e75565b82818110612c9357634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612ca8919061479e565b6001600160a01b031663ef99893a848381518110612cd657634e487b7160e01b600052603260045260246000fd5b60200260200101518a8060400190612cee9190614e75565b85818110612d0c57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612d21919061479e565b612d2e60408d018d614e75565b612d39876001614f19565b818110612d5657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612d6b919061479e565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b03918216602484015216604482015260640160206040518083038186803b158015612db857600080fd5b505afa158015612dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df09190614a5c565b83612dfc836001614f19565b81518110612e1a57634e487b7160e01b600052603260045260246000fd5b602090810291909101015280612e2f81614fca565b915050612c52565b506000612e8433612e4b60408b018b614e75565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250889250613ed7915050565b905087602001358360018551612e9a9190614f70565b81518110612eb857634e487b7160e01b600052603260045260246000fd5b60200260200101511015612f345760405162461bcd60e51b815260206004820152602860248201527f53756d6d6974526f757465723a20496e73756666696369656e74206f7574707560448201527f7420616d6f756e740000000000000000000000000000000000000000000000006064820152608401610b23565b60005b612f4460608a018a614e75565b90508110156132e057612f96612f5d60608b018b614e75565b83818110612f7b57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190612f90919061479e565b8361416f565b6001612fa560608b018b614e75565b612fb0929150614f70565b8110612fbc578661311c565b612fc960608a018a614e75565b612fd4836001614f19565b818110612ff157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613006919061479e565b6001600160a01b031663f3467a9c61302160408c018c614e75565b8481811061303f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613054919061479e565b61306160408d018d614e75565b61306c866001614f19565b81811061308957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061309e919061479e565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b1580156130e457600080fd5b505afa1580156130f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061311c91906147ba565b925061312b60608a018a614e75565b8281811061314957634e487b7160e01b600052603260045260246000fd5b905060200201602081019061315e919061479e565b6001600160a01b031663eab90da685838151811061318c57634e487b7160e01b600052603260045260246000fd5b6020026020010151868460016131a29190614f19565b815181106131c057634e487b7160e01b600052603260045260246000fd5b60200260200101518c80604001906131d89190614e75565b868181106131f657634e487b7160e01b600052603260045260246000fd5b905060200201602081019061320b919061479e565b61321860408f018f614e75565b613223886001614f19565b81811061324057634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613255919061479e565b6040516001600160e01b031960e087901b168152600481019490945260248401929092526001600160a01b03908116604484015290811660648301528616608482015260a401600060405180830381600087803b1580156132b557600080fd5b505af11580156132c9573d6000803e3d6000fd5b5050505080806132d890614fca565b915050612f37565b506132ee6040890189614e75565b60016132fd60408c018c614e75565b613308929150614f70565b81811061332557634e487b7160e01b600052603260045260246000fd5b905060200201602081019061333a919061479e565b6001600160a01b031661335060408a018a614e75565b600081811061336f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190613384919061479e565b6001600160a01b03167f39644f3c14304131550526f45bd2401622464447f4b368c4f7133cc18c37b4cf8a6000013586600188516133c29190614f70565b815181106133e057634e487b7160e01b600052603260045260246000fd5b60200260200101516040516133ff929190918252602082015260400190565b60405180910390a382600184516134169190614f70565b8151811061343457634e487b7160e01b600052603260045260246000fd5b60200260200101519350505050949350505050565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156134c457600080fd5b505af11580156134d8573d6000803e3d6000fd5b5050505050565b306001600160a01b03821614610bd0576001600160a01b038316613533576040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015610da5573d6000803e3d6000fd5b610bd06001600160a01b03841682846141f5565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610e33576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604051623f675f60e91b81526001600160a01b038881166004830152600091908a1690637ecebe009060240160206040518083038186803b15801561360a57600080fd5b505afa15801561361e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136429190614a5c565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081526001600160a01b038a811660048301528981166024830152604482018990526064820188905260ff8716608483015260a4820186905260c48201859052919250908a169063d505accf9060e401600060405180830381600087803b1580156136cf57600080fd5b505af11580156136e3573d6000803e3d6000fd5b5050604051623f675f60e91b81526001600160a01b038b81166004830152600093508c169150637ecebe009060240160206040518083038186803b15801561372a57600080fd5b505afa15801561373e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137629190614a5c565b905061376f826001614f19565b81146137e35760405162461bcd60e51b815260206004820152602160248201527f5361666545524332303a207065726d697420646964206e6f742073756363656560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610b23565b50505050505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610bd0908490614225565b7f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156138b157600080fd5b505af11580156138c5573d6000803e3d6000fd5b505050505050565b6000613922826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122a49092919063ffffffff16565b905080516000148061394357508080602001905181019061394391906148f0565b610bd05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b23565b606082471015613a1a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b23565b600080866001600160a01b03168587604051613a369190614cc6565b60006040518083038185875af1925050503d8060008114613a73576040519150601f19603f3d011682016040523d82523d6000602084013e613a78565b606091505b50915091506112498783838761434e565b60408051602080825281830190925260609160208201818036833750505060208101929092525090565b613ade6040518060800160405280606081526020016060815260200160608152602001600081525090565b604051806080016040528083600001518152602001836020015181526020018360400151815260200183606001518152509050919050565b8460400151613b2d836001600160a01b0316613a89565b604051602001613b3e929190614ce2565b60408051601f198184030181529181528601526020850151613b686001600160a01b038516613a89565b604051602001613b79929190614ce2565b60408051601f1981840301815291905260208601528451613b9985613a89565b604051602001613baa929190614ce2565b60408051601f198184030181529190528552606085018051829190613bd0908390614f19565b9052505050505050565b60408101518051600091610a9a91613c96565b6040810151518151600091610a9a9190613c96565b606060208251613c129190614f31565b67ffffffffffffffff811115613c3857634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613c61578160200160208202803683370190505b50905060005b60208351613c759190614f31565b811015613cd857613c9b83613c8b836020614f51565b613c96906020614f19565b015190565b828281518110613cbb57634e487b7160e01b600052603260045260246000fd5b602090810291909101015280613cd081614fca565b915050613c67565b50919050565b606060208251613cee9190614f31565b67ffffffffffffffff811115613d1457634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015613d3d578160200160208202803683370190505b50905060005b60208351613d519190614f31565b811015613cd857613d6783613c8b836020614f51565b828281518110613d8757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015280613da981614fca565b915050613d43565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610e3357613de2816143c4565b613ded8360206143d6565b604051602001613dfe929190614d11565b60408051601f198184030181529082905262461bcd60e51b8252610b2391600401614dd3565b6000600154821015613e785760405162461bcd60e51b815260206004820152601e60248201527f53756d6d6974526f757465723a20496e73756666696369656e742066656500006044820152606401610b23565b612710613e858382614f70565b613e8f9085614f51565b611f4a9190614f31565b6001600160a01b0383163014613ec357613ebe6001600160a01b0385168484846145fd565b610da5565b610da56001600160a01b03851683836141f5565b6007546000906001600160a01b0316613ef257506000611f4a565b60008060005b85518110156140b55781158015613f5c575060056000878381518110613f2e57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054600014155b15613fb15760056000878381518110613f8557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205491505b8215801561400c575060046000878381518110613fde57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054600014155b156140a35764e8d4a5100085828151811061403757634e487b7160e01b600052603260045260246000fd5b60200260200101516004600089858151811061406357634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020546140969190614f51565b6140a09190614f31565b92505b806140ad81614fca565b915050613ef8565b506000821180156140d057506007546001600160a01b031615155b15611f46576007546001600160a01b03166332102e3b876127106140f48582614f19565b6140fe9087614f51565b6141089190614f31565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561414e57600080fd5b505af1158015614162573d6000803e3d6000fd5b5050505050949350505050565b80158061418557506007546001600160a01b0316155b1561418e575050565b6007546040517fc9d0529b0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018490529091169063c9d0529b90604401600060405180830381600087803b1580156138b157600080fd5b6040516001600160a01b038316602482015260448101829052610bd090849063a9059cbb60e01b90606401612258565b600080836001600160a01b0316836040516142409190614cc6565b6000604051808303816000865af19150503d806000811461427d576040519150601f19603f3d011682016040523d82523d6000602084013e614282565b606091505b5091509150816142d45760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646044820152606401610b23565b805115610da557808060200190518101906142ef91906148f0565b610da55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b23565b606083156143ba5782516143b3576001600160a01b0385163b6143b35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b23565b5081610fcf565b610fcf838361464e565b6060610a9a6001600160a01b03831660145b606060006143e5836002614f51565b6143f0906002614f19565b67ffffffffffffffff81111561441657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015614440576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061448557634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106144de57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000614502846002614f51565b61450d906001614f19565b90505b60018111156145ae577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061455c57634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061458057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936145a781614fb3565b9050614510565b508315611f4a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b23565b6040516001600160a01b0380851660248301528316604482015260648101829052610da59085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612258565b81511561465e5781518083602001fd5b8060405162461bcd60e51b8152600401610b239190614dd3565b8280548282559060005260206000209081019282156146da579160200282015b828111156146da578251825473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909116178255602090920191600190910190614698565b506146e69291506146ea565b5090565b5b808211156146e657600081556001016146eb565b600082601f83011261470f578081fd5b8135602061472461471f83614ef5565b614ec4565b80838252828201915082860187848660051b8901011115614743578586fd5b855b8581101561476a57813561475881615031565b84529284019290840190600101614745565b5090979650505050505050565b600060808284031215613cd8578081fd5b803560ff8116811461479957600080fd5b919050565b6000602082840312156147af578081fd5b8135611f4a81615031565b6000602082840312156147cb578081fd5b8151611f4a81615031565b600080604083850312156147e8578081fd5b82356147f381615031565b946020939093013593505050565b600060208284031215614812578081fd5b813567ffffffffffffffff811115614828578182fd5b61239f848285016146ff565b60008060408385031215614846578182fd5b823567ffffffffffffffff8082111561485d578384fd5b614869868387016146ff565b935060209150818501358181111561487f578384fd5b85019050601f81018613614891578283fd5b803561489f61471f82614ef5565b80828252848201915084840189868560051b87010111156148be578687fd5b8694505b838510156148e05780358352600194909401939185019185016148c2565b5080955050505050509250929050565b600060208284031215614901578081fd5b81518015158114611f4a578182fd5b600060208284031215614921578081fd5b5035919050565b6000806040838503121561493a578182fd5b82359150602083013561494c81615031565b809150509250929050565b600060208284031215614968578081fd5b81356001600160e01b031981168114611f4a578182fd5b600080600060608486031215614993578081fd5b833567ffffffffffffffff8111156149a9578182fd5b6149b586828701614777565b93505060208401356149c681615031565b929592945050506040919091013590565b600080600080600080600060e0888a0312156149f1578283fd5b873567ffffffffffffffff811115614a07578384fd5b614a138a828b01614777565b9750506020880135614a2481615031565b95506040880135945060608801359350614a4060808901614788565b925060a0880135915060c0880135905092959891949750929550565b600060208284031215614a6d578081fd5b5051919050565b600080600060608486031215614a88578081fd5b833592506020840135614a9a81615031565b91506040840135614aaa81615031565b809150509250925092565b600080600080600060808688031215614acc578283fd5b853594506020860135614ade81615031565b93506040860135614aee81615031565b9250606086013567ffffffffffffffff80821115614b0a578283fd5b818801915088601f830112614b1d578283fd5b813581811115614b2b578384fd5b8960208260051b8501011115614b3f578384fd5b9699959850939650602001949392505050565b60008060008060808587031215614b67578182fd5b843593506020850135614b7981615031565b92506040850135614b8981615031565b9396929550929360600135925050565b600080600080600060a08688031215614bb0578283fd5b853594506020860135614bc281615031565b93506040860135614bd281615031565b94979396509394606081013594506080013592915050565b60008060008060808587031215614bff578182fd5b843593506020850135614c1181615031565b92506040850135614c2181615031565b9150614c2f60608601614788565b905092959194509250565b600060208284031215614c4b578081fd5b611f4a82614788565b6000815180845260208085019450808401835b83811015614c8c5781516001600160a01b031687529582019590820190600101614c67565b509495945050505050565b6000815180845260208085019450808401835b83811015614c8c57815187529582019590820190600101614caa565b60008251614cd8818460208701614f87565b9190910192915050565b60008351614cf4818460208801614f87565b835190830190614d08818360208801614f87565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614d49816017850160208801614f87565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614d86816028840160208801614f87565b01602801949350505050565b602081526000611f4a6020830184614c54565b604081526000614db86040830185614c54565b8281036020840152614dca8185614c97565b95945050505050565b6020815260008251806020840152614df2816040850160208701614f87565b601f01601f19169190910160400192915050565b602081526000825160806020840152614e2260a0840182614c97565b90506020840151601f1980858403016040860152614e408383614c54565b9250604086015191508085840301606086015250614e5e8282614c54565b915050606084015160808401528091505092915050565b6000808335601e19843603018112614e8b578283fd5b83018035915067ffffffffffffffff821115614ea5578283fd5b6020019150600581901b3603821315614ebd57600080fd5b9250929050565b604051601f8201601f1916810167ffffffffffffffff81118282101715614eed57614eed61501b565b604052919050565b600067ffffffffffffffff821115614f0f57614f0f61501b565b5060051b60200190565b60008219821115614f2c57614f2c615005565b500190565b600082614f4c57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614f6b57614f6b615005565b500290565b600082821015614f8257614f82615005565b500390565b60005b83811015614fa2578181015183820152602001614f8a565b83811115610da55750506000910152565b600081614fc257614fc2615005565b506000190190565b6000600019821415614fde57614fde615005565b5060010190565b600060ff821660ff811415614ffc57614ffc615005565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461110157600080fdfea54247010af6b3693b80aceddfad12e077c5de3571e6243fada502635f0d7d394d61696e7461696e61626c653a2043616c6c6572206973206e6f742061206d61a2646970667358221220870d002372d4f773cdc75d76cabde7d80fa5c8800887f4683320339604bba31864736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000003a7679e3662bc7c2eb2b1e71fa221da430c6f64b00000000000000000000000043000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000043000000000000000000000000000000000000030000000000000000000000004300000000000000000000000000000000000004
-----Decoded View---------------
Arg [0] : _adapters (address[]):
Arg [1] : _trustedTokens (address[]): 0x4300000000000000000000000000000000000003,0x4300000000000000000000000000000000000004
Arg [2] : _feeClaimer (address): 0x3a7679E3662bC7c2EB2B1E71FA221dA430c6f64B
Arg [3] : _wrapped_native (address): 0x4300000000000000000000000000000000000004
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000003a7679e3662bc7c2eb2b1e71fa221da430c6f64b
Arg [3] : 0000000000000000000000004300000000000000000000000000000000000004
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [6] : 0000000000000000000000004300000000000000000000000000000000000003
Arg [7] : 0000000000000000000000004300000000000000000000000000000000000004
Net Worth in USD
Net Worth in ETH
Token Allocations
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| BLAST | 100.00% | $2,865.3 | 0.001188 | $3.4 |
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.