Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 86 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Default Rout... | 16985867 | 1058 days ago | IN | 0 ETH | 0.00530368 | ||||
| Set Default Rout... | 16985816 | 1058 days ago | IN | 0 ETH | 0.00462293 | ||||
| Set Default Rout... | 16730574 | 1094 days ago | IN | 0 ETH | 0.00393855 | ||||
| Set Default Rout... | 16690699 | 1100 days ago | IN | 0 ETH | 0.00528564 | ||||
| Set Default Rout... | 16636233 | 1107 days ago | IN | 0 ETH | 0.0031318 | ||||
| Set Default Rout... | 16635032 | 1108 days ago | IN | 0 ETH | 0.0086093 | ||||
| Set Default Rout... | 16634911 | 1108 days ago | IN | 0 ETH | 0.00776545 | ||||
| Set Default Rout... | 16634811 | 1108 days ago | IN | 0 ETH | 0.00250465 | ||||
| Set Default Rout... | 16634695 | 1108 days ago | IN | 0 ETH | 0.00806705 | ||||
| Set Default Rout... | 16634691 | 1108 days ago | IN | 0 ETH | 0.00865467 | ||||
| Set Default Rout... | 16576669 | 1116 days ago | IN | 0 ETH | 0.00452882 | ||||
| Set Default Rout... | 16492551 | 1127 days ago | IN | 0 ETH | 0.00415403 | ||||
| Set Default Rout... | 16397798 | 1141 days ago | IN | 0 ETH | 0.00103179 | ||||
| Set Default Rout... | 16397793 | 1141 days ago | IN | 0 ETH | 0.00099767 | ||||
| Set Default Rout... | 16378467 | 1143 days ago | IN | 0 ETH | 0.00586018 | ||||
| Set Default Rout... | 16378458 | 1143 days ago | IN | 0 ETH | 0.00612535 | ||||
| Set Default Rout... | 16333994 | 1150 days ago | IN | 0 ETH | 0.00426064 | ||||
| Set Default Rout... | 16302035 | 1154 days ago | IN | 0 ETH | 0.00347658 | ||||
| Set Default Rout... | 16198811 | 1168 days ago | IN | 0 ETH | 0.00254202 | ||||
| Set Default Rout... | 16198793 | 1168 days ago | IN | 0 ETH | 0.00290858 | ||||
| Set Default Rout... | 16198783 | 1168 days ago | IN | 0 ETH | 0.0027751 | ||||
| Set Default Rout... | 16198764 | 1168 days ago | IN | 0 ETH | 0.00127898 | ||||
| Set Default Rout... | 16198741 | 1168 days ago | IN | 0 ETH | 0.00249226 | ||||
| Set Default Rout... | 16198598 | 1168 days ago | IN | 0 ETH | 0.00240792 | ||||
| Set Default Rout... | 16147992 | 1176 days ago | IN | 0 ETH | 0.00489361 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RoutedSwapper
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../access/Governable.sol";
import "../interfaces/swapper/IRoutedSwapper.sol";
import "../interfaces/swapper/IExchange.sol";
import "../libraries/DataTypes.sol";
/**
* @notice Routed Swapper contract
* This contract execute swaps and quoted using pre-set swap routes
*/
contract RoutedSwapper is IRoutedSwapper, Governable {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/**
* @notice List of the supported exchanges
*/
EnumerableSet.AddressSet private allExchanges;
/**
* @notice Mapping of exchanges' addresses by type
*/
mapping(DataTypes.ExchangeType => address) public addressOf;
/**
* @notice Default swap routings
* @dev Used to save gas by using a preset routing instead of looking for the best
*/
mapping(bytes => bytes) public defaultRoutings;
/// @notice Emitted when an exchange is added
event ExchangeUpdated(
DataTypes.ExchangeType indexed exchangeType,
address indexed oldExchange,
address indexed newExchange
);
/// @notice Emitted when exact-input swap is executed
event SwapExactInput(
IExchange indexed exchange,
bytes path,
address indexed tokenIn,
address indexed tokenOut,
uint256 amountIn,
uint256 amountOut
);
/// @notice Emitted when exact-output swap is executed
event SwapExactOutput(
IExchange indexed exchange,
bytes path,
address indexed tokenIn,
address indexed tokenOut,
uint256 amountInMax,
uint256 amountIn,
uint256 amountOut
);
/// @notice Emitted when default routing is updated
event DefaultRoutingUpdated(bytes key, bytes oldRouting, bytes newRouting);
/// @inheritdoc IRoutedSwapper
function getAmountIn(
address tokenIn_,
address tokenOut_,
uint256 amountOut_
) public returns (uint256 _amountIn) {
bytes memory _defaultRouting = defaultRoutings[
abi.encodePacked(DataTypes.SwapType.EXACT_OUTPUT, tokenIn_, tokenOut_)
];
require(_defaultRouting.length > 0, "no-routing-found");
(DataTypes.ExchangeType _exchangeType, bytes memory _path) = abi.decode(
_defaultRouting,
(DataTypes.ExchangeType, bytes)
);
_amountIn = IExchange(addressOf[_exchangeType]).getAmountsIn(amountOut_, _path);
}
/// @inheritdoc IRoutedSwapper
function getAmountOut(
address tokenIn_,
address tokenOut_,
uint256 amountIn_
) public returns (uint256 _amountOut) {
bytes memory _defaultRouting = defaultRoutings[
abi.encodePacked(DataTypes.SwapType.EXACT_INPUT, tokenIn_, tokenOut_)
];
require(_defaultRouting.length > 0, "no-routing-found");
(DataTypes.ExchangeType _exchangeType, bytes memory _path) = abi.decode(
_defaultRouting,
(DataTypes.ExchangeType, bytes)
);
_amountOut = IExchange(addressOf[_exchangeType]).getAmountsOut(amountIn_, _path);
}
/// @inheritdoc IRoutedSwapper
function getAllExchanges() external view override returns (address[] memory) {
return allExchanges.values();
}
/// @inheritdoc IRoutedSwapper
function swapExactInput(
address tokenIn_,
address tokenOut_,
uint256 amountIn_,
uint256 amountOutMin_,
address receiver_
) external returns (uint256 _amountOut) {
bytes memory _defaultRouting = defaultRoutings[
abi.encodePacked(DataTypes.SwapType.EXACT_INPUT, tokenIn_, tokenOut_)
];
require(_defaultRouting.length > 0, "no-routing-found");
(DataTypes.ExchangeType _exchangeType, bytes memory _path) = abi.decode(
_defaultRouting,
(DataTypes.ExchangeType, bytes)
);
IExchange _exchange = IExchange(addressOf[_exchangeType]);
uint256 _balanceBefore = IERC20(tokenIn_).balanceOf(address(_exchange));
IERC20(tokenIn_).safeTransferFrom(msg.sender, address(_exchange), amountIn_);
_amountOut = _exchange.swapExactInput(
_path,
// amountIn will be balanceNow - balanceBefore for fee-on-transfer tokens
IERC20(tokenIn_).balanceOf(address(_exchange)) - _balanceBefore,
amountOutMin_,
receiver_
);
emit SwapExactInput(_exchange, _path, tokenIn_, tokenOut_, amountIn_, _amountOut);
}
/// @inheritdoc IRoutedSwapper
function swapExactOutput(
address tokenIn_,
address tokenOut_,
uint256 amountOut_,
uint256 amountInMax_,
address receiver_
) external returns (uint256 _amountIn) {
bytes memory _defaultRouting = defaultRoutings[
abi.encodePacked(DataTypes.SwapType.EXACT_OUTPUT, tokenIn_, tokenOut_)
];
require(_defaultRouting.length > 0, "no-routing-found");
(DataTypes.ExchangeType _exchangeType, bytes memory _path) = abi.decode(
_defaultRouting,
(DataTypes.ExchangeType, bytes)
);
IExchange _exchange = IExchange(addressOf[_exchangeType]);
IERC20(tokenIn_).safeTransferFrom(msg.sender, address(_exchange), amountInMax_);
_amountIn = _exchange.swapExactOutput(_path, amountOut_, amountInMax_, msg.sender, receiver_);
emit SwapExactOutput(_exchange, _path, tokenIn_, tokenOut_, amountInMax_, _amountIn, amountOut_);
}
/**
* @notice Add or update exchange
* @dev Use null `exchange_` for removal
*/
function setExchange(DataTypes.ExchangeType type_, address exchange_) external onlyGovernor {
address _currentExchange = addressOf[type_];
if (_currentExchange == address(0)) {
// Adding
require(allExchanges.add(exchange_), "exchange-exists");
addressOf[type_] = exchange_;
} else if (exchange_ == address(0)) {
// Removing
require(allExchanges.remove(_currentExchange), "exchange-does-not-exist");
delete addressOf[type_];
} else {
// Updating
require(allExchanges.remove(_currentExchange), "exchange-does-not-exist");
require(allExchanges.add(exchange_), "exchange-exists");
addressOf[type_] = exchange_;
}
emit ExchangeUpdated(type_, _currentExchange, exchange_);
}
/**
* @notice Set default routing
* @dev Use empty `path_` for removal
* @param swapType_ If the routing is related to `EXACT_INPUT` or `EXACT_OUTPUT`
* @param tokenIn_ The swap in token
* @param tokenOut_ The swap out token
* @param exchange_ The type (i.e. protocol) of the exchange
* @param path_ The swap path
* @dev Use `abi.encodePacked(tokenA, poolFee1, tokenB, poolFee2, tokenC, ...)` for UniswapV3 exchange
* @dev Use `abi.encode([tokenA, tokenB, tokenC, ...])` for UniswapV2-like exchanges
*/
function setDefaultRouting(
DataTypes.SwapType swapType_,
address tokenIn_,
address tokenOut_,
DataTypes.ExchangeType exchange_,
bytes calldata path_
) external onlyGovernor {
bytes memory _key = abi.encodePacked(swapType_, tokenIn_, tokenOut_);
bytes memory _currentRouting = defaultRoutings[_key];
bytes memory _newRouting = abi.encode(exchange_, path_);
if (path_.length == 0) {
delete defaultRoutings[_key];
} else {
defaultRoutings[_key] = _newRouting;
}
emit DefaultRoutingUpdated(_key, _currentRouting, _newRouting);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/Address.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = _setInitializedVersion(1);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
bool isTopLevelCall = _setInitializedVersion(version);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(version);
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
_setInitializedVersion(type(uint8).max);
}
function _setInitializedVersion(uint8 version) private returns (bool) {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
// of initializers, because in other contexts the contract may have been reentered.
if (_initializing) {
require(
version == 1 && !Address.isContract(address(this)),
"Initializable: contract is already initialized"
);
return false;
} else {
require(_initialized < version, "Initializable: contract is already initialized");
_initialized = version;
return true;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.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;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {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));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
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");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @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");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
* ====
*
* [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "../interfaces/IGovernable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (governor) that can be granted exclusive access to
* specific functions.
*
* By default, the governor account will be the one that deploys the contract. This
* can later be changed with {transferGovernorship}.
*
*/
abstract contract Governable is IGovernable, Context, Initializable {
address public governor;
address private proposedGovernor;
event UpdatedGovernor(address indexed previousGovernor, address indexed proposedGovernor);
/**
* @dev Initializes the contract setting the deployer as the initial governor.
*/
constructor() {
address msgSender = _msgSender();
governor = msgSender;
emit UpdatedGovernor(address(0), msgSender);
}
/**
* @dev If inheriting child is using proxy then child contract can use
* __Governable_init() function to initialization this contract
*/
// solhint-disable-next-line func-name-mixedcase
function __Governable_init() internal initializer {
address msgSender = _msgSender();
governor = msgSender;
emit UpdatedGovernor(address(0), msgSender);
}
/**
* @dev Throws if called by any account other than the governor.
*/
modifier onlyGovernor() {
require(governor == _msgSender(), "not-governor");
_;
}
/**
* @dev Transfers governorship of the contract to a new account (`proposedGovernor`).
* Can only be called by the current owner.
*/
function transferGovernorship(address _proposedGovernor) external onlyGovernor {
require(_proposedGovernor != address(0), "proposed-governor-is-zero");
proposedGovernor = _proposedGovernor;
}
/**
* @dev Allows new governor to accept governorship of the contract.
*/
function acceptGovernorship() external {
require(proposedGovernor == _msgSender(), "not-the-proposed-governor");
emit UpdatedGovernor(governor, proposedGovernor);
governor = proposedGovernor;
proposedGovernor = address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
/**
* @notice Governable interface
*/
interface IGovernable {
function governor() external view returns (address _governor);
function transferGovernorship(address _proposedGovernor) external;
}// SPDX-License-Identifier: MIT
pragma solidity <=0.8.9;
/**
* @notice Exchange interface
*/
interface IExchange {
/**
* @notice Get *spot* quote
* It will return the swap amount based on the current reserves of the given path (i.e. spot price)
* @dev It shouldn't be used as oracle!!!
*/
function getAmountsIn(uint256 _amountOut, bytes memory path_) external returns (uint256 _amountIn);
/**
* @notice Get *spot* quote
* It will return the swap amount based on the current reserves of the given path (i.e. spot price)
* @dev It shouldn't be used as oracle!!!
*/
function getAmountsOut(uint256 amountIn_, bytes memory path_) external returns (uint256 _amountOut);
/**
* @notice Get *spot* quote
* It will return the swap amount based on the current reserves of the best pair/path found (i.e. spot price)
* @dev It shouldn't be used as oracle!!!
*/
function getBestAmountIn(
address tokenIn_,
address tokenOut_,
uint256 amountOut_
) external returns (uint256 _amountIn, bytes memory _path);
/**
* @notice Get *spot* quote
* It will return the swap amount based on the current reserves of the best pair/path found (i.e. spot price)
* @dev It shouldn't be used as oracle!!!
*/
function getBestAmountOut(
address tokenIn_,
address tokenOut_,
uint256 amountIn_
) external returns (uint256 _amountOut, bytes memory _path);
/**
* @notice Perform an exact input swap
* @dev Should transfer `amountIn_` before performing swap
*/
function swapExactInput(
bytes calldata path_,
uint256 amountIn_,
uint256 amountOutMin_,
address outReceiver_
) external returns (uint256 _amountOut);
/**
* @notice Perform an exact output swap
* @dev Should transfer `amountInMax_` before performing swap
* @dev Sends swap remains - if any - to the `inSender_`
*/
function swapExactOutput(
bytes calldata path_,
uint256 amountOut_,
uint256 amountInMax_,
address inSender_,
address outRecipient_
) external returns (uint256 _amountIn);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
/**
* @notice Routed Swapper interface
* @dev This contract doesn't support native coins (e.g. ETH, AVAX, MATIC, etc) use wrapper tokens instead
*/
interface IRoutedSwapper {
/**
* @notice The list of supported DEXes
* @dev This function is gas intensive
*/
function getAllExchanges() external view returns (address[] memory);
/**
* @notice Get *spot* quote
* It will return the swap amount based on the current reserves of the best pair/path found (i.e. spot price).
* @dev It shouldn't be used as oracle!!!
*/
function getAmountIn(
address tokenIn_,
address tokenOut_,
uint256 amountOut_
) external returns (uint256 _amountIn);
/**
* @notice Get *spot* quote
* It will return the swap amount based on the current reserves of the best pair/path found (i.e. spot price).
* @dev It shouldn't be used as oracle!!!
*/
function getAmountOut(
address tokenIn_,
address tokenOut_,
uint256 amountIn_
) external returns (uint256 _amountOut);
/**
* @notice Perform an exact input swap - will revert if there is no default routing
*/
function swapExactInput(
address tokenIn_,
address tokenOut_,
uint256 amountIn_,
uint256 amountOutMin_,
address _receiver
) external returns (uint256 _amountOut);
/**
* @notice Perform an exact output swap - will revert if there is no default routing
*/
function swapExactOutput(
address tokenIn_,
address tokenOut_,
uint256 amountOut_,
uint256 amountInMax_,
address receiver_
) external returns (uint256 _amountIn);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
library DataTypes {
/**
* @notice Price providers enumeration
*/
enum Provider {
NONE,
CHAINLINK,
UNISWAP_V3,
UNISWAP_V2,
SUSHISWAP,
TRADERJOE,
PANGOLIN,
QUICKSWAP,
UMBRELLA_FIRST_CLASS,
UMBRELLA_PASSPORT,
FLUX
}
enum ExchangeType {
UNISWAP_V2,
SUSHISWAP,
TRADERJOE,
PANGOLIN,
QUICKSWAP,
UNISWAP_V3
}
enum SwapType {
EXACT_INPUT,
EXACT_OUTPUT
}
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 5000
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"key","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"oldRouting","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"newRouting","type":"bytes"}],"name":"DefaultRoutingUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum DataTypes.ExchangeType","name":"exchangeType","type":"uint8"},{"indexed":true,"internalType":"address","name":"oldExchange","type":"address"},{"indexed":true,"internalType":"address","name":"newExchange","type":"address"}],"name":"ExchangeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IExchange","name":"exchange","type":"address"},{"indexed":false,"internalType":"bytes","name":"path","type":"bytes"},{"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":"SwapExactInput","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IExchange","name":"exchange","type":"address"},{"indexed":false,"internalType":"bytes","name":"path","type":"bytes"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountInMax","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"SwapExactOutput","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernor","type":"address"},{"indexed":true,"internalType":"address","name":"proposedGovernor","type":"address"}],"name":"UpdatedGovernor","type":"event"},{"inputs":[],"name":"acceptGovernorship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum DataTypes.ExchangeType","name":"","type":"uint8"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"defaultRoutings","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllExchanges","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn_","type":"address"},{"internalType":"address","name":"tokenOut_","type":"address"},{"internalType":"uint256","name":"amountOut_","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn_","type":"address"},{"internalType":"address","name":"tokenOut_","type":"address"},{"internalType":"uint256","name":"amountIn_","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"_amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum DataTypes.SwapType","name":"swapType_","type":"uint8"},{"internalType":"address","name":"tokenIn_","type":"address"},{"internalType":"address","name":"tokenOut_","type":"address"},{"internalType":"enum DataTypes.ExchangeType","name":"exchange_","type":"uint8"},{"internalType":"bytes","name":"path_","type":"bytes"}],"name":"setDefaultRouting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum DataTypes.ExchangeType","name":"type_","type":"uint8"},{"internalType":"address","name":"exchange_","type":"address"}],"name":"setExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn_","type":"address"},{"internalType":"address","name":"tokenOut_","type":"address"},{"internalType":"uint256","name":"amountIn_","type":"uint256"},{"internalType":"uint256","name":"amountOutMin_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"}],"name":"swapExactInput","outputs":[{"internalType":"uint256","name":"_amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn_","type":"address"},{"internalType":"address","name":"tokenOut_","type":"address"},{"internalType":"uint256","name":"amountOut_","type":"uint256"},{"internalType":"uint256","name":"amountInMax_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"}],"name":"swapExactOutput","outputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proposedGovernor","type":"address"}],"name":"transferGovernorship","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506000805462010000600160b01b03191633620100008102919091178255604051909182917fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a3506121b98061006a6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806367b4264511610081578063b6aa515b1161005b578063b6aa515b146101dc578063c71f8f94146101ef578063f3b27bc31461020257600080fd5b806367b426451461018d5780636ccb2b01146101b657806381cc619b146101c957600080fd5b806337c03fb6116100b257806337c03fb6146101445780634aa066521461015957806353b609b51461017a57600080fd5b80630c340a24146100d95780632aa3e6c61461010f5780633254e7b114610124575b600080fd5b6000546100f2906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61012261011d366004611a3d565b61020a565b005b610137610132366004611afa565b610594565b6040516101069190611bd2565b61014c610639565b6040516101069190611be5565b61016c610167366004611c32565b61064a565b604051908152602001610106565b61016c610188366004611c32565b610862565b6100f261019b366004611c6e565b6004602052600090815260409020546001600160a01b031681565b61016c6101c4366004611c8b565b610a1d565b61016c6101d7366004611c8b565b610dc5565b6101226101ea366004611ce2565b61105d565b6101226101fd366004611cfd565b61114e565b610122611359565b6000546001600160a01b03620100009091041633146102705760405162461bcd60e51b815260206004820152600c60248201527f6e6f742d676f7665726e6f72000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60006004600084600581111561028857610288611db9565b600581111561029957610299611db9565b81526020810191909152604001600020546001600160a01b0316905080610370576102c5600283611459565b6103115760405162461bcd60e51b815260206004820152600f60248201527f65786368616e67652d65786973747300000000000000000000000000000000006044820152606401610267565b816004600085600581111561032857610328611db9565b600581111561033957610339611db9565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610540565b6001600160a01b03821661043757610389600282611477565b6103d55760405162461bcd60e51b815260206004820152601760248201527f65786368616e67652d646f65732d6e6f742d65786973740000000000000000006044820152606401610267565b600460008460058111156103eb576103eb611db9565b60058111156103fc576103fc611db9565b8152602081019190915260400160002080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610540565b610442600282611477565b61048e5760405162461bcd60e51b815260206004820152601760248201527f65786368616e67652d646f65732d6e6f742d65786973740000000000000000006044820152606401610267565b610499600283611459565b6104e55760405162461bcd60e51b815260206004820152600f60248201527f65786368616e67652d65786973747300000000000000000000000000000000006044820152606401610267565b81600460008560058111156104fc576104fc611db9565b600581111561050d5761050d611db9565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b816001600160a01b0316816001600160a01b031684600581111561056657610566611db9565b6040517fd368678e81cb4fa5855a3e8bc7c4df1cdfdc699b194e44bff3d1a4399ee6be1490600090a4505050565b8051602081830181018051600582529282019190930120915280546105b890611de8565b80601f01602080910402602001604051908101604052809291908181526020018280546105e490611de8565b80156106315780601f1061060657610100808354040283529160200191610631565b820191906000526020600020905b81548152906001019060200180831161061457829003601f168201915b505050505081565b6060610645600261148c565b905090565b60008060056000868660405160200161066593929190611e3c565b60408051601f198184030181529082905261067f91611e92565b9081526020016040518091039020805461069890611de8565b80601f01602080910402602001604051908101604052809291908181526020018280546106c490611de8565b80156107115780601f106106e657610100808354040283529160200191610711565b820191906000526020600020905b8154815290600101906020018083116106f457829003601f168201915b5050505050905060008151116107695760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b600080828060200190518101906107809190611eae565b915091506004600083600581111561079a5761079a611db9565b60058111156107ab576107ab611db9565b8152602081019190915260409081016000205490517ffee9574a0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fee9574a906108059088908590600401611f3b565b602060405180830381600087803b15801561081f57600080fd5b505af1158015610833573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108579190611f54565b979650505050505050565b60008060056001868660405160200161087d93929190611e3c565b60408051601f198184030181529082905261089791611e92565b908152602001604051809103902080546108b090611de8565b80601f01602080910402602001604051908101604052809291908181526020018280546108dc90611de8565b80156109295780601f106108fe57610100808354040283529160200191610929565b820191906000526020600020905b81548152906001019060200180831161090c57829003601f168201915b5050505050905060008151116109815760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b600080828060200190518101906109989190611eae565b91509150600460008360058111156109b2576109b2611db9565b60058111156109c3576109c3611db9565b8152602081019190915260409081016000205490517f2aa4a9e50000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690632aa4a9e5906108059088908590600401611f3b565b600080600560008888604051602001610a3893929190611e3c565b60408051601f1981840301815290829052610a5291611e92565b90815260200160405180910390208054610a6b90611de8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9790611de8565b8015610ae45780601f10610ab957610100808354040283529160200191610ae4565b820191906000526020600020905b815481529060010190602001808311610ac757829003601f168201915b505050505090506000815111610b3c5760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b60008082806020019051810190610b539190611eae565b91509150600060046000846005811115610b6f57610b6f611db9565b6005811115610b8057610b80611db9565b81526020810191909152604090810160009081205491517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201819052935090918c16906370a082319060240160206040518083038186803b158015610bf457600080fd5b505afa158015610c08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2c9190611f54565b9050610c436001600160a01b038c1633848c6114a0565b816001600160a01b0316634909c29a84838e6001600160a01b03166370a08231876040518263ffffffff1660e01b8152600401610c8f91906001600160a01b0391909116815260200190565b60206040518083038186803b158015610ca757600080fd5b505afa158015610cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdf9190611f54565b610ce99190611f6d565b8b8b6040518563ffffffff1660e01b8152600401610d0a9493929190611fab565b602060405180830381600087803b158015610d2457600080fd5b505af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611f54565b9550896001600160a01b03168b6001600160a01b0316836001600160a01b03167f332d883d1035df5d58d7a529e9dab834dbc4c3983a2d629a6424230ec1bf8c04868d8b604051610daf93929190611fe3565b60405180910390a4505050505095945050505050565b600080600560018888604051602001610de093929190611e3c565b60408051601f1981840301815290829052610dfa91611e92565b90815260200160405180910390208054610e1390611de8565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3f90611de8565b8015610e8c5780601f10610e6157610100808354040283529160200191610e8c565b820191906000526020600020905b815481529060010190602001808311610e6f57829003601f168201915b505050505090506000815111610ee45760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b60008082806020019051810190610efb9190611eae565b91509150600060046000846005811115610f1757610f17611db9565b6005811115610f2857610f28611db9565b81526020810191909152604001600020546001600160a01b039081169150610f54908b1633838a6114a0565b6040517f9d9f384d0000000000000000000000000000000000000000000000000000000081526001600160a01b03821690639d9f384d90610fa19085908c908c9033908d90600401612008565b602060405180830381600087803b158015610fbb57600080fd5b505af1158015610fcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff39190611f54565b9450886001600160a01b03168a6001600160a01b0316826001600160a01b03167fe2b399ee44535cc98392f9d1d787f5c925873e04562dee99db8c1f781240c062858b8a8e6040516110489493929190612048565b60405180910390a45050505095945050505050565b6000546001600160a01b03620100009091041633146110be5760405162461bcd60e51b815260206004820152600c60248201527f6e6f742d676f7665726e6f7200000000000000000000000000000000000000006044820152606401610267565b6001600160a01b0381166111145760405162461bcd60e51b815260206004820152601960248201527f70726f706f7365642d676f7665726e6f722d69732d7a65726f000000000000006044820152606401610267565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000546001600160a01b03620100009091041633146111af5760405162461bcd60e51b815260206004820152600c60248201527f6e6f742d676f7665726e6f7200000000000000000000000000000000000000006044820152606401610267565b60008686866040516020016111c693929190611e3c565b604051602081830303815290604052905060006005826040516111e99190611e92565b9081526020016040518091039020805461120290611de8565b80601f016020809104026020016040519081016040528092919081815260200182805461122e90611de8565b801561127b5780601f106112505761010080835404028352916020019161127b565b820191906000526020600020905b81548152906001019060200180831161125e57829003601f168201915b50505050509050600085858560405160200161129993929190612077565b60408051601f198184030181529190529050836112df576005836040516112c09190611e92565b908152602001604051809103902060006112da919061193e565b611313565b806005846040516112f09190611e92565b9081526020016040518091039020908051906020019061131192919061197b565b505b7f69f079d2078c67fbbdee50f8233f472aed9a0ddc1deb4c04fa3ed59fdee4db30838383604051611346939291906120c0565b60405180910390a1505050505050505050565b6001546001600160a01b031633146113b35760405162461bcd60e51b815260206004820152601960248201527f6e6f742d7468652d70726f706f7365642d676f7665726e6f72000000000000006044820152606401610267565b600154600080546040516001600160a01b039384169362010000909204909116917fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d091a360018054600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166001600160a01b03831662010000021790557fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600061146e836001600160a01b03841661152e565b90505b92915050565b600061146e836001600160a01b03841661157d565b6060600061149983611670565b9392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526115289085906116cc565b50505050565b600081815260018301602052604081205461157557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611471565b506000611471565b600081815260018301602052604081205480156116665760006115a1600183611f6d565b85549091506000906115b590600190611f6d565b905081811461161a5760008660000182815481106115d5576115d5612103565b90600052602060002001549050808760000184815481106115f8576115f8612103565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061162b5761162b612132565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611471565b6000915050611471565b6060816000018054806020026020016040519081016040528092919081815260200182805480156116c057602002820191906000526020600020905b8154815260200190600101908083116116ac575b50505050509050919050565b6000611721826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117b69092919063ffffffff16565b8051909150156117b1578080602001905181019061173f9190612161565b6117b15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610267565b505050565b60606117c584846000856117cd565b949350505050565b6060824710156118455760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610267565b6001600160a01b0385163b61189c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610267565b600080866001600160a01b031685876040516118b89190611e92565b60006040518083038185875af1925050503d80600081146118f5576040519150601f19603f3d011682016040523d82523d6000602084013e6118fa565b606091505b509150915061085782828660608315611914575081611499565b8251156119245782518084602001fd5b8160405162461bcd60e51b81526004016102679190611bd2565b50805461194a90611de8565b6000825580601f1061195a575050565b601f01602090049060005260206000209081019061197891906119ff565b50565b82805461198790611de8565b90600052602060002090601f0160209004810192826119a957600085556119ef565b82601f106119c257805160ff19168380011785556119ef565b828001600101855582156119ef579182015b828111156119ef5782518255916020019190600101906119d4565b506119fb9291506119ff565b5090565b5b808211156119fb5760008155600101611a00565b6006811061197857600080fd5b80356001600160a01b0381168114611a3857600080fd5b919050565b60008060408385031215611a5057600080fd5b8235611a5b81611a14565b9150611a6960208401611a21565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611aca57611aca611a72565b604052919050565b600067ffffffffffffffff821115611aec57611aec611a72565b50601f01601f191660200190565b600060208284031215611b0c57600080fd5b813567ffffffffffffffff811115611b2357600080fd5b8201601f81018413611b3457600080fd5b8035611b47611b4282611ad2565b611aa1565b818152856020838501011115611b5c57600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b83811015611b95578181015183820152602001611b7d565b838111156115285750506000910152565b60008151808452611bbe816020860160208601611b7a565b601f01601f19169290920160200192915050565b60208152600061146e6020830184611ba6565b6020808252825182820181905260009190848201906040850190845b81811015611c265783516001600160a01b031683529284019291840191600101611c01565b50909695505050505050565b600080600060608486031215611c4757600080fd5b611c5084611a21565b9250611c5e60208501611a21565b9150604084013590509250925092565b600060208284031215611c8057600080fd5b813561149981611a14565b600080600080600060a08688031215611ca357600080fd5b611cac86611a21565b9450611cba60208701611a21565b93506040860135925060608601359150611cd660808701611a21565b90509295509295909350565b600060208284031215611cf457600080fd5b61146e82611a21565b60008060008060008060a08789031215611d1657600080fd5b863560028110611d2557600080fd5b9550611d3360208801611a21565b9450611d4160408801611a21565b93506060870135611d5181611a14565b9250608087013567ffffffffffffffff80821115611d6e57600080fd5b818901915089601f830112611d8257600080fd5b813581811115611d9157600080fd5b8a6020828501011115611da357600080fd5b6020830194508093505050509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600181811c90821680611dfc57607f821691505b60208210811415611e36577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600060028510611e4e57611e4e611db9565b5060f89390931b83527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b81166001850152911b16601582015260290190565b60008251611ea4818460208701611b7a565b9190910192915050565b60008060408385031215611ec157600080fd5b8251611ecc81611a14565b602084015190925067ffffffffffffffff811115611ee957600080fd5b8301601f81018513611efa57600080fd5b8051611f08611b4282611ad2565b818152866020838501011115611f1d57600080fd5b611f2e826020830160208601611b7a565b8093505050509250929050565b8281526040602082015260006117c56040830184611ba6565b600060208284031215611f6657600080fd5b5051919050565b600082821015611fa6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500390565b608081526000611fbe6080830187611ba6565b60208301959095525060408101929092526001600160a01b0316606090910152919050565b606081526000611ff66060830186611ba6565b60208301949094525060400152919050565b60a08152600061201b60a0830188611ba6565b60208301969096525060408101939093526001600160a01b03918216606084015216608090910152919050565b60808152600061205b6080830187611ba6565b6020830195909552506040810192909252606090910152919050565b60006006851061208957612089611db9565b84825260406020830152826040830152828460608401376000606084840101526060601f19601f8501168301019050949350505050565b6060815260006120d36060830186611ba6565b82810360208401526120e58186611ba6565b905082810360408401526120f98185611ba6565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006020828403121561217357600080fd5b8151801515811461149957600080fdfea26469706673582212208660e29c6608ac0da13cf734f66cf0e3026c446b3c37c797231e5bcdadf6929264736f6c63430008090033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806367b4264511610081578063b6aa515b1161005b578063b6aa515b146101dc578063c71f8f94146101ef578063f3b27bc31461020257600080fd5b806367b426451461018d5780636ccb2b01146101b657806381cc619b146101c957600080fd5b806337c03fb6116100b257806337c03fb6146101445780634aa066521461015957806353b609b51461017a57600080fd5b80630c340a24146100d95780632aa3e6c61461010f5780633254e7b114610124575b600080fd5b6000546100f2906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61012261011d366004611a3d565b61020a565b005b610137610132366004611afa565b610594565b6040516101069190611bd2565b61014c610639565b6040516101069190611be5565b61016c610167366004611c32565b61064a565b604051908152602001610106565b61016c610188366004611c32565b610862565b6100f261019b366004611c6e565b6004602052600090815260409020546001600160a01b031681565b61016c6101c4366004611c8b565b610a1d565b61016c6101d7366004611c8b565b610dc5565b6101226101ea366004611ce2565b61105d565b6101226101fd366004611cfd565b61114e565b610122611359565b6000546001600160a01b03620100009091041633146102705760405162461bcd60e51b815260206004820152600c60248201527f6e6f742d676f7665726e6f72000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60006004600084600581111561028857610288611db9565b600581111561029957610299611db9565b81526020810191909152604001600020546001600160a01b0316905080610370576102c5600283611459565b6103115760405162461bcd60e51b815260206004820152600f60248201527f65786368616e67652d65786973747300000000000000000000000000000000006044820152606401610267565b816004600085600581111561032857610328611db9565b600581111561033957610339611db9565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610540565b6001600160a01b03821661043757610389600282611477565b6103d55760405162461bcd60e51b815260206004820152601760248201527f65786368616e67652d646f65732d6e6f742d65786973740000000000000000006044820152606401610267565b600460008460058111156103eb576103eb611db9565b60058111156103fc576103fc611db9565b8152602081019190915260400160002080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610540565b610442600282611477565b61048e5760405162461bcd60e51b815260206004820152601760248201527f65786368616e67652d646f65732d6e6f742d65786973740000000000000000006044820152606401610267565b610499600283611459565b6104e55760405162461bcd60e51b815260206004820152600f60248201527f65786368616e67652d65786973747300000000000000000000000000000000006044820152606401610267565b81600460008560058111156104fc576104fc611db9565b600581111561050d5761050d611db9565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b816001600160a01b0316816001600160a01b031684600581111561056657610566611db9565b6040517fd368678e81cb4fa5855a3e8bc7c4df1cdfdc699b194e44bff3d1a4399ee6be1490600090a4505050565b8051602081830181018051600582529282019190930120915280546105b890611de8565b80601f01602080910402602001604051908101604052809291908181526020018280546105e490611de8565b80156106315780601f1061060657610100808354040283529160200191610631565b820191906000526020600020905b81548152906001019060200180831161061457829003601f168201915b505050505081565b6060610645600261148c565b905090565b60008060056000868660405160200161066593929190611e3c565b60408051601f198184030181529082905261067f91611e92565b9081526020016040518091039020805461069890611de8565b80601f01602080910402602001604051908101604052809291908181526020018280546106c490611de8565b80156107115780601f106106e657610100808354040283529160200191610711565b820191906000526020600020905b8154815290600101906020018083116106f457829003601f168201915b5050505050905060008151116107695760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b600080828060200190518101906107809190611eae565b915091506004600083600581111561079a5761079a611db9565b60058111156107ab576107ab611db9565b8152602081019190915260409081016000205490517ffee9574a0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fee9574a906108059088908590600401611f3b565b602060405180830381600087803b15801561081f57600080fd5b505af1158015610833573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108579190611f54565b979650505050505050565b60008060056001868660405160200161087d93929190611e3c565b60408051601f198184030181529082905261089791611e92565b908152602001604051809103902080546108b090611de8565b80601f01602080910402602001604051908101604052809291908181526020018280546108dc90611de8565b80156109295780601f106108fe57610100808354040283529160200191610929565b820191906000526020600020905b81548152906001019060200180831161090c57829003601f168201915b5050505050905060008151116109815760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b600080828060200190518101906109989190611eae565b91509150600460008360058111156109b2576109b2611db9565b60058111156109c3576109c3611db9565b8152602081019190915260409081016000205490517f2aa4a9e50000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690632aa4a9e5906108059088908590600401611f3b565b600080600560008888604051602001610a3893929190611e3c565b60408051601f1981840301815290829052610a5291611e92565b90815260200160405180910390208054610a6b90611de8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9790611de8565b8015610ae45780601f10610ab957610100808354040283529160200191610ae4565b820191906000526020600020905b815481529060010190602001808311610ac757829003601f168201915b505050505090506000815111610b3c5760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b60008082806020019051810190610b539190611eae565b91509150600060046000846005811115610b6f57610b6f611db9565b6005811115610b8057610b80611db9565b81526020810191909152604090810160009081205491517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201819052935090918c16906370a082319060240160206040518083038186803b158015610bf457600080fd5b505afa158015610c08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2c9190611f54565b9050610c436001600160a01b038c1633848c6114a0565b816001600160a01b0316634909c29a84838e6001600160a01b03166370a08231876040518263ffffffff1660e01b8152600401610c8f91906001600160a01b0391909116815260200190565b60206040518083038186803b158015610ca757600080fd5b505afa158015610cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdf9190611f54565b610ce99190611f6d565b8b8b6040518563ffffffff1660e01b8152600401610d0a9493929190611fab565b602060405180830381600087803b158015610d2457600080fd5b505af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611f54565b9550896001600160a01b03168b6001600160a01b0316836001600160a01b03167f332d883d1035df5d58d7a529e9dab834dbc4c3983a2d629a6424230ec1bf8c04868d8b604051610daf93929190611fe3565b60405180910390a4505050505095945050505050565b600080600560018888604051602001610de093929190611e3c565b60408051601f1981840301815290829052610dfa91611e92565b90815260200160405180910390208054610e1390611de8565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3f90611de8565b8015610e8c5780601f10610e6157610100808354040283529160200191610e8c565b820191906000526020600020905b815481529060010190602001808311610e6f57829003601f168201915b505050505090506000815111610ee45760405162461bcd60e51b815260206004820152601060248201527f6e6f2d726f7574696e672d666f756e64000000000000000000000000000000006044820152606401610267565b60008082806020019051810190610efb9190611eae565b91509150600060046000846005811115610f1757610f17611db9565b6005811115610f2857610f28611db9565b81526020810191909152604001600020546001600160a01b039081169150610f54908b1633838a6114a0565b6040517f9d9f384d0000000000000000000000000000000000000000000000000000000081526001600160a01b03821690639d9f384d90610fa19085908c908c9033908d90600401612008565b602060405180830381600087803b158015610fbb57600080fd5b505af1158015610fcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff39190611f54565b9450886001600160a01b03168a6001600160a01b0316826001600160a01b03167fe2b399ee44535cc98392f9d1d787f5c925873e04562dee99db8c1f781240c062858b8a8e6040516110489493929190612048565b60405180910390a45050505095945050505050565b6000546001600160a01b03620100009091041633146110be5760405162461bcd60e51b815260206004820152600c60248201527f6e6f742d676f7665726e6f7200000000000000000000000000000000000000006044820152606401610267565b6001600160a01b0381166111145760405162461bcd60e51b815260206004820152601960248201527f70726f706f7365642d676f7665726e6f722d69732d7a65726f000000000000006044820152606401610267565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000546001600160a01b03620100009091041633146111af5760405162461bcd60e51b815260206004820152600c60248201527f6e6f742d676f7665726e6f7200000000000000000000000000000000000000006044820152606401610267565b60008686866040516020016111c693929190611e3c565b604051602081830303815290604052905060006005826040516111e99190611e92565b9081526020016040518091039020805461120290611de8565b80601f016020809104026020016040519081016040528092919081815260200182805461122e90611de8565b801561127b5780601f106112505761010080835404028352916020019161127b565b820191906000526020600020905b81548152906001019060200180831161125e57829003601f168201915b50505050509050600085858560405160200161129993929190612077565b60408051601f198184030181529190529050836112df576005836040516112c09190611e92565b908152602001604051809103902060006112da919061193e565b611313565b806005846040516112f09190611e92565b9081526020016040518091039020908051906020019061131192919061197b565b505b7f69f079d2078c67fbbdee50f8233f472aed9a0ddc1deb4c04fa3ed59fdee4db30838383604051611346939291906120c0565b60405180910390a1505050505050505050565b6001546001600160a01b031633146113b35760405162461bcd60e51b815260206004820152601960248201527f6e6f742d7468652d70726f706f7365642d676f7665726e6f72000000000000006044820152606401610267565b600154600080546040516001600160a01b039384169362010000909204909116917fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d091a360018054600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166001600160a01b03831662010000021790557fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600061146e836001600160a01b03841661152e565b90505b92915050565b600061146e836001600160a01b03841661157d565b6060600061149983611670565b9392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526115289085906116cc565b50505050565b600081815260018301602052604081205461157557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611471565b506000611471565b600081815260018301602052604081205480156116665760006115a1600183611f6d565b85549091506000906115b590600190611f6d565b905081811461161a5760008660000182815481106115d5576115d5612103565b90600052602060002001549050808760000184815481106115f8576115f8612103565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061162b5761162b612132565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611471565b6000915050611471565b6060816000018054806020026020016040519081016040528092919081815260200182805480156116c057602002820191906000526020600020905b8154815260200190600101908083116116ac575b50505050509050919050565b6000611721826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117b69092919063ffffffff16565b8051909150156117b1578080602001905181019061173f9190612161565b6117b15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610267565b505050565b60606117c584846000856117cd565b949350505050565b6060824710156118455760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610267565b6001600160a01b0385163b61189c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610267565b600080866001600160a01b031685876040516118b89190611e92565b60006040518083038185875af1925050503d80600081146118f5576040519150601f19603f3d011682016040523d82523d6000602084013e6118fa565b606091505b509150915061085782828660608315611914575081611499565b8251156119245782518084602001fd5b8160405162461bcd60e51b81526004016102679190611bd2565b50805461194a90611de8565b6000825580601f1061195a575050565b601f01602090049060005260206000209081019061197891906119ff565b50565b82805461198790611de8565b90600052602060002090601f0160209004810192826119a957600085556119ef565b82601f106119c257805160ff19168380011785556119ef565b828001600101855582156119ef579182015b828111156119ef5782518255916020019190600101906119d4565b506119fb9291506119ff565b5090565b5b808211156119fb5760008155600101611a00565b6006811061197857600080fd5b80356001600160a01b0381168114611a3857600080fd5b919050565b60008060408385031215611a5057600080fd5b8235611a5b81611a14565b9150611a6960208401611a21565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611aca57611aca611a72565b604052919050565b600067ffffffffffffffff821115611aec57611aec611a72565b50601f01601f191660200190565b600060208284031215611b0c57600080fd5b813567ffffffffffffffff811115611b2357600080fd5b8201601f81018413611b3457600080fd5b8035611b47611b4282611ad2565b611aa1565b818152856020838501011115611b5c57600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b83811015611b95578181015183820152602001611b7d565b838111156115285750506000910152565b60008151808452611bbe816020860160208601611b7a565b601f01601f19169290920160200192915050565b60208152600061146e6020830184611ba6565b6020808252825182820181905260009190848201906040850190845b81811015611c265783516001600160a01b031683529284019291840191600101611c01565b50909695505050505050565b600080600060608486031215611c4757600080fd5b611c5084611a21565b9250611c5e60208501611a21565b9150604084013590509250925092565b600060208284031215611c8057600080fd5b813561149981611a14565b600080600080600060a08688031215611ca357600080fd5b611cac86611a21565b9450611cba60208701611a21565b93506040860135925060608601359150611cd660808701611a21565b90509295509295909350565b600060208284031215611cf457600080fd5b61146e82611a21565b60008060008060008060a08789031215611d1657600080fd5b863560028110611d2557600080fd5b9550611d3360208801611a21565b9450611d4160408801611a21565b93506060870135611d5181611a14565b9250608087013567ffffffffffffffff80821115611d6e57600080fd5b818901915089601f830112611d8257600080fd5b813581811115611d9157600080fd5b8a6020828501011115611da357600080fd5b6020830194508093505050509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600181811c90821680611dfc57607f821691505b60208210811415611e36577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600060028510611e4e57611e4e611db9565b5060f89390931b83527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606092831b81166001850152911b16601582015260290190565b60008251611ea4818460208701611b7a565b9190910192915050565b60008060408385031215611ec157600080fd5b8251611ecc81611a14565b602084015190925067ffffffffffffffff811115611ee957600080fd5b8301601f81018513611efa57600080fd5b8051611f08611b4282611ad2565b818152866020838501011115611f1d57600080fd5b611f2e826020830160208601611b7a565b8093505050509250929050565b8281526040602082015260006117c56040830184611ba6565b600060208284031215611f6657600080fd5b5051919050565b600082821015611fa6577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500390565b608081526000611fbe6080830187611ba6565b60208301959095525060408101929092526001600160a01b0316606090910152919050565b606081526000611ff66060830186611ba6565b60208301949094525060400152919050565b60a08152600061201b60a0830188611ba6565b60208301969096525060408101939093526001600160a01b03918216606084015216608090910152919050565b60808152600061205b6080830187611ba6565b6020830195909552506040810192909252606090910152919050565b60006006851061208957612089611db9565b84825260406020830152826040830152828460608401376000606084840101526060601f19601f8501168301019050949350505050565b6060815260006120d36060830186611ba6565b82810360208401526120e58186611ba6565b905082810360408401526120f98185611ba6565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006020828403121561217357600080fd5b8151801515811461149957600080fdfea26469706673582212208660e29c6608ac0da13cf734f66cf0e3026c446b3c37c797231e5bcdadf6929264736f6c63430008090033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.