Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x5c67A2A7...a36d56472 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
L1LidoTokensBridge
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 100000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; import {L1ERC20ExtendedTokensBridge} from "./L1ERC20ExtendedTokensBridge.sol"; import {Versioned} from "../utils/Versioned.sol"; import {TokenRateAndUpdateTimestampProvider} from "./TokenRateAndUpdateTimestampProvider.sol"; /// @author kovalgek /// @notice Hides wstETH concept from other contracts to keep `L1ERC20ExtendedTokensBridge` reusable. contract L1LidoTokensBridge is L1ERC20ExtendedTokensBridge, TokenRateAndUpdateTimestampProvider, Versioned { /// @param messenger_ L1 messenger address being used for cross-chain communications /// @param l2TokenBridge_ Address of the corresponding L2 bridge /// @param l1TokenNonRebasable_ Address of the bridged token in the L1 chain /// @param l1TokenRebasable_ Address of the bridged token in the L1 chain /// @param l2TokenNonRebasable_ Address of the token minted on the L2 chain when token bridged /// @param l2TokenRebasable_ Address of the token minted on the L2 chain when token bridged /// @param accountingOracle_ Address of the AccountingOracle instance to retrieve rate update timestamps constructor( address messenger_, address l2TokenBridge_, address l1TokenNonRebasable_, address l1TokenRebasable_, address l2TokenNonRebasable_, address l2TokenRebasable_, address accountingOracle_ ) L1ERC20ExtendedTokensBridge( messenger_, l2TokenBridge_, l1TokenNonRebasable_, l1TokenRebasable_, l2TokenNonRebasable_, l2TokenRebasable_ ) TokenRateAndUpdateTimestampProvider( l1TokenNonRebasable_, accountingOracle_ ) {} /// @notice Initializes the contract from scratch. /// @param admin_ Address of the account to grant the DEFAULT_ADMIN_ROLE function initialize(address admin_) external { _initializeContractVersionTo(2); _initializeBridgingManager(admin_); } /// @notice A function to finalize upgrade to v2 (from v1). function finalizeUpgrade_v2() external { if (!_isBridgingManagerInitialized()) { revert ErrorBridgingManagerIsNotInitialized(); } _initializeContractVersionTo(2); } function _tokenRate() override internal view returns (uint256 rate, uint256 updateTimestamp) { return _getTokenRateAndUpdateTimestamp(); } }
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_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.
*/
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(uint160(account), 20),
" 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.
*/
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.
*/
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`.
*/
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.
*
* [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.
*/
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.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts 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 v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @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] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; /// @author psirex, kovalgek /// @notice Contains administrative methods to retrieve and control the state of the bridging contract BridgingManager is AccessControl { /// @dev Stores the state of the bridging /// @param isInitialized Shows whether the contract is initialized or not /// @param isDepositsEnabled Stores the state of the deposits /// @param isWithdrawalsEnabled Stores the state of the withdrawals struct State { /// @dev This variable is used to determine whether the contract has been initialized or not. /// At the same time, bridges have their own code for initialization and storage versioning. /// Therefore, it is recommended to base upgrade logic on new mechanisms since v2. bool isInitialized; bool isDepositsEnabled; bool isWithdrawalsEnabled; } bytes32 public constant DEPOSITS_ENABLER_ROLE = keccak256("BridgingManager.DEPOSITS_ENABLER_ROLE"); bytes32 public constant DEPOSITS_DISABLER_ROLE = keccak256("BridgingManager.DEPOSITS_DISABLER_ROLE"); bytes32 public constant WITHDRAWALS_ENABLER_ROLE = keccak256("BridgingManager.WITHDRAWALS_ENABLER_ROLE"); bytes32 public constant WITHDRAWALS_DISABLER_ROLE = keccak256("BridgingManager.WITHDRAWALS_DISABLER_ROLE"); /// @dev The location of the slot with State bytes32 private constant STATE_SLOT = keccak256("BridgingManager.bridgingState"); /// @notice Initializes the contract to grant DEFAULT_ADMIN_ROLE to the admin_ address /// @dev This method might be called only once /// @param admin_ Address of the account to grant the DEFAULT_ADMIN_ROLE function _initializeBridgingManager(address admin_) internal { if (admin_ == address(0)) { revert ErrorZeroAddressAdmin(); } State storage s = _loadState(); if (s.isInitialized) { revert ErrorAlreadyInitialized(); } _grantRole(DEFAULT_ADMIN_ROLE, admin_); s.isInitialized = true; emit Initialized(admin_); } /// @notice Returns whether the contract is initialized or not function isInitialized() public view returns (bool) { return _loadState().isInitialized; } /// @notice Returns whether the deposits are enabled or not function isDepositsEnabled() public view returns (bool) { return _loadState().isDepositsEnabled; } /// @notice Returns whether the withdrawals are enabled or not function isWithdrawalsEnabled() public view returns (bool) { return _loadState().isWithdrawalsEnabled; } /// @notice Enables the deposits if they are disabled function enableDeposits() external onlyRole(DEPOSITS_ENABLER_ROLE) { if (isDepositsEnabled()) { revert ErrorDepositsEnabled(); } _loadState().isDepositsEnabled = true; emit DepositsEnabled(msg.sender); } /// @notice Disables the deposits if they aren't disabled yet function disableDeposits() external whenDepositsEnabled onlyRole(DEPOSITS_DISABLER_ROLE) { _loadState().isDepositsEnabled = false; emit DepositsDisabled(msg.sender); } /// @notice Enables the withdrawals if they are disabled function enableWithdrawals() external onlyRole(WITHDRAWALS_ENABLER_ROLE) { if (isWithdrawalsEnabled()) { revert ErrorWithdrawalsEnabled(); } _loadState().isWithdrawalsEnabled = true; emit WithdrawalsEnabled(msg.sender); } /// @notice Disables the withdrawals if they aren't disabled yet function disableWithdrawals() external whenWithdrawalsEnabled onlyRole(WITHDRAWALS_DISABLER_ROLE) { _loadState().isWithdrawalsEnabled = false; emit WithdrawalsDisabled(msg.sender); } function _isBridgingManagerInitialized() internal view returns (bool) { State storage s = _loadState(); return s.isInitialized; } /// @dev Returns the reference to the slot with State struct function _loadState() private pure returns (State storage r) { bytes32 slot = STATE_SLOT; assembly { r.slot := slot } } /// @dev Validates that deposits are enabled modifier whenDepositsEnabled() { if (!isDepositsEnabled()) { revert ErrorDepositsDisabled(); } _; } /// @dev Validates that withdrawals are enabled modifier whenWithdrawalsEnabled() { if (!isWithdrawalsEnabled()) { revert ErrorWithdrawalsDisabled(); } _; } event DepositsEnabled(address indexed enabler); event DepositsDisabled(address indexed disabler); event WithdrawalsEnabled(address indexed enabler); event WithdrawalsDisabled(address indexed disabler); event Initialized(address indexed admin); error ErrorZeroAddressAdmin(); error ErrorDepositsEnabled(); error ErrorDepositsDisabled(); error ErrorWithdrawalsEnabled(); error ErrorWithdrawalsDisabled(); error ErrorAlreadyInitialized(); error ErrorBridgingManagerIsNotInitialized(); }
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @author kovalgek /// @notice encodes and decodes DepositData for crosschain transfering. library DepositDataCodec { uint8 internal constant RATE_FIELD_SIZE = 16; uint8 internal constant TIMESTAMP_FIELD_SIZE = 5; struct DepositData { uint128 rate; uint40 timestamp; bytes data; } function encodeDepositData(DepositData memory depositData) internal pure returns (bytes memory) { bytes memory data = bytes.concat( abi.encodePacked(depositData.rate), abi.encodePacked(depositData.timestamp), abi.encodePacked(depositData.data) ); return data; } function decodeDepositData(bytes calldata buffer) internal pure returns (DepositData memory) { if (buffer.length < RATE_FIELD_SIZE + TIMESTAMP_FIELD_SIZE) { revert ErrorDepositDataLength(); } DepositData memory depositData = DepositData({ rate: uint128(bytes16(buffer[0:RATE_FIELD_SIZE])), timestamp: uint40(bytes5(buffer[RATE_FIELD_SIZE:RATE_FIELD_SIZE + TIMESTAMP_FIELD_SIZE])), data: buffer[RATE_FIELD_SIZE + TIMESTAMP_FIELD_SIZE:] }); return depositData; } error ErrorDepositDataLength(); }
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @dev A copy of UnstructuredStorage.sol library from Lido on Ethereum protocol. /// https://github.com/lidofinance/lido-dao/blob/master/contracts/0.8.9/lib/UnstructuredStorage.sol library UnstructuredStorage { function getStorageBool(bytes32 position) internal view returns (bool data) { assembly { data := sload(position) } } function getStorageUint256(bytes32 position) internal view returns (uint256 data) { assembly { data := sload(position) } } function setStorageBool(bytes32 position, bool data) internal { assembly { sstore(position, data) } } function setStorageUint256(bytes32 position, uint256 data) internal { assembly { sstore(position, data) } } }
// SPDX-FileCopyrightText: 2022 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; import {ICrossDomainMessenger} from "./interfaces/ICrossDomainMessenger.sol"; /// @dev Helper contract for contracts performing cross-domain communications contract CrossDomainEnabled { /// @notice Messenger contract used to send and receive messages from the other domain ICrossDomainMessenger public immutable MESSENGER; /// @param messenger_ Address of the CrossDomainMessenger on the current layer constructor(address messenger_) { if (messenger_ == address(0)) { revert ErrorZeroAddressMessenger(); } MESSENGER = ICrossDomainMessenger(messenger_); } /// @dev Sends a message to an account on another domain /// @param crossDomainTarget_ Intended recipient on the destination domain /// @param message_ Data to send to the target (usually calldata to a function with /// `onlyFromCrossDomainAccount()`) /// @param gasLimit_ gasLimit for the receipt of the message on the target domain. function sendCrossDomainMessage( address crossDomainTarget_, uint32 gasLimit_, bytes memory message_ ) internal { MESSENGER.sendMessage(crossDomainTarget_, message_, gasLimit_); } /// @dev Enforces that the modified function is only callable by a specific cross-domain account /// @param sourceDomainAccount_ The only account on the originating domain which is /// authenticated to call this function modifier onlyFromCrossDomainAccount(address sourceDomainAccount_) { if (msg.sender != address(MESSENGER)) { revert ErrorUnauthorizedMessenger(); } if (MESSENGER.xDomainMessageSender() != sourceDomainAccount_) { revert ErrorWrongCrossDomainSender(); } _; } error ErrorZeroAddressMessenger(); error ErrorUnauthorizedMessenger(); error ErrorWrongCrossDomainSender(); }
// SPDX-FileCopyrightText: 2022 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; interface ICrossDomainMessenger { function xDomainMessageSender() external view returns (address); /// Sends a cross domain message to the target messenger. /// @param _target Target contract address. /// @param _message Message to send to the target. /// @param _gasLimit Gas limit for the provided message. function sendMessage( address _target, bytes calldata _message, uint32 _gasLimit ) external; }
// SPDX-FileCopyrightText: 2022 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @notice The L1 Standard bridge locks bridged tokens on the L1 side, sends deposit messages /// on the L2 side, and finalizes token withdrawals from L2. interface IL1ERC20Bridge { event ERC20DepositInitiated( address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data ); event ERC20WithdrawalFinalized( address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data ); /// @notice get the address of the corresponding L2 bridge contract. /// @return Address of the corresponding L2 bridge contract. function l2TokenBridge() external returns (address); /// @notice deposit an amount of the ERC20 to the caller's balance on L2. /// @param l1Token_ Address of the L1 ERC20 we are depositing /// @param l2Token_ Address of the L1 respective L2 ERC20 /// @param amount_ Amount of the ERC20 to deposit /// @param l2Gas_ Gas limit required to complete the deposit on L2. /// @param data_ Optional data to forward to L2. This data is provided /// solely as a convenience for external contracts. Aside from enforcing a maximum /// length, these contracts provide no guarantees about its content. function depositERC20( address l1Token_, address l2Token_, uint256 amount_, uint32 l2Gas_, bytes calldata data_ ) external; /// @notice deposit an amount of ERC20 to a recipient's balance on L2. /// @param l1Token_ Address of the L1 ERC20 we are depositing /// @param l2Token_ Address of the L1 respective L2 ERC20 /// @param to_ L2 address to credit the withdrawal to. /// @param amount_ Amount of the ERC20 to deposit. /// @param l2Gas_ Gas limit required to complete the deposit on L2. /// @param data_ Optional data to forward to L2. This data is provided /// solely as a convenience for external contracts. Aside from enforcing a maximum /// length, these contracts provide no guarantees about its content. function depositERC20To( address l1Token_, address l2Token_, address to_, uint256 amount_, uint32 l2Gas_, bytes calldata data_ ) external; /// @notice Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the /// L1 ERC20 token. /// @dev This call will fail if the initialized withdrawal from L2 has not been finalized. /// @param l1Token_ Address of L1 token to finalizeWithdrawal for. /// @param l2Token_ Address of L2 token where withdrawal was initiated. /// @param from_ L2 address initiating the transfer. /// @param to_ L1 address to credit the withdrawal to. /// @param amount_ Amount of the ERC20 to deposit. /// @param data_ Data provided by the sender on L2. This data is provided /// solely as a convenience for external contracts. Aside from enforcing a maximum /// length, these contracts provide no guarantees about its content. function finalizeERC20Withdrawal( address l1Token_, address l2Token_, address from_, address to_, uint256 amount_, bytes calldata data_ ) external; }
// SPDX-FileCopyrightText: 2022 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @notice The L2 token bridge works with the L1 token bridge to enable ERC20 token bridging /// between L1 and L2. It acts as a minter for new tokens when it hears about /// deposits into the L1 token bridge. It also acts as a burner of the tokens /// intended for withdrawal, informing the L1 bridge to release L1 funds. interface IL2ERC20Bridge { event WithdrawalInitiated( address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data ); event DepositFinalized( address indexed _l1Token, address indexed _l2Token, address indexed _from, address _to, uint256 _amount, bytes _data ); /// @notice Returns the address of the corresponding L1 bridge contract function l1TokenBridge() external returns (address); /// @notice Initiates a withdraw of some tokens to the caller's account on L1 /// @param l2Token_ Address of L2 token where withdrawal was initiated. /// @param amount_ Amount of the token to withdraw. /// @param l1Gas_ Minimum gas limit to use for the transaction. /// @param data_ Optional data to forward to L1. This data is provided /// solely as a convenience for external contracts. Aside from enforcing a maximum /// length, these contracts provide no guarantees about its content. function withdraw( address l2Token_, uint256 amount_, uint32 l1Gas_, bytes calldata data_ ) external; /// @notice Initiates a withdraw of some token to a recipient's account on L1. /// @param l2Token_ Address of L2 token where withdrawal is initiated. /// @param to_ L1 adress to credit the withdrawal to. /// @param amount_ Amount of the token to withdraw. /// @param l1Gas_ Minimum gas limit to use for the transaction. /// @param data_ Optional data to forward to L1. This data is provided /// solely as a convenience for external contracts. Aside from enforcing a maximum /// length, these contracts provide no guarantees about its content. function withdrawTo( address l2Token_, address to_, uint256 amount_, uint32 l1Gas_, bytes calldata data_ ) external; /// @notice Completes a deposit from L1 to L2, and credits funds to the recipient's balance of /// this L2 token. This call will fail if it did not originate from a corresponding deposit /// in L1StandardTokenBridge. /// @param l1Token_ Address for the l1 token this is called with /// @param l2Token_ Address for the l2 token this is called with /// @param from_ Account to pull the deposit from on L2. /// @param to_ Address to receive the withdrawal at /// @param amount_ Amount of the token to withdraw /// @param data_ Data provider by the sender on L1. This data is provided /// solely as a convenience for external contracts. Aside from enforcing a maximum /// length, these contracts provide no guarantees about its content. function finalizeDeposit( address l1Token_, address l2Token_, address from_, address to_, uint256 amount_, bytes calldata data_ ) external; }
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IL1ERC20Bridge} from "./interfaces/IL1ERC20Bridge.sol"; import {IL2ERC20Bridge} from "./interfaces/IL2ERC20Bridge.sol"; import {IERC20Wrapper} from "../token/interfaces/IERC20Wrapper.sol"; import {BridgingManager} from "../BridgingManager.sol"; import {RebasableAndNonRebasableTokens} from "./RebasableAndNonRebasableTokens.sol"; import {CrossDomainEnabled} from "./CrossDomainEnabled.sol"; import {DepositDataCodec} from "../lib//DepositDataCodec.sol"; /// @author psirex, kovalgek /// @notice The L1 ERC20 token bridge locks bridged tokens on the L1 side, sends deposit messages /// on the L2 side, and finalizes token withdrawals from L2. Additionally, adds the methods for /// bridging management: enabling and disabling withdrawals/deposits abstract contract L1ERC20ExtendedTokensBridge is IL1ERC20Bridge, BridgingManager, RebasableAndNonRebasableTokens, CrossDomainEnabled { using SafeERC20 for IERC20; address private immutable L2_TOKEN_BRIDGE; /// @param messenger_ L1 messenger address being used for cross-chain communications /// @param l2TokenBridge_ Address of the corresponding L2 bridge /// @param l1TokenNonRebasable_ Address of the bridged token in the L1 chain /// @param l1TokenRebasable_ Address of the bridged token in the L1 chain /// @param l2TokenNonRebasable_ Address of the token minted on the L2 chain when token bridged /// @param l2TokenRebasable_ Address of the token minted on the L2 chain when token bridged constructor( address messenger_, address l2TokenBridge_, address l1TokenNonRebasable_, address l1TokenRebasable_, address l2TokenNonRebasable_, address l2TokenRebasable_ ) CrossDomainEnabled(messenger_) RebasableAndNonRebasableTokens( l1TokenNonRebasable_, l1TokenRebasable_, l2TokenNonRebasable_, l2TokenRebasable_ ) { if (l2TokenBridge_ == address(0)) { revert ErrorZeroAddressL2Bridge(); } L2_TOKEN_BRIDGE = l2TokenBridge_; } /// @inheritdoc IL1ERC20Bridge function l2TokenBridge() external view returns (address) { return L2_TOKEN_BRIDGE; } /// @inheritdoc IL1ERC20Bridge function depositERC20( address l1Token_, address l2Token_, uint256 amount_, uint32 l2Gas_, bytes calldata data_ ) external whenDepositsEnabled onlySupportedL1L2TokensPair(l1Token_, l2Token_) { if (Address.isContract(msg.sender)) { revert ErrorSenderNotEOA(); } bytes memory encodedDepositData = _encodeInputDepositData(data_); _depositERC20To(l1Token_, l2Token_, msg.sender, msg.sender, amount_, l2Gas_, encodedDepositData); emit ERC20DepositInitiated(l1Token_, l2Token_, msg.sender, msg.sender, amount_, encodedDepositData); } /// @inheritdoc IL1ERC20Bridge function depositERC20To( address l1Token_, address l2Token_, address to_, uint256 amount_, uint32 l2Gas_, bytes calldata data_ ) external whenDepositsEnabled onlyNonZeroAccount(to_) onlySupportedL1L2TokensPair(l1Token_, l2Token_) { bytes memory encodedDepositData = _encodeInputDepositData(data_); _depositERC20To(l1Token_, l2Token_, msg.sender, to_, amount_, l2Gas_, encodedDepositData); emit ERC20DepositInitiated(l1Token_, l2Token_, msg.sender, to_, amount_, encodedDepositData); } /// @inheritdoc IL1ERC20Bridge function finalizeERC20Withdrawal( address l1Token_, address l2Token_, address from_, address to_, uint256 amount_, bytes calldata data_ ) external whenWithdrawalsEnabled onlyFromCrossDomainAccount(L2_TOKEN_BRIDGE) onlySupportedL1L2TokensPair(l1Token_, l2Token_) { uint256 withdrawnL1TokenAmount = (l1Token_ == L1_TOKEN_REBASABLE && amount_ != 0) ? IERC20Wrapper(L1_TOKEN_NON_REBASABLE).unwrap(amount_) : amount_; IERC20(l1Token_).safeTransfer(to_, withdrawnL1TokenAmount); emit ERC20WithdrawalFinalized(l1Token_, l2Token_, from_, to_, withdrawnL1TokenAmount, data_); } /// @notice Performs the logic for deposits by informing the L2 token bridge contract /// of the deposit and calling safeTransferFrom to lock the L1 funds. /// @param l1Token_ Address of the L1 ERC20 we are depositing /// @param l2Token_ Address of the L1 respective L2 ERC20 /// @param from_ Account to pull the deposit from on L1 /// @param to_ Account to give the deposit to on L2 /// @param amount_ Amount of the ERC20 to deposit. /// @param l2Gas_ Gas limit required to complete the deposit on L2. /// @param encodedDepositData_ a concatenation of packed token rate with L1 time and /// optional data passed by external contract function _depositERC20To( address l1Token_, address l2Token_, address from_, address to_, uint256 amount_, uint32 l2Gas_, bytes memory encodedDepositData_ ) internal { uint256 nonRebasableAmountToDeposit = _transferToBridge(l1Token_, from_, amount_); bytes memory message = abi.encodeWithSelector( IL2ERC20Bridge.finalizeDeposit.selector, l1Token_, l2Token_, from_, to_, nonRebasableAmountToDeposit, encodedDepositData_ ); sendCrossDomainMessage(L2_TOKEN_BRIDGE, l2Gas_, message); } /// @notice Transfers tokens to the bridge and wraps if needed. /// @param l1Token_ Address of the L1 ERC20 we are depositing. /// @param from_ Account to pull the deposit from on L1. /// @param amount_ Amount of the ERC20 to deposit. /// @return Amount of non-rebasable token. function _transferToBridge( address l1Token_, address from_, uint256 amount_ ) internal returns (uint256) { if (amount_ != 0) { IERC20(l1Token_).safeTransferFrom(from_, address(this), amount_); if (l1Token_ == L1_TOKEN_REBASABLE) { IERC20(l1Token_).safeIncreaseAllowance(L1_TOKEN_NON_REBASABLE, amount_); return IERC20Wrapper(L1_TOKEN_NON_REBASABLE).wrap(amount_); } } return amount_; } /// @dev Helper that simplifies calling encoding by DepositDataCodec. /// Encodes token rate, it's L1 timestamp and optional data. /// @param data_ Optional data to forward to L2. /// @return encoded data in the 'wired' bytes form. function _encodeInputDepositData(bytes calldata data_) internal view returns (bytes memory) { (uint256 rate, uint256 timestamp) = _tokenRate(); return DepositDataCodec.encodeDepositData(DepositDataCodec.DepositData({ rate: uint128(rate), timestamp: uint40(timestamp), data: data_ })); } /// @notice required to abstact a way token rate is requested. function _tokenRate() virtual internal view returns (uint256 rate_, uint256 updateTimestamp_); error ErrorSenderNotEOA(); error ErrorZeroAddressL2Bridge(); }
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @author psirex, kovalgek /// @notice Contains the logic for validation of tokens used in the bridging process contract RebasableAndNonRebasableTokens { /// @notice Address of the bridged non rebasable token in the L1 chain address public immutable L1_TOKEN_NON_REBASABLE; /// @notice Address of the bridged rebasable token in the L1 chain address public immutable L1_TOKEN_REBASABLE; /// @notice Address of the non rebasable token minted on the L2 chain when token bridged address public immutable L2_TOKEN_NON_REBASABLE; /// @notice Address of the rebasable token minted on the L2 chain when token bridged address public immutable L2_TOKEN_REBASABLE; /// @param l1TokenNonRebasable_ Address of the bridged non rebasable token in the L1 chain /// @param l1TokenRebasable_ Address of the bridged rebasable token in the L1 chain /// @param l2TokenNonRebasable_ Address of the non rebasable token minted on the L2 chain when token bridged /// @param l2TokenRebasable_ Address of the rebasable token minted on the L2 chain when token bridged constructor( address l1TokenNonRebasable_, address l1TokenRebasable_, address l2TokenNonRebasable_, address l2TokenRebasable_ ) { if (l1TokenNonRebasable_ == address(0)) { revert ErrorZeroAddressL1TokenNonRebasable(); } if (l1TokenRebasable_ == address(0)) { revert ErrorZeroAddressL1TokenRebasable(); } if (l2TokenNonRebasable_ == address(0)) { revert ErrorZeroAddressL2TokenNonRebasable(); } if (l2TokenRebasable_ == address(0)) { revert ErrorZeroAddressL2TokenRebasable(); } L1_TOKEN_NON_REBASABLE = l1TokenNonRebasable_; L1_TOKEN_REBASABLE = l1TokenRebasable_; L2_TOKEN_NON_REBASABLE = l2TokenNonRebasable_; L2_TOKEN_REBASABLE = l2TokenRebasable_; } function _isSupportedL1L2TokensPair(address l1Token_, address l2Token_) internal view returns (bool) { bool isNonRebasablePair = l1Token_ == L1_TOKEN_NON_REBASABLE && l2Token_ == L2_TOKEN_NON_REBASABLE; bool isRebasablePair = l1Token_ == L1_TOKEN_REBASABLE && l2Token_ == L2_TOKEN_REBASABLE; return isNonRebasablePair || isRebasablePair; } function _getL1Token(address l2Token_) internal view returns (address) { if (l2Token_ == L2_TOKEN_NON_REBASABLE) { return L1_TOKEN_NON_REBASABLE; } if (l2Token_ == L2_TOKEN_REBASABLE) { return L1_TOKEN_REBASABLE; } revert ErrorUnsupportedL2Token(l2Token_); } /// @dev Validates that passed l1Token_ and l2Token_ tokens pair is supported by the bridge. modifier onlySupportedL1L2TokensPair(address l1Token_, address l2Token_) { if (!_isSupportedL1L2TokensPair(l1Token_, l2Token_)) { revert ErrorUnsupportedL1L2TokensPair(l1Token_, l2Token_); } _; } /// @dev Validates that passed l2Token_ is supported by the bridge modifier onlySupportedL2Token(address l2Token_) { if (l2Token_ != L2_TOKEN_NON_REBASABLE && l2Token_ != L2_TOKEN_REBASABLE) { revert ErrorUnsupportedL2Token(l2Token_); } _; } /// @dev validates that account_ is not zero address modifier onlyNonZeroAccount(address account_) { if (account_ == address(0)) { revert ErrorAccountIsZeroAddress(); } _; } error ErrorZeroAddressL1TokenNonRebasable(); error ErrorZeroAddressL1TokenRebasable(); error ErrorZeroAddressL2TokenNonRebasable(); error ErrorZeroAddressL2TokenRebasable(); error ErrorUnsupportedL2Token(address l2Token); error ErrorUnsupportedL1L2TokensPair(address l1Token, address l2Token); error ErrorAccountIsZeroAddress(); }
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @author dzhon /// @notice A subset of AccountingOracle interface of core LIDO protocol. interface IAccountingOracle { /// @notice Get timestamp of the Consensus Layer genesis function GENESIS_TIME() external view returns (uint256); /// @notice Get seconds per single Consensus Layer slot function SECONDS_PER_SLOT() external view returns (uint256); /// @notice Returns the last reference slot for which processing of the report was started function getLastProcessingRefSlot() external view returns (uint256); } /// @author kovalgek /// @notice A subset of wstETH token interface of core LIDO protocol. interface IERC20WstETH { /// @notice Get amount of stETH for a given amount of wstETH /// @param wstETHAmount_ amount of wstETH /// @return Amount of stETH for a given wstETH amount function getStETHByWstETH(uint256 wstETHAmount_) external view returns (uint256); } /// @author kovalgek /// @notice Provides token rate and update timestamp. abstract contract TokenRateAndUpdateTimestampProvider { /// @notice Non-rebasable token of Core Lido procotol. address public immutable WSTETH; /// @notice Address of the AccountingOracle instance address public immutable ACCOUNTING_ORACLE; /// @notice Timetamp of the Consensus Layer genesis uint256 public immutable GENESIS_TIME; /// @notice Seconds per single Consensus Layer slot uint256 public immutable SECONDS_PER_SLOT; /// @notice Token rate decimals to push uint256 public constant TOKEN_RATE_DECIMALS = 27; constructor(address wstETH_, address accountingOracle_) { if (wstETH_ == address(0)) { revert ErrorZeroAddressWstETH(); } if (accountingOracle_ == address(0)) { revert ErrorZeroAddressAccountingOracle(); } WSTETH = wstETH_; ACCOUNTING_ORACLE = accountingOracle_; GENESIS_TIME = IAccountingOracle(ACCOUNTING_ORACLE).GENESIS_TIME(); SECONDS_PER_SLOT = IAccountingOracle(ACCOUNTING_ORACLE).SECONDS_PER_SLOT(); } function _getTokenRateAndUpdateTimestamp() internal view returns (uint256 rate, uint256 updateTimestamp) { rate = IERC20WstETH(WSTETH).getStETHByWstETH(10 ** TOKEN_RATE_DECIMALS); /// @dev github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/beacon-chain.md#compute_timestamp_at_slot updateTimestamp = GENESIS_TIME + SECONDS_PER_SLOT * IAccountingOracle( ACCOUNTING_ORACLE ).getLastProcessingRefSlot(); } error ErrorZeroAddressWstETH(); error ErrorZeroAddressAccountingOracle(); }
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; /// @author kovalgek /// @notice Extends the ERC20 functionality that allows to wrap/unwrap token. interface IERC20Wrapper { /// @notice Exchanges wrappable token to wrapper one. /// @param wrappableTokenAmount_ amount of wrappable token to wrap. /// @return Amount of wrapper token user receives after wrap. function wrap(uint256 wrappableTokenAmount_) external returns (uint256); /// @notice Exchanges wrapper token to wrappable one. /// @param wrapperTokenAmount_ amount of wrapper token to uwrap in exchange for wrappable. /// @return Amount of wrappable token user receives after unwrap. function unwrap(uint256 wrapperTokenAmount_) external returns (uint256); }
// SPDX-FileCopyrightText: 2022 Lido <[email protected]> // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; import {UnstructuredStorage} from "../lib/UnstructuredStorage.sol"; /// @dev A copy of Versioned.sol contract from Lido on Ethereum protocol /// https://github.com/lidofinance/lido-dao/blob/master/contracts/0.8.9/utils/Versioned.sol contract Versioned { using UnstructuredStorage for bytes32; event ContractVersionSet(uint256 version); error NonZeroContractVersionOnInit(); error InvalidContractVersionIncrement(); error UnexpectedContractVersion(uint256 expected, uint256 received); /// @dev Storage slot: uint256 version /// Version of the initialized contract storage. /// The version stored in CONTRACT_VERSION_POSITION equals to: /// - 0 right after the deployment, before an initializer is invoked (and only at that moment); /// - N after calling initialize(), where N is the initially deployed contract version; /// - N after upgrading contract by calling finalizeUpgrade_vN(). bytes32 internal constant CONTRACT_VERSION_POSITION = keccak256("lido.Versioned.contractVersion"); uint256 internal constant PETRIFIED_VERSION_MARK = type(uint256).max; constructor() { // lock version in the implementation's storage to prevent initialization CONTRACT_VERSION_POSITION.setStorageUint256(PETRIFIED_VERSION_MARK); } /// @notice Returns the current contract version. function getContractVersion() public view returns (uint256) { return CONTRACT_VERSION_POSITION.getStorageUint256(); } function _checkContractVersion(uint256 version) internal view { uint256 expectedVersion = getContractVersion(); if (version != expectedVersion) { revert UnexpectedContractVersion(expectedVersion, version); } } /// @dev Sets the contract version to N. Should be called from the initialize() function. function _initializeContractVersionTo(uint256 version) internal { if (getContractVersion() != 0) revert NonZeroContractVersionOnInit(); _setContractVersion(version); } /// @dev Updates the contract version. Should be called from a finalizeUpgrade_vN() function. function _updateContractVersion(uint256 newVersion) internal { if (newVersion != getContractVersion() + 1) revert InvalidContractVersionIncrement(); _setContractVersion(newVersion); } function _setContractVersion(uint256 version) private { CONTRACT_VERSION_POSITION.setStorageUint256(version); emit ContractVersionSet(version); } }
{
"optimizer": {
"enabled": true,
"runs": 100000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"messenger_","type":"address"},{"internalType":"address","name":"l2TokenBridge_","type":"address"},{"internalType":"address","name":"l1TokenNonRebasable_","type":"address"},{"internalType":"address","name":"l1TokenRebasable_","type":"address"},{"internalType":"address","name":"l2TokenNonRebasable_","type":"address"},{"internalType":"address","name":"l2TokenRebasable_","type":"address"},{"internalType":"address","name":"accountingOracle_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ErrorAccountIsZeroAddress","type":"error"},{"inputs":[],"name":"ErrorAlreadyInitialized","type":"error"},{"inputs":[],"name":"ErrorBridgingManagerIsNotInitialized","type":"error"},{"inputs":[],"name":"ErrorDepositsDisabled","type":"error"},{"inputs":[],"name":"ErrorDepositsEnabled","type":"error"},{"inputs":[],"name":"ErrorSenderNotEOA","type":"error"},{"inputs":[],"name":"ErrorUnauthorizedMessenger","type":"error"},{"inputs":[{"internalType":"address","name":"l1Token","type":"address"},{"internalType":"address","name":"l2Token","type":"address"}],"name":"ErrorUnsupportedL1L2TokensPair","type":"error"},{"inputs":[{"internalType":"address","name":"l2Token","type":"address"}],"name":"ErrorUnsupportedL2Token","type":"error"},{"inputs":[],"name":"ErrorWithdrawalsDisabled","type":"error"},{"inputs":[],"name":"ErrorWithdrawalsEnabled","type":"error"},{"inputs":[],"name":"ErrorWrongCrossDomainSender","type":"error"},{"inputs":[],"name":"ErrorZeroAddressAccountingOracle","type":"error"},{"inputs":[],"name":"ErrorZeroAddressAdmin","type":"error"},{"inputs":[],"name":"ErrorZeroAddressL1TokenNonRebasable","type":"error"},{"inputs":[],"name":"ErrorZeroAddressL1TokenRebasable","type":"error"},{"inputs":[],"name":"ErrorZeroAddressL2Bridge","type":"error"},{"inputs":[],"name":"ErrorZeroAddressL2TokenNonRebasable","type":"error"},{"inputs":[],"name":"ErrorZeroAddressL2TokenRebasable","type":"error"},{"inputs":[],"name":"ErrorZeroAddressMessenger","type":"error"},{"inputs":[],"name":"ErrorZeroAddressWstETH","type":"error"},{"inputs":[],"name":"InvalidContractVersionIncrement","type":"error"},{"inputs":[],"name":"NonZeroContractVersionOnInit","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"received","type":"uint256"}],"name":"UnexpectedContractVersion","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"version","type":"uint256"}],"name":"ContractVersionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"disabler","type":"address"}],"name":"DepositsDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"enabler","type":"address"}],"name":"DepositsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_l1Token","type":"address"},{"indexed":true,"internalType":"address","name":"_l2Token","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"ERC20DepositInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_l1Token","type":"address"},{"indexed":true,"internalType":"address","name":"_l2Token","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"ERC20WithdrawalFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"disabler","type":"address"}],"name":"WithdrawalsDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"enabler","type":"address"}],"name":"WithdrawalsEnabled","type":"event"},{"inputs":[],"name":"ACCOUNTING_ORACLE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSITS_DISABLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSITS_ENABLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GENESIS_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"L1_TOKEN_NON_REBASABLE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"L1_TOKEN_REBASABLE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"L2_TOKEN_NON_REBASABLE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"L2_TOKEN_REBASABLE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MESSENGER","outputs":[{"internalType":"contract ICrossDomainMessenger","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_PER_SLOT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_RATE_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWALS_DISABLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWALS_ENABLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WSTETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"l1Token_","type":"address"},{"internalType":"address","name":"l2Token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint32","name":"l2Gas_","type":"uint32"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"depositERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"l1Token_","type":"address"},{"internalType":"address","name":"l2Token_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint32","name":"l2Gas_","type":"uint32"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"depositERC20To","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"l1Token_","type":"address"},{"internalType":"address","name":"l2Token_","type":"address"},{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"finalizeERC20Withdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalizeUpgrade_v2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getContractVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isDepositsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWithdrawalsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l2TokenBridge","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6101c06040523480156200001257600080fd5b50604051620034c9380380620034c9833981016040819052620000359162000306565b848188888388888885848484846001600160a01b0384166200006a5760405163635c10c560e01b815260040160405180910390fd5b6001600160a01b0383166200009257604051636a83f30760e01b815260040160405180910390fd5b6001600160a01b038216620000ba57604051630f52c48160e01b815260040160405180910390fd5b6001600160a01b038116620000e257604051636cdc4fe760e11b815260040160405180910390fd5b6001600160a01b0393841660805291831660a052821660c052811660e05281166200012057604051635d4339db60e01b815260040160405180910390fd5b6001600160a01b039081166101005285166200014f576040516367b3326960e11b815260040160405180910390fd5b5050506001600160a01b03918216610120525083161515905062000186576040516303c1f4f760e31b815260040160405180910390fd5b6001600160a01b038116620001ae5760405163de46615360e01b815260040160405180910390fd5b6001600160a01b038083166101405281166101608190526040805163f288246160e01b8152905163f2882461916004808201926020929091908290030181865afa15801562000201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022791906200039b565b6101808181525050610160516001600160a01b031663304b90716040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000271573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029791906200039b565b6101a05250620002d890507f4dd0f6662ba1d6b081f08b350f5e9a6a7b15cf586926ba66f753594928fa64a6600019620002e5602090811b6200142517901c565b50505050505050620003b5565b9055565b80516001600160a01b03811681146200030157600080fd5b919050565b600080600080600080600060e0888a0312156200032257600080fd5b6200032d88620002e9565b96506200033d60208901620002e9565b95506200034d60408901620002e9565b94506200035d60608901620002e9565b93506200036d60808901620002e9565b92506200037d60a08901620002e9565b91506200038d60c08901620002e9565b905092959891949750929550565b600060208284031215620003ae57600080fd5b5051919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a05161301a620004af600039600081816103050152612426015260008181610609015261245001526000818161043901526123930152600081816105b301526122ff01526000818161049f01528181610ce7015261187a01526000818161050c01528181610d1e01528181610d8e0152611ec701526000818161027301526116df015260008181610630015261163501526000818161036901528181610ece015281816116890152611d3501526000818161057901528181610f5f015281816115df01528181611da30152611df7015261301a6000f3fe608060405234801561001057600080fd5b50600436106102415760003560e01c80638d7601c011610145578063c4d66de8116100bd578063e3b523e31161008c578063f288246111610071578063f288246114610604578063f73abda91461062b578063fadcc54a1461065257600080fd5b8063e3b523e3146105d5578063e8bac93b146105fc57600080fd5b8063c4d66de814610561578063c83dbcee14610574578063d547741f1461059b578063d9fb643a146105ae57600080fd5b8063a217fddf11610114578063ac67e1af116100f9578063ac67e1af14610549578063ad960ce114610551578063b210de8b1461055957600080fd5b8063a217fddf1461052e578063a9f9e6751461053657600080fd5b80638d7601c01461047657806391c49bf81461049d57806391d14854146104c3578063927ede2d1461050757600080fd5b8063507f8a52116101d85780635ed2c220116101a757806375e3ddbb1161018c57806375e3ddbb14610434578063838b25201461045b5780638aa104351461046e57600080fd5b80635ed2c220146103dd5780636f18bd221461040d57600080fd5b8063507f8a521461038b5780635777bf501461039357806358a997f6146103c25780635e4c57a4146103d557600080fd5b8063304b907111610214578063304b90711461030057806336568abe14610327578063392e53cd1461033a5780633d9131a41461036457600080fd5b806301ffc9a71461024657806320f748c41461026e578063248a9ca3146102ba5780632f2ff15d146102eb575b600080fd5b6102596102543660046127dc565b610679565b60405190151581526020015b60405180910390f35b6102957f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610265565b6102dd6102c836600461281e565b60009081526020819052604090206001015490565b604051908152602001610265565b6102fe6102f9366004612859565b610712565b005b6102dd7f000000000000000000000000000000000000000000000000000000000000000081565b6102fe610335366004612859565b61073c565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5460ff16610259565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6102dd601b81565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff16610259565b6102fe6103d03660046128eb565b6107f4565b6102fe610997565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff16610259565b6102dd7f63f736f21cb2943826cd50b191eb054ebbea670e4e962d0527611f830cd399d681565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6102fe61046936600461296e565b610a9b565b6102dd610c55565b6102dd7f94a954c0bc99227eddbc0715a62a7e1056ed8784cd719c2303b685683908857c81565b7f0000000000000000000000000000000000000000000000000000000000000000610295565b6102596104d1366004612859565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6102dd600081565b6102fe610544366004612a04565b610c84565b6102fe61107e565b6102fe61117d565b6102fe61127d565b6102fe61056f366004612a7d565b6112e4565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6102fe6105a9366004612859565b6112fa565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6102dd7f9ab8816a3dc0b3849ec1ac00483f6ec815b07eee2fd766a353311c823ad59d0d81565b6102fe61131f565b6102dd7f000000000000000000000000000000000000000000000000000000000000000081565b6102957f000000000000000000000000000000000000000000000000000000000000000081565b6102dd7f4b43b36766bde12c5e9cbbc37d15f8d1f769f08f54720ab370faeb4ce893753a81565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061070c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461072d81611429565b6107378383611433565b505050565b73ffffffffffffffffffffffffffffffffffffffff811633146107e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107f08282611523565b5050565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff16610854576040517fa185a6b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b858561086082826115da565b6108b6576040517f759b5b3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8084166004830152821660248201526044016107dd565b333b156108ef576040517fdf6691fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108fb8585611741565b905061090c898933338b8b876117c2565b3373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396338b8660405161098493929190612b10565b60405180910390a4505050505050505050565b7f4b43b36766bde12c5e9cbbc37d15f8d1f769f08f54720ab370faeb4ce893753a6109c181611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff1615610a22576040517f4f2c8be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905560405133907fc36a428b063177e3f28b3b5d340c08f77827847b2ee30114ccf0c40e519c420a90600090a250565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff16610afb576040517fa185a6b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff8116610b49576040517fef6b416200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8787610b5582826115da565b610bab576040517f759b5b3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8084166004830152821660248201526044016107dd565b6000610bb78686611741565b9050610bc88b8b338c8c8c876117c2565b3373ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d03968c8c86604051610c4093929190612b10565b60405180910390a45050505050505050505050565b6000610c7f7f4dd0f6662ba1d6b081f08b350f5e9a6a7b15cf586926ba66f753594928fa64a65490565b905090565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff16610ce5576040517f77d195b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610d75576040517ff95a18f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015610df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1b9190612b45565b73ffffffffffffffffffffffffffffffffffffffff1614610e68576040517fe36e2eb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8787610e7482826115da565b610eca576040517f759b5b3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8084166004830152821660248201526044016107dd565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff16148015610f2657508615155b610f305786610fe1565b6040517fde0e9a3e000000000000000000000000000000000000000000000000000000008152600481018890527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063de0e9a3e906024016020604051808303816000875af1158015610fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe19190612b62565b905061100473ffffffffffffffffffffffffffffffffffffffff8c1689836118ab565b8873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b38b858b8b604051610c409493929190612b7b565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff166110de576040517fa185a6b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f63f736f21cb2943826cd50b191eb054ebbea670e4e962d0527611f830cd399d661110881611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405133907f9ca4d309bbfd23c65db3dc38c1712862f5812c7139937e2655de86e803f73bb990600090a250565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff166111de576040517f77d195b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f94a954c0bc99227eddbc0715a62a7e1056ed8784cd719c2303b685683908857c61120881611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff16905560405133907f644eeba8ede48fefc32ada09fb240c5f6c0f06507ab1d296d5af41f1521d9fcb90600090a250565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5460ff166112d8576040517f1ac3cb3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112e2600261197f565b565b6112ee600261197f565b6112f7816119c7565b50565b60008281526020819052604090206001015461131581611429565b6107378383611523565b7f9ab8816a3dc0b3849ec1ac00483f6ec815b07eee2fd766a353311c823ad59d0d61134981611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff16156113ab576040517ff74ad25400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff166201000017905560405133907fb2ed3603bd9051f0182ebfb75f12a21059b4d31b578a2a05c8d0245e9e2d320490600090a250565b9055565b6112f78133611aea565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107f05760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556114c53390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156107f05760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561168357507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614801561172d57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b905081806117385750805b95945050505050565b606060008061174e611bba565b915091506117386040518060600160405280846fffffffffffffffffffffffffffffffff1681526020018364ffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250611bcd565b60006117cf888786611d09565b9050600063662a633a60e01b8989898986886040516024016117f696959493929190612bec565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290506118a07f00000000000000000000000000000000000000000000000000000000000000008583611e8a565b505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526107379084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611f37565b611987610c55565b156119be576040517f61394a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112f781612043565b73ffffffffffffffffffffffffffffffffffffffff8116611a14576040517fc6ab211700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba805460ff1615611a71576040517f66a02dea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a7c600083611433565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815560405173ffffffffffffffffffffffffffffffffffffffff8316907f908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e690600090a25050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107f057611b408173ffffffffffffffffffffffffffffffffffffffff1660146120a2565b611b4b8360206120a2565b604051602001611b5c929190612c47565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526107dd91600401612cc8565b600080611bc56122e5565b915091509091565b606060008260000151604051602001611c11919060809190911b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000016815260100190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529082905260208581015160d81b7fffffffffff0000000000000000000000000000000000000000000000000000001690830152906025016040516020818303038152906040528460400151604051602001611c979190612cdb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611cd4939291602001612cf7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529392505050565b60008115611e8057611d3373ffffffffffffffffffffffffffffffffffffffff851684308561247a565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611e8057611dc873ffffffffffffffffffffffffffffffffffffffff85167f0000000000000000000000000000000000000000000000000000000000000000846124de565b6040517fea598cb0000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063ea598cb0906024016020604051808303816000875af1158015611e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e799190612b62565b9050611e83565b50805b9392505050565b6040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690633dbb202b90611f0090869085908790600401612d3a565b600060405180830381600087803b158015611f1a57600080fd5b505af1158015611f2e573d6000803e3d6000fd5b50505050505050565b6000611f99826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125dc9092919063ffffffff16565b8051909150156107375780806020019051810190611fb79190612d7f565b610737576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107dd565b61206c7f4dd0f6662ba1d6b081f08b350f5e9a6a7b15cf586926ba66f753594928fa64a6829055565b6040518181527ffddcded6b4f4730c226821172046b48372d3cd963c159701ae1b7c3bcac541bb9060200160405180910390a150565b606060006120b1836002612dd0565b6120bc906002612e0d565b67ffffffffffffffff8111156120d4576120d4612e25565b6040519080825280601f01601f1916602001820160405280156120fe576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061213557612135612e54565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061219857612198612e54565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006121d4846002612dd0565b6121df906001612e0d565b90505b600181111561227c577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061222057612220612e54565b1a60f81b82828151811061223657612236612e54565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361227581612e83565b90506121e2565b508315611e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107dd565b60008073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663bb2952fc612330601b600a612fd8565b6040518263ffffffff1660e01b815260040161234e91815260200190565b602060405180830381865afa15801561236b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238f9190612b62565b91507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633584d59c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124209190612b62565b61244a907f0000000000000000000000000000000000000000000000000000000000000000612dd0565b612474907f0000000000000000000000000000000000000000000000000000000000000000612e0d565b90509091565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526124d89085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016118fd565b50505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015612555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125799190612b62565b6125839190612e0d565b60405173ffffffffffffffffffffffffffffffffffffffff85166024820152604481018290529091506124d89085907f095ea7b300000000000000000000000000000000000000000000000000000000906064016118fd565b60606125eb84846000856125f3565b949350505050565b606082471015612685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016107dd565b73ffffffffffffffffffffffffffffffffffffffff85163b612703576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107dd565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161272c9190612cdb565b60006040518083038185875af1925050503d8060008114612769576040519150601f19603f3d011682016040523d82523d6000602084013e61276e565b606091505b509150915061277e828286612789565b979650505050505050565b60608315612798575081611e83565b8251156127a85782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dd9190612cc8565b6000602082840312156127ee57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611e8357600080fd5b60006020828403121561283057600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146112f757600080fd5b6000806040838503121561286c57600080fd5b82359150602083013561287e81612837565b809150509250929050565b803563ffffffff8116811461289d57600080fd5b919050565b60008083601f8401126128b457600080fd5b50813567ffffffffffffffff8111156128cc57600080fd5b6020830191508360208285010111156128e457600080fd5b9250929050565b60008060008060008060a0878903121561290457600080fd5b863561290f81612837565b9550602087013561291f81612837565b94506040870135935061293460608801612889565b9250608087013567ffffffffffffffff81111561295057600080fd5b61295c89828a016128a2565b979a9699509497509295939492505050565b600080600080600080600060c0888a03121561298957600080fd5b873561299481612837565b965060208801356129a481612837565b955060408801356129b481612837565b9450606088013593506129c960808901612889565b925060a088013567ffffffffffffffff8111156129e557600080fd5b6129f18a828b016128a2565b989b979a50959850939692959293505050565b600080600080600080600060c0888a031215612a1f57600080fd5b8735612a2a81612837565b96506020880135612a3a81612837565b95506040880135612a4a81612837565b94506060880135612a5a81612837565b93506080880135925060a088013567ffffffffffffffff8111156129e557600080fd5b600060208284031215612a8f57600080fd5b8135611e8381612837565b60005b83811015612ab5578181015183820152602001612a9d565b838111156124d85750506000910152565b60008151808452612ade816020860160208601612a9a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681528260208201526060604082015260006117386060830184612ac6565b600060208284031215612b5757600080fd5b8151611e8381612837565b600060208284031215612b7457600080fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01601019392505050565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a0830152612c3b60c0830184612ac6565b98975050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612c7f816017850160208801612a9a565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612cbc816028840160208801612a9a565b01602801949350505050565b602081526000611e836020830184612ac6565b60008251612ced818460208701612a9a565b9190910192915050565b60008451612d09818460208901612a9a565b845190830190612d1d818360208901612a9a565b8451910190612d30818360208801612a9a565b0195945050505050565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201526000612d696060830185612ac6565b905063ffffffff83166040830152949350505050565b600060208284031215612d9157600080fd5b81518015158114611e8357600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e0857612e08612da1565b500290565b60008219821115612e2057612e20612da1565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081612e9257612e92612da1565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600181815b80851115612f1157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612ef757612ef7612da1565b80851615612f0457918102915b93841c9390800290612ebd565b509250929050565b600082612f285750600161070c565b81612f355750600061070c565b8160018114612f4b5760028114612f5557612f71565b600191505061070c565b60ff841115612f6657612f66612da1565b50506001821b61070c565b5060208310610133831016604e8410600b8410161715612f94575081810a61070c565b612f9e8383612eb8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612fd057612fd0612da1565b029392505050565b6000611e838383612f1956fea26469706673582212209dc54136ab8f6cf2e5f9b0a94d8abca5b9ec7f37032d050f6c45da8028a0281664736f6c634300080a00330000000000000000000000009cf951e3f74b644e621b36ca9cea147a78d4c39f000000000000000000000000b4a0cc7be277dc9f9cbb6fbe8574b6f5221018d80000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000aa9bd8c957d803466fa92504bdd728cc140f89410000000000000000000000000ce031aed457c870d74914ecaa7971dd3176cdaf000000000000000000000000852ded011285fe67063a08005c71a85690503cee
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102415760003560e01c80638d7601c011610145578063c4d66de8116100bd578063e3b523e31161008c578063f288246111610071578063f288246114610604578063f73abda91461062b578063fadcc54a1461065257600080fd5b8063e3b523e3146105d5578063e8bac93b146105fc57600080fd5b8063c4d66de814610561578063c83dbcee14610574578063d547741f1461059b578063d9fb643a146105ae57600080fd5b8063a217fddf11610114578063ac67e1af116100f9578063ac67e1af14610549578063ad960ce114610551578063b210de8b1461055957600080fd5b8063a217fddf1461052e578063a9f9e6751461053657600080fd5b80638d7601c01461047657806391c49bf81461049d57806391d14854146104c3578063927ede2d1461050757600080fd5b8063507f8a52116101d85780635ed2c220116101a757806375e3ddbb1161018c57806375e3ddbb14610434578063838b25201461045b5780638aa104351461046e57600080fd5b80635ed2c220146103dd5780636f18bd221461040d57600080fd5b8063507f8a521461038b5780635777bf501461039357806358a997f6146103c25780635e4c57a4146103d557600080fd5b8063304b907111610214578063304b90711461030057806336568abe14610327578063392e53cd1461033a5780633d9131a41461036457600080fd5b806301ffc9a71461024657806320f748c41461026e578063248a9ca3146102ba5780632f2ff15d146102eb575b600080fd5b6102596102543660046127dc565b610679565b60405190151581526020015b60405180910390f35b6102957f0000000000000000000000000ce031aed457c870d74914ecaa7971dd3176cdaf81565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610265565b6102dd6102c836600461281e565b60009081526020819052604090206001015490565b604051908152602001610265565b6102fe6102f9366004612859565b610712565b005b6102dd7f000000000000000000000000000000000000000000000000000000000000000c81565b6102fe610335366004612859565b61073c565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5460ff16610259565b6102957f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8481565b6102dd601b81565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff16610259565b6102fe6103d03660046128eb565b6107f4565b6102fe610997565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff16610259565b6102dd7f63f736f21cb2943826cd50b191eb054ebbea670e4e962d0527611f830cd399d681565b6102957f000000000000000000000000852ded011285fe67063a08005c71a85690503cee81565b6102fe61046936600461296e565b610a9b565b6102dd610c55565b6102dd7f94a954c0bc99227eddbc0715a62a7e1056ed8784cd719c2303b685683908857c81565b7f000000000000000000000000b4a0cc7be277dc9f9cbb6fbe8574b6f5221018d8610295565b6102596104d1366004612859565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102957f0000000000000000000000009cf951e3f74b644e621b36ca9cea147a78d4c39f81565b6102dd600081565b6102fe610544366004612a04565b610c84565b6102fe61107e565b6102fe61117d565b6102fe61127d565b6102fe61056f366004612a7d565b6112e4565b6102957f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca081565b6102fe6105a9366004612859565b6112fa565b6102957f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca081565b6102dd7f9ab8816a3dc0b3849ec1ac00483f6ec815b07eee2fd766a353311c823ad59d0d81565b6102fe61131f565b6102dd7f000000000000000000000000000000000000000000000000000000005fc6305781565b6102957f000000000000000000000000aa9bd8c957d803466fa92504bdd728cc140f894181565b6102dd7f4b43b36766bde12c5e9cbbc37d15f8d1f769f08f54720ab370faeb4ce893753a81565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061070c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461072d81611429565b6107378383611433565b505050565b73ffffffffffffffffffffffffffffffffffffffff811633146107e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6107f08282611523565b5050565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff16610854576040517fa185a6b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b858561086082826115da565b6108b6576040517f759b5b3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8084166004830152821660248201526044016107dd565b333b156108ef576040517fdf6691fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108fb8585611741565b905061090c898933338b8b876117c2565b3373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396338b8660405161098493929190612b10565b60405180910390a4505050505050505050565b7f4b43b36766bde12c5e9cbbc37d15f8d1f769f08f54720ab370faeb4ce893753a6109c181611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff1615610a22576040517f4f2c8be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905560405133907fc36a428b063177e3f28b3b5d340c08f77827847b2ee30114ccf0c40e519c420a90600090a250565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff16610afb576040517fa185a6b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff8116610b49576040517fef6b416200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8787610b5582826115da565b610bab576040517f759b5b3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8084166004830152821660248201526044016107dd565b6000610bb78686611741565b9050610bc88b8b338c8c8c876117c2565b3373ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d03968c8c86604051610c4093929190612b10565b60405180910390a45050505050505050505050565b6000610c7f7f4dd0f6662ba1d6b081f08b350f5e9a6a7b15cf586926ba66f753594928fa64a65490565b905090565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff16610ce5576040517f77d195b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000b4a0cc7be277dc9f9cbb6fbe8574b6f5221018d83373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000009cf951e3f74b644e621b36ca9cea147a78d4c39f1614610d75576040517ff95a18f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f0000000000000000000000009cf951e3f74b644e621b36ca9cea147a78d4c39f73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015610df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1b9190612b45565b73ffffffffffffffffffffffffffffffffffffffff1614610e68576040517fe36e2eb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8787610e7482826115da565b610eca576040517f759b5b3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8084166004830152821660248201526044016107dd565b60007f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8473ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff16148015610f2657508615155b610f305786610fe1565b6040517fde0e9a3e000000000000000000000000000000000000000000000000000000008152600481018890527f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca073ffffffffffffffffffffffffffffffffffffffff169063de0e9a3e906024016020604051808303816000875af1158015610fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe19190612b62565b905061100473ffffffffffffffffffffffffffffffffffffffff8c1689836118ab565b8873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b38b858b8b604051610c409493929190612b7b565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba54610100900460ff166110de576040517fa185a6b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f63f736f21cb2943826cd50b191eb054ebbea670e4e962d0527611f830cd399d661110881611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405133907f9ca4d309bbfd23c65db3dc38c1712862f5812c7139937e2655de86e803f73bb990600090a250565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff166111de576040517f77d195b200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f94a954c0bc99227eddbc0715a62a7e1056ed8784cd719c2303b685683908857c61120881611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff16905560405133907f644eeba8ede48fefc32ada09fb240c5f6c0f06507ab1d296d5af41f1521d9fcb90600090a250565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5460ff166112d8576040517f1ac3cb3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112e2600261197f565b565b6112ee600261197f565b6112f7816119c7565b50565b60008281526020819052604090206001015461131581611429565b6107378383611523565b7f9ab8816a3dc0b3849ec1ac00483f6ec815b07eee2fd766a353311c823ad59d0d61134981611429565b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba5462010000900460ff16156113ab576040517ff74ad25400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff166201000017905560405133907fb2ed3603bd9051f0182ebfb75f12a21059b4d31b578a2a05c8d0245e9e2d320490600090a250565b9055565b6112f78133611aea565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107f05760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556114c53390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156107f05760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000807f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561168357507f000000000000000000000000aa9bd8c957d803466fa92504bdd728cc140f894173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b905060007f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8473ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614801561172d57507f0000000000000000000000000ce031aed457c870d74914ecaa7971dd3176cdaf73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b905081806117385750805b95945050505050565b606060008061174e611bba565b915091506117386040518060600160405280846fffffffffffffffffffffffffffffffff1681526020018364ffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250611bcd565b60006117cf888786611d09565b9050600063662a633a60e01b8989898986886040516024016117f696959493929190612bec565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290506118a07f000000000000000000000000b4a0cc7be277dc9f9cbb6fbe8574b6f5221018d88583611e8a565b505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526107379084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611f37565b611987610c55565b156119be576040517f61394a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112f781612043565b73ffffffffffffffffffffffffffffffffffffffff8116611a14576040517fc6ab211700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f013e929b381f2fbbac854bd18fb8231dc73c4a2eab0d4cbb4db9436b6ff9b2ba805460ff1615611a71576040517f66a02dea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a7c600083611433565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117815560405173ffffffffffffffffffffffffffffffffffffffff8316907f908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e690600090a25050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166107f057611b408173ffffffffffffffffffffffffffffffffffffffff1660146120a2565b611b4b8360206120a2565b604051602001611b5c929190612c47565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526107dd91600401612cc8565b600080611bc56122e5565b915091509091565b606060008260000151604051602001611c11919060809190911b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000016815260100190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529082905260208581015160d81b7fffffffffff0000000000000000000000000000000000000000000000000000001690830152906025016040516020818303038152906040528460400151604051602001611c979190612cdb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611cd4939291602001612cf7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529392505050565b60008115611e8057611d3373ffffffffffffffffffffffffffffffffffffffff851684308561247a565b7f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611e8057611dc873ffffffffffffffffffffffffffffffffffffffff85167f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0846124de565b6040517fea598cb0000000000000000000000000000000000000000000000000000000008152600481018390527f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca073ffffffffffffffffffffffffffffffffffffffff169063ea598cb0906024016020604051808303816000875af1158015611e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e799190612b62565b9050611e83565b50805b9392505050565b6040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000009cf951e3f74b644e621b36ca9cea147a78d4c39f1690633dbb202b90611f0090869085908790600401612d3a565b600060405180830381600087803b158015611f1a57600080fd5b505af1158015611f2e573d6000803e3d6000fd5b50505050505050565b6000611f99826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125dc9092919063ffffffff16565b8051909150156107375780806020019051810190611fb79190612d7f565b610737576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107dd565b61206c7f4dd0f6662ba1d6b081f08b350f5e9a6a7b15cf586926ba66f753594928fa64a6829055565b6040518181527ffddcded6b4f4730c226821172046b48372d3cd963c159701ae1b7c3bcac541bb9060200160405180910390a150565b606060006120b1836002612dd0565b6120bc906002612e0d565b67ffffffffffffffff8111156120d4576120d4612e25565b6040519080825280601f01601f1916602001820160405280156120fe576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061213557612135612e54565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061219857612198612e54565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006121d4846002612dd0565b6121df906001612e0d565b90505b600181111561227c577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061222057612220612e54565b1a60f81b82828151811061223657612236612e54565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361227581612e83565b90506121e2565b508315611e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107dd565b60008073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca01663bb2952fc612330601b600a612fd8565b6040518263ffffffff1660e01b815260040161234e91815260200190565b602060405180830381865afa15801561236b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238f9190612b62565b91507f000000000000000000000000852ded011285fe67063a08005c71a85690503cee73ffffffffffffffffffffffffffffffffffffffff16633584d59c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124209190612b62565b61244a907f000000000000000000000000000000000000000000000000000000000000000c612dd0565b612474907f000000000000000000000000000000000000000000000000000000005fc63057612e0d565b90509091565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526124d89085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016118fd565b50505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015612555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125799190612b62565b6125839190612e0d565b60405173ffffffffffffffffffffffffffffffffffffffff85166024820152604481018290529091506124d89085907f095ea7b300000000000000000000000000000000000000000000000000000000906064016118fd565b60606125eb84846000856125f3565b949350505050565b606082471015612685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016107dd565b73ffffffffffffffffffffffffffffffffffffffff85163b612703576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107dd565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161272c9190612cdb565b60006040518083038185875af1925050503d8060008114612769576040519150601f19603f3d011682016040523d82523d6000602084013e61276e565b606091505b509150915061277e828286612789565b979650505050505050565b60608315612798575081611e83565b8251156127a85782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dd9190612cc8565b6000602082840312156127ee57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611e8357600080fd5b60006020828403121561283057600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146112f757600080fd5b6000806040838503121561286c57600080fd5b82359150602083013561287e81612837565b809150509250929050565b803563ffffffff8116811461289d57600080fd5b919050565b60008083601f8401126128b457600080fd5b50813567ffffffffffffffff8111156128cc57600080fd5b6020830191508360208285010111156128e457600080fd5b9250929050565b60008060008060008060a0878903121561290457600080fd5b863561290f81612837565b9550602087013561291f81612837565b94506040870135935061293460608801612889565b9250608087013567ffffffffffffffff81111561295057600080fd5b61295c89828a016128a2565b979a9699509497509295939492505050565b600080600080600080600060c0888a03121561298957600080fd5b873561299481612837565b965060208801356129a481612837565b955060408801356129b481612837565b9450606088013593506129c960808901612889565b925060a088013567ffffffffffffffff8111156129e557600080fd5b6129f18a828b016128a2565b989b979a50959850939692959293505050565b600080600080600080600060c0888a031215612a1f57600080fd5b8735612a2a81612837565b96506020880135612a3a81612837565b95506040880135612a4a81612837565b94506060880135612a5a81612837565b93506080880135925060a088013567ffffffffffffffff8111156129e557600080fd5b600060208284031215612a8f57600080fd5b8135611e8381612837565b60005b83811015612ab5578181015183820152602001612a9d565b838111156124d85750506000910152565b60008151808452612ade816020860160208601612a9a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681528260208201526060604082015260006117386060830184612ac6565b600060208284031215612b5757600080fd5b8151611e8381612837565b600060208284031215612b7457600080fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01601019392505050565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a0830152612c3b60c0830184612ac6565b98975050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612c7f816017850160208801612a9a565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612cbc816028840160208801612a9a565b01602801949350505050565b602081526000611e836020830184612ac6565b60008251612ced818460208701612a9a565b9190910192915050565b60008451612d09818460208901612a9a565b845190830190612d1d818360208901612a9a565b8451910190612d30818360208801612a9a565b0195945050505050565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201526000612d696060830185612ac6565b905063ffffffff83166040830152949350505050565b600060208284031215612d9157600080fd5b81518015158114611e8357600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e0857612e08612da1565b500290565b60008219821115612e2057612e20612da1565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081612e9257612e92612da1565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600181815b80851115612f1157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612ef757612ef7612da1565b80851615612f0457918102915b93841c9390800290612ebd565b509250929050565b600082612f285750600161070c565b81612f355750600061070c565b8160018114612f4b5760028114612f5557612f71565b600191505061070c565b60ff841115612f6657612f66612da1565b50506001821b61070c565b5060208310610133831016604e8410600b8410161715612f94575081810a61070c565b612f9e8383612eb8565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612fd057612fd0612da1565b029392505050565b6000611e838383612f1956fea26469706673582212209dc54136ab8f6cf2e5f9b0a94d8abca5b9ec7f37032d050f6c45da8028a0281664736f6c634300080a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.