Source Code
Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 20,983 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Execute Batch Ca... | 8125214 | 525 days ago | IN | 0.005 ETH | 0.00009952 | ||||
| Execute Batch Ca... | 7794045 | 536 days ago | IN | 0.011 ETH | 0.00009657 | ||||
| Execute Batch Ca... | 7422929 | 548 days ago | IN | 0.00484184 ETH | 0.00013654 | ||||
| Execute Batch Ca... | 7422510 | 548 days ago | IN | 0.011 ETH | 0.00013559 | ||||
| Execute Batch Ca... | 7255466 | 554 days ago | IN | 0.053 ETH | 0.00018846 | ||||
| Execute Batch Ca... | 7193668 | 556 days ago | IN | 0.05 ETH | 0.00009103 | ||||
| Execute Batch Ca... | 7193668 | 556 days ago | IN | 0.05 ETH | 0.00009396 | ||||
| Execute Batch Ca... | 7191398 | 556 days ago | IN | 0.07 ETH | 0.00009677 | ||||
| Execute Batch Ca... | 7183464 | 556 days ago | IN | 0.0187 ETH | 0.0001296 | ||||
| Execute Batch Ca... | 7173405 | 557 days ago | IN | 0.01 ETH | 0.00013478 | ||||
| Execute Batch Ca... | 7167045 | 557 days ago | IN | 0.1 ETH | 0.00105743 | ||||
| Execute Batch Ca... | 7166795 | 557 days ago | IN | 0.1086 ETH | 0.000096 | ||||
| Execute Batch Ca... | 7166536 | 557 days ago | IN | 0.005 ETH | 0.00017943 | ||||
| Execute Batch Ca... | 7166462 | 557 days ago | IN | 0.038 ETH | 0.00015565 | ||||
| Execute Batch Ca... | 7166331 | 557 days ago | IN | 0.02 ETH | 0.00014792 | ||||
| Execute Batch Ca... | 7166327 | 557 days ago | IN | 0.02 ETH | 0.00013458 | ||||
| Execute Batch Ca... | 7166314 | 557 days ago | IN | 0.1094 ETH | 0.00013302 | ||||
| Execute Batch Ca... | 7166180 | 557 days ago | IN | 0.1 ETH | 0.00009599 | ||||
| Execute Batch Ca... | 7166023 | 557 days ago | IN | 0.005 ETH | 0.0007581 | ||||
| Execute Batch Ca... | 7165999 | 557 days ago | IN | 0.01553 ETH | 0.00009903 | ||||
| Execute Batch Ca... | 7165962 | 557 days ago | IN | 0.014 ETH | 0.00009597 | ||||
| Execute Batch Ca... | 7165679 | 557 days ago | IN | 0.011 ETH | 0.00018051 | ||||
| Execute Batch Ca... | 7165663 | 557 days ago | IN | 0.064 ETH | 0.00013888 | ||||
| Execute Batch Ca... | 7165644 | 557 days ago | IN | 0.02055 ETH | 0.00013772 | ||||
| Execute Batch Ca... | 7165429 | 557 days ago | IN | 0.021 ETH | 0.00010096 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 8125214 | 525 days ago | 0.005 ETH | ||||
| 7794045 | 536 days ago | 0.011 ETH | ||||
| 7422929 | 548 days ago | 0.00484184 ETH | ||||
| 7422510 | 548 days ago | 0.011 ETH | ||||
| 7255466 | 554 days ago | 0.053 ETH | ||||
| 7193668 | 556 days ago | 0.05 ETH | ||||
| 7193668 | 556 days ago | 0.05 ETH | ||||
| 7191398 | 556 days ago | 0.07 ETH | ||||
| 7183464 | 556 days ago | 0.0187 ETH | ||||
| 7173405 | 557 days ago | 0.01 ETH | ||||
| 7167045 | 557 days ago | 0.1 ETH | ||||
| 7166795 | 557 days ago | 0.1086 ETH | ||||
| 7166536 | 557 days ago | 0.005 ETH | ||||
| 7166462 | 557 days ago | 0.038 ETH | ||||
| 7166331 | 557 days ago | 0.02 ETH | ||||
| 7166327 | 557 days ago | 0.02 ETH | ||||
| 7166314 | 557 days ago | 0.1094 ETH | ||||
| 7166180 | 557 days ago | 0.1 ETH | ||||
| 7166023 | 557 days ago | 0.005 ETH | ||||
| 7165999 | 557 days ago | 0.01553 ETH | ||||
| 7165962 | 557 days ago | 0.014 ETH | ||||
| 7165679 | 557 days ago | 0.011 ETH | ||||
| 7165663 | 557 days ago | 0.064 ETH | ||||
| 7165644 | 557 days ago | 0.02055 ETH | ||||
| 7165429 | 557 days ago | 0.021 ETH |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
BatchTransaction
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {ReentrancyGuard} from "@routerprotocol/intents-core/contracts/utils/ReentrancyGuard.sol";
import {Basic} from "@routerprotocol/intents-core/contracts/common/Basic.sol";
import {CallLib} from "@routerprotocol/intents-core/contracts/utils/CallLib.sol";
import {IERC20, SafeERC20} from "@routerprotocol/intents-core/contracts/utils/SafeERC20.sol";
import {Errors} from "@routerprotocol/intents-core/contracts/utils/Errors.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {EoaExecutorWithDataProvider, EoaExecutorWithoutDataProvider} from "@routerprotocol/intents-core/contracts/RouterIntentEoaAdapter.sol";
import {BaseAdapter} from "@routerprotocol/intents-core/contracts/BaseAdapter.sol";
/**
* @title BatchTransaction
* @author Shivam Agrawal
* @notice Batch Transaction Contract for EOAs.
*/
contract BatchTransaction is Basic, AccessControl, ReentrancyGuard {
using SafeERC20 for IERC20;
struct RefundData {
address[] tokens;
}
bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE");
address private immutable _native;
address private immutable _wnative;
address private _assetForwarder;
address private _dexspan;
// user -> token array
mapping(address => RefundData) private tokensToRefund;
mapping(address => bool) private adapterWhitelist;
event OperationFailedRefundEvent(
address token,
address recipient,
uint256 amount
);
event OperationSuccessful();
event Executed(uint256 appId);
constructor(
address __native,
address __wnative,
address __assetForwarder,
address __dexspan
) {
_native = __native;
_wnative = __wnative;
_assetForwarder = __assetForwarder;
_dexspan = __dexspan;
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(SETTER_ROLE, msg.sender);
}
/**
* @notice function to return the address of WNative token.
*/
function wnative() public view virtual override returns (address) {
return _wnative;
}
/**
* @notice function to return the address of Native token.
*/
function native() public view virtual override returns (address) {
return _native;
}
/**
* @notice function to return the address of Dexspan.
*/
function dexspan() public view virtual returns (address) {
return _dexspan;
}
/**
* @notice function to return the address of AssetForwarder.
*/
function assetForwarder() public view virtual returns (address) {
return _assetForwarder;
}
/**
* @notice function to check whether an adapter is whitelisted.
* @param adapter Address of the adapter.
*/
function isAdapterWhitelisted(address adapter) public view returns (bool) {
return adapterWhitelist[adapter];
}
/**
* @notice function to set dexspan address.
* @param __dexspan Address of the dexspan.
*/
function setDexspan(address __dexspan) external onlyRole(SETTER_ROLE) {
_dexspan = __dexspan;
}
/**
* @notice function to set assetForwarder address.
* @param __assetForwarder Address of the assetForwarder.
*/
function setAssetForwarder(
address __assetForwarder
) external onlyRole(SETTER_ROLE) {
_assetForwarder = __assetForwarder;
}
/**
* @notice function to set adapter whitelist.
* @param adapters Addresses of the adapters.
* @param shouldWhitelist Boolean array suggesting whether to whitelist the adapters.
*/
function setAdapterWhitelist(
address[] memory adapters,
bool[] memory shouldWhitelist
) external onlyRole(SETTER_ROLE) {
uint256 len = adapters.length;
require(
len != 0 && len == shouldWhitelist.length,
Errors.ARRAY_LENGTH_MISMATCH
);
for (uint i = 0; i < len; ) {
adapterWhitelist[adapters[i]] = shouldWhitelist[i];
unchecked {
++i;
}
}
}
/**
* @dev function to execute batch calls on the same chain
* @param appId Application Id
* @param tokens Addresses of the tokens to fetch from the user
* @param amounts amounts of the tokens to fetch from the user
* @param target Addresses of the contracts to call
* @param value Amounts of native tokens to send along with the transactions
* @param callType Type of call. 1: call, 2: delegatecall
* @param data Data of the transactions
*/
function executeBatchCallsSameChain(
uint256 appId,
address[] calldata tokens,
uint256[] calldata amounts,
address[] calldata target,
uint256[] calldata value,
uint256[] calldata callType,
bytes[] calldata data
) external payable {
uint256 tokensLength = tokens.length;
require(tokensLength == amounts.length, Errors.ARRAY_LENGTH_MISMATCH);
uint256 totalValue = 0;
for (uint256 i = 0; i < tokensLength; ) {
totalValue += _pullTokens(tokens[i], amounts[i]);
tokensToRefund[msg.sender].tokens.push(tokens[i]);
unchecked {
++i;
}
}
require(
msg.value >= totalValue,
Errors.INSUFFICIENT_NATIVE_FUNDS_PASSED
);
for (uint256 i = 0; i < callType.length; ) {
// callType can be either 1 or 2
require(callType[i] < 3, Errors.INVALID_CALL_TYPE);
unchecked {
++i;
}
}
_executeBatchCalls(appId, msg.sender, target, value, callType, data);
}
/**
* @dev function to execute batch calls
* @param appId Application Id
* @param refundRecipient Address of recipient of refunds of dust at the end
* @param target Addresses of the contracts to call
* @param value Amounts of native tokens to send along with the transactions
* @param data Data of the transactions
* @param callType Type of call. 1: call, 2: delegatecall
*/
function executeBatchCallsDestChain(
uint256 appId,
address refundRecipient,
address[] calldata target,
uint256[] calldata value,
uint256[] calldata callType,
bytes[] calldata data
) external payable {
require(msg.sender == address(this), Errors.ONLY_SELF);
_executeBatchCalls(
appId,
refundRecipient,
target,
value,
callType,
data
);
}
/**
* @dev function to execute batch calls
* @param appId Application Id
* @param target Addresses of the contracts to call
* @param value Amounts of native tokens to send along with the transactions
* @param data Data of the transactions
* @param callType Type of call. 1: call, 2: delegatecall
*/
function _executeBatchCalls(
uint256 appId,
address refundRecipient,
address[] calldata target,
uint256[] calldata value,
uint256[] calldata callType,
bytes[] calldata data
) internal {
uint256 targetLength = target.length;
require(
targetLength != 0 &&
targetLength == value.length &&
value.length == data.length &&
data.length == callType.length,
Errors.WRONG_BATCH_PROVIDED
);
if (target.length == 1) {
_execute(
refundRecipient,
target[0],
address(0),
address(0),
value[0],
callType[0],
data[0]
);
} else {
_execute(
refundRecipient,
target[0],
address(0),
target[1],
value[0],
callType[0],
data[0]
);
for (uint256 i = 1; i < targetLength; ) {
if (i != targetLength - 1) {
_execute(
refundRecipient,
target[i],
target[i - 1],
target[i + 1],
value[i],
callType[i],
data[i]
);
} else {
_execute(
refundRecipient,
target[i],
target[i - 1],
address(0),
value[i],
callType[i],
data[i]
);
}
unchecked {
++i;
}
}
}
processRefunds(refundRecipient);
emit Executed(appId);
}
function _pullTokens(
address token,
uint256 amount
) internal returns (uint256) {
uint256 totalValue = 0;
if (token == native()) {
totalValue += amount;
} else {
IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
}
return totalValue;
}
function _execute(
address refundRecipient,
address target,
address precedingAdapter,
address succeedingAdapter,
uint256 value,
uint256 callType,
bytes memory data
) internal {
require(adapterWhitelist[target], Errors.ADAPTER_NOT_WHITELISTED);
bytes memory _calldata;
if (address(BaseAdapter(target).adapterDataProvider()) == address(0)) {
_calldata = abi.encodeWithSelector(
EoaExecutorWithoutDataProvider.execute.selector,
data
);
} else {
_calldata = abi.encodeWithSelector(
EoaExecutorWithDataProvider.execute.selector,
precedingAdapter,
succeedingAdapter,
data
);
}
bytes memory result;
if (callType == 1) result = CallLib._call(target, value, _calldata);
else if (callType == 2)
result = CallLib._delegateCall(target, _calldata);
if (result.length != 0) processResult(refundRecipient, result);
}
function processResult(address user, bytes memory data) internal {
address[] memory tokens = abi.decode(data, (address[]));
for (uint256 i = 0; i < tokens.length; ) {
tokensToRefund[user].tokens.push(tokens[i]);
unchecked {
++i;
}
}
}
function processRefunds(address user) internal {
uint256 len = tokensToRefund[user].tokens.length;
for (uint256 i = 0; i < len; ) {
withdrawTokens(
tokensToRefund[user].tokens[i],
user,
type(uint256).max
);
unchecked {
++i;
}
}
delete tokensToRefund[user];
}
function handleMessage(
address tokenSent,
uint256 amount,
bytes memory instruction
) external onlyNitro nonReentrant {
(
uint256 appId,
address refundAddress,
address[] memory target,
uint256[] memory value,
uint256[] memory callType,
bytes[] memory data
) = abi.decode(
instruction,
(uint256, address, address[], uint256[], uint256[], bytes[])
);
for (uint256 i = 0; i < callType.length; ) {
if (callType[i] > 2) {
withdrawTokens(tokenSent, refundAddress, amount);
emit OperationFailedRefundEvent(
tokenSent,
refundAddress,
amount
);
return;
}
unchecked {
++i;
}
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, ) = address(this).call(
abi.encodeWithSelector(
this.executeBatchCallsDestChain.selector,
appId,
refundAddress,
target,
value,
callType,
data
)
);
if (success) {
emit OperationSuccessful();
} else {
withdrawTokens(tokenSent, refundAddress, amount);
emit OperationFailedRefundEvent(tokenSent, refundAddress, amount);
}
}
// solhint-disable-next-line no-empty-blocks
receive() external payable {}
function adminWithdrawFunds(
address _token,
address _recipient,
uint256 _amount
) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_token == native()) {
if (_amount == type(uint256).max) _amount = address(this).balance;
(bool success, ) = _recipient.call{value: _amount}("");
if (!success) revert("Transfer failed");
} else {
if (_amount == type(uint256).max)
_amount = IERC20(_token).balanceOf(address(this));
IERC20(_token).transfer(_recipient, _amount);
}
}
/**
* @notice modifier to ensure that only Nitro bridge can call handleMessage function
*/
modifier onlyNitro() {
_onlyNitro();
_;
}
function _onlyNitro() private view {
require(
msg.sender == _assetForwarder || msg.sender == _dexspan,
Errors.ONLY_NITRO
);
}
}// 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 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 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.18;
import {IAdapterDataProvider} from "./interfaces/IAdapterDataProvider.sol";
/**
* @title AdapterDataProvider
* @author Router Protocol
* @notice This contract serves as the data provider for an intent adapter based on Router
* Cross-Chain Intent Framework.
*/
contract AdapterDataProvider is IAdapterDataProvider {
address private _owner;
mapping(address => bool) private _headRegistry;
mapping(address => bool) private _tailRegistry;
mapping(address => bool) private _inboundAssetRegistry;
mapping(address => bool) private _outboundAssetRegistry;
constructor(address __owner) {
_owner = __owner;
}
/**
* @inheritdoc IAdapterDataProvider
*/
function owner() external view returns (address) {
return _owner;
}
/**
* @inheritdoc IAdapterDataProvider
*/
function setOwner(address __owner) external onlyOwner {
_owner = __owner;
}
/**
* @inheritdoc IAdapterDataProvider
*/
function isAuthorizedPrecedingContract(
address precedingContract
) external view returns (bool) {
if (precedingContract == address(0)) return true;
return _headRegistry[precedingContract];
}
/**
* @inheritdoc IAdapterDataProvider
*/
function isAuthorizedSucceedingContract(
address succeedingContract
) external view returns (bool) {
if (succeedingContract == address(0)) return true;
return _tailRegistry[succeedingContract];
}
/**
* @inheritdoc IAdapterDataProvider
*/
function isValidInboundAsset(address asset) external view returns (bool) {
return _inboundAssetRegistry[asset];
}
/**
* @inheritdoc IAdapterDataProvider
*/
function isValidOutboundAsset(address asset) external view returns (bool) {
return _outboundAssetRegistry[asset];
}
/**
* @inheritdoc IAdapterDataProvider
*/
function setPrecedingContract(
address precedingContract,
bool isValid
) external onlyOwner {
_headRegistry[precedingContract] = isValid;
}
/**
* @inheritdoc IAdapterDataProvider
*/
function setSucceedingContract(
address succeedingContract,
bool isValid
) external onlyOwner {
_tailRegistry[succeedingContract] = isValid;
}
/**
* @inheritdoc IAdapterDataProvider
*/
function setInboundAsset(address asset, bool isValid) external onlyOwner {
_inboundAssetRegistry[asset] = isValid;
}
/**
* @inheritdoc IAdapterDataProvider
*/
function setOutboundAsset(address asset, bool isValid) external onlyOwner {
_outboundAssetRegistry[asset] = isValid;
}
/**
* @notice modifier to ensure that only owner can call this function
*/
modifier onlyOwner() {
_onlyOwner();
_;
}
function _onlyOwner() private view {
require(msg.sender == _owner, "Only owner");
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Basic} from "./common/Basic.sol";
import {Errors} from "./utils/Errors.sol";
import {ReentrancyGuard} from "./utils/ReentrancyGuard.sol";
import {AdapterDataProvider} from "./AdapterDataProvider.sol";
/**
* @title BaseAdapter
* @author Router Protocol
* @notice This contract is the base implementation of an intent adapter based on Router
* Cross-Chain Intent Framework.
*/
abstract contract BaseAdapter is Basic, ReentrancyGuard {
address private immutable _self;
address private immutable _native;
address private immutable _wnative;
AdapterDataProvider private immutable _adapterDataProvider;
event ExecutionEvent(string indexed adapterName, bytes data);
event OperationFailedRefundEvent(
address token,
address recipient,
uint256 amount
);
event UnsupportedOperation(
address token,
address refundAddress,
uint256 amount
);
constructor(
address __native,
address __wnative,
bool __deployDataProvider,
address __owner
) {
_self = address(this);
_native = __native;
_wnative = __wnative;
AdapterDataProvider dataProvider;
if (__deployDataProvider)
dataProvider = new AdapterDataProvider(__owner);
else dataProvider = AdapterDataProvider(address(0));
_adapterDataProvider = dataProvider;
}
/**
* @dev function to get the address of weth
*/
function wnative() public view override returns (address) {
return _wnative;
}
/**
* @dev function to get the address of native token
*/
function native() public view override returns (address) {
return _native;
}
/**
* @dev function to get the AdapterDataProvider instance for this contract
*/
function adapterDataProvider() public view returns (AdapterDataProvider) {
return _adapterDataProvider;
}
/**
* @dev Function to check whether the contract is a valid preceding contract registered in
* the head registry.
* @dev This registry governs the initiation of the adapter, exclusively listing authorized
* preceding adapters.
* @notice Only the adapters documented in this registry can invoke the current adapter,
* thereby guaranteeing regulated and secure execution sequences.
* @param precedingContract Address of preceding contract.
* @return true if valid, false if invalid.
*/
function isAuthorizedPrecedingContract(
address precedingContract
) public view returns (bool) {
return
_adapterDataProvider.isAuthorizedPrecedingContract(
precedingContract
);
}
/**
* @dev Function to check whether the contract is a valid succeeding contract registered in
* the tail registry.
* @dev This registry dictates the potential succeeding actions by listing adapters that
* may be invoked following the current one.
* @notice Only the adapters documented in this registry can be invoked by the current adapter,
* thereby guaranteeing regulated and secure execution sequences.
* @param succeedingContract Address of succeeding contract.
* @return true if valid, false if invalid.
*/
function isAuthorizedSucceedingContract(
address succeedingContract
) public view returns (bool) {
return
_adapterDataProvider.isAuthorizedSucceedingContract(
succeedingContract
);
}
/**
* @dev Function to check whether the asset is a valid inbound asset registered in the inbound
* asset registry.
* @dev This registry keeps track of all the acceptable incoming assets, ensuring that the
* adapter only processes predefined asset types.
* @param asset Address of the asset.
* @return true if valid, false if invalid.
*/
function isValidInboundAsset(address asset) public view returns (bool) {
return _adapterDataProvider.isValidInboundAsset(asset);
}
/**
* @dev Function to check whether the asset is a valid outbound asset registered in the outbound
* asset registry.
* @dev It manages the types of assets that the adapter is allowed to output, thus controlling
* the flow’s output and maintaining consistency.
* @param asset Address of the asset.
* @return true if valid, false if invalid.
*/
function isValidOutboundAsset(address asset) public view returns (bool) {
return _adapterDataProvider.isValidOutboundAsset(asset);
}
/**
* @dev function to get the name of the adapter
*/
function name() public view virtual returns (string memory);
/**
* @dev function to get the address of the contract
*/
function self() public view returns (address) {
return _self;
}
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {TokenInterface} from "./Interfaces.sol";
import {TokenUtilsBase} from "./TokenUtilsBase.sol";
abstract contract Basic is TokenUtilsBase {
function getTokenBal(address token) internal view returns (uint _amt) {
_amt = address(token) == native()
? address(this).balance
: TokenInterface(token).balanceOf(address(this));
}
function approve(address token, address spender, uint256 amount) internal {
// solhint-disable-next-line no-empty-blocks
try TokenInterface(token).approve(spender, amount) {} catch {
TokenInterface(token).approve(spender, 0);
TokenInterface(token).approve(spender, amount);
}
}
function convertNativeToWnative(uint amount) internal {
TokenInterface(wnative()).deposit{value: amount}();
}
function convertWnativeToNative(uint amount) internal {
TokenInterface(wnative()).withdraw(amount);
}
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
interface TokenInterface {
function approve(address, uint256) external;
function transfer(address, uint) external;
function transferFrom(address, address, uint) external;
function deposit() external payable;
function withdraw(uint) external;
function balanceOf(address) external view returns (uint);
function decimals() external view returns (uint);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {IWETH} from "../interfaces/IWETH.sol";
import {SafeERC20, IERC20} from "../utils/SafeERC20.sol";
abstract contract TokenUtilsBase {
using SafeERC20 for IERC20;
function wnative() public view virtual returns (address);
function native() public view virtual returns (address);
function approveToken(
address _tokenAddr,
address _to,
uint256 _amount
) internal {
if (_tokenAddr == native()) return;
if (IERC20(_tokenAddr).allowance(address(this), _to) < _amount) {
IERC20(_tokenAddr).safeApprove(_to, _amount);
}
}
function pullTokensIfNeeded(
address _token,
address _from,
uint256 _amount
) internal returns (uint256) {
// handle max uint amount
if (_amount == type(uint256).max) {
_amount = getBalance(_token, _from);
}
if (
_from != address(0) &&
_from != address(this) &&
_token != native() &&
_amount != 0
) {
IERC20(_token).safeTransferFrom(_from, address(this), _amount);
}
return _amount;
}
function withdrawTokens(
address _token,
address _to,
uint256 _amount
) internal returns (uint256) {
if (_amount == type(uint256).max) {
_amount = getBalance(_token, address(this));
}
if (_to != address(0) && _to != address(this) && _amount != 0) {
if (_token != native()) {
IERC20(_token).safeTransfer(_to, _amount);
} else {
(bool success, ) = _to.call{value: _amount}("");
require(success, "native send fail");
}
}
return _amount;
}
function depositWnative(uint256 _amount) internal {
IWETH(wnative()).deposit{value: _amount}();
}
function withdrawWnative(uint256 _amount) internal {
IWETH(wnative()).withdraw(_amount);
}
function getBalance(
address _tokenAddr,
address _acc
) internal view returns (uint256) {
if (_tokenAddr == native()) {
return _acc.balance;
} else {
return IERC20(_tokenAddr).balanceOf(_acc);
}
}
function getTokenDecimals(address _token) internal view returns (uint256) {
if (_token == native()) return 18;
return IERC20(_token).decimals();
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
/**
* @title Interface for Adapter Data Provider contract for intent adapter.
* @author Router Protocol.
*/
interface IAdapterDataProvider {
/**
* @dev Function to get the address of owner.
*/
function owner() external view returns (address);
/**
* @dev Function to set the address of owner.
* @dev This function can only be called by the owner of this contract.
* @param __owner Address of the new owner
*/
function setOwner(address __owner) external;
/**
* @dev Function to check whether the contract is a valid preceding contract registered in
* the head registry.
* @dev This registry governs the initiation of the adapter, exclusively listing authorized
* preceding adapters.
* @notice Only the adapters documented in this registry can invoke the current adapter,
* thereby guaranteeing regulated and secure execution sequences.
* @param precedingContract Address of preceding contract.
* @return true if valid, false if invalid.
*/
function isAuthorizedPrecedingContract(
address precedingContract
) external view returns (bool);
/**
* @dev Function to check whether the contract is a valid succeeding contract registered in
* the tail registry.
* @dev This registry dictates the potential succeeding actions by listing adapters that
* may be invoked following the current one.
* @notice Only the adapters documented in this registry can be invoked by the current adapter,
* thereby guaranteeing regulated and secure execution sequences.
* @param succeedingContract Address of succeeding contract.
* @return true if valid, false if invalid.
*/
function isAuthorizedSucceedingContract(
address succeedingContract
) external view returns (bool);
/**
* @dev Function to check whether the asset is a valid inbound asset registered in the inbound
* asset registry.
* @dev This registry keeps track of all the acceptable incoming assets, ensuring that the
* adapter only processes predefined asset types.
* @param asset Address of the asset.
* @return true if valid, false if invalid.
*/
function isValidInboundAsset(address asset) external view returns (bool);
/**
* @dev Function to check whether the asset is a valid outbound asset registered in the outbound
* asset registry.
* @dev It manages the types of assets that the adapter is allowed to output, thus controlling
* the flow’s output and maintaining consistency.
* @param asset Address of the asset.
* @return true if valid, false if invalid.
*/
function isValidOutboundAsset(address asset) external view returns (bool);
/**
* @dev Function to set preceding contract (head registry) for the adapter.
* @dev This registry governs the initiation of the adapter, exclusively listing authorized
* preceding adapters.
* @notice Only the adapters documented in this registry can invoke the current adapter,
* thereby guaranteeing regulated and secure execution sequences.
* @param precedingContract Address of preceding contract.
* @param isValid Boolean value suggesting if this is a valid preceding contract.
*/
function setPrecedingContract(
address precedingContract,
bool isValid
) external;
/**
* @dev Function to set succeeding contract (tail registry) for the adapter.
* @dev This registry dictates the potential succeeding actions by listing adapters that
* may be invoked following the current one.
* @notice Only the adapters documented in this registry can be invoked by the current adapter,
* thereby guaranteeing regulated and secure execution sequences.
* @param succeedingContract Address of succeeding contract.
* @param isValid Boolean value suggesting if this is a valid succeeding contract.
*/
function setSucceedingContract(
address succeedingContract,
bool isValid
) external;
/**
* @dev Function to set inbound asset registry for the adapter.
* @dev This registry keeps track of all the acceptable incoming assets, ensuring that the
* adapter only processes predefined asset types.
* @param asset Address of the asset.
* @param isValid Boolean value suggesting if this is a valid inbound asset.
*/
function setInboundAsset(address asset, bool isValid) external;
/**
* @dev Function to set outbound asset registry for the adapter.
* @dev It manages the types of assets that the adapter is allowed to output, thus controlling
* the flow’s output and maintaining consistency.
* @param asset Address of the asset.
* @param isValid Boolean value suggesting if this is a valid inbound asset.
*/
function setOutboundAsset(address asset, bool isValid) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(
address _to,
uint256 _value
) external returns (bool success);
function transferFrom(
address _from,
address _to,
uint256 _value
) external returns (bool success);
function approve(
address _spender,
uint256 _value
) external returns (bool success);
function allowance(
address _owner,
address _spender
) external view returns (uint256 remaining);
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _value
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {IERC20} from "../utils/SafeERC20.sol";
abstract contract IWETH {
function allowance(address, address) public view virtual returns (uint256);
function balanceOf(address) public view virtual returns (uint256);
function approve(address, uint256) public virtual;
function transfer(address, uint256) public virtual returns (bool);
function transferFrom(
address,
address,
uint256
) public virtual returns (bool);
function deposit() public payable virtual;
function withdraw(uint256) public virtual;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {BaseAdapter} from "./BaseAdapter.sol";
import {EoaExecutorWithDataProvider, EoaExecutorWithoutDataProvider} from "./utils/EoaExecutor.sol";
abstract contract RouterIntentEoaAdapterWithDataProvider is
BaseAdapter,
EoaExecutorWithDataProvider
{
constructor(
address __native,
address __wnative,
address __owner
)
BaseAdapter(__native, __wnative, true, __owner)
// solhint-disable-next-line no-empty-blocks
{
}
}
abstract contract RouterIntentEoaAdapterWithoutDataProvider is
BaseAdapter,
EoaExecutorWithoutDataProvider
{
constructor(
address __native,
address __wnative
)
BaseAdapter(__native, __wnative, false, address(0))
// solhint-disable-next-line no-empty-blocks
{
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
library Address {
//insufficient balance
error InsufficientBalance(uint256 available, uint256 required);
//unable to send value, recipient may have reverted
error SendingValueFail();
//insufficient balance for call
error InsufficientBalanceForCall(uint256 available, uint256 required);
//call to non-contract
error NonContractCall();
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly {
codehash := extcodehash(account)
}
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
uint256 balance = address(this).balance;
if (balance < amount) {
revert InsufficientBalance(balance, amount);
}
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
if (!(success)) {
revert SendingValueFail();
}
}
function functionCall(
address target,
bytes memory data
) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
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"
);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
uint256 balance = address(this).balance;
if (balance < value) {
revert InsufficientBalanceForCall(balance, value);
}
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
if (!(isContract(target))) {
revert NonContractCall();
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(
data
);
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
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
library CallLib {
/**
* @dev internal method that fecilitates the extenral calls from SmartAccount
* @dev similar to execute() of Executor.sol
* @param target destination address contract/non-contract
* @param value amount of native tokens
* @param data function singature of destination
*/
function _call(
address target,
uint256 value,
bytes memory data
) internal returns (bytes memory result) {
// solhint-disable-next-line no-inline-assembly
assembly {
let success := call(
gas(),
target,
value,
add(data, 0x20),
mload(data),
0,
0
)
// Get the size of the returned data
let size := returndatasize()
// Allocate memory for the return data
result := mload(0x40)
// Set the length of the return data
mstore(result, size)
// Copy the return data to the allocated memory
returndatacopy(add(result, 0x20), 0, size)
// Update the free memory pointer
mstore(0x40, add(result, add(0x20, size)))
if iszero(success) {
revert(result, returndatasize())
}
}
}
/**
* @dev internal method that fecilitates the extenral calls from SmartAccount
* @dev similar to execute() of Executor.sol
* @param target destination address contract/non-contract
* @param data function singature of destination
*/
function _delegateCall(
address target,
bytes memory data
) internal returns (bytes memory result) {
require(target != address(this), "delegatecall to self");
// solhint-disable-next-line no-inline-assembly
assembly {
// Perform delegatecall to the target contract
let success := delegatecall(
gas(),
target,
add(data, 0x20),
mload(data),
0,
0
)
// Get the size of the returned data
let size := returndatasize()
// Allocate memory for the return data
result := mload(0x40)
// Set the length of the return data
mstore(result, size)
// Copy the return data to the allocated memory
returndatacopy(add(result, 0x20), 0, size)
// Update the free memory pointer
mstore(0x40, add(result, add(0x20, size)))
if iszero(success) {
revert(result, returndatasize())
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
abstract contract EoaExecutorWithDataProvider {
/**
* @dev function to execute an action on an adapter used in an EOA.
* @param precedingAdapter Address of the preceding adapter.
* @param succeedingAdapter Address of the succeeding adapter.
* @param data inputs data.
* @return tokens to be refunded to user at the end of tx.
*/
function execute(
address precedingAdapter,
address succeedingAdapter,
bytes calldata data
) external payable virtual returns (address[] memory tokens);
}
abstract contract EoaExecutorWithoutDataProvider {
/**
* @dev function to execute an action on an adapter used in an EOA.
* @param data inputs data.
* @return tokens to be refunded to user at the end of tx.
*/
function execute(
bytes calldata data
) external payable virtual returns (address[] memory tokens);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.18;
/**
* @title Errors library
* @author Router Intents Error
* @notice Defines the error messages emitted by the contracts on Router Intents
*/
library Errors {
string public constant ARRAY_LENGTH_MISMATCH = "1"; // 'Array lengths mismatch'
string public constant INSUFFICIENT_NATIVE_FUNDS_PASSED = "2"; // 'Insufficient native tokens passed'
string public constant WRONG_BATCH_PROVIDED = "3"; // 'The targetLength, valueLength, callTypeLength, funcLength do not match in executeBatch transaction functions in batch transaction contract'
string public constant INVALID_CALL_TYPE = "4"; // 'The callType value can only be 1 (call)' and 2(delegatecall)'
string public constant ONLY_NITRO = "5"; // 'Only nitro can call this function'
string public constant ONLY_SELF = "6"; // 'Only the current contract can call this function'
string public constant ADAPTER_NOT_WHITELISTED = "7"; // 'Adapter not whitelisted'
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
error ReentrantCall();
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
if (_status == _ENTERED) {
revert ReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {IERC20} from "../interfaces/IERC20.sol";
import {Address} from "./Address.sol";
import {SafeMath} from "./SafeMath.sol";
library SafeERC20 {
using SafeMath for uint256;
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 Edited so it always first approves 0 and then the value, because of non standard tokens
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.approve.selector, spender, 0)
);
_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).add(
value
);
_callOptionalReturn(
token,
abi.encodeWithSelector(
token.approve.selector,
spender,
newAllowance
)
);
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(
value,
"SafeERC20: decreased allowance below zero"
);
_callOptionalReturn(
token,
abi.encodeWithSelector(
token.approve.selector,
spender,
newAllowance
)
);
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(
data,
"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: operation failed"
);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: mul overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}{
"optimizer": {
"enabled": true,
"runs": 1000000
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"__native","type":"address"},{"internalType":"address","name":"__wnative","type":"address"},{"internalType":"address","name":"__assetForwarder","type":"address"},{"internalType":"address","name":"__dexspan","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NonContractCall","type":"error"},{"inputs":[],"name":"ReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"appId","type":"uint256"}],"name":"Executed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"OperationFailedRefundEvent","type":"event"},{"anonymous":false,"inputs":[],"name":"OperationSuccessful","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"adminWithdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"assetForwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dexspan","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"appId","type":"uint256"},{"internalType":"address","name":"refundRecipient","type":"address"},{"internalType":"address[]","name":"target","type":"address[]"},{"internalType":"uint256[]","name":"value","type":"uint256[]"},{"internalType":"uint256[]","name":"callType","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"executeBatchCallsDestChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"appId","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address[]","name":"target","type":"address[]"},{"internalType":"uint256[]","name":"value","type":"uint256[]"},{"internalType":"uint256[]","name":"callType","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"executeBatchCallsSameChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"address","name":"tokenSent","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"instruction","type":"bytes"}],"name":"handleMessage","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":"adapter","type":"address"}],"name":"isAdapterWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"native","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"adapters","type":"address[]"},{"internalType":"bool[]","name":"shouldWhitelist","type":"bool[]"}],"name":"setAdapterWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"__assetForwarder","type":"address"}],"name":"setAssetForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"__dexspan","type":"address"}],"name":"setDexspan","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":[],"name":"wnative","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60c034620001c157601f6200346338819003918201601f191683019291906001600160401b03841183851017620001c6578160809284926040968752833981010312620001c1576200005181620001dc565b9060209162000062838301620001dc565b6200007d606062000075878601620001dc565b9401620001dc565b916001805560805260a05260018060a01b03908160018060a01b03199316836002541617600255169060035416176003556000808052808252828120338252825260ff83822054161562000189575b7f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda91828252818152838220338352815260ff8483205416156200014e575b83516132519081620001f28239608051818181610375015281816107eb01528181611f0101528181612ab301528181612c120152612cb5015260a051816104e50152f35b8282528181528382209033835252828120600160ff19825416179055339160008051602062003443833981519152339280a43880806200010a565b8080528082528281203382528252828120600160ff19825416179055333382600080516020620034438339815191528180a4620000cc565b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001c15756fe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806301ffc9a71461015b57806303fe21731461015657806311b0b42d1461015157806318137a411461014c578063248a9ca3146101475780632cebdeb2146101425780632f2ff15d1461013d57806336568abe146101385780636cec044b1461013357806375ea1c921461012e5780637fe689171461012957806391d1485414610124578063963276f31461011f578063a2011b3f1461011a578063a217fddf14610115578063c5962f2614610110578063d00a2d5f1461010b578063d547741f14610106578063dfd7cb06146101015763f6f38e7c0361000e57611086565b610fbc565b610ed2565b610da8565b610c1f565b610be5565b610b8c565b610ad9565b610a57565b610a05565b61077c565b61072a565b610642565b610509565b61049a565b61044d565b6103c6565b61032a565b610250565b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361021a57807f7965db0b00000000000000000000000000000000000000000000000000000000602092149081156101f0575b506040519015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014386101e5565b600080fd5b9181601f8401121561021a5782359167ffffffffffffffff831161021a576020808501948460051b01011161021a57565b60e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5767ffffffffffffffff60243581811161021a5761029c6004913690830161021f565b60449291923584811161021a576102b6903690840161021f565b60649291923586811161021a576102d0903690860161021f565b60849291923588811161021a576102ea903690880161021f565b93909260a4358a811161021a576103049036908a0161021f565b97909660c4359b8c1161021a576103216100199c36908c0161021f565b9b909a35611a1b565b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b73ffffffffffffffffffffffffffffffffffffffff81160361021a57565b602435906103c482610399565b565b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5773ffffffffffffffffffffffffffffffffffffffff60043561041681610399565b61041e6110f4565b167fffffffffffffffffffffffff00000000000000000000000000000000000000006002541617600255600080f35b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760043560005260006020526020600160406000200154604051908152f35b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760043560243561054781610399565b600091808352826020526105616001604085200154611388565b8083528260205260ff61059783604086209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5416156105a2578280f35b808352826020526105d682604085209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905573ffffffffffffffffffffffffffffffffffffffff339216907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8480a438808280f35b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760243561067d81610399565b3373ffffffffffffffffffffffffffffffffffffffff8216036106a657610019906004356114ec565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b3461021a5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a576004356107b781610399565b6024356107c381610399565b604435906107cf6112bc565b8173ffffffffffffffffffffffffffffffffffffffff809416937f00000000000000000000000000000000000000000000000000000000000000001684146000146108c457506000809350828193927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8394146108bc575b5af1610851612096565b501561085957005b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606490fd5b0390fd5b479150610847565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610981575b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481019190915290602090829081600081604481015b03925af1801561097c5761095557005b6100199060203d8111610975575b61096d8183610cf6565b810190611fa9565b503d610963565b6121e4565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529150602082602481865afa92831561097c57610945936020936000916109d8575b50925092506108eb565b6109f89150843d81116109fe575b6109f08183610cf6565b810190612c8b565b386109ce565b503d6109e6565b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060ff610acd602435610a9981610399565b6004356000526000845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57610b0b6103b7565b67ffffffffffffffff9060443582811161021a57610b2d90369060040161021f565b60649291923584811161021a57610b4890369060040161021f565b60849291923586811161021a57610b6390369060040161021f565b93909260a43597881161021a57610b8161001998369060040161021f565b979096600435611b1f565b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760206040517f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda8152f35b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060405160008152f35b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5773ffffffffffffffffffffffffffffffffffffffff600435610c6f81610399565b610c776110f4565b167fffffffffffffffffffffffff00000000000000000000000000000000000000006003541617600355600080f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff821117610cf157604052565b610ca6565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610cf157604052565b67ffffffffffffffff8111610cf157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b929192610d7d82610d37565b91610d8b6040519384610cf6565b82948184528183011161021a578281602093846000960137010152565b3461021a5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57600435610de381610399565b60443567ffffffffffffffff811161021a573660238201121561021a57610e14903690602481600401359101610d71565b610e7873ffffffffffffffffffffffffffffffffffffffff80600254163314908115610ec4575b5060405190610e4982610cd5565b600182527f350000000000000000000000000000000000000000000000000000000000000060208301526118b7565b600260015414610e9a57610e94916002600155602435906130a1565b60018055005b60046040517f37ed32e8000000000000000000000000000000000000000000000000000000008152fd5b905060035416331438610e3b565b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57610019602435600435610f1382610399565b806000526000602052610f2d600160406000200154611388565b6114ec565b67ffffffffffffffff8111610cf15760051b60200190565b8015150361021a57565b81601f8201121561021a57803591610f6b83610f32565b92610f796040519485610cf6565b808452602092838086019260051b82010192831161021a578301905b828210610fa3575050505090565b8380918335610fb181610f4a565b815201910190610f95565b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5767ffffffffffffffff60043581811161021a573660238201121561021a57806004013561101781610f32565b916110256040519384610cf6565b81835260209160248385019160051b8301019136831161021a57602401905b82821061106d576024358587821161021a57611067610019923690600401610f54565b906117cd565b838091833561107b81610399565b815201910190611044565b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5773ffffffffffffffffffffffffffffffffffffffff6004356110d681610399565b166000526005602052602060ff604060002054166040519015158152f35b3360009081527f637999432676374d4ea036a5e1ac845bfb5900b653d4393f12108092e01503ce60205260409020547f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda9060ff16156111505750565b61115933611730565b611161611617565b91603061116d84611672565b5360786111798461167f565b5360415b60018111611269576108b860486112378561120b8861119c88156116cb565b6040519485937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000060208601526111dc81518092602060378901910161145b565b84017f206973206d697373696e6720726f6c65200000000000000000000000000000006037820152019061147e565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610cf6565b6040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016114d8565b90600f81169060108210156112b7577f30313233343536373839616263646566000000000000000000000000000000006112b2921a6112a8848761168f565b5360041c916116a0565b61117d565b611643565b3360009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff16156112f557565b6112fe33611730565b600090611309611617565b91603061131584611672565b5360786113218461167f565b5360415b60018111611344576108b860486112378561120b8861119c88156116cb565b90600f81169060108210156112b7577f3031323334353637383961626364656600000000000000000000000000000000611383921a6112a8848761168f565b611325565b80600052600060205260ff6113c13360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5416156113cb5750565b6113d433611730565b6113dc611617565b9160306113e884611672565b5360786113f48461167f565b5360415b60018111611417576108b860486112378561120b8861119c88156116cb565b90600f81169060108210156112b7577f3031323334353637383961626364656600000000000000000000000000000000611456921a6112a8848761168f565b6113f8565b60005b83811061146e5750506000910152565b818101518382015260200161145e565b906114916020928281519485920161145b565b0190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936114d18151809281875287808801910161145b565b0116010190565b9060206114e9928181520190611495565b90565b6000908082528160205260ff61152584604085209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b541661153057505050565b8082528160205261156483604084209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b73ffffffffffffffffffffffffffffffffffffffff3394169280a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b906001820180921161160557565b6115c8565b9190820180921161160557565b604051906080820182811067ffffffffffffffff821117610cf157604052604282526060366020840137565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8051156112b75760200190565b8051600110156112b75760210190565b9081518110156112b7570160200190565b8015611605577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b156116d257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b604051906060820182811067ffffffffffffffff821117610cf157604052602a82526040366020840137603061176583611672565b5360786117718361167f565b536029905b60018211611789576114e99150156116cb565b600f81169060108210156112b7577f30313233343536373839616263646566000000000000000000000000000000006117c7921a6112a8848661168f565b90611776565b6117d56110f4565b80519182151580611874575b6117f3906117ed61187e565b906118b7565b600090815b848110611806575050505050565b80611813600192846118fd565b51151573ffffffffffffffffffffffffffffffffffffffff61183583886118fd565b511685526005602052604085209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008354169116179055016117f8565b50805183146117e1565b6040519061188b82610cd5565b600182527f31000000000000000000000000000000000000000000000000000000000000006020830152565b156118bf5750565b6108b8906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352602060048401526024830190611495565b80518210156112b75760209160051b010190565b90156112b75790565b90600110156112b75760200190565b91908110156112b75760051b0190565b356114e981610399565b80548210156112b75760005260206000200190600090565b805468010000000000000000811015610cf15761197d91600182018155611943565b819291549060031b9173ffffffffffffffffffffffffffffffffffffffff809116831b921b1916179055565b604051906119b682610cd5565b600182527f32000000000000000000000000000000000000000000000000000000000000006020830152565b604051906119ef82610cd5565b600182527f34000000000000000000000000000000000000000000000000000000000000006020830152565b9c9b9a9998979695949390611a39611a3161187e565b8385146118b7565b60009283945b818610611a9a5750505050611a609150611a576119a9565b903410156118b7565b60005b868110611a7757506103c498993390611c91565b80611a946003611a8a6001948b8b611929565b35106117ed6119e2565b01611a63565b90919293611ad2600191611acc611aba611ab58a888a611929565b611939565b611ac58a8a88611929565b3590611ee3565b9061160a565b95611b14611b003373ffffffffffffffffffffffffffffffffffffffff166000526004602052604060002090565b611b0e611ab584888a611929565b9061195b565b019493929190611a3f565b906103c4999897969594939291611b6d604051611b3b81610cd5565b600181527f360000000000000000000000000000000000000000000000000000000000000060208201523033146118b7565b611c91565b60405190611b7f82610cd5565b600182527f33000000000000000000000000000000000000000000000000000000000000006020830152565b90156112b7578035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561021a57019081359167ffffffffffffffff831161021a57602001823603811361021a579190565b91908110156112b75760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561021a57019081359167ffffffffffffffff831161021a57602001823603811361021a579190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820191821161160557565b98939692909795949181151580611eda575b80611ed1575b80611ec8575b611cbb906117ed611b72565b6001828103611d4d5750611d25611d3395611d1e7fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b679c9a96611d17611d389b97611d11611d489f9c98611ab590611d2c99611911565b99611911565b3595611911565b3594611bab565b3691610d71565b928561256f565b6129cc565b6040519081529081906020820190565b0390a1565b9792611da28a89898786611d9c611d25829f9d8d9f9d611d9590611d8e8c8f859f81611d82611ab5611d8894611ab594611911565b9a61191a565b98611911565b3597611911565b3596611bab565b946122ac565b885b838110611de357505050505050505050507fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6791611d38611d48926129cc565b80888c8989898f968f908a8a8d93611dfa85611c64565b8414611e745792611e6892611e6182611e6e9c611e5a82611d2597611e54611ab58c611e448f9e8f611ab588611e3392611ab594611929565b9f611e3d88611c64565b9084611929565b9e611e4e866115f7565b91611929565b9c611929565b359a611929565b3598611c04565b95612696565b01611da4565b91611eb684611ec39b611eaf828096611ea9611ab58a611e9f611ab58f9e611ebd9f611d259f611929565b9d611e4e86611c64565b9b611929565b3599611929565b3597611c04565b94612447565b611e6e565b50848414611caf565b50848314611ca9565b50828214611ca3565b60009073ffffffffffffffffffffffffffffffffffffffff908116907f0000000000000000000000000000000000000000000000000000000000000000168103611f2c57505090565b6040517f23b872dd000000000000000000000000000000000000000000000000000000006020820152336024820152306044820152606481019390935290916114e991611fa482608481015b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283610cf6565b611fbe565b9081602091031261021a57516114e981610f4a565b6120149173ffffffffffffffffffffffffffffffffffffffff60405192611fe484610cd5565b602084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646020850152166120c6565b80519081612020575050565b602080612031938301019101611fa9565b1561203857565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5361666545524332303a206f7065726174696f6e206661696c656400000000006044820152fd5b3d156120c1573d906120a782610d37565b916120b56040519384610cf6565b82523d6000602084013e565b606090565b803f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811415908161218c575b50156121625781600092918360208194519301915af190612112612096565b911561211c575090565b81511561212c5750805190602001fd5b6108b8906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016114d8565b60046040517f304619b5000000000000000000000000000000000000000000000000000000008152fd5b90501515386120f3565b604051906121a382610cd5565b600182527f37000000000000000000000000000000000000000000000000000000000000006020830152565b9081602091031261021a57516114e981610399565b6040513d6000823e3d90fd5b60609073ffffffffffffffffffffffffffffffffffffffff6114e99493600083521660208201528160408201520190611495565b60609073ffffffffffffffffffffffffffffffffffffffff6114e99493168152600060208201528160408201520190611495565b9060606114e99260008152600060208201528160408201520190611495565b6060916114e9949373ffffffffffffffffffffffffffffffffffffffff80921683521660208201528160408201520190611495565b949092916122ef6122e76122e08673ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b5460ff1690565b6117ed612196565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868b165afa91821561097c5791612419575b50166123d7575061238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b915b606093600181036123b457506123a193506127c2565b80516123ab575050565b6103c491612908565b6002919250146123c6575b50506123a1565b6123d092506127f6565b38806123bf565b6124139061120b6040519384927ff5542f2d000000000000000000000000000000000000000000000000000000006020850152602484016121f0565b9161238b565b61243a915060203d8111612440575b6124328183610cf6565b8101906121cf565b38612346565b503d612428565b9490929161247b6122e76122e08673ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868b165afa91821561097c5791612551575b5016612515575061238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b6124139061120b6040519384927ff5542f2d00000000000000000000000000000000000000000000000000000000602085015260248401612224565b612569915060203d8111612440576124328183610cf6565b386124d2565b939190916125a36122e76122e08573ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868a165afa91821561097c5791612678575b501661263c5761238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b61241361120b916040519283917ff5542f2d00000000000000000000000000000000000000000000000000000000602084015260248301612258565b612690915060203d8111612440576124328183610cf6565b386125fa565b9591939290936126cc6122e76122e08773ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868c165afa91821561097c57916127a4575b501661276757505061238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b61120b61241392936040519485937ff5542f2d00000000000000000000000000000000000000000000000000000000602086015260248501612277565b6127bc915060203d8111612440576124328183610cf6565b38612723565b916000928392602083519301915af1903d916020604051938085528060008387013e840101604052156127f157565b503d90fd5b3073ffffffffffffffffffffffffffffffffffffffff82161461284257816000929160208493519201905af4903d916020604051938085528060008387013e840101604052156127f157565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64656c656761746563616c6c20746f2073656c660000000000000000000000006044820152fd5b81601f8201121561021a578051916128b783610f32565b926128c56040519485610cf6565b808452602092838086019260051b82010192831161021a578301905b8282106128ef575050505090565b83809183516128fd81610399565b8152019101906128e1565b91909182518301602093848183031261021a57848101519167ffffffffffffffff831161021a5761293f92868092019201016128a0565b92600090815b855181101561298f5760019061298973ffffffffffffffffffffffffffffffffffffffff8087168652600485526040862090612981848b6118fd565b51169061195b565b01612945565b505050509050565b805490600090818155826129aa57505050565b815260208120918201915b8281106129c157505050565b8181556001016129b5565b73ffffffffffffffffffffffffffffffffffffffff811660005260049060209082825260406000205460005b818110612a2857505073ffffffffffffffffffffffffffffffffffffffff16600052526103c46040600020612997565b60019073ffffffffffffffffffffffffffffffffffffffff841660005285855273ffffffffffffffffffffffffffffffffffffffff612a6b826040600020611943565b90549060031b1c16612a7d3082612c9a565b73ffffffffffffffffffffffffffffffffffffffff861680151590612b28575b80612b1f575b612ab0575b5050016129f8565b857f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168314612afe57612af792612d45565b3880612aa8565b612b1a9250600080809381935af1612b14612096565b50612b48565b612af7565b50801515612aa3565b503073ffffffffffffffffffffffffffffffffffffffff87161415612a9d565b15612b4f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e61746976652073656e64206661696c000000000000000000000000000000006044820152fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314612c79575b829073ffffffffffffffffffffffffffffffffffffffff908184168015159081612c6e575b5080612c65575b612c0d575b5050505090565b8116907f0000000000000000000000000000000000000000000000000000000000000000168114612c4b5791612c4292612d45565b38818180612c06565b50600080808093612c60955af1612b14612096565b612c42565b50821515612c01565b905030141538612bfa565b9150612c853083612c9a565b91612bd5565b9081602091031261021a575190565b73ffffffffffffffffffffffffffffffffffffffff908116907f000000000000000000000000000000000000000000000000000000000000000081168203612ce25750503190565b60246020929360405194859384927f70a082310000000000000000000000000000000000000000000000000000000084521660048301525afa90811561097c57600091612d2d575090565b6114e9915060203d81116109fe576109f08183610cf6565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff909216602483015260448201929092526103c491611fa48260648101611f78565b51906103c482610399565b81601f8201121561021a57805191612dc683610f32565b92612dd46040519485610cf6565b808452602092838086019260051b82010192831161021a578301905b828210612dfe575050505090565b81518152908301908301612df0565b9080601f8301121561021a57815191612e2583610f32565b92604090612e3582519586610cf6565b808552602093848087019260051b8501019381851161021a57858101925b858410612e64575050505050505090565b835167ffffffffffffffff811161021a5782019083603f8301121561021a578782015190612e9182610d37565b612e9d88519182610cf6565b8281528588848601011161021a57612ebe8a949385948a868501910161145b565b815201930192612e53565b91909160c08184031261021a57805192612ee560208301612da4565b9260408301519067ffffffffffffffff9182811161021a5783612f099186016128a0565b93606081015183811161021a5784612f22918301612daf565b93608082015184811161021a5781612f3b918401612daf565b9360a083015190811161021a576114e99201612e0d565b90815180825260208080930193019160005b828110612f72575050505090565b835185529381019392810192600101612f64565b908082519081815260208091019281808460051b8301019501936000915b848310612fb45750505050505090565b9091929394958480612ff0837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a51611495565b9801930193019194939290612fa4565b949291909695939660c0860190865273ffffffffffffffffffffffffffffffffffffffff9182602091168188015260c0604088015283518092528060e088019401926000905b8382106130885750505050509061306c826114e996978661307a95036060880152612f52565b908482036080860152612f52565b9160a0818403910152612f86565b8451811686529482019493820193600190910190613046565b6130ca73ffffffffffffffffffffffffffffffffffffffff929360208082518301019101612ec9565b979492969093169560005b84518110156131675760026130ea82876118fd565b51116130f8576001016130d5565b50505050507fb69677b2a82170abd46dbc9853e73529a3ac021a6e65e7c02f89cdf3b3d063c793508061312f611d48928585612bad565b506040519384938460409194939294606082019573ffffffffffffffffffffffffffffffffffffffff80921683521660208201520152565b506131ad9061120b6000969987966040519586948c60208701997f963276f3000000000000000000000000000000000000000000000000000000008b5260248801613000565b519082305af16131bb612096565b50156131eb575050507fc2623b31705c3a17d595c59e4c160723c6c140a0a0cbea051392e781b741575d600080a1565b611d488361312f7fb69677b2a82170abd46dbc9853e73529a3ac021a6e65e7c02f89cdf3b3d063c7958585612bad56fea2646970667358221220d0a8ab593876007b67e0a731eff9a49245d0580ae885b1b3505bcef2b3925c4b64736f6c634300081200332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000530000000000000000000000000000000000000400000000000000000000000001b4ce0d48ce91eb6bcaf5db33870c65d641b8940000000000000000000000005546da2bcdcff39b187723434cde10d4ee99c566
Deployed Bytecode
0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806301ffc9a71461015b57806303fe21731461015657806311b0b42d1461015157806318137a411461014c578063248a9ca3146101475780632cebdeb2146101425780632f2ff15d1461013d57806336568abe146101385780636cec044b1461013357806375ea1c921461012e5780637fe689171461012957806391d1485414610124578063963276f31461011f578063a2011b3f1461011a578063a217fddf14610115578063c5962f2614610110578063d00a2d5f1461010b578063d547741f14610106578063dfd7cb06146101015763f6f38e7c0361000e57611086565b610fbc565b610ed2565b610da8565b610c1f565b610be5565b610b8c565b610ad9565b610a57565b610a05565b61077c565b61072a565b610642565b610509565b61049a565b61044d565b6103c6565b61032a565b610250565b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361021a57807f7965db0b00000000000000000000000000000000000000000000000000000000602092149081156101f0575b506040519015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014386101e5565b600080fd5b9181601f8401121561021a5782359167ffffffffffffffff831161021a576020808501948460051b01011161021a57565b60e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5767ffffffffffffffff60243581811161021a5761029c6004913690830161021f565b60449291923584811161021a576102b6903690840161021f565b60649291923586811161021a576102d0903690860161021f565b60849291923588811161021a576102ea903690880161021f565b93909260a4358a811161021a576103049036908a0161021f565b97909660c4359b8c1161021a576103216100199c36908c0161021f565b9b909a35611a1b565b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060405173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee168152f35b73ffffffffffffffffffffffffffffffffffffffff81160361021a57565b602435906103c482610399565b565b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5773ffffffffffffffffffffffffffffffffffffffff60043561041681610399565b61041e6110f4565b167fffffffffffffffffffffffff00000000000000000000000000000000000000006002541617600255600080f35b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760043560005260006020526020600160406000200154604051908152f35b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005300000000000000000000000000000000000004168152f35b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760043560243561054781610399565b600091808352826020526105616001604085200154611388565b8083528260205260ff61059783604086209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5416156105a2578280f35b808352826020526105d682604085209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905573ffffffffffffffffffffffffffffffffffffffff339216907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8480a438808280f35b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760243561067d81610399565b3373ffffffffffffffffffffffffffffffffffffffff8216036106a657610019906004356114ec565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b3461021a5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a576004356107b781610399565b6024356107c381610399565b604435906107cf6112bc565b8173ffffffffffffffffffffffffffffffffffffffff809416937f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1684146000146108c457506000809350828193927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8394146108bc575b5af1610851612096565b501561085957005b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606490fd5b0390fd5b479150610847565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610981575b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481019190915290602090829081600081604481015b03925af1801561097c5761095557005b6100199060203d8111610975575b61096d8183610cf6565b810190611fa9565b503d610963565b6121e4565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529150602082602481865afa92831561097c57610945936020936000916109d8575b50925092506108eb565b6109f89150843d81116109fe575b6109f08183610cf6565b810190612c8b565b386109ce565b503d6109e6565b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060ff610acd602435610a9981610399565b6004356000526000845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b60c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57610b0b6103b7565b67ffffffffffffffff9060443582811161021a57610b2d90369060040161021f565b60649291923584811161021a57610b4890369060040161021f565b60849291923586811161021a57610b6390369060040161021f565b93909260a43597881161021a57610b8161001998369060040161021f565b979096600435611b1f565b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5760206040517f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda8152f35b3461021a5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57602060405160008152f35b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5773ffffffffffffffffffffffffffffffffffffffff600435610c6f81610399565b610c776110f4565b167fffffffffffffffffffffffff00000000000000000000000000000000000000006003541617600355600080f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff821117610cf157604052565b610ca6565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610cf157604052565b67ffffffffffffffff8111610cf157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b929192610d7d82610d37565b91610d8b6040519384610cf6565b82948184528183011161021a578281602093846000960137010152565b3461021a5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57600435610de381610399565b60443567ffffffffffffffff811161021a573660238201121561021a57610e14903690602481600401359101610d71565b610e7873ffffffffffffffffffffffffffffffffffffffff80600254163314908115610ec4575b5060405190610e4982610cd5565b600182527f350000000000000000000000000000000000000000000000000000000000000060208301526118b7565b600260015414610e9a57610e94916002600155602435906130a1565b60018055005b60046040517f37ed32e8000000000000000000000000000000000000000000000000000000008152fd5b905060035416331438610e3b565b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a57610019602435600435610f1382610399565b806000526000602052610f2d600160406000200154611388565b6114ec565b67ffffffffffffffff8111610cf15760051b60200190565b8015150361021a57565b81601f8201121561021a57803591610f6b83610f32565b92610f796040519485610cf6565b808452602092838086019260051b82010192831161021a578301905b828210610fa3575050505090565b8380918335610fb181610f4a565b815201910190610f95565b3461021a5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5767ffffffffffffffff60043581811161021a573660238201121561021a57806004013561101781610f32565b916110256040519384610cf6565b81835260209160248385019160051b8301019136831161021a57602401905b82821061106d576024358587821161021a57611067610019923690600401610f54565b906117cd565b838091833561107b81610399565b815201910190611044565b3461021a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261021a5773ffffffffffffffffffffffffffffffffffffffff6004356110d681610399565b166000526005602052602060ff604060002054166040519015158152f35b3360009081527f637999432676374d4ea036a5e1ac845bfb5900b653d4393f12108092e01503ce60205260409020547f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda9060ff16156111505750565b61115933611730565b611161611617565b91603061116d84611672565b5360786111798461167f565b5360415b60018111611269576108b860486112378561120b8861119c88156116cb565b6040519485937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000060208601526111dc81518092602060378901910161145b565b84017f206973206d697373696e6720726f6c65200000000000000000000000000000006037820152019061147e565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610cf6565b6040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016114d8565b90600f81169060108210156112b7577f30313233343536373839616263646566000000000000000000000000000000006112b2921a6112a8848761168f565b5360041c916116a0565b61117d565b611643565b3360009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff16156112f557565b6112fe33611730565b600090611309611617565b91603061131584611672565b5360786113218461167f565b5360415b60018111611344576108b860486112378561120b8861119c88156116cb565b90600f81169060108210156112b7577f3031323334353637383961626364656600000000000000000000000000000000611383921a6112a8848761168f565b611325565b80600052600060205260ff6113c13360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5416156113cb5750565b6113d433611730565b6113dc611617565b9160306113e884611672565b5360786113f48461167f565b5360415b60018111611417576108b860486112378561120b8861119c88156116cb565b90600f81169060108210156112b7577f3031323334353637383961626364656600000000000000000000000000000000611456921a6112a8848761168f565b6113f8565b60005b83811061146e5750506000910152565b818101518382015260200161145e565b906114916020928281519485920161145b565b0190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936114d18151809281875287808801910161145b565b0116010190565b9060206114e9928181520190611495565b90565b6000908082528160205260ff61152584604085209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b541661153057505050565b8082528160205261156483604084209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b73ffffffffffffffffffffffffffffffffffffffff3394169280a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b906001820180921161160557565b6115c8565b9190820180921161160557565b604051906080820182811067ffffffffffffffff821117610cf157604052604282526060366020840137565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8051156112b75760200190565b8051600110156112b75760210190565b9081518110156112b7570160200190565b8015611605577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b156116d257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b604051906060820182811067ffffffffffffffff821117610cf157604052602a82526040366020840137603061176583611672565b5360786117718361167f565b536029905b60018211611789576114e99150156116cb565b600f81169060108210156112b7577f30313233343536373839616263646566000000000000000000000000000000006117c7921a6112a8848661168f565b90611776565b6117d56110f4565b80519182151580611874575b6117f3906117ed61187e565b906118b7565b600090815b848110611806575050505050565b80611813600192846118fd565b51151573ffffffffffffffffffffffffffffffffffffffff61183583886118fd565b511685526005602052604085209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008354169116179055016117f8565b50805183146117e1565b6040519061188b82610cd5565b600182527f31000000000000000000000000000000000000000000000000000000000000006020830152565b156118bf5750565b6108b8906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352602060048401526024830190611495565b80518210156112b75760209160051b010190565b90156112b75790565b90600110156112b75760200190565b91908110156112b75760051b0190565b356114e981610399565b80548210156112b75760005260206000200190600090565b805468010000000000000000811015610cf15761197d91600182018155611943565b819291549060031b9173ffffffffffffffffffffffffffffffffffffffff809116831b921b1916179055565b604051906119b682610cd5565b600182527f32000000000000000000000000000000000000000000000000000000000000006020830152565b604051906119ef82610cd5565b600182527f34000000000000000000000000000000000000000000000000000000000000006020830152565b9c9b9a9998979695949390611a39611a3161187e565b8385146118b7565b60009283945b818610611a9a5750505050611a609150611a576119a9565b903410156118b7565b60005b868110611a7757506103c498993390611c91565b80611a946003611a8a6001948b8b611929565b35106117ed6119e2565b01611a63565b90919293611ad2600191611acc611aba611ab58a888a611929565b611939565b611ac58a8a88611929565b3590611ee3565b9061160a565b95611b14611b003373ffffffffffffffffffffffffffffffffffffffff166000526004602052604060002090565b611b0e611ab584888a611929565b9061195b565b019493929190611a3f565b906103c4999897969594939291611b6d604051611b3b81610cd5565b600181527f360000000000000000000000000000000000000000000000000000000000000060208201523033146118b7565b611c91565b60405190611b7f82610cd5565b600182527f33000000000000000000000000000000000000000000000000000000000000006020830152565b90156112b7578035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561021a57019081359167ffffffffffffffff831161021a57602001823603811361021a579190565b91908110156112b75760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561021a57019081359167ffffffffffffffff831161021a57602001823603811361021a579190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820191821161160557565b98939692909795949181151580611eda575b80611ed1575b80611ec8575b611cbb906117ed611b72565b6001828103611d4d5750611d25611d3395611d1e7fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b679c9a96611d17611d389b97611d11611d489f9c98611ab590611d2c99611911565b99611911565b3595611911565b3594611bab565b3691610d71565b928561256f565b6129cc565b6040519081529081906020820190565b0390a1565b9792611da28a89898786611d9c611d25829f9d8d9f9d611d9590611d8e8c8f859f81611d82611ab5611d8894611ab594611911565b9a61191a565b98611911565b3597611911565b3596611bab565b946122ac565b885b838110611de357505050505050505050507fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6791611d38611d48926129cc565b80888c8989898f968f908a8a8d93611dfa85611c64565b8414611e745792611e6892611e6182611e6e9c611e5a82611d2597611e54611ab58c611e448f9e8f611ab588611e3392611ab594611929565b9f611e3d88611c64565b9084611929565b9e611e4e866115f7565b91611929565b9c611929565b359a611929565b3598611c04565b95612696565b01611da4565b91611eb684611ec39b611eaf828096611ea9611ab58a611e9f611ab58f9e611ebd9f611d259f611929565b9d611e4e86611c64565b9b611929565b3599611929565b3597611c04565b94612447565b611e6e565b50848414611caf565b50848314611ca9565b50828214611ca3565b60009073ffffffffffffffffffffffffffffffffffffffff908116907f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee168103611f2c57505090565b6040517f23b872dd000000000000000000000000000000000000000000000000000000006020820152336024820152306044820152606481019390935290916114e991611fa482608481015b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283610cf6565b611fbe565b9081602091031261021a57516114e981610f4a565b6120149173ffffffffffffffffffffffffffffffffffffffff60405192611fe484610cd5565b602084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65646020850152166120c6565b80519081612020575050565b602080612031938301019101611fa9565b1561203857565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5361666545524332303a206f7065726174696f6e206661696c656400000000006044820152fd5b3d156120c1573d906120a782610d37565b916120b56040519384610cf6565b82523d6000602084013e565b606090565b803f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811415908161218c575b50156121625781600092918360208194519301915af190612112612096565b911561211c575090565b81511561212c5750805190602001fd5b6108b8906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016114d8565b60046040517f304619b5000000000000000000000000000000000000000000000000000000008152fd5b90501515386120f3565b604051906121a382610cd5565b600182527f37000000000000000000000000000000000000000000000000000000000000006020830152565b9081602091031261021a57516114e981610399565b6040513d6000823e3d90fd5b60609073ffffffffffffffffffffffffffffffffffffffff6114e99493600083521660208201528160408201520190611495565b60609073ffffffffffffffffffffffffffffffffffffffff6114e99493168152600060208201528160408201520190611495565b9060606114e99260008152600060208201528160408201520190611495565b6060916114e9949373ffffffffffffffffffffffffffffffffffffffff80921683521660208201528160408201520190611495565b949092916122ef6122e76122e08673ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b5460ff1690565b6117ed612196565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868b165afa91821561097c5791612419575b50166123d7575061238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b915b606093600181036123b457506123a193506127c2565b80516123ab575050565b6103c491612908565b6002919250146123c6575b50506123a1565b6123d092506127f6565b38806123bf565b6124139061120b6040519384927ff5542f2d000000000000000000000000000000000000000000000000000000006020850152602484016121f0565b9161238b565b61243a915060203d8111612440575b6124328183610cf6565b8101906121cf565b38612346565b503d612428565b9490929161247b6122e76122e08673ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868b165afa91821561097c5791612551575b5016612515575061238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b6124139061120b6040519384927ff5542f2d00000000000000000000000000000000000000000000000000000000602085015260248401612224565b612569915060203d8111612440576124328183610cf6565b386124d2565b939190916125a36122e76122e08573ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868a165afa91821561097c5791612678575b501661263c5761238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b61241361120b916040519283917ff5542f2d00000000000000000000000000000000000000000000000000000000602084015260248301612258565b612690915060203d8111612440576124328183610cf6565b386125fa565b9591939290936126cc6122e76122e08773ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6000604051907f6af563e900000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff91602081600481868c165afa91821561097c57916127a4575b501661276757505061238961120b916040519283917f09c5eabe000000000000000000000000000000000000000000000000000000006020840152602483016114d8565b61120b61241392936040519485937ff5542f2d00000000000000000000000000000000000000000000000000000000602086015260248501612277565b6127bc915060203d8111612440576124328183610cf6565b38612723565b916000928392602083519301915af1903d916020604051938085528060008387013e840101604052156127f157565b503d90fd5b3073ffffffffffffffffffffffffffffffffffffffff82161461284257816000929160208493519201905af4903d916020604051938085528060008387013e840101604052156127f157565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64656c656761746563616c6c20746f2073656c660000000000000000000000006044820152fd5b81601f8201121561021a578051916128b783610f32565b926128c56040519485610cf6565b808452602092838086019260051b82010192831161021a578301905b8282106128ef575050505090565b83809183516128fd81610399565b8152019101906128e1565b91909182518301602093848183031261021a57848101519167ffffffffffffffff831161021a5761293f92868092019201016128a0565b92600090815b855181101561298f5760019061298973ffffffffffffffffffffffffffffffffffffffff8087168652600485526040862090612981848b6118fd565b51169061195b565b01612945565b505050509050565b805490600090818155826129aa57505050565b815260208120918201915b8281106129c157505050565b8181556001016129b5565b73ffffffffffffffffffffffffffffffffffffffff811660005260049060209082825260406000205460005b818110612a2857505073ffffffffffffffffffffffffffffffffffffffff16600052526103c46040600020612997565b60019073ffffffffffffffffffffffffffffffffffffffff841660005285855273ffffffffffffffffffffffffffffffffffffffff612a6b826040600020611943565b90549060031b1c16612a7d3082612c9a565b73ffffffffffffffffffffffffffffffffffffffff861680151590612b28575b80612b1f575b612ab0575b5050016129f8565b857f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168314612afe57612af792612d45565b3880612aa8565b612b1a9250600080809381935af1612b14612096565b50612b48565b612af7565b50801515612aa3565b503073ffffffffffffffffffffffffffffffffffffffff87161415612a9d565b15612b4f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e61746976652073656e64206661696c000000000000000000000000000000006044820152fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314612c79575b829073ffffffffffffffffffffffffffffffffffffffff908184168015159081612c6e575b5080612c65575b612c0d575b5050505090565b8116907f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee168114612c4b5791612c4292612d45565b38818180612c06565b50600080808093612c60955af1612b14612096565b612c42565b50821515612c01565b905030141538612bfa565b9150612c853083612c9a565b91612bd5565b9081602091031261021a575190565b73ffffffffffffffffffffffffffffffffffffffff908116907f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81168203612ce25750503190565b60246020929360405194859384927f70a082310000000000000000000000000000000000000000000000000000000084521660048301525afa90811561097c57600091612d2d575090565b6114e9915060203d81116109fe576109f08183610cf6565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff909216602483015260448201929092526103c491611fa48260648101611f78565b51906103c482610399565b81601f8201121561021a57805191612dc683610f32565b92612dd46040519485610cf6565b808452602092838086019260051b82010192831161021a578301905b828210612dfe575050505090565b81518152908301908301612df0565b9080601f8301121561021a57815191612e2583610f32565b92604090612e3582519586610cf6565b808552602093848087019260051b8501019381851161021a57858101925b858410612e64575050505050505090565b835167ffffffffffffffff811161021a5782019083603f8301121561021a578782015190612e9182610d37565b612e9d88519182610cf6565b8281528588848601011161021a57612ebe8a949385948a868501910161145b565b815201930192612e53565b91909160c08184031261021a57805192612ee560208301612da4565b9260408301519067ffffffffffffffff9182811161021a5783612f099186016128a0565b93606081015183811161021a5784612f22918301612daf565b93608082015184811161021a5781612f3b918401612daf565b9360a083015190811161021a576114e99201612e0d565b90815180825260208080930193019160005b828110612f72575050505090565b835185529381019392810192600101612f64565b908082519081815260208091019281808460051b8301019501936000915b848310612fb45750505050505090565b9091929394958480612ff0837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a51611495565b9801930193019194939290612fa4565b949291909695939660c0860190865273ffffffffffffffffffffffffffffffffffffffff9182602091168188015260c0604088015283518092528060e088019401926000905b8382106130885750505050509061306c826114e996978661307a95036060880152612f52565b908482036080860152612f52565b9160a0818403910152612f86565b8451811686529482019493820193600190910190613046565b6130ca73ffffffffffffffffffffffffffffffffffffffff929360208082518301019101612ec9565b979492969093169560005b84518110156131675760026130ea82876118fd565b51116130f8576001016130d5565b50505050507fb69677b2a82170abd46dbc9853e73529a3ac021a6e65e7c02f89cdf3b3d063c793508061312f611d48928585612bad565b506040519384938460409194939294606082019573ffffffffffffffffffffffffffffffffffffffff80921683521660208201520152565b506131ad9061120b6000969987966040519586948c60208701997f963276f3000000000000000000000000000000000000000000000000000000008b5260248801613000565b519082305af16131bb612096565b50156131eb575050507fc2623b31705c3a17d595c59e4c160723c6c140a0a0cbea051392e781b741575d600080a1565b611d488361312f7fb69677b2a82170abd46dbc9853e73529a3ac021a6e65e7c02f89cdf3b3d063c7958585612bad56fea2646970667358221220d0a8ab593876007b67e0a731eff9a49245d0580ae885b1b3505bcef2b3925c4b64736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000530000000000000000000000000000000000000400000000000000000000000001b4ce0d48ce91eb6bcaf5db33870c65d641b8940000000000000000000000005546da2bcdcff39b187723434cde10d4ee99c566
-----Decoded View---------------
Arg [0] : __native (address): 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
Arg [1] : __wnative (address): 0x5300000000000000000000000000000000000004
Arg [2] : __assetForwarder (address): 0x01B4CE0d48Ce91eB6bcaf5dB33870C65d641b894
Arg [3] : __dexspan (address): 0x5546dA2bCdCFF39b187723434cDE10D4eE99C566
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Arg [1] : 0000000000000000000000005300000000000000000000000000000000000004
Arg [2] : 00000000000000000000000001b4ce0d48ce91eb6bcaf5db33870c65d641b894
Arg [3] : 0000000000000000000000005546da2bcdcff39b187723434cde10d4ee99c566
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.