Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 19931000 | 114 days ago | IN | 0 ETH | 0.02167263 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
LRTWithdrawalManager
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@shared/lib-contracts-v0.8/contracts/Dependencies/TransferHelper.sol"; import "./Interfaces/IelETH.sol"; import "./Interfaces/ILRTOracle.sol"; import "./Interfaces/ILRTWithdrawalManager.sol"; import "./Interfaces/ILRTDepositPool.sol"; import "./Interfaces/ILRTUnstakingVault.sol"; import "./Utils/DoubleEndedQueue.sol"; import "./Utils/LRTConstants.sol"; import "./Utils/LRTChecker.sol"; contract LRTWithdrawalManager is ILRTWithdrawalManager, LRTChecker, PausableUpgradeable, ReentrancyGuardUpgradeable, AccessControlUpgradeable { using DoubleEndedQueue for DoubleEndedQueue.Uint256Deque; using SafeERC20 for IERC20; address public elETH; ILRTOracle public lrtOracle; address public lrtUnstakingVault; mapping(address => uint256) public minAmountToWithdraw; uint256 public withdrawalDelayBlocks; // Next available nonce for withdrawal requests per asset, indicating total requests made. mapping(address => uint256) public nextUnusedNonce; // Next nonce for which a withdrawal request remains locked. mapping(address => uint256) public nextLockedNonce; // Mapping from a unique request identifier to its corresponding withdrawal request mapping(bytes32 => WithdrawalRequest) public withdrawalRequests; // Maps each asset to user addresses, pointing to an ordert list of their withdrawal request nonces. // Utilizes a double-ended queue for efficient management and removal of initial requests. mapping(address => mapping(address => DoubleEndedQueue.Uint256Deque)) public userAssociatedNonces; // Asset amount commited to be withdrawn by users. mapping(address => uint256) public assetsCommitted; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /// @notice Initializes the contract /// @param _lrtConfig LRT config address function initialize( address _lrtConfig, address _elETH, address _lrtOracle, address _lrtUnstakingVault ) external initializer { __AccessControl_init(); __Pausable_init_unchained(); __ReentrancyGuard_init_unchained(); lrtConfig = ILRTConfig(_lrtConfig); elETH = _elETH; lrtOracle = ILRTOracle(_lrtOracle); lrtUnstakingVault = _lrtUnstakingVault; withdrawalDelayBlocks = 8 days / 12 seconds; _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(LRTConstants.ADMIN_ROLE, msg.sender); } modifier onlySupportedLST(address asset) { if ( !lrtConfig.isSupportedAsset(asset) || AddressLib.isPlatformToken(asset) || lrtConfig.getStrategy(asset) == address(0) ) { revert NotSupportedLST(); } _; } /*////////////////////////////////////////////////////////////// VIEW FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice Get request id /// @param asset Asset address /// @param requestIndex The requests index to generate id for function getRequestId( address asset, uint256 requestIndex ) public pure returns (bytes32) { return keccak256(abi.encodePacked(asset, requestIndex)); } /// @notice Get asset amount to receive when trading in elETH /// @param asset Asset address of LST to receive /// @param amount elETH amount to convert /// @return underlyingToReceive Amount of underlying to receive function getExpectedAssetAmount( address asset, uint256 amount ) public view override returns (uint256 underlyingToReceive) { // calculate underlying asset amount to receive based on elETH amount and asset exchange rate underlyingToReceive = (amount * lrtOracle.elETHPrice()) / lrtOracle.getAssetPrice(asset); } /// @notice Calculates the amount of asset available for withdrawal. /// @param asset The asset address. /// @return availableAssetAmount The asset amount avaialble for withdrawal. function getAvailableAssetAmount( address asset ) public view override returns (uint256 availableAssetAmount) { ILRTDepositPool lrtDepositPool = ILRTDepositPool( lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL) ); uint256 totalAssets = lrtDepositPool.getTotalAssetDeposits(asset); availableAssetAmount = totalAssets > assetsCommitted[asset] ? totalAssets - assetsCommitted[asset] : 0; } /// @notice View user withdrawal request /// @param asset Asset address /// @param user User address /// @param userIndex Index in list of users withdrawal request function getUserWithdrawalRequest( address asset, address user, uint256 userIndex ) public view override returns ( uint256 elETHAmount, uint256 expectedAssetAmount, uint256 withdrawalStartBlock ) { bytes32 requestId = getRequestId( asset, userAssociatedNonces[asset][user].at(userIndex) ); elETHAmount = withdrawalRequests[requestId].elETHUnstaked; expectedAssetAmount = withdrawalRequests[requestId].expectedAssetAmount; withdrawalStartBlock = withdrawalRequests[requestId] .withdrawalStartBlock; } function getUserWithdrawlLength( address asset, address user ) external view returns (uint256) { return userAssociatedNonces[asset][user].length(); } /*////////////////////////////////////////////////////////////// User Withdrawal functions //////////////////////////////////////////////////////////////*/ /// @notice Initiates a withdrawal request for converting elETH to a specified LST. /// @param asset The LST address the user wants to receive. /// @param elETHUnstaked The amount of elETH the user wishes to unstake. /// @dev This function is only callable by the user and is used to initiate a withdrawal request for a specific /// asset. Will be finalised by calling `completeWithdrawal` after the manager unlocked the request and the delay /// has past. There is an edge case were the user withdraws last underlying asset and that asset gets slashed. function initiateWithdrawal( address asset, uint256 elETHUnstaked ) external override whenNotPaused nonReentrant onlySupportedLST(asset) { if (elETHUnstaked == 0 || elETHUnstaked < minAmountToWithdraw[asset]) { revert InvalidAmountToWithdraw(); } IERC20(elETH).safeTransferFrom( msg.sender, address(this), elETHUnstaked ); uint256 expectedAssetAmount = getExpectedAssetAmount( asset, elETHUnstaked ); // Ensure the withdrawal does not exceed the available shares. if (expectedAssetAmount > getAvailableAssetAmount(asset)) { revert ExceedAmountToWithdraw(); } // preventing over-withdrawal. assetsCommitted[asset] += expectedAssetAmount; _addUserWithdrawalRequest(asset, elETHUnstaked, expectedAssetAmount); emit AssetWithdrawalQueued(msg.sender, asset, elETHUnstaked); } /// @notice Completes a user's withdrawal process by transferring the LST amount corresponding to the elETH /// unstaked. /// @param asset The asset address the user wishes to withdraw. function completeWithdrawal( address asset ) external payable whenNotPaused onlySupportedLST(asset) nonReentrant { // Retrieve and remove the oldest withdrawal request for the user. uint256 usersFirstWithdrawalRequestNonce = userAssociatedNonces[asset][ msg.sender ].popFront(); // Ensure the request is already unlocked. if (usersFirstWithdrawalRequestNonce >= nextLockedNonce[asset]) { revert WithdrawalLocked(); } bytes32 requestId = getRequestId( asset, usersFirstWithdrawalRequestNonce ); WithdrawalRequest memory request = withdrawalRequests[requestId]; delete withdrawalRequests[requestId]; // Check that the withdrawal delay has passed since the request's initiation. if ( block.number < request.withdrawalStartBlock + withdrawalDelayBlocks ) { revert WithdrawalDelayNotPassed(); } TransferHelper.safeTransferToken( asset, msg.sender, request.expectedAssetAmount ); emit AssetWithdrawalFinalized( msg.sender, asset, request.elETHUnstaked, request.expectedAssetAmount ); } /*////////////////////////////////////////////////////////////// MANAGER UNSTAKING FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice Unlocks assets in the queue up to a specified limit. /// @param asset The address of the asset to unlock. /// @param firstExcludedIndex First withdrawal requests index that will not be considered for unlocking. /// @param minimumAssetPrice The minimum acceptable price for the asset. /// @param minimumElEthPrice The minimum acceptable price for elETH. function unlockQueue( address asset, uint256 firstExcludedIndex, uint256 minimumAssetPrice, uint256 minimumElEthPrice ) external nonReentrant onlySupportedLST(asset) onlyRole(LRTConstants.ADMIN_ROLE) returns (uint256 elETHBurned, uint256 assetAmountUnlocked) { uint256 elETHPrice = lrtOracle.elETHPrice(); uint256 assetPrice = lrtOracle.getAssetPrice(asset); // Ensure the current prices meet or exceed the minimum required prices. if (elETHPrice < minimumElEthPrice) revert ElETHPriceMustBeGreaterMinimum(elETHPrice); if (assetPrice < minimumAssetPrice) revert AssetPriceMustBeGreaterMinimum(assetPrice); uint256 totalAvailableAssets = ILRTUnstakingVault(lrtUnstakingVault) .balanceOf(asset); if (totalAvailableAssets == 0) { revert AmountMustBeGreaterThanZero(); } // Updates and unlocks withdrawal requests up to a specified upper limit or until allocated assets are fully // utilized. (elETHBurned, assetAmountUnlocked) = _unlockWithdrawalRequests( asset, totalAvailableAssets, elETHPrice, assetPrice, firstExcludedIndex ); if (elETHBurned != 0) { IelETH(elETH).burn(address(this), elETHBurned); } // Take the amount to distribute from vault ILRTUnstakingVault(lrtUnstakingVault).redeem( asset, assetAmountUnlocked ); emit AssetUnlocked( asset, elETHBurned, assetAmountUnlocked, elETHPrice, assetPrice ); } /*////////////////////////////////////////////////////////////// MANAGER FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice update min amount to withdraw /// @dev only callable by LRT admin /// @param asset Asset address /// @param minAmountToWithdraw_ Minimum amount to withdraw function setMinAmountToWithdraw( address asset, uint256 minAmountToWithdraw_ ) external onlyRole(LRTConstants.ADMIN_ROLE) { minAmountToWithdraw[asset] = minAmountToWithdraw_; emit MinAmountToWithdrawUpdated(asset, minAmountToWithdraw_); } /// @notice update withdrawal delay /// @dev only callable by LRT admin /// @param withdrawalDelayBlocks_ The amount of blocks to wait till to complete a withdraw function setWithdrawalDelayBlocks( uint256 withdrawalDelayBlocks_ ) external onlyRole(LRTConstants.ADMIN_ROLE) { withdrawalDelayBlocks = withdrawalDelayBlocks_; emit WithdrawalDelayBlocksUpdated(withdrawalDelayBlocks); } /// @dev Triggers stopped state. Contract must not be paused. function pause() external onlyRole(LRTConstants.ADMIN_ROLE) { _pause(); } /// @dev Returns to normal state. Contract must be paused function unpause() external onlyRole(LRTConstants.ADMIN_ROLE) { _unpause(); } /*////////////////////////////////////////////////////////////// INTERNAL FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice Registers a new request for withdrawing an asset in exchange for elETH. /// @param asset The address of the asset being withdrawn. /// @param elETHUnstaked The amount of elETH being exchanged. /// @param expectedAssetAmount The expected amount of the asset to be received upon withdrawal completion. function _addUserWithdrawalRequest( address asset, uint256 elETHUnstaked, uint256 expectedAssetAmount ) internal { // Generate a unique identifier for the new withdrawal request. bytes32 requestId = getRequestId(asset, nextUnusedNonce[asset]); // Create and store the new withdrawal request. withdrawalRequests[requestId] = WithdrawalRequest({ elETHUnstaked: elETHUnstaked, expectedAssetAmount: expectedAssetAmount, withdrawalStartBlock: block.number }); // Map the user to the newly created request index and increment the nonce for future requests. userAssociatedNonces[asset][msg.sender].pushBack( nextUnusedNonce[asset] ); nextUnusedNonce[asset]++; } /// @dev Unlocks user withdrawal requests based on current asset availability and prices. /// Iterates through pending requests and unlocks them until the provided asset amount is fully allocated. /// @param asset The asset's address for which withdrawals are being processed. /// @param elETHPrice Current elETH to ETH exchange rate. /// @param assetPrice Current asset to ETH exchange rate. /// @param firstExcludedIndex First withdrawal requests index that will not be considered for unlocking. /// @return elETHAmountToBurn The total amount of elETH unlocked for withdrawals. /// @return assetAmountToUnlock The total asset amount allocated to unlocked withdrawals. function _unlockWithdrawalRequests( address asset, uint256 availableAssetAmount, uint256 elETHPrice, uint256 assetPrice, uint256 firstExcludedIndex ) internal returns (uint256 elETHAmountToBurn, uint256 assetAmountToUnlock) { // Check that upper limit is in the range of existing withdrawal requests. If it is greater set it to the first // nonce with no withdrawal request. if (firstExcludedIndex > nextUnusedNonce[asset]) { firstExcludedIndex = nextUnusedNonce[asset]; } // Revert when trying to unlock a request that has already been unlocked if (nextLockedNonce[asset] >= firstExcludedIndex) revert NoPendingWithdrawals(); while (nextLockedNonce[asset] < firstExcludedIndex) { bytes32 requestId = getRequestId(asset, nextLockedNonce[asset]); WithdrawalRequest storage request = withdrawalRequests[requestId]; // Calculate the amount user will recieve uint256 payoutAmount = _calculatePayoutAmount( request, elETHPrice, assetPrice ); if (availableAssetAmount < payoutAmount) break; // Exit if not enough assets to cover this request assetsCommitted[asset] -= request.expectedAssetAmount; // Set the amount the user will recieve request.expectedAssetAmount = payoutAmount; elETHAmountToBurn += request.elETHUnstaked; availableAssetAmount -= payoutAmount; assetAmountToUnlock += payoutAmount; unchecked { nextLockedNonce[asset]++; } } } /// @notice Determines the final amount to be disbursed to the user, based on the lesser of the initially /// expected asset amount and the currently calculated return. /// @param request The specific withdrawal request being processed. /// @param elETHPrice The latest exchange rate of elETH to ETH. /// @param assetPrice The latest exchange rate of the asset to ETH. /// @return The final amount the user is going to receive. function _calculatePayoutAmount( WithdrawalRequest memory request, uint256 elETHPrice, uint256 assetPrice ) private pure returns (uint256) { uint256 currentReturn = (request.elETHUnstaked * elETHPrice) / assetPrice; return (request.expectedAssetAmount < currentReturn) ? request.expectedAssetAmount : currentReturn; } receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } 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(IAccessControlUpgradeable).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 ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// 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 IAccessControlUpgradeable { /** * @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.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// 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 IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // 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); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; 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)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); 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.7.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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; library AddressLib { address public constant PLATFORM_TOKEN_ADDRESS = 0xeFEfeFEfeFeFEFEFEfefeFeFefEfEfEfeFEFEFEf; function isPlatformToken(address addr) internal pure returns (bool) { return addr == PLATFORM_TOKEN_ADDRESS; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./AddressLib.sol"; library TransferHelper { using AddressLib for address; function safeTransferToken( address token, address to, uint value ) internal { if (token.isPlatformToken()) { safeTransferETH(to, value); } else { safeTransfer(IERC20(token), to, value); } } function safeTransferETH( address to, uint value ) internal { (bool success, ) = address(to).call{value: value}(""); require(success, "TransferHelper: Sending ETH failed"); } function balanceOf(address token, address addr) internal view returns (uint) { if (token.isPlatformToken()) { return addr.balance; } else { return IERC20(token).balanceOf(addr); } } function safeTransfer( IERC20 token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))) -> 0xa9059cbb (bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))) -> 0x23b872dd (bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransferFrom: transfer failed' ); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; interface IelETH is IERC20Upgradeable { function mint(address, uint256) external; function burn(address, uint256) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ILRTConfig { function getContract(bytes32 _contractKey) external view returns (address); function isSupportedAsset(address _asset) external view returns (bool); function getSupportedAssets() external view returns (address[] memory); function getStrategy(address _asset) external view returns (address); function getAssetSwitch( address _asset, bytes32 _switchKey ) external view returns (bool); function getGlobalDepositLimitByAsset( address _asset ) external view returns (uint256); function getUserDepositLimitByAsset( address _user, address _asset ) external view returns (uint256); event ContractSet( bytes32 indexed _contractKey, address indexed _contractAddress ); event SupportedAssetAdded(address indexed _asset); event SupportedAssetRemoved(address indexed _asset); event AssetStrategySet(address indexed _asset, address indexed _strategy); event AssetSwitchSet( address indexed _asset, bytes32 indexed _switchKey, bool _value ); event GlobalDepositLimitByAssetSet(address indexed _asset, uint256 _limit); event UserDepositLimitByAssetSet( address indexed _user, address indexed _asset, uint256 _limit ); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ILRTDepositPool { function getELETHAmountToMint( address _asset, uint256 _amount ) external view returns (uint256); function depositAsset( address _asset, uint256 _amount, uint256 _minELETHAmountToReceive, string calldata _referralId ) external payable returns (uint256); function getTotalAssetDeposits( address _asset ) external view returns (uint256); function getAssetDistributionData( address _asset ) external view returns ( uint256 assetLyingInDepositPool, uint256 assetLyingInProxy, uint256 assetStakedInEigenLayer, uint256 assetUnstakingFromEigenLayer, uint256 assetLyingUnstakingVault ); event AssetDeposited( address indexed _user, address indexed _asset, uint256 _amount, uint256 _elETHAmount, string _referralId ); event AssetTransferedToProxy( address indexed _asset, uint256 _amount, address indexed _proxy ); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ILRTOracle { function getAssetPrice(address _asset) external view returns (uint256); function elETHPrice() external view returns (uint256); event ElETHSet(address indexed elETH); event DepositPoolSet(address indexed depositPool); event LRTConfigSet(address indexed lrtConfig); event AssetPriceOracleUpdate( address indexed asset, address indexed priceOracle ); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ILRTUnstakingVault { error CallerNotLRTProxy(); error CallerNotLRTWithdrawalManager(); event SharesUnstakingAdded(address asset, uint256 amount); event SharesUnstakingReduced(address asset, uint256 amount); event Redeemed(address asset, uint256 amount); event EthReceived(address sender, uint256 amount); function sharesUnstaking(address asset) external view returns (uint256); function getAssetsUnstaking(address asset) external view returns (uint256); function balanceOf(address asset) external view returns (uint256); function addSharesUnstaking(address asset, uint256 amount) external; function reduceSharesUnstaking(address asset, uint256 amount) external; function redeem(address asset, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ILRTWithdrawalManager { //errors error InvalidAmountToWithdraw(); error ExceedAmountToWithdraw(); error WithdrawalLocked(); error WithdrawalDelayNotPassed(); error NoPendingWithdrawals(); error AmountMustBeGreaterThanZero(); error NotSupportedLST(); error ElETHPriceMustBeGreaterMinimum(uint256 elETHPrice); error AssetPriceMustBeGreaterMinimum(uint256 assetPrice); struct WithdrawalRequest { uint256 elETHUnstaked; uint256 expectedAssetAmount; uint256 withdrawalStartBlock; } //events event AssetWithdrawalQueued( address indexed withdrawer, address asset, uint256 elETHUnstaked ); event AssetWithdrawalFinalized( address indexed withdrawer, address indexed asset, uint256 amountBurned, uint256 amountReceived ); event EtherReceived( address indexed depositor, uint256 ethAmount, uint256 sharesAmount ); event AssetUnlocked( address asset, uint256 elETHAmount, uint256 assetAmount, uint256 rsEThPrice, uint256 assetPrice ); event MinAmountToWithdrawUpdated( address asset, uint256 minAmountToWithdraw ); event WithdrawalDelayBlocksUpdated(uint256 withdrawalDelayBlocks); // methods function getExpectedAssetAmount( address asset, uint256 amount ) external view returns (uint256); function getAvailableAssetAmount( address asset ) external view returns (uint256 assetAmount); function getUserWithdrawalRequest( address asset, address user, uint256 index ) external view returns ( uint256 elETHAmount, uint256 expectedAssetAmount, uint256 withdrawalStartBlock ); function initiateWithdrawal(address asset, uint256 withdrawAmount) external; function completeWithdrawal(address asset) external payable; function unlockQueue( address asset, uint256 index, uint256 minimumAssetPrice, uint256 minimumElEthPrice ) external returns (uint256 elETHBurned, uint256 assetAmountUnlocked); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; /** * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that * the existing queue contents are left in storage. * * The struct is called `Uint256Deque`. Other types can be cast to and from `uint128`. This data structure can only be * used in storage, and not in memory. * ```solidity * DoubleEndedQueue.Uint256Deque queue; * ``` */ library DoubleEndedQueue { /** * @dev An operation (e.g. {front}) couldn't be completed due to the queue being empty. */ error QueueEmpty(); /** * @dev A push operation couldn't be completed due to the queue being full. */ error QueueFull(); /** * @dev An operation (e.g. {at}) couldn't be completed due to an index being out of bounds. */ error QueueOutOfBounds(); /** * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access. * * Struct members have an underscore prefix indicating that they are "private" and should not be read or written to * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and * lead to unexpected behavior. * * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around. */ struct Uint256Deque { uint128 _begin; uint128 _end; mapping(uint128 => uint256) _data; } /** * @dev Inserts an item at the end of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushBack(Uint256Deque storage deque, uint256 value) internal { unchecked { uint128 backIndex = deque._end; if (backIndex + 1 == deque._begin) revert QueueFull(); deque._data[backIndex] = value; deque._end = backIndex + 1; } } /** * @dev Removes the item at the end of the queue and returns it. * * Reverts with {QueueEmpty} if the queue is empty. */ function popBack( Uint256Deque storage deque ) internal returns (uint256 value) { unchecked { uint128 backIndex = deque._end; if (backIndex == deque._begin) revert QueueEmpty(); --backIndex; value = deque._data[backIndex]; delete deque._data[backIndex]; deque._end = backIndex; } } /** * @dev Inserts an item at the beginning of the queue. * * Reverts with {QueueFull} if the queue is full. */ function pushFront(Uint256Deque storage deque, uint256 value) internal { unchecked { uint128 frontIndex = deque._begin - 1; if (frontIndex == deque._end) revert QueueFull(); deque._data[frontIndex] = value; deque._begin = frontIndex; } } /** * @dev Removes the item at the beginning of the queue and returns it. * * Reverts with `QueueEmpty` if the queue is empty. */ function popFront( Uint256Deque storage deque ) internal returns (uint256 value) { unchecked { uint128 frontIndex = deque._begin; if (frontIndex == deque._end) revert QueueEmpty(); value = deque._data[frontIndex]; delete deque._data[frontIndex]; deque._begin = frontIndex + 1; } } /** * @dev Returns the item at the beginning of the queue. * * Reverts with `QueueEmpty` if the queue is empty. */ function front( Uint256Deque storage deque ) internal view returns (uint256 value) { if (empty(deque)) revert QueueEmpty(); return deque._data[deque._begin]; } /** * @dev Returns the item at the end of the queue. * * Reverts with `QueueEmpty` if the queue is empty. */ function back( Uint256Deque storage deque ) internal view returns (uint256 value) { if (empty(deque)) revert QueueEmpty(); unchecked { return deque._data[deque._end - 1]; } } /** * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at * `length(deque) - 1`. * * Reverts with `QueueOutOfBounds` if the index is out of bounds. */ function at( Uint256Deque storage deque, uint256 index ) internal view returns (uint256 value) { if (index >= length(deque)) revert QueueOutOfBounds(); // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128 unchecked { return deque._data[deque._begin + uint128(index)]; } } /** * @dev Resets the queue back to being empty. * * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses * out on potential gas refunds. */ function clear(Uint256Deque storage deque) internal { deque._begin = 0; deque._end = 0; } /** * @dev Returns the number of items in the queue. */ function length( Uint256Deque storage deque ) internal view returns (uint256) { unchecked { return uint256(deque._end - deque._begin); } } /** * @dev Returns true if the queue is empty. */ function empty(Uint256Deque storage deque) internal view returns (bool) { return deque._end == deque._begin; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "../Interfaces/ILRTConfig.sol"; abstract contract LRTChecker { ILRTConfig public lrtConfig; modifier onlySupportedAsset(address _asset) { require(lrtConfig.isSupportedAsset(_asset), "asset not supported!"); _; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; library LRTConstants { // Roles bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); // contracts bytes32 public constant LRT_DEPOSIT_POOL = keccak256("LRT_DEPOSIT_POOL"); bytes32 public constant LRT_PROXY = keccak256("LRT_PROXY"); bytes32 public constant LRT_WITHDRAW_MANAGER = keccak256("LRT_WITHDRAW_MANAGER"); bytes32 public constant LRT_UNSTAKING_VAULT = keccak256("LRT_UNSTAKING_VAULT"); bytes32 public constant EIGEN_POD_MANAGER = keccak256("EIGEN_POD_MANAGER"); bytes32 public constant EIGEN_STRATEGY_MANAGER = keccak256("EIGEN_STRATEGY_MANAGER"); bytes32 public constant EIGEN_DELEGATION_MANAGER = keccak256("EIGEN_DELEGATION_MANAGER"); bytes32 public constant BEACON_CHAIN_ETH_STRATEGY = keccak256("BEACON_CHAIN_ETH_STRATEGY"); // swtiches bytes32 public constant SWITCH_DEPOSIT_ASSET_TO_STRATEGY = keccak256("SWITCH_DEPOSIT_ASSET_TO_STRATEGY"); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AmountMustBeGreaterThanZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"assetPrice","type":"uint256"}],"name":"AssetPriceMustBeGreaterMinimum","type":"error"},{"inputs":[{"internalType":"uint256","name":"elETHPrice","type":"uint256"}],"name":"ElETHPriceMustBeGreaterMinimum","type":"error"},{"inputs":[],"name":"ExceedAmountToWithdraw","type":"error"},{"inputs":[],"name":"InvalidAmountToWithdraw","type":"error"},{"inputs":[],"name":"NoPendingWithdrawals","type":"error"},{"inputs":[],"name":"NotSupportedLST","type":"error"},{"inputs":[],"name":"QueueEmpty","type":"error"},{"inputs":[],"name":"QueueFull","type":"error"},{"inputs":[],"name":"QueueOutOfBounds","type":"error"},{"inputs":[],"name":"WithdrawalDelayNotPassed","type":"error"},{"inputs":[],"name":"WithdrawalLocked","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"elETHAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rsEThPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetPrice","type":"uint256"}],"name":"AssetUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountBurned","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"}],"name":"AssetWithdrawalFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"elETHUnstaked","type":"uint256"}],"name":"AssetWithdrawalQueued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesAmount","type":"uint256"}],"name":"EtherReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"minAmountToWithdraw","type":"uint256"}],"name":"MinAmountToWithdrawUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"withdrawalDelayBlocks","type":"uint256"}],"name":"WithdrawalDelayBlocksUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetsCommitted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"completeWithdrawal","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"elETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getAvailableAssetAmount","outputs":[{"internalType":"uint256","name":"availableAssetAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getExpectedAssetAmount","outputs":[{"internalType":"uint256","name":"underlyingToReceive","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"requestIndex","type":"uint256"}],"name":"getRequestId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"userIndex","type":"uint256"}],"name":"getUserWithdrawalRequest","outputs":[{"internalType":"uint256","name":"elETHAmount","type":"uint256"},{"internalType":"uint256","name":"expectedAssetAmount","type":"uint256"},{"internalType":"uint256","name":"withdrawalStartBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"getUserWithdrawlLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"_lrtConfig","type":"address"},{"internalType":"address","name":"_elETH","type":"address"},{"internalType":"address","name":"_lrtOracle","type":"address"},{"internalType":"address","name":"_lrtUnstakingVault","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"elETHUnstaked","type":"uint256"}],"name":"initiateWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lrtConfig","outputs":[{"internalType":"contract ILRTConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lrtOracle","outputs":[{"internalType":"contract ILRTOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lrtUnstakingVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minAmountToWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nextLockedNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nextUnusedNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"minAmountToWithdraw_","type":"uint256"}],"name":"setMinAmountToWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"withdrawalDelayBlocks_","type":"uint256"}],"name":"setWithdrawalDelayBlocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"firstExcludedIndex","type":"uint256"},{"internalType":"uint256","name":"minimumAssetPrice","type":"uint256"},{"internalType":"uint256","name":"minimumElEthPrice","type":"uint256"}],"name":"unlockQueue","outputs":[{"internalType":"uint256","name":"elETHBurned","type":"uint256"},{"internalType":"uint256","name":"assetAmountUnlocked","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userAssociatedNonces","outputs":[{"internalType":"uint128","name":"_begin","type":"uint128"},{"internalType":"uint128","name":"_end","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalDelayBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"withdrawalRequests","outputs":[{"internalType":"uint256","name":"elETHUnstaked","type":"uint256"},{"internalType":"uint256","name":"expectedAssetAmount","type":"uint256"},{"internalType":"uint256","name":"withdrawalStartBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000f1565b600054600160a81b900460ff1615620000915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff600160a01b90910481161015620000ef576000805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b612ef180620001016000396000f3fe6080604052600436106101e65760003560e01c80636359b87211610102578063b6cf3fef11610095578063f1650a4611610064578063f1650a46146106aa578063f5abc562146106ca578063f8c8765e146106ea578063fac48eea1461070a57600080fd5b8063b6cf3fef1461060e578063c1af971a1461063c578063c8393ba91461066a578063d547741f1461068a57600080fd5b806386f26f77116100d157806386f26f771461055e57806391d148541461057e5780639cd89e99146105c4578063a217fddf146105f957600080fd5b80636359b872146104a95780636dbaf9ee146104c95780637cef12ae146104dc5780638456cb591461054957600080fd5b806336568abe1161017a5780634d50f9a4116101495780634d50f9a41461043b57806350f73e7c1461045b5780635c975abb146104715780635f57f9681461048957600080fd5b806336568abe146103845780633ddd2511146103a45780633f4ba83a1461040657806347204df11461041b57600080fd5b8063248a9ca3116101b6578063248a9ca3146102da57806329db05e11461030a5780632cb2f198146103425780632f2ff15d1461036257600080fd5b8062918407146101f257806301ffc9a7146102255780630c955fb414610255578063124b82a51461028257600080fd5b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021261020d366004612ac4565b610738565b6040519081526020015b60405180910390f35b34801561023157600080fd5b50610245610240366004612afd565b610785565b604051901515815260200161021c565b34801561026157600080fd5b50610212610270366004612b3f565b60fe6020526000908152604090205481565b34801561028e57600080fd5b506102bf61029d366004612b5c565b6101026020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161021c565b3480156102e657600080fd5b506102126102f5366004612b5c565b600090815260c9602052604090206001015490565b34801561031657600080fd5b5060fc5461032a906001600160a01b031681565b6040516001600160a01b03909116815260200161021c565b34801561034e57600080fd5b5060fd5461032a906001600160a01b031681565b34801561036e57600080fd5b5061038261037d366004612b75565b61081c565b005b34801561039057600080fd5b5061038261039f366004612b75565b610846565b3480156103b057600080fd5b506102126103bf366004612b9a565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b34801561041257600080fd5b506103826108d7565b34801561042757600080fd5b506102bf610436366004612bc6565b61090c565b34801561044757600080fd5b50610382610456366004612b5c565b610975565b34801561046757600080fd5b5061021260ff5481565b34801561047d57600080fd5b5060335460ff16610245565b34801561049557600080fd5b506102126104a4366004612b3f565b6109db565b3480156104b557600080fd5b506102126104c4366004612b9a565b610b60565b6103826104d7366004612b3f565b610c5a565b3480156104e857600080fd5b506105296104f7366004612ac4565b6101036020908152600092835260408084209091529082529020546001600160801b0380821691600160801b90041682565b604080516001600160801b0393841681529290911660208301520161021c565b34801561055557600080fd5b50610382610fa7565b34801561056a57600080fd5b50610382610579366004612b9a565b610fd9565b34801561058a57600080fd5b50610245610599366004612b75565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156105d057600080fd5b506105e46105df366004612c07565b61105c565b6040805192835260208301919091520161021c565b34801561060557600080fd5b50610212600081565b34801561061a57600080fd5b50610212610629366004612b3f565b6101046020526000908152604090205481565b34801561064857600080fd5b50610212610657366004612b3f565b6101006020526000908152604090205481565b34801561067657600080fd5b50610382610685366004612b9a565b6115d3565b34801561069657600080fd5b506103826106a5366004612b75565b6118b2565b3480156106b657600080fd5b5060005461032a906001600160a01b031681565b3480156106d657600080fd5b5060fb5461032a906001600160a01b031681565b3480156106f657600080fd5b50610382610705366004612c42565b6118d7565b34801561071657600080fd5b50610212610725366004612b3f565b6101016020526000908152604090205481565b6001600160a01b038281166000908152610103602090815260408083209385168352929052908120546001600160801b03808216600160801b909204811691909103165b90505b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061077f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461077f565b600082815260c9602052604090206001015461083781611ad9565b6108418383611ae3565b505050565b6001600160a01b03811633146108c95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6108d38282611b85565b5050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561090181611ad9565b610909611c08565b50565b6001600160a01b03808416600090815261010360209081526040808320938616835292905290812081908190819061094a9088906103bf9088611c5a565b6000908152610102602052604090208054600182015460029092015490999198509650945050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561099f81611ad9565b60ff8290556040518281527f2e56f6093fb947ef7b002dcdf68fcb314c466a1917eac6fa5b00879a7f5de63f9060200160405180910390a15050565b600080546040517fe16c7d980000000000000000000000000000000000000000000000000000000081527f7a8fe1bac8d7638862c53b62ffada56d0a56c381287c35f66503b5b86fa88b85600482015282916001600160a01b03169063e16c7d9890602401602060405180830381865afa158015610a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a819190612c9e565b6040517f52c4889f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301529192506000918316906352c4889f90602401602060405180830381865afa158015610ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0a9190612cbb565b6001600160a01b038516600090815261010460205260409020549091508111610b34576000610b58565b6001600160a01b03841660009081526101046020526040902054610b589082612cea565b949350505050565b60fc5460405163b3596f0760e01b81526001600160a01b038481166004830152600092169063b3596f0790602401602060405180830381865afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf9190612cbb565b60fc60009054906101000a90046001600160a01b03166001600160a01b031663a539550b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c469190612cbb565b610c509084612cfd565b61077c9190612d14565b610c62611cde565b600054604051634df48c7360e11b81526001600160a01b03808416600483015283921690639be918e690602401602060405180830381865afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190612d36565b1580610cf8575073efefefefefefefefefefefefefefefefefefefef6001600160a01b038216145b80610d7857506000805460405163f8806a1360e01b81526001600160a01b0384811660048301529091169063f8806a1390602401602060405180830381865afa158015610d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6d9190612c9e565b6001600160a01b0316145b15610d96576040516327600db160e01b815260040160405180910390fd5b600260655403610de85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c0565b60026065556001600160a01b0382166000908152610103602090815260408083203384529091528120610e1a90611d33565b6001600160a01b038416600090815261010160205260409020549091508110610e6f576040517f321116dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516bffffffffffffffffffffffff19606086901b1660208083019190915260348083018590528351808403909101815260548301808552815191830191909120600081815261010280855286822060b4870190975286548452600187018054607488015260028801805460949098019788528484529190955295819055928390559190935560ff549151909291610f0891612d58565b431015610f41576040517f7d8488e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5085338360200151611dd9565b805160208083015160408051938452918301526001600160a01b0387169133917fca13475b00c46ee0ce4a479bd18ed747ff89395e96e93779ba7f18cbe1735fb4910160405180910390a350506001606555505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610fd181611ad9565b610909611e12565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561100381611ad9565b6001600160a01b038316600081815260fe6020908152604091829020859055815192835282018490527fde4ed37901dc230db7df5ec2ec48bb07c4286fa1c66128cd200c6b6e9cd2bc83910160405180910390a1505050565b6000806002606554036110b15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c0565b6002606555600054604051634df48c7360e11b81526001600160a01b03808916600483015288921690639be918e690602401602060405180830381865afa158015611100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111249190612d36565b158061114c575073efefefefefefefefefefefefefefefefefefefef6001600160a01b038216145b806111cc57506000805460405163f8806a1360e01b81526001600160a01b0384811660048301529091169063f8806a1390602401602060405180830381865afa15801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c19190612c9e565b6001600160a01b0316145b156111ea576040516327600db160e01b815260040160405180910390fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561121481611ad9565b60fc54604080517fa539550b00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163a539550b9160048083019260209291908290030181865afa158015611277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129b9190612cbb565b60fc5460405163b3596f0760e01b81526001600160a01b038c811660048301529293506000929091169063b3596f0790602401602060405180830381865afa1580156112eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130f9190612cbb565b90508682101561134e576040517f2f25f4ee000000000000000000000000000000000000000000000000000000008152600481018390526024016108c0565b8781101561138b576040517f4f216ee7000000000000000000000000000000000000000000000000000000008152600481018290526024016108c0565b60fd546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038c8116600483015260009216906370a0823190602401602060405180830381865afa1580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114139190612cbb565b90508060000361144f576040517f5e85ae7300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61145c8b8285858e611e4f565b909750955086156114e55760fb546040517f9dc29fac000000000000000000000000000000000000000000000000000000008152306004820152602481018990526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b1580156114cc57600080fd5b505af11580156114e0573d6000803e3d6000fd5b505050505b60fd546040517f1e9a69500000000000000000000000000000000000000000000000000000000081526001600160a01b038d811660048301526024820189905290911690631e9a695090604401600060405180830381600087803b15801561154c57600080fd5b505af1158015611560573d6000803e3d6000fd5b5050604080516001600160a01b038f168152602081018b905290810189905260608101869052608081018590527f72e38cd9e650a56d27bba7e1a9a8d6f77dc5cc382bb38a7e56f4f1e845be910d925060a001905060405180910390a15050505050600160658190555094509492505050565b6115db611cde565b60026065540361162d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c0565b6002606555600054604051634df48c7360e11b81526001600160a01b03808516600483015284921690639be918e690602401602060405180830381865afa15801561167c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a09190612d36565b15806116c8575073efefefefefefefefefefefefefefefefefefefef6001600160a01b038216145b8061174857506000805460405163f8806a1360e01b81526001600160a01b0384811660048301529091169063f8806a1390602401602060405180830381865afa158015611719573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173d9190612c9e565b6001600160a01b0316145b15611766576040516327600db160e01b815260040160405180910390fd5b81158061178a57506001600160a01b038316600090815260fe602052604090205482105b156117c1576040517fe70dea0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb546117d9906001600160a01b031633308561203c565b60006117e58484610b60565b90506117f0846109db565b811115611829576040517f9fd55ef600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384166000908152610104602052604081208054839290611852908490612d58565b9091555061186390508484836120ca565b604080516001600160a01b03861681526020810185905233917ff79eabc24df3643a1dfc26dde4d79b5bde29ce49ca096544d28132e66ce6c6ff910160405180910390a2505060016065555050565b600082815260c960205260409020600101546118cd81611ad9565b6108418383611b85565b600054600160a81b900460ff16158080156118ff57506000546001600160a01b90910460ff16105b806119205750303b1580156119205750600054600160a01b900460ff166001145b6119925760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108c0565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580156119da576000805460ff60a81b1916600160a81b1790555b6119e26121ac565b6119ea612219565b6119f2612292565b600080546001600160a01b038088167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617835560fb805488831690841617905560fc805487831690841617905560fd80549186169190921617905561e10060ff55611a609033611ae3565b611a8a7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611ae3565b8015611ad2576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6109098133612306565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff166108d357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611b413390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff16156108d357600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b611c10612386565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000611c7e83546001600160801b03808216600160801b9092048116919091031690565b8210611cb6576040517f580821e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5081546001600160801b03908116820116600090815260018301602052604090205492915050565b60335460ff1615611d315760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108c0565b565b80546000906001600160801b0380821691600160801b9004168103611d84576040517f75e52f4f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160801b038181166000908152600185810160205260408220805492905585547fffffffffffffffffffffffffffffffff00000000000000000000000000000000169301909116919091179092555090565b73efefefefefefefefefefefefefefefefefefefef6001600160a01b03841603611e075761084182826123d8565b6108418383836124a1565b611e1a611cde565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611c3d3390565b6001600160a01b038516600090815261010060205260408120548190831115611e8f576001600160a01b0387166000908152610100602052604090205492505b6001600160a01b038716600090815261010160205260409020548311611ee1576040517f0ac1d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03871660009081526101016020526040902054831115612032576001600160a01b0387166000908152610101602090815260408083205481516bffffffffffffffffffffffff1960608d901b1681850152603480820192909252825180820390920182526054810180845282519285019290922080865261010290945282852060b482019093528254825260018301546074820152600283015460949091015291929091611f97908989612609565b905080891015611fa957505050612032565b60018201546001600160a01b038b166000908152610104602052604081208054909190611fd7908490612cea565b9091555050600182018190558154611fef9086612d58565b9450611ffb818a612cea565b98506120078185612d58565b6001600160a01b038b16600090815261010160205260409020805460010190559350611ee192505050565b9550959350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526120c490859061264b565b50505050565b6001600160a01b038316600081815261010060209081526040808320805482516bffffffffffffffffffffffff1960608b901b1681860152603480820192909252835180820390920182526054810180855282519286019290922060b48201855289835260748201898152436094909301928352818852610102875285882093518455516001840155905160029092019190915594845254610103835281842033855290925290912061217c91612730565b6001600160a01b0384166000908152610100602052604081208054916121a183612d6b565b919050555050505050565b600054600160a81b900460ff16611d315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108c0565b600054600160a81b900460ff166122865760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108c0565b6033805460ff19169055565b600054600160a81b900460ff166122ff5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108c0565b6001606555565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff166108d357612344816001600160a01b031660146127ba565b61234f8360206127ba565b604051602001612360929190612da8565b60408051601f198184030181529082905262461bcd60e51b82526108c091600401612e29565b60335460ff16611d315760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108c0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612425576040519150601f19603f3d011682016040523d82523d6000602084013e61242a565b606091505b50509050806108415760405162461bcd60e51b815260206004820152602260248201527f5472616e7366657248656c7065723a2053656e64696e6720455448206661696c60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016108c0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052915160009283929087169161252b9190612e5c565b6000604051808303816000865af19150503d8060008114612568576040519150601f19603f3d011682016040523d82523d6000602084013e61256d565b606091505b50915091508180156125975750805115806125975750808060200190518101906125979190612d36565b611ad25760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c65640000000000000000000000000000000000000060648201526084016108c0565b6000808284866000015161261d9190612cfd565b6126279190612d14565b90508085602001511061263a5780612640565b84602001515b9150505b9392505050565b60006126a0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661299b9092919063ffffffff16565b80519091501561084157808060200190518101906126be9190612d36565b6108415760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108c0565b81546001600160801b03600160801b820481169181166001830190911603612784576040517f8acb5f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b606060006127c9836002612cfd565b6127d4906002612d58565b67ffffffffffffffff8111156127ec576127ec612e78565b6040519080825280601f01601f191660200182016040528015612816576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061284d5761284d612e8e565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061289857612898612e8e565b60200101906001600160f81b031916908160001a90535060006128bc846002612cfd565b6128c7906001612d58565b90505b600181111561294c577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061290857612908612e8e565b1a60f81b82828151811061291e5761291e612e8e565b60200101906001600160f81b031916908160001a90535060049490941c9361294581612ea4565b90506128ca565b50831561077c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108c0565b6060610b588484600085856001600160a01b0385163b6129fd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108c0565b600080866001600160a01b03168587604051612a199190612e5c565b60006040518083038185875af1925050503d8060008114612a56576040519150601f19603f3d011682016040523d82523d6000602084013e612a5b565b606091505b5091509150612a6b828286612a76565b979650505050505050565b60608315612a85575081612644565b825115612a955782518084602001fd5b8160405162461bcd60e51b81526004016108c09190612e29565b6001600160a01b038116811461090957600080fd5b60008060408385031215612ad757600080fd5b8235612ae281612aaf565b91506020830135612af281612aaf565b809150509250929050565b600060208284031215612b0f57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461077c57600080fd5b600060208284031215612b5157600080fd5b813561077c81612aaf565b600060208284031215612b6e57600080fd5b5035919050565b60008060408385031215612b8857600080fd5b823591506020830135612af281612aaf565b60008060408385031215612bad57600080fd5b8235612bb881612aaf565b946020939093013593505050565b600080600060608486031215612bdb57600080fd5b8335612be681612aaf565b92506020840135612bf681612aaf565b929592945050506040919091013590565b60008060008060808587031215612c1d57600080fd5b8435612c2881612aaf565b966020860135965060408601359560600135945092505050565b60008060008060808587031215612c5857600080fd5b8435612c6381612aaf565b93506020850135612c7381612aaf565b92506040850135612c8381612aaf565b91506060850135612c9381612aaf565b939692955090935050565b600060208284031215612cb057600080fd5b815161077c81612aaf565b600060208284031215612ccd57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561077f5761077f612cd4565b808202811582820484141761077f5761077f612cd4565b600082612d3157634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612d4857600080fd5b8151801515811461077c57600080fd5b8082018082111561077f5761077f612cd4565b600060018201612d7d57612d7d612cd4565b5060010190565b60005b83811015612d9f578181015183820152602001612d87565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612de0816017850160208801612d84565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612e1d816028840160208801612d84565b01602801949350505050565b6020815260008251806020840152612e48816040850160208701612d84565b601f01601f19169190910160400192915050565b60008251612e6e818460208701612d84565b9190910192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081612eb357612eb3612cd4565b50600019019056fea26469706673582212200fb679fb5b086316098c5aefbb9ba68bfb7723bcc0b39530f84156012a66164e64736f6c63430008110033
Deployed Bytecode
0x6080604052600436106101e65760003560e01c80636359b87211610102578063b6cf3fef11610095578063f1650a4611610064578063f1650a46146106aa578063f5abc562146106ca578063f8c8765e146106ea578063fac48eea1461070a57600080fd5b8063b6cf3fef1461060e578063c1af971a1461063c578063c8393ba91461066a578063d547741f1461068a57600080fd5b806386f26f77116100d157806386f26f771461055e57806391d148541461057e5780639cd89e99146105c4578063a217fddf146105f957600080fd5b80636359b872146104a95780636dbaf9ee146104c95780637cef12ae146104dc5780638456cb591461054957600080fd5b806336568abe1161017a5780634d50f9a4116101495780634d50f9a41461043b57806350f73e7c1461045b5780635c975abb146104715780635f57f9681461048957600080fd5b806336568abe146103845780633ddd2511146103a45780633f4ba83a1461040657806347204df11461041b57600080fd5b8063248a9ca3116101b6578063248a9ca3146102da57806329db05e11461030a5780632cb2f198146103425780632f2ff15d1461036257600080fd5b8062918407146101f257806301ffc9a7146102255780630c955fb414610255578063124b82a51461028257600080fd5b366101ed57005b600080fd5b3480156101fe57600080fd5b5061021261020d366004612ac4565b610738565b6040519081526020015b60405180910390f35b34801561023157600080fd5b50610245610240366004612afd565b610785565b604051901515815260200161021c565b34801561026157600080fd5b50610212610270366004612b3f565b60fe6020526000908152604090205481565b34801561028e57600080fd5b506102bf61029d366004612b5c565b6101026020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161021c565b3480156102e657600080fd5b506102126102f5366004612b5c565b600090815260c9602052604090206001015490565b34801561031657600080fd5b5060fc5461032a906001600160a01b031681565b6040516001600160a01b03909116815260200161021c565b34801561034e57600080fd5b5060fd5461032a906001600160a01b031681565b34801561036e57600080fd5b5061038261037d366004612b75565b61081c565b005b34801561039057600080fd5b5061038261039f366004612b75565b610846565b3480156103b057600080fd5b506102126103bf366004612b9a565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b34801561041257600080fd5b506103826108d7565b34801561042757600080fd5b506102bf610436366004612bc6565b61090c565b34801561044757600080fd5b50610382610456366004612b5c565b610975565b34801561046757600080fd5b5061021260ff5481565b34801561047d57600080fd5b5060335460ff16610245565b34801561049557600080fd5b506102126104a4366004612b3f565b6109db565b3480156104b557600080fd5b506102126104c4366004612b9a565b610b60565b6103826104d7366004612b3f565b610c5a565b3480156104e857600080fd5b506105296104f7366004612ac4565b6101036020908152600092835260408084209091529082529020546001600160801b0380821691600160801b90041682565b604080516001600160801b0393841681529290911660208301520161021c565b34801561055557600080fd5b50610382610fa7565b34801561056a57600080fd5b50610382610579366004612b9a565b610fd9565b34801561058a57600080fd5b50610245610599366004612b75565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156105d057600080fd5b506105e46105df366004612c07565b61105c565b6040805192835260208301919091520161021c565b34801561060557600080fd5b50610212600081565b34801561061a57600080fd5b50610212610629366004612b3f565b6101046020526000908152604090205481565b34801561064857600080fd5b50610212610657366004612b3f565b6101006020526000908152604090205481565b34801561067657600080fd5b50610382610685366004612b9a565b6115d3565b34801561069657600080fd5b506103826106a5366004612b75565b6118b2565b3480156106b657600080fd5b5060005461032a906001600160a01b031681565b3480156106d657600080fd5b5060fb5461032a906001600160a01b031681565b3480156106f657600080fd5b50610382610705366004612c42565b6118d7565b34801561071657600080fd5b50610212610725366004612b3f565b6101016020526000908152604090205481565b6001600160a01b038281166000908152610103602090815260408083209385168352929052908120546001600160801b03808216600160801b909204811691909103165b90505b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061077f57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461077f565b600082815260c9602052604090206001015461083781611ad9565b6108418383611ae3565b505050565b6001600160a01b03811633146108c95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6108d38282611b85565b5050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561090181611ad9565b610909611c08565b50565b6001600160a01b03808416600090815261010360209081526040808320938616835292905290812081908190819061094a9088906103bf9088611c5a565b6000908152610102602052604090208054600182015460029092015490999198509650945050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561099f81611ad9565b60ff8290556040518281527f2e56f6093fb947ef7b002dcdf68fcb314c466a1917eac6fa5b00879a7f5de63f9060200160405180910390a15050565b600080546040517fe16c7d980000000000000000000000000000000000000000000000000000000081527f7a8fe1bac8d7638862c53b62ffada56d0a56c381287c35f66503b5b86fa88b85600482015282916001600160a01b03169063e16c7d9890602401602060405180830381865afa158015610a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a819190612c9e565b6040517f52c4889f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301529192506000918316906352c4889f90602401602060405180830381865afa158015610ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0a9190612cbb565b6001600160a01b038516600090815261010460205260409020549091508111610b34576000610b58565b6001600160a01b03841660009081526101046020526040902054610b589082612cea565b949350505050565b60fc5460405163b3596f0760e01b81526001600160a01b038481166004830152600092169063b3596f0790602401602060405180830381865afa158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf9190612cbb565b60fc60009054906101000a90046001600160a01b03166001600160a01b031663a539550b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c469190612cbb565b610c509084612cfd565b61077c9190612d14565b610c62611cde565b600054604051634df48c7360e11b81526001600160a01b03808416600483015283921690639be918e690602401602060405180830381865afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190612d36565b1580610cf8575073efefefefefefefefefefefefefefefefefefefef6001600160a01b038216145b80610d7857506000805460405163f8806a1360e01b81526001600160a01b0384811660048301529091169063f8806a1390602401602060405180830381865afa158015610d49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6d9190612c9e565b6001600160a01b0316145b15610d96576040516327600db160e01b815260040160405180910390fd5b600260655403610de85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c0565b60026065556001600160a01b0382166000908152610103602090815260408083203384529091528120610e1a90611d33565b6001600160a01b038416600090815261010160205260409020549091508110610e6f576040517f321116dc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516bffffffffffffffffffffffff19606086901b1660208083019190915260348083018590528351808403909101815260548301808552815191830191909120600081815261010280855286822060b4870190975286548452600187018054607488015260028801805460949098019788528484529190955295819055928390559190935560ff549151909291610f0891612d58565b431015610f41576040517f7d8488e000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5085338360200151611dd9565b805160208083015160408051938452918301526001600160a01b0387169133917fca13475b00c46ee0ce4a479bd18ed747ff89395e96e93779ba7f18cbe1735fb4910160405180910390a350506001606555505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610fd181611ad9565b610909611e12565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561100381611ad9565b6001600160a01b038316600081815260fe6020908152604091829020859055815192835282018490527fde4ed37901dc230db7df5ec2ec48bb07c4286fa1c66128cd200c6b6e9cd2bc83910160405180910390a1505050565b6000806002606554036110b15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c0565b6002606555600054604051634df48c7360e11b81526001600160a01b03808916600483015288921690639be918e690602401602060405180830381865afa158015611100573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111249190612d36565b158061114c575073efefefefefefefefefefefefefefefefefefefef6001600160a01b038216145b806111cc57506000805460405163f8806a1360e01b81526001600160a01b0384811660048301529091169063f8806a1390602401602060405180830381865afa15801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c19190612c9e565b6001600160a01b0316145b156111ea576040516327600db160e01b815260040160405180910390fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561121481611ad9565b60fc54604080517fa539550b00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163a539550b9160048083019260209291908290030181865afa158015611277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129b9190612cbb565b60fc5460405163b3596f0760e01b81526001600160a01b038c811660048301529293506000929091169063b3596f0790602401602060405180830381865afa1580156112eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130f9190612cbb565b90508682101561134e576040517f2f25f4ee000000000000000000000000000000000000000000000000000000008152600481018390526024016108c0565b8781101561138b576040517f4f216ee7000000000000000000000000000000000000000000000000000000008152600481018290526024016108c0565b60fd546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038c8116600483015260009216906370a0823190602401602060405180830381865afa1580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114139190612cbb565b90508060000361144f576040517f5e85ae7300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61145c8b8285858e611e4f565b909750955086156114e55760fb546040517f9dc29fac000000000000000000000000000000000000000000000000000000008152306004820152602481018990526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b1580156114cc57600080fd5b505af11580156114e0573d6000803e3d6000fd5b505050505b60fd546040517f1e9a69500000000000000000000000000000000000000000000000000000000081526001600160a01b038d811660048301526024820189905290911690631e9a695090604401600060405180830381600087803b15801561154c57600080fd5b505af1158015611560573d6000803e3d6000fd5b5050604080516001600160a01b038f168152602081018b905290810189905260608101869052608081018590527f72e38cd9e650a56d27bba7e1a9a8d6f77dc5cc382bb38a7e56f4f1e845be910d925060a001905060405180910390a15050505050600160658190555094509492505050565b6115db611cde565b60026065540361162d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c0565b6002606555600054604051634df48c7360e11b81526001600160a01b03808516600483015284921690639be918e690602401602060405180830381865afa15801561167c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a09190612d36565b15806116c8575073efefefefefefefefefefefefefefefefefefefef6001600160a01b038216145b8061174857506000805460405163f8806a1360e01b81526001600160a01b0384811660048301529091169063f8806a1390602401602060405180830381865afa158015611719573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173d9190612c9e565b6001600160a01b0316145b15611766576040516327600db160e01b815260040160405180910390fd5b81158061178a57506001600160a01b038316600090815260fe602052604090205482105b156117c1576040517fe70dea0f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb546117d9906001600160a01b031633308561203c565b60006117e58484610b60565b90506117f0846109db565b811115611829576040517f9fd55ef600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384166000908152610104602052604081208054839290611852908490612d58565b9091555061186390508484836120ca565b604080516001600160a01b03861681526020810185905233917ff79eabc24df3643a1dfc26dde4d79b5bde29ce49ca096544d28132e66ce6c6ff910160405180910390a2505060016065555050565b600082815260c960205260409020600101546118cd81611ad9565b6108418383611b85565b600054600160a81b900460ff16158080156118ff57506000546001600160a01b90910460ff16105b806119205750303b1580156119205750600054600160a01b900460ff166001145b6119925760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108c0565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580156119da576000805460ff60a81b1916600160a81b1790555b6119e26121ac565b6119ea612219565b6119f2612292565b600080546001600160a01b038088167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617835560fb805488831690841617905560fc805487831690841617905560fd80549186169190921617905561e10060ff55611a609033611ae3565b611a8a7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533611ae3565b8015611ad2576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6109098133612306565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff166108d357600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611b413390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff16156108d357600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b611c10612386565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000611c7e83546001600160801b03808216600160801b9092048116919091031690565b8210611cb6576040517f580821e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5081546001600160801b03908116820116600090815260018301602052604090205492915050565b60335460ff1615611d315760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016108c0565b565b80546000906001600160801b0380821691600160801b9004168103611d84576040517f75e52f4f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160801b038181166000908152600185810160205260408220805492905585547fffffffffffffffffffffffffffffffff00000000000000000000000000000000169301909116919091179092555090565b73efefefefefefefefefefefefefefefefefefefef6001600160a01b03841603611e075761084182826123d8565b6108418383836124a1565b611e1a611cde565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611c3d3390565b6001600160a01b038516600090815261010060205260408120548190831115611e8f576001600160a01b0387166000908152610100602052604090205492505b6001600160a01b038716600090815261010160205260409020548311611ee1576040517f0ac1d61d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03871660009081526101016020526040902054831115612032576001600160a01b0387166000908152610101602090815260408083205481516bffffffffffffffffffffffff1960608d901b1681850152603480820192909252825180820390920182526054810180845282519285019290922080865261010290945282852060b482019093528254825260018301546074820152600283015460949091015291929091611f97908989612609565b905080891015611fa957505050612032565b60018201546001600160a01b038b166000908152610104602052604081208054909190611fd7908490612cea565b9091555050600182018190558154611fef9086612d58565b9450611ffb818a612cea565b98506120078185612d58565b6001600160a01b038b16600090815261010160205260409020805460010190559350611ee192505050565b9550959350505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526120c490859061264b565b50505050565b6001600160a01b038316600081815261010060209081526040808320805482516bffffffffffffffffffffffff1960608b901b1681860152603480820192909252835180820390920182526054810180855282519286019290922060b48201855289835260748201898152436094909301928352818852610102875285882093518455516001840155905160029092019190915594845254610103835281842033855290925290912061217c91612730565b6001600160a01b0384166000908152610100602052604081208054916121a183612d6b565b919050555050505050565b600054600160a81b900460ff16611d315760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108c0565b600054600160a81b900460ff166122865760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108c0565b6033805460ff19169055565b600054600160a81b900460ff166122ff5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108c0565b6001606555565b600082815260c9602090815260408083206001600160a01b038516845290915290205460ff166108d357612344816001600160a01b031660146127ba565b61234f8360206127ba565b604051602001612360929190612da8565b60408051601f198184030181529082905262461bcd60e51b82526108c091600401612e29565b60335460ff16611d315760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016108c0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612425576040519150601f19603f3d011682016040523d82523d6000602084013e61242a565b606091505b50509050806108415760405162461bcd60e51b815260206004820152602260248201527f5472616e7366657248656c7065723a2053656e64696e6720455448206661696c60448201527f656400000000000000000000000000000000000000000000000000000000000060648201526084016108c0565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052915160009283929087169161252b9190612e5c565b6000604051808303816000865af19150503d8060008114612568576040519150601f19603f3d011682016040523d82523d6000602084013e61256d565b606091505b50915091508180156125975750805115806125975750808060200190518101906125979190612d36565b611ad25760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c65640000000000000000000000000000000000000060648201526084016108c0565b6000808284866000015161261d9190612cfd565b6126279190612d14565b90508085602001511061263a5780612640565b84602001515b9150505b9392505050565b60006126a0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661299b9092919063ffffffff16565b80519091501561084157808060200190518101906126be9190612d36565b6108415760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108c0565b81546001600160801b03600160801b820481169181166001830190911603612784576040517f8acb5f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b606060006127c9836002612cfd565b6127d4906002612d58565b67ffffffffffffffff8111156127ec576127ec612e78565b6040519080825280601f01601f191660200182016040528015612816576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061284d5761284d612e8e565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061289857612898612e8e565b60200101906001600160f81b031916908160001a90535060006128bc846002612cfd565b6128c7906001612d58565b90505b600181111561294c577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061290857612908612e8e565b1a60f81b82828151811061291e5761291e612e8e565b60200101906001600160f81b031916908160001a90535060049490941c9361294581612ea4565b90506128ca565b50831561077c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108c0565b6060610b588484600085856001600160a01b0385163b6129fd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108c0565b600080866001600160a01b03168587604051612a199190612e5c565b60006040518083038185875af1925050503d8060008114612a56576040519150601f19603f3d011682016040523d82523d6000602084013e612a5b565b606091505b5091509150612a6b828286612a76565b979650505050505050565b60608315612a85575081612644565b825115612a955782518084602001fd5b8160405162461bcd60e51b81526004016108c09190612e29565b6001600160a01b038116811461090957600080fd5b60008060408385031215612ad757600080fd5b8235612ae281612aaf565b91506020830135612af281612aaf565b809150509250929050565b600060208284031215612b0f57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461077c57600080fd5b600060208284031215612b5157600080fd5b813561077c81612aaf565b600060208284031215612b6e57600080fd5b5035919050565b60008060408385031215612b8857600080fd5b823591506020830135612af281612aaf565b60008060408385031215612bad57600080fd5b8235612bb881612aaf565b946020939093013593505050565b600080600060608486031215612bdb57600080fd5b8335612be681612aaf565b92506020840135612bf681612aaf565b929592945050506040919091013590565b60008060008060808587031215612c1d57600080fd5b8435612c2881612aaf565b966020860135965060408601359560600135945092505050565b60008060008060808587031215612c5857600080fd5b8435612c6381612aaf565b93506020850135612c7381612aaf565b92506040850135612c8381612aaf565b91506060850135612c9381612aaf565b939692955090935050565b600060208284031215612cb057600080fd5b815161077c81612aaf565b600060208284031215612ccd57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561077f5761077f612cd4565b808202811582820484141761077f5761077f612cd4565b600082612d3157634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612d4857600080fd5b8151801515811461077c57600080fd5b8082018082111561077f5761077f612cd4565b600060018201612d7d57612d7d612cd4565b5060010190565b60005b83811015612d9f578181015183820152602001612d87565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612de0816017850160208801612d84565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612e1d816028840160208801612d84565b01602801949350505050565b6020815260008251806020840152612e48816040850160208701612d84565b601f01601f19169190910160400192915050565b60008251612e6e818460208701612d84565b9190910192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081612eb357612eb3612cd4565b50600019019056fea26469706673582212200fb679fb5b086316098c5aefbb9ba68bfb7723bcc0b39530f84156012a66164e64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.