Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
LevelReserveLensMorphoOracle
Compiler Version
v0.8.25+commit.b61c2a91
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.21;
import {ILevelReserveLensMorphoOracle} from "../interfaces/lens/ILevelReserveLensMorphoOracle.sol";
import {ILevelReserveLens} from "../interfaces/lens/ILevelReserveLens.sol";
import {SingleAdminAccessControl} from "../auth/v5/SingleAdminAccessControl.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
/**
* .-==+=======+:
* :---=-::-==:g
* .-:-==-:-==:
* .:::--::::::. .--:-=--:--. .:--:::--..
* .=++=++:::::.. .:::---::--. ....::...:::.
* :::-::..::.. .::::-:::::. ...::...:::.
* ...::..::::.. .::::--::-:. ....::...:::..
* ............ ....:::..::. ------:......
* ........... ........:.... .....::..:.. ======-...... ...........
* :------:.:... ...:+***++*#+ .------:---. ...::::.:::... .....:-----::.
* .::::::::-:.. .::--..:-::.. .-=+===++=-==: ...:::..:--:.. .:==+=++++++*:
*
* @title LevelReserveLensMorphoOracle
* @author Level (https://level.money)
* @notice The LevelReserveLensMorphoOracle contract is a thin wrapper around LevelReserveLens that implements the Chainlink AggregatorV3Interface.
* @notice This contract reverts to a default price of $1 to protect borrowers from liquidation, which may come at the cost of lenders. Vault curators and lenders should take care to monitor the solvency of lvlUSD off-chain and pause new loans if necessary. See audit reports for more details.
*/
contract LevelReserveLensMorphoOracle is ILevelReserveLensMorphoOracle, SingleAdminAccessControl, Pausable {
using Math for uint256;
using SafeCast for uint256;
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
ILevelReserveLens public immutable lens;
/**
* @param _lens The address of the LevelReserveLens contract.
* @param _admin The address of the admin.
* @param _pauser The address of the pauser.
*/
constructor(address _admin, address _pauser, address _lens) {
if (_lens == address(0) || _admin == address(0)) revert("Address cannot be zero");
lens = ILevelReserveLens(_lens);
_grantRole(DEFAULT_ADMIN_ROLE, _admin);
if (_pauser != address(0)) {
_grantRole(PAUSER_ROLE, _pauser);
}
}
/**
* @dev Returns the number of decimals; use Chainlink's default for USD pairs.
* @return decimals The number of decimals.
*/
function decimals() public pure override returns (uint8) {
return 8;
}
/**
* @dev Returns a short description of the aggregator.
* @return description A description of the aggregator.
*/
function description() external pure override returns (string memory) {
return "Chainlink interface compliant oracle for Level USD";
}
/**
* @dev Returns the version of the interface; hard-coded to 0.
* @return version The version of the interface.
*/
function version() external pure override returns (uint256) {
return 0;
}
/**
* @inheritdoc ILevelReserveLensMorphoOracle
*/
function setPaused(bool _paused) external onlyRole(PAUSER_ROLE) {
if (_paused) {
_pause();
} else {
_unpause();
}
}
/**
* @dev Returns a default price of $1 (1e18). Intended to be used when the oracle cannot fetch the price from the lens contract, or if the contract is paused.
*/
function defaultRoundData()
public
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
return (0, int256(10 ** decimals()), block.timestamp, block.timestamp, 0);
}
/**
* @dev Returns the latest round data (since this oracle does not require data to be pushed). See latestRoundData for more details.
*/
function getRoundData(uint80 /* _roundId */ )
external
view
override
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
return this.latestRoundData();
}
/**
* @dev Returns the price of lvlUSD. This function should always return some value.
* @dev Invariants: answer > 0, answer <= this.decimals()
* @return roundId non-meaningful value
* @return answer The price of lvlUSD, where 1e18 means 1 USD. Returns $1 (1e18) if the reserves are overcollateralized, if the contract is paused, or the underlying lens contract reverts. Otherwise, returns the ratio of USD reserves to lvlUSD supply.
* @return startedAt non-meaningful value
* @return updatedAt the timestamp of the current block
* @return answeredInRound non-meaningful value
*/
function latestRoundData()
external
view
override
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
if (paused()) {
return defaultRoundData();
}
(bool reservePriceSuccess, bytes memory reservePriceData) =
address(lens).staticcall(abi.encodeWithSignature("getReservePrice()"));
(bool reserveDecimalsSuccess, bytes memory reserveDecimalsData) =
address(lens).staticcall(abi.encodeWithSignature("getReservePriceDecimals()"));
if (!reservePriceSuccess || !reserveDecimalsSuccess) {
return defaultRoundData();
}
// Decode the returned value
uint256 reservePrice = abi.decode(reservePriceData, (uint256));
uint8 reserveDecimals = abi.decode(reserveDecimalsData, (uint8));
answer = int256(reservePrice.mulDiv(10 ** decimals(), 10 ** reserveDecimals, Math.Rounding.Ceil));
return (0, answer, block.timestamp, block.timestamp, 0);
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.21;
import {AggregatorV3Interface} from "../AggregatorV3Interface.sol";
import {ILevelReserveLens} from "./ILevelReserveLens.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/interfaces/IERC20Metadata.sol";
/**
* .-==+=======+:
* :---=-::-==:
* .-:-==-:-==:
* .:::--::::::. .--:-=--:--. .:--:::--..
* .=++=++:::::.. .:::---::--. ....::...:::.
* :::-::..::.. .::::-:::::. ...::...:::.
* ...::..::::.. .::::--::-:. ....::...:::..
* ............ ....:::..::. ------:......
* ........... ........:.... .....::..:.. ======-...... ...........
* :------:.:... ...:+***++*#+ .------:---. ...::::.:::... .....:-----::.
* .::::::::-:.. .::--..:-::.. .-=+===++=-==: ...:::..:--:.. .:==+=++++++*:
*
* @title ILevelReserveLensMorphoOracle
* @author Level (https://level.money)
* @notice Interface for a Chainlink-compatible oracle wrapper around LevelReserveLens that provides lvlUSD price data
*/
interface ILevelReserveLensMorphoOracle is AggregatorV3Interface {
/**
* @notice Sets the paused state of the contract
* @param _paused True to pause, false to unpause
*/
function setPaused(bool _paused) external;
/**
* @notice Returns a default price of $1
* @dev Intended to be used when the oracle cannot fetch the price from the lens contract, or if the contract is paused
* @return roundId non-meaningful value
* @return answer The default price (1 USD)
* @return startedAt The current block timestamp
* @return updatedAt The current block timestamp
* @return answeredInRound non-meaningful value
*/
function defaultRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.21;
import {IERC20Metadata} from "@openzeppelin/contracts/interfaces/IERC20Metadata.sol";
/**
* .-==+=======+:
* :---=-::-==:
* .-:-==-:-==:
* .:::--::::::. .--:-=--:--. .:--:::--..
* .=++=++:::::.. .:::---::--. ....::...:::.
* :::-::..::.. .::::-:::::. ...::...:::.
* ...::..::::.. .::::--::-:. ....::...:::..
* ............ ....:::..::. ------:......
* ........... ........:.... .....::..:.. ======-...... ...........
* :------:.:... ...:+***++*#+ .------:---. ...::::.:::... .....:-----::.
* .::::::::-:.. .::--..:-::.. .-=+===++=-==: ...:::..:--:.. .:==+=++++++*:
*
* @title ILevelReserveLens
* @author Level (https://level.money)
* @notice Interface for querying the reserves backing lvlUSD per underlying collateral token address.
*/
interface ILevelReserveLens {
/**
* @notice Returns the reserves of the given token, including any lending derivatives. For example, if the token is USDC, we will return the balance of all ReserveManagers' USDC and wrapped Aave tokens. Also includes reserves in LevelMinting.
* @dev Note: waUSDC/T and USDC/T are used interchangeably because the wrapped Aave tokens are withdrawable 1:1 for the underlying token
* @dev Note: the reserves returned may include deposits from non-Level participants, which may cause the total reserves to be higher than expected. This should not affect the lvlUSD/USD price (which is capped at 1 if the reserves are overcollateralized).
* @param collateral The address of the collateral token
* @return The reserves of the given token, in lvlUSD's decimals (18)
*/
function getReserves(address collateral) external view returns (uint256);
/**
* @notice Returns the USD-value reserves of the given token. See getReserves for more details.
* @param collateral The address of the collateral token
* @return usdReserves The USD-value reserves of the given token, in lvlUSD's decimals (18)
*/
function getReserveValue(address collateral) external view returns (uint256 usdReserves);
/**
* @notice Returns the total dollar value of reserves backing lvlUSD, including all collateral tokens.
* @return usdReserves The total dollar value of reserves backing lvlUSD, in lvlUSD's decimals
*/
function getReserveValue() external view returns (uint256 usdReserves);
/**
* @notice Returns the reserve price of lvlUSD. If the reserves are overcollateralized, return $1 (1e18). Otherwise, return the ratio of USD reserves to lvlUSD supply.
* @return reservePrice The reserve price of lvlUSD, with lvlUSD's decimals (18).
*/
function getReservePrice() external view returns (uint256);
/**
* @notice Returns the number of decimals used for the reserve price.
* @return reservePriceDecimals The number of decimals used for the reserve price
*/
function getReservePriceDecimals() external view returns (uint8);
/**
* @notice Returns the price of minting lvlUSD using the same logic as LevelMinting
* @param collateral The address of the collateral token
* @return mintPrice The price of lvlUSD for 1 unit of the collateral token, with lvlUSD's decimals (18)
*/
function getMintPrice(IERC20Metadata collateral) external view returns (uint256);
/**
* @notice Returns the price of redeeming lvlUSD using the same logic as LevelMinting
* @param collateral The address of the collateral token
* @return redeemPrice The price of collateral for 1 unit of lvlUSD, with the same decimals as the collateral token
*/
function getRedeemPrice(IERC20Metadata collateral) external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.19;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/interfaces/IERC5313.sol";
import "../../interfaces/ISingleAdminAccessControl.sol";
/**
* @title SingleAdminAccessControl
* @notice SingleAdminAccessControl is a contract that provides a single admin role with timelock
* @notice This contract is a simplified alternative to OpenZeppelin's AccessControlDefaultAdminRules
* @dev Added 3-day timelock for admin transfers
*/
abstract contract SingleAdminAccessControl is IERC5313, ISingleAdminAccessControl, AccessControl {
address private _currentDefaultAdmin;
address private _pendingDefaultAdmin;
// New variables for timelock
uint256 public constant TIMELOCK_DELAY = 3 days;
uint256 private _transferRequestTime;
error TimelockNotExpired(uint256 remainingTime);
error NoActiveTransferRequest();
error TransferAlreadyInProgress();
// Add this event to ISingleAdminAccessControl.sol
event AdminTransferCancelled(address indexed currentAdmin, address indexed pendingAdmin);
modifier notAdmin(bytes32 role) {
if (role == DEFAULT_ADMIN_ROLE) revert InvalidAdminChange();
_;
}
/// @notice Transfer the admin role to a new address
/// @notice This can ONLY be executed by the current admin
/// @notice Initiates a transfer request with a 3-day timelock
/// @param newAdmin address of the new admin
function transferAdmin(address newAdmin) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (newAdmin == msg.sender) revert InvalidAdminChange();
if (newAdmin == address(0)) revert InvalidAdminChange();
if (_transferRequestTime != 0) revert TransferAlreadyInProgress();
_pendingDefaultAdmin = newAdmin;
_transferRequestTime = block.timestamp;
emit AdminTransferRequested(_currentDefaultAdmin, newAdmin);
}
/// @notice Cancel a pending admin transfer request
/// @notice Can only be called by the current admin
function cancelTransferAdmin() external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_pendingDefaultAdmin == address(0)) {
revert NoActiveTransferRequest();
}
delete _pendingDefaultAdmin;
delete _transferRequestTime;
emit AdminTransferCancelled(_currentDefaultAdmin, _pendingDefaultAdmin);
}
/// @notice Accept the admin role transfer after timelock expires
/// @notice Can only be called by the pending admin after the timelock period
function acceptAdmin() external {
if (msg.sender != _pendingDefaultAdmin) revert NotPendingAdmin();
if (_transferRequestTime == 0) revert NoActiveTransferRequest();
uint256 timeElapsed = block.timestamp - _transferRequestTime;
if (timeElapsed < TIMELOCK_DELAY) {
revert TimelockNotExpired(TIMELOCK_DELAY - timeElapsed);
}
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
/// @notice Check the remaining time until a transfer can be accepted
/// @return remaining time in seconds, 0 if no active transfer or if timelock has expired
function getTransferTimelockStatus() external view returns (uint256) {
if (_pendingDefaultAdmin == address(0) || _transferRequestTime == 0) {
return 0;
}
uint256 timeElapsed = block.timestamp - _transferRequestTime;
if (timeElapsed >= TIMELOCK_DELAY) {
return 0;
}
return TIMELOCK_DELAY - timeElapsed;
}
/// @notice grant a role
/// @notice can only be executed by the current single admin
/// @notice admin role cannot be granted externally
/// @param role bytes32
/// @param account address
function grantRole(bytes32 role, address account) public override onlyRole(DEFAULT_ADMIN_ROLE) notAdmin(role) {
_grantRole(role, account);
}
/// @notice revoke a role
/// @notice can only be executed by the current admin
/// @notice admin role cannot be revoked
/// @param role bytes32
/// @param account address
function revokeRole(bytes32 role, address account) public override onlyRole(DEFAULT_ADMIN_ROLE) notAdmin(role) {
_revokeRole(role, account);
}
/// @notice renounce the role of msg.sender
/// @notice admin role cannot be renounced
/// @param role bytes32
/// @param account address
function renounceRole(bytes32 role, address account) public virtual override notAdmin(role) {
super.renounceRole(role, account);
}
/**
* @dev See {IERC5313-owner}.
*/
function owner() public view virtual returns (address) {
return _currentDefaultAdmin;
}
/**
* @notice no way to change admin without removing old admin first
*/
function _grantRole(bytes32 role, address account) internal override returns (bool) {
if (role == DEFAULT_ADMIN_ROLE) {
emit AdminTransferred(_currentDefaultAdmin, account);
_revokeRole(DEFAULT_ADMIN_ROLE, _currentDefaultAdmin);
_currentDefaultAdmin = account;
delete _pendingDefaultAdmin;
delete _transferRequestTime;
}
return super._grantRole(role, account);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.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 Pausable is Context {
bool private _paused;
/**
* @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);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_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 {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @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());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.20;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;
// solhint-disable-next-line interface-starts-with-i
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function getRoundData(uint80 _roundId)
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @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 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 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 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 `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5313.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the Light Contract Ownership Standard.
*
* A standardized minimal interface required to identify an account that controls a contract
*/
interface IERC5313 {
/**
* @dev Gets the address of the owner.
*/
function owner() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
interface ISingleAdminAccessControl {
error InvalidAdminChange();
error NotPendingAdmin();
event AdminTransferred(address indexed oldAdmin, address indexed newAdmin);
event AdminTransferRequested(address indexed oldAdmin, address indexed newAdmin);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @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.
*/
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 `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@level/=/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin-4.9.0/contracts/=lib/openzeppelin-contracts-4.9.0/contracts/",
"@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@solmate/=lib/solmate/",
"@openzeppelin-upgrades/=lib/openzeppelin-foundry-upgrades/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"openzeppelin-contracts-4.9.0/=lib/openzeppelin-contracts-4.9.0/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"openzeppelin/=lib/openzeppelin-contracts-4.9.0/contracts/",
"solmate/=lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_pauser","type":"address"},{"internalType":"address","name":"_lens","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidAdminChange","type":"error"},{"inputs":[],"name":"MathOverflowedMulDiv","type":"error"},{"inputs":[],"name":"NoActiveTransferRequest","type":"error"},{"inputs":[],"name":"NotPendingAdmin","type":"error"},{"inputs":[{"internalType":"uint256","name":"remainingTime","type":"uint256"}],"name":"TimelockNotExpired","type":"error"},{"inputs":[],"name":"TransferAlreadyInProgress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currentAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"pendingAdmin","type":"address"}],"name":"AdminTransferCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminTransferred","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelTransferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"defaultRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"uint80","name":"","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferTimelockStatus","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":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lens","outputs":[{"internalType":"contract ILevelReserveLens","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"bool","name":"_paused","type":"bool"}],"name":"setPaused","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":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
60a060405234801561000f575f80fd5b506040516114a03803806114a083398101604081905261002e916102da565b6004805460ff191690556001600160a01b038116158061005557506001600160a01b038316155b156100a65760405162461bcd60e51b815260206004820152601660248201527f416464726573732063616e6e6f74206265207a65726f00000000000000000000604482015260640160405180910390fd5b6001600160a01b0381166080526100bd5f84610101565b506001600160a01b038216156100f9576100f77f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a83610101565b505b50505061031a565b5f82610184576001546040516001600160a01b038085169216907ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec6905f90a3600154610157905f906001600160a01b0316610197565b50600180546001600160a01b0384166001600160a01b0319918216179091556002805490911690555f6003555b61018e838361021f565b90505b92915050565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1615610218575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610191565b505f610191565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610218575f838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556102773390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610191565b80516001600160a01b03811681146102d5575f80fd5b919050565b5f805f606084860312156102ec575f80fd5b6102f5846102bf565b9250610303602085016102bf565b9150610311604085016102bf565b90509250925092565b6080516111606103405f395f8181610183015281816107f9015261089f01526111605ff3fe608060405234801561000f575f80fd5b5060043610610148575f3560e01c80635c975abb116100bf5780639a6fc8f5116100795780639a6fc8f5146102e3578063a217fddf146102f6578063b55dd256146102fd578063d547741f14610305578063e63ab1e914610318578063feaf968c1461033f575f80fd5b80635c975abb14610284578063662d2ebf1461028f5780637284e4161461029757806375829def146102ac5780638da5cb5b146102bf57806391d14854146102d0575f80fd5b80632f2ff15d116101105780632f2ff15d14610200578063313ce5671461021357806336568abe146102225780633720703f1461023557806354fd4d50146102745780635ba1c1a91461027a575f80fd5b806301ffc9a71461014c5780630e18b68114610174578063112666b71461017e57806316c38b3c146101bd578063248a9ca3146101d0575b5f80fd5b61015f61015a366004610db8565b610347565b60405190151581526020015b60405180910390f35b61017c61037d565b005b6101a57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161016b565b61017c6101cb366004610ddf565b610426565b6101f26101de366004610dfe565b5f9081526020819052604090206001015490565b60405190815260200161016b565b61017c61020e366004610e30565b610466565b6040516008815260200161016b565b61017c610230366004610e30565b6104a0565b61023d6104ce565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a00161016b565b5f6101f2565b6101f26203f48081565b60045460ff1661015f565b61017c6104f5565b61029f610578565b60405161016b9190610e5a565b61017c6102ba366004610e8f565b610598565b6001546001600160a01b03166101a5565b61015f6102de366004610e30565b610669565b61023d6102f1366004610ebf565b610691565b6101f25f81565b6101f2610708565b61017c610313366004610e30565b610761565b6101f27f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b61023d610794565b5f6001600160e01b03198216637965db0b60e01b148061037757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6002546001600160a01b031633146103a85760405163058d9a1b60e01b815260040160405180910390fd5b6003545f036103ca57604051632becf27f60e21b815260040160405180910390fd5b5f600354426103d99190610eee565b90506203f480811015610418576103f3816203f480610eee565b6040516396a5c63160e01b815260040161040f91815260200190565b60405180910390fd5b6104225f336109a1565b5050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61045081610a35565b811561045e57610422610a42565b610422610a9c565b5f61047081610a35565b828061048f5760405163318bd07d60e11b815260040160405180910390fd5b61049984846109a1565b5050505050565b81806104bf5760405163318bd07d60e11b815260040160405180910390fd5b6104c98383610ad5565b505050565b5f80808080806104e06008600a610fe1565b42425f945094509450945094505b9091929394565b5f6104ff81610a35565b6002546001600160a01b031661052857604051632becf27f60e21b815260040160405180910390fd5b600280546001600160a01b03191690555f60038190556001546040516001600160a01b03909116907f3793833b9ab43215ac21b7766b4196d31276ccf43ec6edeade82fbd6946aac0a908390a350565b60606040518060600160405280603281526020016110f960329139905090565b5f6105a281610a35565b336001600160a01b038316036105cb5760405163318bd07d60e11b815260040160405180910390fd5b6001600160a01b0382166105f25760405163318bd07d60e11b815260040160405180910390fd5b6003541561061357604051633a76bcd760e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0384811691821790925542600355600154604051919216907fefdcbba819467e00b0262c12892dda980bac68580b72178e57a162368b808766905f90a35050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f805f805f306001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156106d2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106f69190610fef565b939a9299509097509550909350915050565b6002545f906001600160a01b031615806107225750600354155b1561072c57505f90565b5f6003544261073b9190610eee565b90506203f480811061074e575f91505090565b61075b816203f480610eee565b91505090565b5f61076b81610a35565b828061078a5760405163318bd07d60e11b815260040160405180910390fd5b6104998484610b04565b5f805f805f6107a560045460ff1690565b156107c1576107b26104ce565b945094509450945094506104ee565b60408051600481526024810182526020810180516001600160e01b0316637839119160e11b17905290515f9182916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169161082391611043565b5f60405180830381855afa9150503d805f811461085b576040519150601f19603f3d011682016040523d82523d5f602084013e610860565b606091505b5060408051600481526024810182526020810180516001600160e01b0316630c0a44a960e31b17905290519294509092505f9182916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916108ca9190611043565b5f60405180830381855afa9150503d805f8114610902576040519150601f19603f3d011682016040523d82523d5f602084013e610907565b606091505b5091509150831580610917575081155b15610937576109246104ce565b98509850985098509850505050506104ee565b5f8380602001905181019061094c9190611059565b90505f828060200190518101906109639190611070565b90506109896109746008600a610fe1565b61097f83600a610fe1565b8491906001610b74565b5f9c909b50429a508a99508c98509650505050505050565b5f82610a24576001546040516001600160a01b038085169216907ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec6905f90a36001546109f7905f906001600160a01b0316610b04565b50600180546001600160a01b0384166001600160a01b0319918216179091556002805490911690555f6003555b610a2e8383610bc3565b9392505050565b610a3f8133610c4b565b50565b610a4a610c84565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610a7f3390565b6040516001600160a01b03909116815260200160405180910390a1565b610aa4610caa565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610a7f565b6001600160a01b0381163314610afe5760405163334bd91960e11b815260040160405180910390fd5b6104c982825b5f610b0f8383610669565b15610b6d575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610377565b505f610377565b5f80610b81868686610ccd565b9050610b8c83610d8c565b8015610ba757505f8480610ba257610ba2611090565b868809115b15610bba57610bb76001826110a4565b90505b95945050505050565b5f610bce8383610669565b610b6d575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610c033390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610377565b610c558282610669565b6104225760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161040f565b60045460ff1615610ca85760405163d93c066560e01b815260040160405180910390fd5b565b60045460ff16610ca857604051638dfc202b60e01b815260040160405180910390fd5b5f838302815f1985870982811083820303915050805f03610d0157838281610cf757610cf7611090565b0492505050610a2e565b808411610d215760405163227bc15360e01b815260040160405180910390fd5b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b5f6002826003811115610da157610da16110b7565b610dab91906110cb565b60ff166001149050919050565b5f60208284031215610dc8575f80fd5b81356001600160e01b031981168114610a2e575f80fd5b5f60208284031215610def575f80fd5b81358015158114610a2e575f80fd5b5f60208284031215610e0e575f80fd5b5035919050565b80356001600160a01b0381168114610e2b575f80fd5b919050565b5f8060408385031215610e41575f80fd5b82359150610e5160208401610e15565b90509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f60208284031215610e9f575f80fd5b610a2e82610e15565b69ffffffffffffffffffff81168114610a3f575f80fd5b5f60208284031215610ecf575f80fd5b8135610a2e81610ea8565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561037757610377610eda565b600181815b80851115610f3b57815f1904821115610f2157610f21610eda565b80851615610f2e57918102915b93841c9390800290610f06565b509250929050565b5f82610f5157506001610377565b81610f5d57505f610377565b8160018114610f735760028114610f7d57610f99565b6001915050610377565b60ff841115610f8e57610f8e610eda565b50506001821b610377565b5060208310610133831016604e8410600b8410161715610fbc575081810a610377565b610fc68383610f01565b805f1904821115610fd957610fd9610eda565b029392505050565b5f610a2e60ff841683610f43565b5f805f805f60a08688031215611003575f80fd5b855161100e81610ea8565b80955050602086015193506040860151925060608601519150608086015161103581610ea8565b809150509295509295909350565b5f82518060208501845e5f920191825250919050565b5f60208284031215611069575f80fd5b5051919050565b5f60208284031215611080575f80fd5b815160ff81168114610a2e575f80fd5b634e487b7160e01b5f52601260045260245ffd5b8082018082111561037757610377610eda565b634e487b7160e01b5f52602160045260245ffd5b5f60ff8316806110e957634e487b7160e01b5f52601260045260245ffd5b8060ff8416069150509291505056fe436861696e6c696e6b20696e7465726661636520636f6d706c69616e74206f7261636c6520666f72204c6576656c20555344a2646970667358221220dc75c5e0650e03d3d57d980542145be9ed781432d0dae8481e0a95905f5c383b64736f6c63430008190033000000000000000000000000343acce723339d5a417411d8ff57fde8886e91dc000000000000000000000000cea14c3e9afc5822d44ade8d006fcfbab60f7a2100000000000000000000000029759944834e08ace755dcea71491413f7e2cbad
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610148575f3560e01c80635c975abb116100bf5780639a6fc8f5116100795780639a6fc8f5146102e3578063a217fddf146102f6578063b55dd256146102fd578063d547741f14610305578063e63ab1e914610318578063feaf968c1461033f575f80fd5b80635c975abb14610284578063662d2ebf1461028f5780637284e4161461029757806375829def146102ac5780638da5cb5b146102bf57806391d14854146102d0575f80fd5b80632f2ff15d116101105780632f2ff15d14610200578063313ce5671461021357806336568abe146102225780633720703f1461023557806354fd4d50146102745780635ba1c1a91461027a575f80fd5b806301ffc9a71461014c5780630e18b68114610174578063112666b71461017e57806316c38b3c146101bd578063248a9ca3146101d0575b5f80fd5b61015f61015a366004610db8565b610347565b60405190151581526020015b60405180910390f35b61017c61037d565b005b6101a57f00000000000000000000000029759944834e08ace755dcea71491413f7e2cbad81565b6040516001600160a01b03909116815260200161016b565b61017c6101cb366004610ddf565b610426565b6101f26101de366004610dfe565b5f9081526020819052604090206001015490565b60405190815260200161016b565b61017c61020e366004610e30565b610466565b6040516008815260200161016b565b61017c610230366004610e30565b6104a0565b61023d6104ce565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a00161016b565b5f6101f2565b6101f26203f48081565b60045460ff1661015f565b61017c6104f5565b61029f610578565b60405161016b9190610e5a565b61017c6102ba366004610e8f565b610598565b6001546001600160a01b03166101a5565b61015f6102de366004610e30565b610669565b61023d6102f1366004610ebf565b610691565b6101f25f81565b6101f2610708565b61017c610313366004610e30565b610761565b6101f27f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b61023d610794565b5f6001600160e01b03198216637965db0b60e01b148061037757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6002546001600160a01b031633146103a85760405163058d9a1b60e01b815260040160405180910390fd5b6003545f036103ca57604051632becf27f60e21b815260040160405180910390fd5b5f600354426103d99190610eee565b90506203f480811015610418576103f3816203f480610eee565b6040516396a5c63160e01b815260040161040f91815260200190565b60405180910390fd5b6104225f336109a1565b5050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a61045081610a35565b811561045e57610422610a42565b610422610a9c565b5f61047081610a35565b828061048f5760405163318bd07d60e11b815260040160405180910390fd5b61049984846109a1565b5050505050565b81806104bf5760405163318bd07d60e11b815260040160405180910390fd5b6104c98383610ad5565b505050565b5f80808080806104e06008600a610fe1565b42425f945094509450945094505b9091929394565b5f6104ff81610a35565b6002546001600160a01b031661052857604051632becf27f60e21b815260040160405180910390fd5b600280546001600160a01b03191690555f60038190556001546040516001600160a01b03909116907f3793833b9ab43215ac21b7766b4196d31276ccf43ec6edeade82fbd6946aac0a908390a350565b60606040518060600160405280603281526020016110f960329139905090565b5f6105a281610a35565b336001600160a01b038316036105cb5760405163318bd07d60e11b815260040160405180910390fd5b6001600160a01b0382166105f25760405163318bd07d60e11b815260040160405180910390fd5b6003541561061357604051633a76bcd760e11b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0384811691821790925542600355600154604051919216907fefdcbba819467e00b0262c12892dda980bac68580b72178e57a162368b808766905f90a35050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f805f805f306001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156106d2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106f69190610fef565b939a9299509097509550909350915050565b6002545f906001600160a01b031615806107225750600354155b1561072c57505f90565b5f6003544261073b9190610eee565b90506203f480811061074e575f91505090565b61075b816203f480610eee565b91505090565b5f61076b81610a35565b828061078a5760405163318bd07d60e11b815260040160405180910390fd5b6104998484610b04565b5f805f805f6107a560045460ff1690565b156107c1576107b26104ce565b945094509450945094506104ee565b60408051600481526024810182526020810180516001600160e01b0316637839119160e11b17905290515f9182916001600160a01b037f00000000000000000000000029759944834e08ace755dcea71491413f7e2cbad169161082391611043565b5f60405180830381855afa9150503d805f811461085b576040519150601f19603f3d011682016040523d82523d5f602084013e610860565b606091505b5060408051600481526024810182526020810180516001600160e01b0316630c0a44a960e31b17905290519294509092505f9182916001600160a01b037f00000000000000000000000029759944834e08ace755dcea71491413f7e2cbad16916108ca9190611043565b5f60405180830381855afa9150503d805f8114610902576040519150601f19603f3d011682016040523d82523d5f602084013e610907565b606091505b5091509150831580610917575081155b15610937576109246104ce565b98509850985098509850505050506104ee565b5f8380602001905181019061094c9190611059565b90505f828060200190518101906109639190611070565b90506109896109746008600a610fe1565b61097f83600a610fe1565b8491906001610b74565b5f9c909b50429a508a99508c98509650505050505050565b5f82610a24576001546040516001600160a01b038085169216907ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec6905f90a36001546109f7905f906001600160a01b0316610b04565b50600180546001600160a01b0384166001600160a01b0319918216179091556002805490911690555f6003555b610a2e8383610bc3565b9392505050565b610a3f8133610c4b565b50565b610a4a610c84565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610a7f3390565b6040516001600160a01b03909116815260200160405180910390a1565b610aa4610caa565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33610a7f565b6001600160a01b0381163314610afe5760405163334bd91960e11b815260040160405180910390fd5b6104c982825b5f610b0f8383610669565b15610b6d575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610377565b505f610377565b5f80610b81868686610ccd565b9050610b8c83610d8c565b8015610ba757505f8480610ba257610ba2611090565b868809115b15610bba57610bb76001826110a4565b90505b95945050505050565b5f610bce8383610669565b610b6d575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610c033390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610377565b610c558282610669565b6104225760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161040f565b60045460ff1615610ca85760405163d93c066560e01b815260040160405180910390fd5b565b60045460ff16610ca857604051638dfc202b60e01b815260040160405180910390fd5b5f838302815f1985870982811083820303915050805f03610d0157838281610cf757610cf7611090565b0492505050610a2e565b808411610d215760405163227bc15360e01b815260040160405180910390fd5b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b5f6002826003811115610da157610da16110b7565b610dab91906110cb565b60ff166001149050919050565b5f60208284031215610dc8575f80fd5b81356001600160e01b031981168114610a2e575f80fd5b5f60208284031215610def575f80fd5b81358015158114610a2e575f80fd5b5f60208284031215610e0e575f80fd5b5035919050565b80356001600160a01b0381168114610e2b575f80fd5b919050565b5f8060408385031215610e41575f80fd5b82359150610e5160208401610e15565b90509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f60208284031215610e9f575f80fd5b610a2e82610e15565b69ffffffffffffffffffff81168114610a3f575f80fd5b5f60208284031215610ecf575f80fd5b8135610a2e81610ea8565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561037757610377610eda565b600181815b80851115610f3b57815f1904821115610f2157610f21610eda565b80851615610f2e57918102915b93841c9390800290610f06565b509250929050565b5f82610f5157506001610377565b81610f5d57505f610377565b8160018114610f735760028114610f7d57610f99565b6001915050610377565b60ff841115610f8e57610f8e610eda565b50506001821b610377565b5060208310610133831016604e8410600b8410161715610fbc575081810a610377565b610fc68383610f01565b805f1904821115610fd957610fd9610eda565b029392505050565b5f610a2e60ff841683610f43565b5f805f805f60a08688031215611003575f80fd5b855161100e81610ea8565b80955050602086015193506040860151925060608601519150608086015161103581610ea8565b809150509295509295909350565b5f82518060208501845e5f920191825250919050565b5f60208284031215611069575f80fd5b5051919050565b5f60208284031215611080575f80fd5b815160ff81168114610a2e575f80fd5b634e487b7160e01b5f52601260045260245ffd5b8082018082111561037757610377610eda565b634e487b7160e01b5f52602160045260245ffd5b5f60ff8316806110e957634e487b7160e01b5f52601260045260245ffd5b8060ff8416069150509291505056fe436861696e6c696e6b20696e7465726661636520636f6d706c69616e74206f7261636c6520666f72204c6576656c20555344a2646970667358221220dc75c5e0650e03d3d57d980542145be9ed781432d0dae8481e0a95905f5c383b64736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000343acce723339d5a417411d8ff57fde8886e91dc000000000000000000000000cea14c3e9afc5822d44ade8d006fcfbab60f7a2100000000000000000000000029759944834e08ace755dcea71491413f7e2cbad
-----Decoded View---------------
Arg [0] : _admin (address): 0x343ACce723339D5A417411D8Ff57fde8886E91dc
Arg [1] : _pauser (address): 0xcEa14C3e9Afc5822d44ADe8d006fCFBAb60f7a21
Arg [2] : _lens (address): 0x29759944834e08acE755dcEA71491413f7e2CBAD
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000343acce723339d5a417411d8ff57fde8886e91dc
Arg [1] : 000000000000000000000000cea14c3e9afc5822d44ade8d006fcfbab60f7a21
Arg [2] : 00000000000000000000000029759944834e08ace755dcea71491413f7e2cbad
Deployed Bytecode Sourcemap
1841:4342:17:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2565:202:0;;;;;;:::i;:::-;;:::i;:::-;;;470:14:18;;463:22;445:41;;433:2;418:18;2565:202:0;;;;;;;;2555:433:12;;;:::i;:::-;;2084:39:17;;;;;;;;-1:-1:-1;;;;;687:32:18;;;669:51;;657:2;642:18;2084:39:17;497:229:18;3471:167:17;;;;;;:::i;:::-;;:::i;3810:120:0:-;;;;;;:::i;:::-;3875:7;3901:12;;;;;;;;;;:22;;;;3810:120;;;;1340:25:18;;;1328:2;1313:18;3810:120:0;1194:177:18;3758:152:12;;;;;;:::i;:::-;;:::i;2804:82:17:-;;;2878:1;1955:36:18;;1943:2;1928:18;2804:82:17;1813:184:18;4422:142:12;;;;;;:::i;:::-;;:::i;3823:260:17:-;;;:::i;:::-;;;;2265:22:18;2314:15;;;2296:34;;2361:2;2346:18;;2339:34;;;;2389:18;;2382:34;;;;2447:2;2432:18;;2425:34;2496:15;;;2490:3;2475:19;;2468:44;2242:3;2227:19;3823:260:17;2002:516:18;3315:85:17;3366:7;3315:85;;752:47:12;;793:6;752:47;;1850:84:7;1920:7;;;;1850:84;;2058:339:12;;;:::i;3027:146:17:-;;;:::i;:::-;;;;;;;:::i;1489:451:12:-;;;;;;:::i;:::-;;:::i;4620:99::-;4692:20;;-1:-1:-1;;;;;4692:20:12;4620:99;;2854:136:0;;;;;;:::i;:::-;;:::i;4241:253:17:-;;;;;;:::i;:::-;;:::i;2187:49:0:-;;2232:4;2187:49;;3162:381:12;;;:::i;4108:154::-;;;;;;:::i;:::-;;:::i;2015:62:17:-;;2053:24;2015:62;;5124:1057;;;:::i;2565:202:0:-;2650:4;-1:-1:-1;;;;;;2673:47:0;;-1:-1:-1;;;2673:47:0;;:87;;-1:-1:-1;;;;;;;;;;861:40:8;;;2724:36:0;2666:94;2565:202;-1:-1:-1;;2565:202:0:o;2555:433:12:-;2615:20;;-1:-1:-1;;;;;2615:20:12;2601:10;:34;2597:64;;2644:17;;-1:-1:-1;;;2644:17:12;;;;;;;;;;;2597:64;2675:20;;2699:1;2675:25;2671:63;;2709:25;;-1:-1:-1;;;2709:25:12;;;;;;;;;;;2671:63;2745:19;2785:20;;2767:15;:38;;;;:::i;:::-;2745:60;;793:6;2819:11;:28;2815:114;;;2889:28;2906:11;793:6;2889:28;:::i;:::-;2870:48;;-1:-1:-1;;;2870:48:12;;;;;;1340:25:18;;1328:2;1313:18;;1194:177;2870:48:12;;;;;;;;2815:114;2939:42;2232:4:0;2970:10:12;2939;:42::i;:::-;;2587:401;2555:433::o;3471:167:17:-;2053:24;2464:16:0;2475:4;2464:10;:16::i;:::-;3549:7:17::1;3545:87;;;3572:8;:6;:8::i;3545:87::-;3611:10;:8;:10::i;3758:152:12:-:0;2232:4:0;2464:16;2232:4;2464:10;:16::i;:::-;3862:4:12;;1170:59:::1;;1209:20;;-1:-1:-1::0;;;1209:20:12::1;;;;;;;;;;;1170:59;3878:25:::2;3889:4;3895:7;3878:10;:25::i;:::-;;2490:1:0::1;3758:152:12::0;;;:::o;4422:142::-;4508:4;;1170:59;;1209:20;;-1:-1:-1;;;1209:20:12;;;;;;;;;;;1170:59;4524:33:::1;4543:4;4549:7;4524:18;:33::i;:::-;4422:142:::0;;;:::o;3823:260:17:-;3896:14;;;;;;4021:16;2878:1;4021:2;:16;:::i;:::-;4040:15;4057;4074:1;4003:73;;;;;;;;;;3823:260;;;;;;:::o;2058:339:12:-;2232:4:0;2464:16;2232:4;2464:10;:16::i;:::-;2141:20:12::1;::::0;-1:-1:-1;;;;;2141:20:12::1;2137:97;;2198:25;;-1:-1:-1::0;;;2198:25:12::1;;;;;;;;;;;2137:97;2251:20;2244:27:::0;;-1:-1:-1;;;;;;2244:27:12::1;::::0;;-1:-1:-1;2288:20:12::1;2281:27:::0;;;-1:-1:-1;2347:20:12;2324:66:::1;::::0;-1:-1:-1;;;;;2347:20:12;;::::1;::::0;2324:66:::1;::::0;-1:-1:-1;;2324:66:12::1;2058:339:::0;:::o;3027:146:17:-;3082:13;3107:59;;;;;;;;;;;;;;;;;;;3027:146;:::o;1489:451:12:-;2232:4:0;2464:16;2232:4;2464:10;:16::i;:::-;1594:10:12::1;-1:-1:-1::0;;;;;1582:22:12;::::1;::::0;1578:55:::1;;1613:20;;-1:-1:-1::0;;;1613:20:12::1;;;;;;;;;;;1578:55;-1:-1:-1::0;;;;;1647:22:12;::::1;1643:55;;1678:20;;-1:-1:-1::0;;;1678:20:12::1;;;;;;;;;;;1643:55;1712:20;::::0;:25;1708:65:::1;;1746:27;;-1:-1:-1::0;;;1746:27:12::1;;;;;;;;;;;1708:65;1784:20;:31:::0;;-1:-1:-1;;;;;;1784:31:12::1;-1:-1:-1::0;;;;;1784:31:12;;::::1;::::0;;::::1;::::0;;;1848:15:::1;1825:20;:38:::0;-1:-1:-1;1902:20:12;1879:54:::1;::::0;1784:31;;1902:20:::1;::::0;1879:54:::1;::::0;-1:-1:-1;;1879:54:12::1;1489:451:::0;;:::o;2854:136:0:-;2931:4;2954:12;;;;;;;;;;;-1:-1:-1;;;;;2954:29:0;;;;;;;;;;;;;;;2854:136::o;4241:253:17:-;4351:14;4367:13;4382:17;4401;4420:22;4465:4;-1:-1:-1;;;;;4465:20:17;;:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4458:29;;;;-1:-1:-1;4458:29:17;;-1:-1:-1;4458:29:17;-1:-1:-1;4458:29:17;;-1:-1:-1;4241:253:17;-1:-1:-1;;4241:253:17:o;3162:381:12:-;3245:20;;3222:7;;-1:-1:-1;;;;;3245:20:12;:34;;:63;;-1:-1:-1;3283:20:12;;:25;3245:63;3241:102;;;-1:-1:-1;3331:1:12;;3162:381::o;3241:102::-;3353:19;3393:20;;3375:15;:38;;;;:::i;:::-;3353:60;;793:6;3427:11;:29;3423:68;;3479:1;3472:8;;;3162:381;:::o;3423:68::-;3508:28;3525:11;793:6;3508:28;:::i;:::-;3501:35;;;3162:381;:::o;4108:154::-;2232:4:0;2464:16;2232:4;2464:10;:16::i;:::-;4213:4:12;;1170:59:::1;;1209:20;;-1:-1:-1::0;;;1209:20:12::1;;;;;;;;;;;1170:59;4229:26:::2;4241:4;4247:7;4229:11;:26::i;5124:1057:17:-:0;5215:14;5231:13;5246:17;5265;5284:22;5326:8;1920:7:7;;;;;1850:84;5326:8:17;5322:64;;;5357:18;:16;:18::i;:::-;5350:25;;;;;;;;;;;;5322:64;5493:44;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5493:44:17;-1:-1:-1;;;5493:44:17;;;5468:70;;5397:24;;;;-1:-1:-1;;;;;5476:4:17;5468:24;;:70;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5651:52:17;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5651:52:17;-1:-1:-1;;;5651:52:17;;;5626:78;;5396:142;;-1:-1:-1;5396:142:17;;-1:-1:-1;5549:27:17;;;;-1:-1:-1;;;;;5634:4:17;5626:24;;:78;;5651:52;5626:78;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5548:156;;;;5720:19;5719:20;:47;;;;5744:22;5743:23;5719:47;5715:103;;;5789:18;:16;:18::i;:::-;5782:25;;;;;;;;;;;;;;;;5715:103;5865:20;5899:16;5888:39;;;;;;;;;;;;:::i;:::-;5865:62;;5937:21;5972:19;5961:40;;;;;;;;;;;;:::i;:::-;5937:64;-1:-1:-1;6028:80:17;6048:16;2878:1;6048:2;:16;:::i;:::-;6066:21;6072:15;6066:2;:21;:::i;:::-;6028:12;;:80;6089:18;6028:19;:80::i;:::-;6127:1;;6012:97;;-1:-1:-1;6138:15:17;;-1:-1:-1;6138:15:17;;-1:-1:-1;6127:1:17;;-1:-1:-1;5124:1057:17;-1:-1:-1;;;;;;;5124:1057:17:o;4812:450:12:-;4890:4;4910;4906:302;;4974:20;;4957:47;;-1:-1:-1;;;;;4957:47:12;;;;4974:20;;4957:47;;4974:20;;4957:47;5050:20;;5018:53;;2232:4:0;;-1:-1:-1;;;;;5050:20:12;5018:11;:53::i;:::-;-1:-1:-1;5085:20:12;:30;;-1:-1:-1;;;;;5085:30:12;;-1:-1:-1;;;;;;5085:30:12;;;;;;;5136:20;5129:27;;;;;;;5085:20;5177;5170:27;4906:302;5224:31;5241:4;5247:7;5224:16;:31::i;:::-;5217:38;4812:450;-1:-1:-1;;;4812:450:12:o;3199:103:0:-;3265:30;3276:4;735:10:6;3265::0;:30::i;:::-;3199:103;:::o;2463:115:7:-;1474:19;:17;:19::i;:::-;2522:7:::1;:14:::0;;-1:-1:-1;;2522:14:7::1;2532:4;2522:14;::::0;;2551:20:::1;2558:12;735:10:6::0;;656:96;2558:12:7::1;2551:20;::::0;-1:-1:-1;;;;;687:32:18;;;669:51;;657:2;642:18;2551:20:7::1;;;;;;;2463:115::o:0;2710:117::-;1721:16;:14;:16::i;:::-;2768:7:::1;:15:::0;;-1:-1:-1;;2768:15:7::1;::::0;;2798:22:::1;735:10:6::0;2807:12:7::1;656:96:6::0;5328:245:0;-1:-1:-1;;;;;5421:34:0;;735:10:6;5421:34:0;5417:102;;5478:30;;-1:-1:-1;;;5478:30:0;;;;;;;;;;;5417:102;5529:37;5541:4;5547:18;6730:317;6808:4;6828:22;6836:4;6842:7;6828;:22::i;:::-;6824:217;;;6898:5;6866:12;;;;;;;;;;;-1:-1:-1;;;;;6866:29:0;;;;;;;;;;:37;;-1:-1:-1;;6866:37:0;;;6922:40;735:10:6;;6866:12:0;;6922:40;;6898:5;6922:40;-1:-1:-1;6983:4:0;6976:11;;6824:217;-1:-1:-1;7025:5:0;7018:12;;8051:302:10;8152:7;8171:14;8188:25;8195:1;8198;8201:11;8188:6;:25::i;:::-;8171:42;;8227:26;8244:8;8227:16;:26::i;:::-;:59;;;;;8285:1;8270:11;8257:25;;;;;:::i;:::-;8267:1;8264;8257:25;:29;8227:59;8223:101;;;8302:11;8312:1;8302:11;;:::i;:::-;;;8223:101;8340:6;8051:302;-1:-1:-1;;;;;8051:302:10:o;6179:316:0:-;6256:4;6277:22;6285:4;6291:7;6277;:22::i;:::-;6272:217;;6315:6;:12;;;;;;;;;;;-1:-1:-1;;;;;6315:29:0;;;;;;;;;:36;;-1:-1:-1;;6315:36:0;6347:4;6315:36;;;6397:12;735:10:6;;656:96;6397:12:0;-1:-1:-1;;;;;6370:40:0;6388:7;-1:-1:-1;;;;;6370:40:0;6382:4;6370:40;;;;;;;;;;-1:-1:-1;6431:4:0;6424:11;;3432:197;3520:22;3528:4;3534:7;3520;:22::i;:::-;3515:108;;3565:47;;-1:-1:-1;;;3565:47:0;;-1:-1:-1;;;;;7354:32:18;;3565:47:0;;;7336:51:18;7403:18;;;7396:34;;;7309:18;;3565:47:0;7162:274:18;2002:128:7;1920:7;;;;2063:61;;;2098:15;;-1:-1:-1;;;2098:15:7;;;;;;;;;;;2063:61;2002:128::o;2202:126::-;1920:7;;;;2260:62;;2296:15;;-1:-1:-1;;;2296:15:7;;;;;;;;;;;3803:4116:10;3885:14;4248:5;;;3885:14;-1:-1:-1;;4252:1:10;4248;4420:20;4493:5;4489:2;4486:13;4478:5;4474:2;4470:14;4466:34;4457:43;;;4595:5;4604:1;4595:10;4591:368;;4933:11;4925:5;:19;;;;;:::i;:::-;;4918:26;;;;;;4591:368;5080:5;5065:11;:20;5061:88;;5112:22;;-1:-1:-1;;;5112:22:10;;;;;;;;;;;5061:88;5404:17;5539:11;5536:1;5533;5526:25;5939:12;5969:15;;;5954:31;;6088:22;;;;;6813:1;6794;:15;;6793:21;;7046;;;7042:25;;7031:36;7115:21;;;7111:25;;7100:36;7185:21;;;7181:25;;7170:36;7255:21;;;7251:25;;7240:36;7325:21;;;7321:25;;7310:36;7396:21;;;7392:25;;;7381:36;6333:12;;;;6329:23;;;6354:1;6325:31;5653:20;;;5642:32;;;6445:12;;;;5700:21;;;;6186:16;;;;6436:21;;;;7860:15;;;;;-1:-1:-1;;3803:4116:10;;;;;:::o;14993:122::-;15061:4;15102:1;15090:8;15084:15;;;;;;;;:::i;:::-;:19;;;;:::i;:::-;:24;;15107:1;15084:24;15077:31;;14993:122;;;:::o;14:286:18:-;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;167:23;;-1:-1:-1;;;;;;219:32:18;;209:43;;199:71;;266:1;263;256:12;731:273;787:6;840:2;828:9;819:7;815:23;811:32;808:52;;;856:1;853;846:12;808:52;895:9;882:23;948:5;941:13;934:21;927:5;924:32;914:60;;970:1;967;960:12;1009:180;1068:6;1121:2;1109:9;1100:7;1096:23;1092:32;1089:52;;;1137:1;1134;1127:12;1089:52;-1:-1:-1;1160:23:18;;1009:180;-1:-1:-1;1009:180:18:o;1376:173::-;1444:20;;-1:-1:-1;;;;;1493:31:18;;1483:42;;1473:70;;1539:1;1536;1529:12;1473:70;1376:173;;;:::o;1554:254::-;1622:6;1630;1683:2;1671:9;1662:7;1658:23;1654:32;1651:52;;;1699:1;1696;1689:12;1651:52;1735:9;1722:23;1712:33;;1764:38;1798:2;1787:9;1783:18;1764:38;:::i;:::-;1754:48;;1554:254;;;;;:::o;2705:418::-;2854:2;2843:9;2836:21;2817:4;2886:6;2880:13;2929:6;2924:2;2913:9;2909:18;2902:34;2988:6;2983:2;2975:6;2971:15;2966:2;2955:9;2951:18;2945:50;3044:1;3039:2;3030:6;3019:9;3015:22;3011:31;3004:42;3114:2;3107;3103:7;3098:2;3090:6;3086:15;3082:29;3071:9;3067:45;3063:54;3055:62;;;2705:418;;;;:::o;3128:186::-;3187:6;3240:2;3228:9;3219:7;3215:23;3211:32;3208:52;;;3256:1;3253;3246:12;3208:52;3279:29;3298:9;3279:29;:::i;3527:133::-;3612:22;3605:5;3601:34;3594:5;3591:45;3581:73;;3650:1;3647;3640:12;3665:245;3723:6;3776:2;3764:9;3755:7;3751:23;3747:32;3744:52;;;3792:1;3789;3782:12;3744:52;3831:9;3818:23;3850:30;3874:5;3850:30;:::i;3915:127::-;3976:10;3971:3;3967:20;3964:1;3957:31;4007:4;4004:1;3997:15;4031:4;4028:1;4021:15;4047:128;4114:9;;;4135:11;;;4132:37;;;4149:18;;:::i;4180:416::-;4269:1;4306:5;4269:1;4320:270;4341:7;4331:8;4328:21;4320:270;;;4400:4;4396:1;4392:6;4388:17;4382:4;4379:27;4376:53;;;4409:18;;:::i;:::-;4459:7;4449:8;4445:22;4442:55;;;4479:16;;;;4442:55;4558:22;;;;4518:15;;;;4320:270;;;4324:3;4180:416;;;;;:::o;4601:806::-;4650:5;4680:8;4670:80;;-1:-1:-1;4721:1:18;4735:5;;4670:80;4769:4;4759:76;;-1:-1:-1;4806:1:18;4820:5;;4759:76;4851:4;4869:1;4864:59;;;;4937:1;4932:130;;;;4844:218;;4864:59;4894:1;4885:10;;4908:5;;;4932:130;4969:3;4959:8;4956:17;4953:43;;;4976:18;;:::i;:::-;-1:-1:-1;;5032:1:18;5018:16;;5047:5;;4844:218;;5146:2;5136:8;5133:16;5127:3;5121:4;5118:13;5114:36;5108:2;5098:8;5095:16;5090:2;5084:4;5081:12;5077:35;5074:77;5071:159;;;-1:-1:-1;5183:19:18;;;5215:5;;5071:159;5262:34;5287:8;5281:4;5262:34;:::i;:::-;5332:6;5328:1;5324:6;5320:19;5311:7;5308:32;5305:58;;;5343:18;;:::i;:::-;5381:20;;4601:806;-1:-1:-1;;;4601:806:18:o;5412:140::-;5470:5;5499:47;5540:4;5530:8;5526:19;5520:4;5499:47;:::i;5557:565::-;5660:6;5668;5676;5684;5692;5745:3;5733:9;5724:7;5720:23;5716:33;5713:53;;;5762:1;5759;5752:12;5713:53;5794:9;5788:16;5813:30;5837:5;5813:30;:::i;:::-;5862:5;5852:15;;;5907:2;5896:9;5892:18;5886:25;5876:35;;5951:2;5940:9;5936:18;5930:25;5920:35;;5995:2;5984:9;5980:18;5974:25;5964:35;;6044:3;6033:9;6029:19;6023:26;6058:32;6082:7;6058:32;:::i;:::-;6109:7;6099:17;;;5557:565;;;;;;;;:::o;6127:301::-;6256:3;6294:6;6288:13;6340:6;6333:4;6325:6;6321:17;6316:3;6310:37;6402:1;6366:16;;6391:13;;;-1:-1:-1;6366:16:18;6127:301;-1:-1:-1;6127:301:18:o;6433:184::-;6503:6;6556:2;6544:9;6535:7;6531:23;6527:32;6524:52;;;6572:1;6569;6562:12;6524:52;-1:-1:-1;6595:16:18;;6433:184;-1:-1:-1;6433:184:18:o;6622:273::-;6690:6;6743:2;6731:9;6722:7;6718:23;6714:32;6711:52;;;6759:1;6756;6749:12;6711:52;6791:9;6785:16;6841:4;6834:5;6830:16;6823:5;6820:27;6810:55;;6861:1;6858;6851:12;6900:127;6961:10;6956:3;6952:20;6949:1;6942:31;6992:4;6989:1;6982:15;7016:4;7013:1;7006:15;7032:125;7097:9;;;7118:10;;;7115:36;;;7131:18;;:::i;7441:127::-;7502:10;7497:3;7493:20;7490:1;7483:31;7533:4;7530:1;7523:15;7557:4;7554:1;7547:15;7573:254;7603:1;7637:4;7634:1;7630:12;7661:3;7651:134;;7707:10;7702:3;7698:20;7695:1;7688:31;7742:4;7739:1;7732:15;7770:4;7767:1;7760:15;7651:134;7817:3;7810:4;7807:1;7803:12;7799:22;7794:27;;;7573:254;;;;:::o
Swarm Source
ipfs://dc75c5e0650e03d3d57d980542145be9ed781432d0dae8481e0a95905f5c383b
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.