Source Code
Overview
ETH Balance
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x28045DC8...8a2E8E549 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
BridgeOracle
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.23;
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { IOracle, IOracleAdapter } from "src/interfaces/IOracle.sol";
import { GOVERNANCE_ROLE } from "src/utils/Constants.sol";
import { BAD_SETUP, PRICE_FEED, SEQUENCER_DOWN } from "src/utils/Errors.sol";
contract BridgeOracle is IOracleAdapter, AccessControl {
using SafeCast for uint256;
address public baseUsdOracle;
address public quoteUsdOracle;
address public sequencerUptimeOracle;
bool private isL2;
uint64 public baseOracleTimeLimit;
uint64 public quoteOracleTimeLimit;
uint64 public sequencerDowntimeLimit;
string public name; // We don't allow changing the name of this oracle to prevent inconsistency
uint8 public constant decimals = 18;
event OracleSet(string oracleType, address _oracleAddress);
event OracleTimeLimitSet(string oracleType, uint64 _timeLimit);
constructor(
address _baseUsdOracle,
address _quoteUsdOracle,
address _sequencerUptimeOracle,
uint64 _baseOracleTimeLimit,
uint64 _quoteOracleTimeLimit,
uint64 _sequencerDowntimeLimit,
bool _isL2,
string memory _name,
address governor
) {
if (
_baseUsdOracle == address(0) ||
_quoteUsdOracle == address(0) ||
_sequencerUptimeOracle == address(0) ||
governor == address(0)
) {
revert(BAD_SETUP);
}
baseUsdOracle = _baseUsdOracle;
quoteUsdOracle = _quoteUsdOracle;
sequencerUptimeOracle = _sequencerUptimeOracle;
baseOracleTimeLimit = _baseOracleTimeLimit;
quoteOracleTimeLimit = _quoteOracleTimeLimit;
sequencerDowntimeLimit = _sequencerDowntimeLimit;
isL2 = _isL2;
name = _name;
_setRoleAdmin(GOVERNANCE_ROLE, GOVERNANCE_ROLE);
_grantRole(GOVERNANCE_ROLE, governor);
}
/// @notice Sets the baseUsdOracle
/// @param _baseUsdOracle The new address of baseUsdOracle
/// @dev This function sets the address of baseUsdOracle oracle
function setBaseUsdOracle(address _baseUsdOracle) external onlyRole(GOVERNANCE_ROLE) {
baseUsdOracle = _baseUsdOracle;
emit OracleSet("baseUsdOracle", _baseUsdOracle);
}
/// @notice Sets the quoteUsdOracle
/// @param _quoteUsdOracle The new address of quoteUsdOracle
/// @dev This function sets the address of quoteUsdOracle oracle
function setQuoteUsdOracle(address _quoteUsdOracle) external onlyRole(GOVERNANCE_ROLE) {
quoteUsdOracle = _quoteUsdOracle;
emit OracleSet("quoteUsdOracle", _quoteUsdOracle);
}
/// @notice Sets the sequencerUptimeOracle
/// @param _sequencerUptimeOracle The new address of _sequencerUptimeOracle
/// @dev This function sets the address of sequencerUptimeOracle oracle
function setSequencerUptimeOracle(address _sequencerUptimeOracle) external onlyRole(GOVERNANCE_ROLE) {
sequencerUptimeOracle = _sequencerUptimeOracle;
emit OracleSet("sequencerUptimeOracle", _sequencerUptimeOracle);
}
/// @notice Sets the baseOracleTimeLimit
/// @param _baseOracleTimeLimit The new value of baseOracleTimeLimit
/// @dev This function sets the value of baseOracleTimeLimit
function setBaseOracleTimeLimit(uint64 _baseOracleTimeLimit) external onlyRole(GOVERNANCE_ROLE) {
baseOracleTimeLimit = _baseOracleTimeLimit;
emit OracleTimeLimitSet("baseOracleTimeLimit", _baseOracleTimeLimit);
}
/// @notice Sets the sequencerDowntimeLimit
/// @param _sequencerDowntimeLimit The new value of sequencerDowntimeLimit
/// @dev This function sets the value of sequencerDowntimeLimit
function setSequencerDowntimeLimit(uint64 _sequencerDowntimeLimit) external onlyRole(GOVERNANCE_ROLE) {
sequencerDowntimeLimit = _sequencerDowntimeLimit;
emit OracleTimeLimitSet("sequencerDowntimeLimit", _sequencerDowntimeLimit);
}
/// @notice Sets the quoteOracleTimeLimit
/// @param _quoteOracleTimeLimit The new value of quoteOracleTimeLimit
/// @dev This function sets the value of quoteOracleTimeLimit
function setQuoteOracleTimeLimit(uint64 _quoteOracleTimeLimit) external onlyRole(GOVERNANCE_ROLE) {
quoteOracleTimeLimit = _quoteOracleTimeLimit;
emit OracleTimeLimitSet("quoteOracleTimeLimit", _quoteOracleTimeLimit);
}
function latestAnswer() external view returns (int256) {
_checkSequencerDowntime();
IOracle _quoteUsdOracle = IOracle(quoteUsdOracle);
(, int256 quoteOraclePrice, , uint256 quoteUpdatedAt, ) = _quoteUsdOracle.latestRoundData();
if (quoteOraclePrice <= 0 || quoteUpdatedAt + quoteOracleTimeLimit <= block.timestamp) revert(PRICE_FEED);
uint8 quoteOracleDecimals = _quoteUsdOracle.decimals();
IOracle _baseUsdOracle = IOracle(baseUsdOracle);
(, int256 baseOraclePrice, , uint256 baseUpdatedAt, ) = _baseUsdOracle.latestRoundData();
if (baseOraclePrice <= 0 || baseUpdatedAt + baseOracleTimeLimit <= block.timestamp) revert(PRICE_FEED);
uint8 baseOracleDecimals = _baseUsdOracle.decimals();
return
(quoteOraclePrice * (10 ** (decimals + baseOracleDecimals)).toInt256()) /
(baseOraclePrice * (10 ** quoteOracleDecimals).toInt256());
}
function numeraireLatestAnswer() external view returns (int256) {
_checkSequencerDowntime();
IOracle _baseUsdOracle = IOracle(baseUsdOracle);
(, int256 baseOraclePrice, , uint256 updatedAt, ) = _baseUsdOracle.latestRoundData();
if (baseOraclePrice <= 0 || updatedAt + baseOracleTimeLimit <= block.timestamp) revert(PRICE_FEED);
return (baseOraclePrice * (10 ** decimals).toInt256()) / (10 ** _baseUsdOracle.decimals()).toInt256();
}
function _checkSequencerDowntime() internal view {
if (isL2) {
// check sequencer downtime
(, int256 answer, uint256 startedAt, , ) = IOracle(sequencerUptimeOracle).latestRoundData();
bool isSequencerUp = answer == 0;
if (!isSequencerUp) {
revert(SEQUENCER_DOWN);
}
// Make sure the grace period has passed after the
// sequencer is back up.
uint256 timeSinceUp = block.timestamp - startedAt;
if (timeSinceUp <= sequencerDowntimeLimit) {
revert(SEQUENCER_DOWN);
}
}
}
}// 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) (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/bool 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);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
/// @solidity memory-safe-assembly
assembly {
u := iszero(iszero(b))
}
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.23;
interface IOracleAdapter {
function latestAnswer() external view returns (int256);
function decimals() external view returns (uint8);
function numeraireLatestAnswer() external view returns (int256);
}
interface IOracle {
function latestRoundData() external view returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.23;
uint16 constant BASE = 10_000;
uint256 constant CURVE_MAP_SLOT = 65_551;
uint256 constant POOL_IDX = 420;
uint256 constant MAX_NUMBER_OF_WITHDRAWAL_SPLIT = 10;
bytes32 constant GOVERNANCE_ROLE = keccak256("GOVERNANCE");
bytes32 constant GUARDIAN_ROLE = keccak256("GUARDIAN");
uint256 constant DEAD_SHARES = 1_000;// SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.23; string constant BAD_SETUP = "B"; string constant BAD_RANGE = "BR"; string constant DELEGATE_CALL_FAILED = "DC"; string constant DEPOSIT_POSED = "D"; string constant HIGH_SLIPPAGE = "H"; string constant LP_ALREADY_EXISTS = "L"; string constant MERKLE_PROOF = "M"; string constant MESSAGE_VALUE = "MV"; string constant NOT_ENOUGH_FUND = "N"; string constant NOT_ENOUGH_TOKEN = "NE"; string constant NOT_ENOUGH_RECEIVED = "NER"; string constant NOT_IMPLEMENTED = "NI"; string constant PRICE_FEED = "P"; string constant SMALL_AMOUNT = "S"; string constant SEQUENCER_DOWN = "SD"; string constant TRANSFER_ETH = "T"; string constant WITHDRAW_EXCEEDS_MAX = "W"; string constant WRONG_LIQUIDITY = "WL"; string constant WITHDRAW_POSED = "WP";
// 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 ERC-165 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. This account bears the admin role (for the granted role).
* Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
*/
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.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) (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 ERC-165 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) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* 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[ERC 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": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"@prb/test/=lib/prb-test/",
"forge-std/=lib/forge-std/src/",
"@uniswap/v3-periphery/=lib/v3-periphery/contracts/",
"@uniswap/v3-core/=lib/v3-core/contracts/",
"base64-sol/=node_modules/base64-sol/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"prb-test/=lib/prb-test/src/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"v3-core/=lib/v3-core/contracts/",
"v3-periphery/=lib/v3-periphery/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 100
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {
"src/libraries/VaultLibrary.sol": {
"VaultLibrary": "0x5843144bE301BA02efBdbE485b5245414e649220"
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_baseUsdOracle","type":"address"},{"internalType":"address","name":"_quoteUsdOracle","type":"address"},{"internalType":"address","name":"_sequencerUptimeOracle","type":"address"},{"internalType":"uint64","name":"_baseOracleTimeLimit","type":"uint64"},{"internalType":"uint64","name":"_quoteOracleTimeLimit","type":"uint64"},{"internalType":"uint64","name":"_sequencerDowntimeLimit","type":"uint64"},{"internalType":"bool","name":"_isL2","type":"bool"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"governor","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":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintToInt","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oracleType","type":"string"},{"indexed":false,"internalType":"address","name":"_oracleAddress","type":"address"}],"name":"OracleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oracleType","type":"string"},{"indexed":false,"internalType":"uint64","name":"_timeLimit","type":"uint64"}],"name":"OracleTimeLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseOracleTimeLimit","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUsdOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numeraireLatestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteOracleTimeLimit","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteUsdOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","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":[],"name":"sequencerDowntimeLimit","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sequencerUptimeOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_baseOracleTimeLimit","type":"uint64"}],"name":"setBaseOracleTimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_baseUsdOracle","type":"address"}],"name":"setBaseUsdOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_quoteOracleTimeLimit","type":"uint64"}],"name":"setQuoteOracleTimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_quoteUsdOracle","type":"address"}],"name":"setQuoteUsdOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_sequencerDowntimeLimit","type":"uint64"}],"name":"setSequencerDowntimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sequencerUptimeOracle","type":"address"}],"name":"setSequencerUptimeOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60806040523480156200001157600080fd5b506040516200196238038062001962833981016040819052620000349162000327565b6001600160a01b03891615806200005257506001600160a01b038816155b806200006557506001600160a01b038716155b806200007857506001600160a01b038116155b15620000b85760408051808201825260018152602160f91b6020820152905162461bcd60e51b8152620000af91906004016200047e565b60405180910390fd5b600180546001600160a01b03199081166001600160a01b038c811691909117909255600280549091168a831617905560038054600480546001600160401b038a81166001600160801b031990921691909117680100000000000000008a83160217909155928a167fffffff0000000000000000ff000000000000000000000000000000000000000090911617600160a81b928916929092029190911760ff60a01b1916600160a01b85151502179055600562000175838262000544565b50620001916000805160206200194283398151915280620001bc565b620001ac600080516020620019428339815191528262000207565b5050505050505050505062000610565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16620002ac576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620002633390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620002b0565b5060005b92915050565b80516001600160a01b0381168114620002ce57600080fd5b919050565b80516001600160401b0381168114620002ce57600080fd5b634e487b7160e01b600052604160045260246000fd5b60005b838110156200031e57818101518382015260200162000304565b50506000910152565b60008060008060008060008060006101208a8c0312156200034757600080fd5b620003528a620002b6565b98506200036260208b01620002b6565b97506200037260408b01620002b6565b96506200038260608b01620002d3565b95506200039260808b01620002d3565b9450620003a260a08b01620002d3565b935060c08a01518015158114620003b857600080fd5b60e08b01519093506001600160401b0380821115620003d657600080fd5b818c0191508c601f830112620003eb57600080fd5b815181811115620004005762000400620002eb565b604051601f8201601f19908116603f011681019083821181831017156200042b576200042b620002eb565b816040528281528f60208487010111156200044557600080fd5b6200045883602083016020880162000301565b80965050505050506200046f6101008b01620002b6565b90509295985092959850929598565b60208152600082518060208401526200049f81604085016020870162000301565b601f01601f19169190910160400192915050565b600181811c90821680620004c857607f821691505b602082108103620004e957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200053f576000816000526020600020601f850160051c810160208610156200051a5750805b601f850160051c820191505b818110156200053b5782815560010162000526565b5050505b505050565b81516001600160401b03811115620005605762000560620002eb565b6200057881620005718454620004b3565b84620004ef565b602080601f831160018114620005b05760008415620005975750858301515b600019600386901b1c1916600185901b1785556200053b565b600085815260208120601f198616915b82811015620005e157888601518255948401946001909101908401620005c0565b5085821015620006005787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61132280620006206000396000f3fe608060405234801561001057600080fd5b506004361061014c5760003560e01c806350d25bcd116100c3578063bb8cbd6d1161007c578063bb8cbd6d146102ef578063c15ef47a14610302578063cd6495bf14610315578063ce84912814610328578063d547741f1461033b578063de5fb7bb1461034e57600080fd5b806350d25bcd146102975780636ba309281461029f57806387a9cc0e146102a757806391d14854146102ba578063a217fddf146102cd578063b59e0a10146102d557600080fd5b80631063cf5d116101155780631063cf5d146101fe578063198f725014610213578063248a9ca3146102265780632f2ff15d14610257578063313ce5671461026a57806336568abe1461028457600080fd5b80627314051461015157806301c4b8551461018857806301ffc9a71461019b57806306fdde03146101be5780630b9cc9e8146101d3575b600080fd5b60045461016b90600160401b90046001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b60045461016b906001600160401b031681565b6101ae6101a9366004610f15565b610361565b604051901515815260200161017f565b6101c6610398565b60405161017f9190610f46565b6002546101e6906001600160a01b031681565b6040516001600160a01b03909116815260200161017f565b61021161020c366004610f95565b610426565b005b610211610221366004610fda565b6104b2565b610249610234366004610ff5565b60009081526020819052604090206001015490565b60405190815260200161017f565b61021161026536600461100e565b61052e565b610272601281565b60405160ff909116815260200161017f565b61021161029236600461100e565b610559565b610249610591565b610249610883565b6102116102b5366004610f95565b6109f9565b6101ae6102c836600461100e565b610a92565b610249600081565b60035461016b90600160a81b90046001600160401b031681565b6001546101e6906001600160a01b031681565b6003546101e6906001600160a01b031681565b610211610323366004610fda565b610abb565b610211610336366004610f95565b610b38565b61021161034936600461100e565b610bce565b61021161035c366004610fda565b610bf3565b60006001600160e01b03198216637965db0b60e01b148061039257506301ffc9a760e01b6001600160e01b03198316145b92915050565b600580546103a59061103a565b80601f01602080910402602001604051908101604052809291908181526020018280546103d19061103a565b801561041e5780601f106103f35761010080835404028352916020019161041e565b820191906000526020600020905b81548152906001019060200180831161040157829003601f168201915b505050505081565b6000805160206112b683398151915261043e81610c77565b6004805467ffffffffffffffff19166001600160401b03841690811790915560408051818152601491810191909152731c5d5bdd1953dc9858db19551a5b59531a5b5a5d60621b606082015260208101919091526000805160206112f6833981519152906080015b60405180910390a15050565b6000805160206112b68339815191526104ca81610c77565b600180546001600160a01b0319166001600160a01b03841690811790915560408051818152600d918101919091526c626173655573644f7261636c6560981b606082015260208101919091526000805160206112d6833981519152906080016104a6565b60008281526020819052604090206001015461054981610c77565b6105538383610c84565b50505050565b6001600160a01b03811633146105825760405163334bd91960e11b815260040160405180910390fd5b61058c8282610d16565b505050565b600061059b610d81565b60025460408051633fabe5a360e21b815290516001600160a01b03909216916000918291849163feaf968c9160048083019260a09291908290030181865afa1580156105eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060f919061108e565b5093505092505060008213158061063c57506004544290610639906001600160401b0316836110f4565b11155b156106795760408051808201825260018152600560fc1b6020820152905162461bcd60e51b81526106709190600401610f46565b60405180910390fd5b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dd9190611107565b90506000600160009054906101000a90046001600160a01b03169050600080826001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561073a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075e919061108e565b509350509250506000821315806107925750600354429061078f90600160a81b90046001600160401b0316836110f4565b11155b156107c65760408051808201825260018152600560fc1b6020820152905162461bcd60e51b81526106709190600401610f46565b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a9190611107565b905061083f61083a86600a61120e565b610ea7565b610849908461121d565b61086261085783601261124d565b61083a90600a61120e565b61086c908961121d565b6108769190611266565b9850505050505050505090565b600061088d610d81565b60015460408051633fabe5a360e21b815290516001600160a01b03909216916000918291849163feaf968c9160048083019260a09291908290030181865afa1580156108dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610901919061108e565b509350509250506000821315806109355750600354429061093290600160a81b90046001600160401b0316836110f4565b11155b156109695760408051808201825260018152600560fc1b6020820152905162461bcd60e51b81526106709190600401610f46565b6109ce836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108579190611107565b6109dd61083a6012600a61120e565b6109e7908461121d565b6109f19190611266565b935050505090565b6000805160206112b6833981519152610a1181610c77565b600480546001600160401b038416600160401b0267ffffffffffffffff60401b199091161790556040516000805160206112f6833981519152906104a69084906040808252601690820152751cd95c5d595b98d95c911bdddb9d1a5b59531a5b5a5d60521b60608201526001600160401b0391909116602082015260800190565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206112b6833981519152610ad381610c77565b600280546001600160a01b0319166001600160a01b03841690811790915560408051818152600e918101919091526d71756f74655573644f7261636c6560901b606082015260208101919091526000805160206112d6833981519152906080016104a6565b6000805160206112b6833981519152610b5081610c77565b600380546001600160401b038416600160a81b0267ffffffffffffffff60a81b199091161790556040516000805160206112f6833981519152906104a690849060408082526013908201527218985cd953dc9858db19551a5b59531a5b5a5d606a1b60608201526001600160401b0391909116602082015260800190565b600082815260208190526040902060010154610be981610c77565b6105538383610d16565b6000805160206112b6833981519152610c0b81610c77565b600380546001600160a01b0319166001600160a01b038416908117909155604080518181526015918101919091527473657175656e636572557074696d654f7261636c6560581b606082015260208101919091526000805160206112d6833981519152906080016104a6565b610c818133610ed8565b50565b6000610c908383610a92565b610d0e576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610cc63390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610392565b506000610392565b6000610d228383610a92565b15610d0e576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610392565b600354600160a01b900460ff1615610ea557600080600360009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610de9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0d919061108e565b509194509250508215905080610e4d57604080518082018252600281526114d160f21b6020820152905162461bcd60e51b81526106709190600401610f46565b6000610e5983426112a2565b600454909150600160401b90046001600160401b0316811161055357604080518082018252600281526114d160f21b6020820152905162461bcd60e51b81526106709190600401610f46565b565b60006001600160ff1b03821115610ed45760405163123baf0360e11b815260048101839052602401610670565b5090565b610ee28282610a92565b610f115760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610670565b5050565b600060208284031215610f2757600080fd5b81356001600160e01b031981168114610f3f57600080fd5b9392505050565b60006020808352835180602085015260005b81811015610f7457858101830151858201604001528201610f58565b506000604082860101526040601f19601f8301168501019250505092915050565b600060208284031215610fa757600080fd5b81356001600160401b0381168114610f3f57600080fd5b80356001600160a01b0381168114610fd557600080fd5b919050565b600060208284031215610fec57600080fd5b610f3f82610fbe565b60006020828403121561100757600080fd5b5035919050565b6000806040838503121561102157600080fd5b8235915061103160208401610fbe565b90509250929050565b600181811c9082168061104e57607f821691505b60208210810361106e57634e487b7160e01b600052602260045260246000fd5b50919050565b805169ffffffffffffffffffff81168114610fd557600080fd5b600080600080600060a086880312156110a657600080fd5b6110af86611074565b94506020860151935060408601519250606086015191506110d260808701611074565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b80820180821115610392576103926110de565b60006020828403121561111957600080fd5b815160ff81168114610f3f57600080fd5b600181815b8085111561116557816000190482111561114b5761114b6110de565b8085161561115857918102915b93841c939080029061112f565b509250929050565b60008261117c57506001610392565b8161118957506000610392565b816001811461119f57600281146111a9576111c5565b6001915050610392565b60ff8411156111ba576111ba6110de565b50506001821b610392565b5060208310610133831016604e8410600b84101617156111e8575081810a610392565b6111f2838361112a565b8060001904821115611206576112066110de565b029392505050565b6000610f3f60ff84168361116d565b80820260008212600160ff1b84141615611239576112396110de565b8181058314821517610392576103926110de565b60ff8181168382160190811115610392576103926110de565b60008261128357634e487b7160e01b600052601260045260246000fd5b600160ff1b82146000198414161561129d5761129d6110de565b500590565b81810381811115610392576103926110de56fe35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee647710134e6f5996fac027f7faa0c7a9c387e89baea8ced15a0cf3c3f3aeb53367c09bc767dbbbd4bc41accc44ab367fdc4b4c9de58617615e4d6c446916d23de5bb8a164736f6c6343000817000a35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee6477100000000000000000000000043d12fb3afcad5347fa764eeab105478337b7200000000000000000000000000f376a91ae078927eb3686d6010a6f1482424954e00000000000000000000000045c2b8c204568a03dc7a2e32b71d67fe97f908a9000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000000000e10000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001200000000000000000000000001e1e19a123b1a6790eb02a4b2ce1890af2b76f320000000000000000000000000000000000000000000000000000000000000009555344542f555344430000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806350d25bcd116100c3578063bb8cbd6d1161007c578063bb8cbd6d146102ef578063c15ef47a14610302578063cd6495bf14610315578063ce84912814610328578063d547741f1461033b578063de5fb7bb1461034e57600080fd5b806350d25bcd146102975780636ba309281461029f57806387a9cc0e146102a757806391d14854146102ba578063a217fddf146102cd578063b59e0a10146102d557600080fd5b80631063cf5d116101155780631063cf5d146101fe578063198f725014610213578063248a9ca3146102265780632f2ff15d14610257578063313ce5671461026a57806336568abe1461028457600080fd5b80627314051461015157806301c4b8551461018857806301ffc9a71461019b57806306fdde03146101be5780630b9cc9e8146101d3575b600080fd5b60045461016b90600160401b90046001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b60045461016b906001600160401b031681565b6101ae6101a9366004610f15565b610361565b604051901515815260200161017f565b6101c6610398565b60405161017f9190610f46565b6002546101e6906001600160a01b031681565b6040516001600160a01b03909116815260200161017f565b61021161020c366004610f95565b610426565b005b610211610221366004610fda565b6104b2565b610249610234366004610ff5565b60009081526020819052604090206001015490565b60405190815260200161017f565b61021161026536600461100e565b61052e565b610272601281565b60405160ff909116815260200161017f565b61021161029236600461100e565b610559565b610249610591565b610249610883565b6102116102b5366004610f95565b6109f9565b6101ae6102c836600461100e565b610a92565b610249600081565b60035461016b90600160a81b90046001600160401b031681565b6001546101e6906001600160a01b031681565b6003546101e6906001600160a01b031681565b610211610323366004610fda565b610abb565b610211610336366004610f95565b610b38565b61021161034936600461100e565b610bce565b61021161035c366004610fda565b610bf3565b60006001600160e01b03198216637965db0b60e01b148061039257506301ffc9a760e01b6001600160e01b03198316145b92915050565b600580546103a59061103a565b80601f01602080910402602001604051908101604052809291908181526020018280546103d19061103a565b801561041e5780601f106103f35761010080835404028352916020019161041e565b820191906000526020600020905b81548152906001019060200180831161040157829003601f168201915b505050505081565b6000805160206112b683398151915261043e81610c77565b6004805467ffffffffffffffff19166001600160401b03841690811790915560408051818152601491810191909152731c5d5bdd1953dc9858db19551a5b59531a5b5a5d60621b606082015260208101919091526000805160206112f6833981519152906080015b60405180910390a15050565b6000805160206112b68339815191526104ca81610c77565b600180546001600160a01b0319166001600160a01b03841690811790915560408051818152600d918101919091526c626173655573644f7261636c6560981b606082015260208101919091526000805160206112d6833981519152906080016104a6565b60008281526020819052604090206001015461054981610c77565b6105538383610c84565b50505050565b6001600160a01b03811633146105825760405163334bd91960e11b815260040160405180910390fd5b61058c8282610d16565b505050565b600061059b610d81565b60025460408051633fabe5a360e21b815290516001600160a01b03909216916000918291849163feaf968c9160048083019260a09291908290030181865afa1580156105eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060f919061108e565b5093505092505060008213158061063c57506004544290610639906001600160401b0316836110f4565b11155b156106795760408051808201825260018152600560fc1b6020820152905162461bcd60e51b81526106709190600401610f46565b60405180910390fd5b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dd9190611107565b90506000600160009054906101000a90046001600160a01b03169050600080826001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561073a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075e919061108e565b509350509250506000821315806107925750600354429061078f90600160a81b90046001600160401b0316836110f4565b11155b156107c65760408051808201825260018152600560fc1b6020820152905162461bcd60e51b81526106709190600401610f46565b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a9190611107565b905061083f61083a86600a61120e565b610ea7565b610849908461121d565b61086261085783601261124d565b61083a90600a61120e565b61086c908961121d565b6108769190611266565b9850505050505050505090565b600061088d610d81565b60015460408051633fabe5a360e21b815290516001600160a01b03909216916000918291849163feaf968c9160048083019260a09291908290030181865afa1580156108dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610901919061108e565b509350509250506000821315806109355750600354429061093290600160a81b90046001600160401b0316836110f4565b11155b156109695760408051808201825260018152600560fc1b6020820152905162461bcd60e51b81526106709190600401610f46565b6109ce836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108579190611107565b6109dd61083a6012600a61120e565b6109e7908461121d565b6109f19190611266565b935050505090565b6000805160206112b6833981519152610a1181610c77565b600480546001600160401b038416600160401b0267ffffffffffffffff60401b199091161790556040516000805160206112f6833981519152906104a69084906040808252601690820152751cd95c5d595b98d95c911bdddb9d1a5b59531a5b5a5d60521b60608201526001600160401b0391909116602082015260800190565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000805160206112b6833981519152610ad381610c77565b600280546001600160a01b0319166001600160a01b03841690811790915560408051818152600e918101919091526d71756f74655573644f7261636c6560901b606082015260208101919091526000805160206112d6833981519152906080016104a6565b6000805160206112b6833981519152610b5081610c77565b600380546001600160401b038416600160a81b0267ffffffffffffffff60a81b199091161790556040516000805160206112f6833981519152906104a690849060408082526013908201527218985cd953dc9858db19551a5b59531a5b5a5d606a1b60608201526001600160401b0391909116602082015260800190565b600082815260208190526040902060010154610be981610c77565b6105538383610d16565b6000805160206112b6833981519152610c0b81610c77565b600380546001600160a01b0319166001600160a01b038416908117909155604080518181526015918101919091527473657175656e636572557074696d654f7261636c6560581b606082015260208101919091526000805160206112d6833981519152906080016104a6565b610c818133610ed8565b50565b6000610c908383610a92565b610d0e576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610cc63390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610392565b506000610392565b6000610d228383610a92565b15610d0e576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610392565b600354600160a01b900460ff1615610ea557600080600360009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610de9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0d919061108e565b509194509250508215905080610e4d57604080518082018252600281526114d160f21b6020820152905162461bcd60e51b81526106709190600401610f46565b6000610e5983426112a2565b600454909150600160401b90046001600160401b0316811161055357604080518082018252600281526114d160f21b6020820152905162461bcd60e51b81526106709190600401610f46565b565b60006001600160ff1b03821115610ed45760405163123baf0360e11b815260048101839052602401610670565b5090565b610ee28282610a92565b610f115760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610670565b5050565b600060208284031215610f2757600080fd5b81356001600160e01b031981168114610f3f57600080fd5b9392505050565b60006020808352835180602085015260005b81811015610f7457858101830151858201604001528201610f58565b506000604082860101526040601f19601f8301168501019250505092915050565b600060208284031215610fa757600080fd5b81356001600160401b0381168114610f3f57600080fd5b80356001600160a01b0381168114610fd557600080fd5b919050565b600060208284031215610fec57600080fd5b610f3f82610fbe565b60006020828403121561100757600080fd5b5035919050565b6000806040838503121561102157600080fd5b8235915061103160208401610fbe565b90509250929050565b600181811c9082168061104e57607f821691505b60208210810361106e57634e487b7160e01b600052602260045260246000fd5b50919050565b805169ffffffffffffffffffff81168114610fd557600080fd5b600080600080600060a086880312156110a657600080fd5b6110af86611074565b94506020860151935060408601519250606086015191506110d260808701611074565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b80820180821115610392576103926110de565b60006020828403121561111957600080fd5b815160ff81168114610f3f57600080fd5b600181815b8085111561116557816000190482111561114b5761114b6110de565b8085161561115857918102915b93841c939080029061112f565b509250929050565b60008261117c57506001610392565b8161118957506000610392565b816001811461119f57600281146111a9576111c5565b6001915050610392565b60ff8411156111ba576111ba6110de565b50506001821b610392565b5060208310610133831016604e8410600b84101617156111e8575081810a610392565b6111f2838361112a565b8060001904821115611206576112066110de565b029392505050565b6000610f3f60ff84168361116d565b80820260008212600160ff1b84141615611239576112396110de565b8181058314821517610392576103926110de565b60ff8181168382160190811115610392576103926110de565b60008261128357634e487b7160e01b600052601260045260246000fd5b600160ff1b82146000198414161561129d5761129d6110de565b500590565b81810381811115610392576103926110de56fe35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee647710134e6f5996fac027f7faa0c7a9c387e89baea8ced15a0cf3c3f3aeb53367c09bc767dbbbd4bc41accc44ab367fdc4b4c9de58617615e4d6c446916d23de5bb8a164736f6c6343000817000a
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 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.