Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
1430987 | 65 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
VisibilityServices
Compiler Version
v0.8.26+commit.8a97fa7a
ZkSolc Version
v1.5.11
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol"; import "./interfaces/IVisibilityCredits.sol"; import "./interfaces/IVisibilityServices.sol"; /** * @title VisibilityServices * @notice Allows users to spend creator credits (from IVisibilityCredits), for ad purposes. */ contract VisibilityServices is AccessControlDefaultAdminRulesUpgradeable, IVisibilityServices { uint256 public constant AUTO_VALIDATION_DELAY = 5 days; bytes32 public constant DISPUTE_RESOLVER_ROLE = keccak256("DISPUTE_RESOLVER_ROLE"); /// @custom:storage-location erc7201:noodles.VisibilityServices struct VisibilityServicesStorage { IVisibilityCredits visibilityCredits; uint256 servicesNonce; // Counter for service IDs mapping(uint256 => Service) services; // Mapping of services by nonce } // keccak256(abi.encode(uint256(keccak256("noodles.VisibilityServices")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant VisibilityServicesStorageLocation = 0x523cffa5e7f48f8e220488f534837697930b9986fe2a9046bebda6761fdc0000; function _getVisibilityServicesStorage() private pure returns (VisibilityServicesStorage storage $) { assembly { $.slot := VisibilityServicesStorageLocation } } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /** * @dev Constructor to initialize the contract. * * @param visibilityCredits Address of the IVisibilityCredits contract. * @param adminDelay Delay for the admin role. * @param admin Address for the admin role. * @param disputeResolver Address for the dispute resolver role. */ function initialize( address visibilityCredits, uint48 adminDelay, address admin, address disputeResolver ) public initializer { if (visibilityCredits == address(0)) revert InvalidAddress(); VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); $.visibilityCredits = IVisibilityCredits(visibilityCredits); __AccessControlDefaultAdminRules_init_unchained(adminDelay, admin); _grantRole(DISPUTE_RESOLVER_ROLE, disputeResolver); } /** * @notice Creates a new service. Can only be called by the creator linked to the visibility ID. * * @param serviceType The type of the service. * @param visibilityId The visibility ID associated with the service. * @param creditsCostAmount The cost in credits for the service. */ function createService( string memory serviceType, string memory visibilityId, uint256 creditsCostAmount ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); (address creator, , ) = $.visibilityCredits.getVisibility(visibilityId); if (creator != msg.sender) revert InvalidCreator(); uint256 nonce = $.servicesNonce; $.services[nonce].enabled = true; $.services[nonce].serviceType = serviceType; $.services[nonce].visibilityId = visibilityId; $.services[nonce].creditsCostAmount = creditsCostAmount; $.services[nonce].executionsNonce = 0; $.servicesNonce += 1; emit ServiceCreated( nonce, serviceType, visibilityId, creditsCostAmount ); } /** * @notice Creates a new service and updates an existing service. Can only be called by the creator linked to the visibility ID. * The existing service is disabled. The new service is created with the same parameters as the existing service, except for the cost in credits. * * @param serviceNonce The ID of the existing service. * @param creditsCostAmount The cost in credits for the new service. */ function createAndUpdateFromService( uint256 serviceNonce, uint256 creditsCostAmount ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; string memory serviceType = service.serviceType; string memory visibilityId = service.visibilityId; (address creator, , ) = $.visibilityCredits.getVisibility(visibilityId); if (creator != msg.sender) revert InvalidCreator(); uint256 nonce = $.servicesNonce; $.services[nonce].enabled = true; $.services[nonce].serviceType = serviceType; $.services[nonce].visibilityId = visibilityId; $.services[nonce].creditsCostAmount = creditsCostAmount; $.services[nonce].executionsNonce = 0; $.servicesNonce += 1; emit ServiceCreated( nonce, serviceType, visibilityId, creditsCostAmount ); service.enabled = false; emit ServiceUpdated(serviceNonce, false); } /** * @notice Updates the status of an existing service. Can only be called by the creator linked to the visibility ID. * * @param serviceNonce The ID of the service to update. * @param enabled The new status of the service (true for enabled, false for disabled). */ function updateService(uint256 serviceNonce, bool enabled) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; string memory visibilityId = service.visibilityId; (address creator, , ) = $.visibilityCredits.getVisibility(visibilityId); if (creator != msg.sender) revert InvalidCreator(); service.enabled = enabled; emit ServiceUpdated(serviceNonce, enabled); } /** * @notice Requests execution of a service. Transfers credits from the requester to the contract. * * @param serviceNonce The ID of the service. * @param requestData The data related to the request. */ function requestServiceExecution( uint256 serviceNonce, string calldata requestData ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; if (!service.enabled) revert DisabledService(); uint256 executionNonce = service.executionsNonce; service.executions[executionNonce].state = ExecutionState.REQUESTED; service.executions[executionNonce].requester = msg.sender; service.executions[executionNonce].lastUpdateTimestamp = block .timestamp; service.executionsNonce += 1; $.visibilityCredits.transferCredits( service.visibilityId, msg.sender, address(this), service.creditsCostAmount ); // revert if not enough credits emit ServiceExecutionRequested( serviceNonce, executionNonce, msg.sender, requestData ); } /** * @notice Accepts a service execution request. Can only be called by the creator linked to the visibility ID. * * @param serviceNonce The ID of the service. * @param executionNonce The ID of the execution. * @param responseData The data related to the response. */ function acceptServiceExecution( uint256 serviceNonce, uint256 executionNonce, string calldata responseData ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; Execution storage execution = service.executions[executionNonce]; if (execution.state != ExecutionState.REQUESTED) revert InvalidExecutionState(); string memory visibilityId = service.visibilityId; (address creator, , ) = $.visibilityCredits.getVisibility(visibilityId); if (creator != msg.sender) revert UnauthorizedExecutionAction(); execution.state = ExecutionState.ACCEPTED; execution.lastUpdateTimestamp = block.timestamp; emit ServiceExecutionAccepted( serviceNonce, executionNonce, responseData ); } /** * @notice Cancels a service execution. Can only be called by the requester or the creator linked to the visibility ID. * * @param serviceNonce The ID of the service. * @param executionNonce The ID of the execution. * @param cancelData The data related to the cancellation. */ function cancelServiceExecution( uint256 serviceNonce, uint256 executionNonce, string calldata cancelData ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; Execution storage execution = service.executions[executionNonce]; if (execution.state != ExecutionState.REQUESTED) revert InvalidExecutionState(); address requester = execution.requester; string memory visibilityId = service.visibilityId; (address creator, , ) = $.visibilityCredits.getVisibility(visibilityId); if (!(requester == msg.sender || creator == msg.sender)) revert UnauthorizedExecutionAction(); execution.state = ExecutionState.REFUNDED; execution.lastUpdateTimestamp = block.timestamp; $.visibilityCredits.transferCredits( visibilityId, address(this), requester, service.creditsCostAmount ); emit ServiceExecutionCanceled( serviceNonce, executionNonce, msg.sender, cancelData ); } /** * @notice Validates a service execution. Can only be called by the requester or by anyone after a delay. * * @param serviceNonce The ID of the service. * @param executionNonce The ID of the execution. */ function validateServiceExecution( uint256 serviceNonce, uint256 executionNonce ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; Execution storage execution = service.executions[executionNonce]; if (execution.state != ExecutionState.ACCEPTED) revert InvalidExecutionState(); if ( !(execution.requester == msg.sender || (AUTO_VALIDATION_DELAY + execution.lastUpdateTimestamp < block.timestamp)) ) revert UnauthorizedExecutionAction(); (address creator, , ) = $.visibilityCredits.getVisibility( service.visibilityId ); execution.state = ExecutionState.VALIDATED; execution.lastUpdateTimestamp = block.timestamp; $.visibilityCredits.transferCredits( service.visibilityId, address(this), creator, service.creditsCostAmount ); emit ServiceExecutionValidated(serviceNonce, executionNonce); } /** * @notice Disputes a service execution. Can only be called by the requester. * * @param serviceNonce The ID of the service. * @param executionNonce The ID of the execution. * @param disputeData The data related to the dispute. */ function disputeServiceExecution( uint256 serviceNonce, uint256 executionNonce, string calldata disputeData ) external { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; Execution storage execution = service.executions[executionNonce]; if (execution.state != ExecutionState.ACCEPTED) revert InvalidExecutionState(); if (execution.requester != msg.sender) revert UnauthorizedExecutionAction(); execution.state = ExecutionState.DISPUTED; execution.lastUpdateTimestamp = block.timestamp; emit ServiceExecutionDisputed( serviceNonce, executionNonce, disputeData ); } /** * @notice Resolves a disputed service execution. Can only be called by the dispute resolver. * * @param serviceNonce The ID of the service. * @param executionNonce The ID of the execution. * @param refund Whether the resolution includes a refund. * @param resolveData The data related to the resolution. */ function resolveServiceExecution( uint256 serviceNonce, uint256 executionNonce, bool refund, string calldata resolveData ) external onlyRole(DISPUTE_RESOLVER_ROLE) { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; Execution storage execution = service.executions[executionNonce]; if (execution.state != ExecutionState.DISPUTED) revert InvalidExecutionState(); if (refund) { execution.state = ExecutionState.REFUNDED; $.visibilityCredits.transferCredits( service.visibilityId, address(this), execution.requester, service.creditsCostAmount ); } else { execution.state = ExecutionState.VALIDATED; (address creator, , ) = $.visibilityCredits.getVisibility( service.visibilityId ); $.visibilityCredits.transferCredits( service.visibilityId, address(this), creator, service.creditsCostAmount ); } execution.lastUpdateTimestamp = block.timestamp; emit ServiceExecutionResolved( serviceNonce, executionNonce, refund, resolveData ); } function getService( uint256 serviceNonce ) external view returns ( bool enabled, string memory serviceType, string memory visibilityId, uint256 creditsCostAmount, uint256 executionsNonce ) { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Service storage service = $.services[serviceNonce]; return ( service.enabled, service.serviceType, service.visibilityId, service.creditsCostAmount, service.executionsNonce ); } function getServiceExecution( uint256 serviceNonce, uint256 executionNonce ) external view returns ( ExecutionState state, address requester, uint256 lastUpdateTimestamp ) { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); Execution storage execution = $.services[serviceNonce].executions[ executionNonce ]; return ( execution.state, execution.requester, execution.lastUpdateTimestamp ); } function getVisibilityCreditsContract() external view returns (address) { VisibilityServicesStorage storage $ = _getVisibilityServicesStorage(); return address($.visibilityCredits); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IVisibilityCredits { struct CreditsTradeEvent { address from; string visibilityId; uint256 amount; bool isBuy; uint256 tradeCost; uint256 creatorFee; uint256 protocolFee; uint256 referrerFee; uint256 partnerFee; address referrer; address partner; uint256 newTotalSupply; } struct Trade { uint256 tradeCost; uint256 creatorFee; uint256 protocolFee; uint256 referrerFee; uint256 partnerFee; address referrer; address partner; } struct Visibility { address creator; uint256 totalSupply; uint256 claimableFeeBalance; mapping(address => uint256) creditBalances; } event CreatorFeeClaimed( address indexed creator, uint256 amount, string visibilityId, address from ); event CreatorVisibilitySet( string visibilityId, address creator, string metadata ); event CreditsTrade(CreditsTradeEvent tradeEvent); event CreditsTransfer( string visibilityId, address indexed from, address indexed to, uint256 amount ); event ReferrerPartnerSet(address referrer, address partner); error InvalidAddress(); error InvalidCreator(); error InvalidAmount(); error NotEnoughEthSent(); error NotEnoughCreditsOwned(); function buyCredits( string calldata visibilityId, uint256 amount, address inputReferrer ) external payable; function sellCredits( string calldata visibilityId, uint256 amount, address inputReferrer ) external; function claimCreatorFee(string calldata visibilityId) external; function setCreatorVisibility( string calldata visibilityId, address creator, string calldata metadata ) external; function setReferrerPartner(address referrer, address partner) external; function transferCredits( string calldata visibilityId, address from, address to, uint256 amount ) external; function updateTreasury(address treasury) external; function getProtocolTreasury() external view returns (address); function getReferrerPartner( address referrer ) external view returns (address); function getUserReferrer(address user) external view returns (address); function getVisibility( string calldata visibilityId ) external view returns ( address creator, uint256 totalSupply, uint256 claimableFeeBalance ); function getVisibilityCreditBalance( string calldata visibilityId, address account ) external view returns (uint256); function getVisibilityKey( string calldata visibilityId ) external pure returns (bytes32); function buyCostWithFees( string calldata visibilityId, uint256 amount, address user, address inputReferrer ) external view returns (uint256 totalCost, Trade memory trade); function sellCostWithFees( string calldata visibilityId, uint256 amount, address user, address inputReferrer ) external view returns (uint256 reimbursement, Trade memory trade); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IVisibilityServices { enum ExecutionState { UNINITIALIZED, REQUESTED, ACCEPTED, DISPUTED, REFUNDED, VALIDATED } struct Execution { ExecutionState state; // Current state of the execution address requester; // Address that requested the service execution uint256 lastUpdateTimestamp; } struct Service { bool enabled; // Indicates if the service is active, if it can be requested string serviceType; // Service type identifier (e.g., "x-post" for post publication) string visibilityId; // Visibility identifier (e.g., "x-807982663000674305" for specific accounts) uint256 creditsCostAmount; // Cost in credits for the service uint256 executionsNonce; // Counter for execution IDs mapping(uint256 => Execution) executions; // Mapping of executions by nonce } event ServiceCreated( uint256 indexed nonce, string serviceType, string visibilityId, uint256 creditsCostAmount ); event ServiceUpdated(uint256 indexed nonce, bool enabled); event ServiceExecutionRequested( uint256 indexed serviceNonce, uint256 indexed executionNonce, address indexed requester, string requestData ); event ServiceExecutionCanceled( uint256 indexed serviceNonce, uint256 indexed executionNonce, address indexed from, string cancelData ); event ServiceExecutionAccepted( uint256 indexed serviceNonce, uint256 indexed executionNonce, string responseData ); event ServiceExecutionValidated( uint256 indexed serviceNonce, uint256 indexed executionNonce ); event ServiceExecutionDisputed( uint256 indexed serviceNonce, uint256 indexed executionNonce, string disputeData ); event ServiceExecutionResolved( uint256 indexed serviceNonce, uint256 indexed executionNonce, bool refund, string resolveData ); error DisabledService(); error InvalidAddress(); error InvalidCreator(); error InvalidExecutionState(); error UnauthorizedExecutionAction(); function createService( string memory serviceType, string memory visibilityId, uint256 creditsCostAmount ) external; function createAndUpdateFromService( uint256 serviceNonce, uint256 creditsCostAmount ) external; function updateService(uint256 serviceNonce, bool enabled) external; function requestServiceExecution( uint256 serviceNonce, string calldata requestData ) external; function acceptServiceExecution( uint256 serviceNonce, uint256 executionNonce, string calldata responseData ) external; function cancelServiceExecution( uint256 serviceNonce, uint256 executionNonce, string calldata cancelData ) external; function validateServiceExecution( uint256 serviceNonce, uint256 executionNonce ) external; function disputeServiceExecution( uint256 serviceNonce, uint256 executionNonce, string calldata disputeData ) external; function resolveServiceExecution( uint256 serviceNonce, uint256 executionNonce, bool refund, string calldata resolveData ) external; function getService( uint256 serviceNonce ) external view returns ( bool enabled, string memory serviceType, string memory visibilityId, uint256 creditsCostAmount, uint256 executionsNonce ); function getServiceExecution( uint256 serviceNonce, uint256 executionNonce ) external view returns ( ExecutionState state, address requester, uint256 lastUpdateTimestamp ); function getVisibilityCreditsContract() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlDefaultAdminRules.sol) pragma solidity ^0.8.20; import {IAccessControlDefaultAdminRules} from "@openzeppelin/contracts/access/extensions/IAccessControlDefaultAdminRules.sol"; import {AccessControlUpgradeable} from "../AccessControlUpgradeable.sol"; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC5313} from "@openzeppelin/contracts/interfaces/IERC5313.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows specifying special rules to manage * the `DEFAULT_ADMIN_ROLE` holder, which is a sensitive role with special permissions * over other roles that may potentially have privileged rights in the system. * * If a specific role doesn't have an admin role assigned, the holder of the * `DEFAULT_ADMIN_ROLE` will have the ability to grant it and revoke it. * * This contract implements the following risk mitigations on top of {AccessControl}: * * * Only one account holds the `DEFAULT_ADMIN_ROLE` since deployment until it's potentially renounced. * * Enforces a 2-step process to transfer the `DEFAULT_ADMIN_ROLE` to another account. * * Enforces a configurable delay between the two steps, with the ability to cancel before the transfer is accepted. * * The delay can be changed by scheduling, see {changeDefaultAdminDelay}. * * It is not possible to use another role to manage the `DEFAULT_ADMIN_ROLE`. * * Example usage: * * ```solidity * contract MyToken is AccessControlDefaultAdminRules { * constructor() AccessControlDefaultAdminRules( * 3 days, * msg.sender // Explicit initial `DEFAULT_ADMIN_ROLE` holder * ) {} * } * ``` */ abstract contract AccessControlDefaultAdminRulesUpgradeable is Initializable, IAccessControlDefaultAdminRules, IERC5313, AccessControlUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.AccessControlDefaultAdminRules struct AccessControlDefaultAdminRulesStorage { // pending admin pair read/written together frequently address _pendingDefaultAdmin; uint48 _pendingDefaultAdminSchedule; // 0 == unset uint48 _currentDelay; address _currentDefaultAdmin; // pending delay pair read/written together frequently uint48 _pendingDelay; uint48 _pendingDelaySchedule; // 0 == unset } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControlDefaultAdminRules")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessControlDefaultAdminRulesStorageLocation = 0xeef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698400; function _getAccessControlDefaultAdminRulesStorage() private pure returns (AccessControlDefaultAdminRulesStorage storage $) { assembly { $.slot := AccessControlDefaultAdminRulesStorageLocation } } /** * @dev Sets the initial values for {defaultAdminDelay} and {defaultAdmin} address. */ function __AccessControlDefaultAdminRules_init(uint48 initialDelay, address initialDefaultAdmin) internal onlyInitializing { __AccessControlDefaultAdminRules_init_unchained(initialDelay, initialDefaultAdmin); } function __AccessControlDefaultAdminRules_init_unchained(uint48 initialDelay, address initialDefaultAdmin) internal onlyInitializing { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (initialDefaultAdmin == address(0)) { revert AccessControlInvalidDefaultAdmin(address(0)); } $._currentDelay = initialDelay; _grantRole(DEFAULT_ADMIN_ROLE, initialDefaultAdmin); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlDefaultAdminRules).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC5313-owner}. */ function owner() public view virtual returns (address) { return defaultAdmin(); } /// /// Override AccessControl role management /// /** * @dev See {AccessControl-grantRole}. Reverts for `DEFAULT_ADMIN_ROLE`. */ function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super.grantRole(role, account); } /** * @dev See {AccessControl-revokeRole}. Reverts for `DEFAULT_ADMIN_ROLE`. */ function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super.revokeRole(role, account); } /** * @dev See {AccessControl-renounceRole}. * * For the `DEFAULT_ADMIN_ROLE`, it only allows renouncing in two steps by first calling * {beginDefaultAdminTransfer} to the `address(0)`, so it's required that the {pendingDefaultAdmin} schedule * has also passed when calling this function. * * After its execution, it will not be possible to call `onlyRole(DEFAULT_ADMIN_ROLE)` functions. * * NOTE: Renouncing `DEFAULT_ADMIN_ROLE` will leave the contract without a {defaultAdmin}, * thereby disabling any functionality that is only available for it, and the possibility of reassigning a * non-administrated role. */ function renounceRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) { (address newDefaultAdmin, uint48 schedule) = pendingDefaultAdmin(); if (newDefaultAdmin != address(0) || !_isScheduleSet(schedule) || !_hasSchedulePassed(schedule)) { revert AccessControlEnforcedDefaultAdminDelay(schedule); } delete $._pendingDefaultAdminSchedule; } super.renounceRole(role, account); } /** * @dev See {AccessControl-_grantRole}. * * For `DEFAULT_ADMIN_ROLE`, it only allows granting if there isn't already a {defaultAdmin} or if the * role has been previously renounced. * * NOTE: Exposing this function through another mechanism may make the `DEFAULT_ADMIN_ROLE` * assignable again. Make sure to guarantee this is the expected behavior in your implementation. */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (role == DEFAULT_ADMIN_ROLE) { if (defaultAdmin() != address(0)) { revert AccessControlEnforcedDefaultAdminRules(); } $._currentDefaultAdmin = account; } return super._grantRole(role, account); } /** * @dev See {AccessControl-_revokeRole}. */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) { delete $._currentDefaultAdmin; } return super._revokeRole(role, account); } /** * @dev See {AccessControl-_setRoleAdmin}. Reverts for `DEFAULT_ADMIN_ROLE`. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual override { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super._setRoleAdmin(role, adminRole); } /// /// AccessControlDefaultAdminRules accessors /// /** * @inheritdoc IAccessControlDefaultAdminRules */ function defaultAdmin() public view virtual returns (address) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); return $._currentDefaultAdmin; } /** * @inheritdoc IAccessControlDefaultAdminRules */ function pendingDefaultAdmin() public view virtual returns (address newAdmin, uint48 schedule) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); return ($._pendingDefaultAdmin, $._pendingDefaultAdminSchedule); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function defaultAdminDelay() public view virtual returns (uint48) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); uint48 schedule = $._pendingDelaySchedule; return (_isScheduleSet(schedule) && _hasSchedulePassed(schedule)) ? $._pendingDelay : $._currentDelay; } /** * @inheritdoc IAccessControlDefaultAdminRules */ function pendingDefaultAdminDelay() public view virtual returns (uint48 newDelay, uint48 schedule) { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); schedule = $._pendingDelaySchedule; return (_isScheduleSet(schedule) && !_hasSchedulePassed(schedule)) ? ($._pendingDelay, schedule) : (0, 0); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function defaultAdminDelayIncreaseWait() public view virtual returns (uint48) { return 5 days; } /// /// AccessControlDefaultAdminRules public and internal setters for defaultAdmin/pendingDefaultAdmin /// /** * @inheritdoc IAccessControlDefaultAdminRules */ function beginDefaultAdminTransfer(address newAdmin) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _beginDefaultAdminTransfer(newAdmin); } /** * @dev See {beginDefaultAdminTransfer}. * * Internal function without access restriction. */ function _beginDefaultAdminTransfer(address newAdmin) internal virtual { uint48 newSchedule = SafeCast.toUint48(block.timestamp) + defaultAdminDelay(); _setPendingDefaultAdmin(newAdmin, newSchedule); emit DefaultAdminTransferScheduled(newAdmin, newSchedule); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function cancelDefaultAdminTransfer() public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _cancelDefaultAdminTransfer(); } /** * @dev See {cancelDefaultAdminTransfer}. * * Internal function without access restriction. */ function _cancelDefaultAdminTransfer() internal virtual { _setPendingDefaultAdmin(address(0), 0); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function acceptDefaultAdminTransfer() public virtual { (address newDefaultAdmin, ) = pendingDefaultAdmin(); if (_msgSender() != newDefaultAdmin) { // Enforce newDefaultAdmin explicit acceptance. revert AccessControlInvalidDefaultAdmin(_msgSender()); } _acceptDefaultAdminTransfer(); } /** * @dev See {acceptDefaultAdminTransfer}. * * Internal function without access restriction. */ function _acceptDefaultAdminTransfer() internal virtual { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); (address newAdmin, uint48 schedule) = pendingDefaultAdmin(); if (!_isScheduleSet(schedule) || !_hasSchedulePassed(schedule)) { revert AccessControlEnforcedDefaultAdminDelay(schedule); } _revokeRole(DEFAULT_ADMIN_ROLE, defaultAdmin()); _grantRole(DEFAULT_ADMIN_ROLE, newAdmin); delete $._pendingDefaultAdmin; delete $._pendingDefaultAdminSchedule; } /// /// AccessControlDefaultAdminRules public and internal setters for defaultAdminDelay/pendingDefaultAdminDelay /// /** * @inheritdoc IAccessControlDefaultAdminRules */ function changeDefaultAdminDelay(uint48 newDelay) public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _changeDefaultAdminDelay(newDelay); } /** * @dev See {changeDefaultAdminDelay}. * * Internal function without access restriction. */ function _changeDefaultAdminDelay(uint48 newDelay) internal virtual { uint48 newSchedule = SafeCast.toUint48(block.timestamp) + _delayChangeWait(newDelay); _setPendingDelay(newDelay, newSchedule); emit DefaultAdminDelayChangeScheduled(newDelay, newSchedule); } /** * @inheritdoc IAccessControlDefaultAdminRules */ function rollbackDefaultAdminDelay() public virtual onlyRole(DEFAULT_ADMIN_ROLE) { _rollbackDefaultAdminDelay(); } /** * @dev See {rollbackDefaultAdminDelay}. * * Internal function without access restriction. */ function _rollbackDefaultAdminDelay() internal virtual { _setPendingDelay(0, 0); } /** * @dev Returns the amount of seconds to wait after the `newDelay` will * become the new {defaultAdminDelay}. * * The value returned guarantees that if the delay is reduced, it will go into effect * after a wait that honors the previously set delay. * * See {defaultAdminDelayIncreaseWait}. */ function _delayChangeWait(uint48 newDelay) internal view virtual returns (uint48) { uint48 currentDelay = defaultAdminDelay(); // When increasing the delay, we schedule the delay change to occur after a period of "new delay" has passed, up // to a maximum given by defaultAdminDelayIncreaseWait, by default 5 days. For example, if increasing from 1 day // to 3 days, the new delay will come into effect after 3 days. If increasing from 1 day to 10 days, the new // delay will come into effect after 5 days. The 5 day wait period is intended to be able to fix an error like // using milliseconds instead of seconds. // // When decreasing the delay, we wait the difference between "current delay" and "new delay". This guarantees // that an admin transfer cannot be made faster than "current delay" at the time the delay change is scheduled. // For example, if decreasing from 10 days to 3 days, the new delay will come into effect after 7 days. return newDelay > currentDelay ? uint48(Math.min(newDelay, defaultAdminDelayIncreaseWait())) // no need to safecast, both inputs are uint48 : currentDelay - newDelay; } /// /// Private setters /// /** * @dev Setter of the tuple for pending admin and its schedule. * * May emit a DefaultAdminTransferCanceled event. */ function _setPendingDefaultAdmin(address newAdmin, uint48 newSchedule) private { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); (, uint48 oldSchedule) = pendingDefaultAdmin(); $._pendingDefaultAdmin = newAdmin; $._pendingDefaultAdminSchedule = newSchedule; // An `oldSchedule` from `pendingDefaultAdmin()` is only set if it hasn't been accepted. if (_isScheduleSet(oldSchedule)) { // Emit for implicit cancellations when another default admin was scheduled. emit DefaultAdminTransferCanceled(); } } /** * @dev Setter of the tuple for pending delay and its schedule. * * May emit a DefaultAdminDelayChangeCanceled event. */ function _setPendingDelay(uint48 newDelay, uint48 newSchedule) private { AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage(); uint48 oldSchedule = $._pendingDelaySchedule; if (_isScheduleSet(oldSchedule)) { if (_hasSchedulePassed(oldSchedule)) { // Materialize a virtual delay $._currentDelay = $._pendingDelay; } else { // Emit for implicit cancellations when another delay was scheduled. emit DefaultAdminDelayChangeCanceled(); } } $._pendingDelay = newDelay; $._pendingDelaySchedule = newSchedule; } /// /// Private helpers /// /** * @dev Defines if an `schedule` is considered set. For consistency purposes. */ function _isScheduleSet(uint48 schedule) private pure returns (bool) { return schedule != 0; } /** * @dev Defines if an `schedule` is considered passed. For consistency purposes. */ function _hasSchedulePassed(uint48 schedule) private view returns (bool) { return schedule < block.timestamp; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl struct AccessControlStorage { mapping(bytes32 role => RoleData) _roles; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800; function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) { assembly { $.slot := AccessControlStorageLocation } } /** * @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); _; } function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } /** * @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) { AccessControlStorage storage $ = _getAccessControlStorage(); 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) { AccessControlStorage storage $ = _getAccessControlStorage(); 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 { AccessControlStorage storage $ = _getAccessControlStorage(); 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) { AccessControlStorage storage $ = _getAccessControlStorage(); 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) { AccessControlStorage storage $ = _getAccessControlStorage(); 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) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// 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 // OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/IAccessControlDefaultAdminRules.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlDefaultAdminRules declared to support ERC-165 detection. */ interface IAccessControlDefaultAdminRules is IAccessControl { /** * @dev The new default admin is not a valid default admin. */ error AccessControlInvalidDefaultAdmin(address defaultAdmin); /** * @dev At least one of the following rules was violated: * * - The `DEFAULT_ADMIN_ROLE` must only be managed by itself. * - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time. * - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps. */ error AccessControlEnforcedDefaultAdminRules(); /** * @dev The delay for transferring the default admin delay is enforced and * the operation must wait until `schedule`. * * NOTE: `schedule` can be 0 indicating there's no transfer scheduled. */ error AccessControlEnforcedDefaultAdminDelay(uint48 schedule); /** * @dev Emitted when a {defaultAdmin} transfer is started, setting `newAdmin` as the next * address to become the {defaultAdmin} by calling {acceptDefaultAdminTransfer} only after `acceptSchedule` * passes. */ event DefaultAdminTransferScheduled(address indexed newAdmin, uint48 acceptSchedule); /** * @dev Emitted when a {pendingDefaultAdmin} is reset if it was never accepted, regardless of its schedule. */ event DefaultAdminTransferCanceled(); /** * @dev Emitted when a {defaultAdminDelay} change is started, setting `newDelay` as the next * delay to be applied between default admin transfer after `effectSchedule` has passed. */ event DefaultAdminDelayChangeScheduled(uint48 newDelay, uint48 effectSchedule); /** * @dev Emitted when a {pendingDefaultAdminDelay} is reset if its schedule didn't pass. */ event DefaultAdminDelayChangeCanceled(); /** * @dev Returns the address of the current `DEFAULT_ADMIN_ROLE` holder. */ function defaultAdmin() external view returns (address); /** * @dev Returns a tuple of a `newAdmin` and an accept schedule. * * After the `schedule` passes, the `newAdmin` will be able to accept the {defaultAdmin} role * by calling {acceptDefaultAdminTransfer}, completing the role transfer. * * A zero value only in `acceptSchedule` indicates no pending admin transfer. * * NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced. */ function pendingDefaultAdmin() external view returns (address newAdmin, uint48 acceptSchedule); /** * @dev Returns the delay required to schedule the acceptance of a {defaultAdmin} transfer started. * * This delay will be added to the current timestamp when calling {beginDefaultAdminTransfer} to set * the acceptance schedule. * * NOTE: If a delay change has been scheduled, it will take effect as soon as the schedule passes, making this * function returns the new delay. See {changeDefaultAdminDelay}. */ function defaultAdminDelay() external view returns (uint48); /** * @dev Returns a tuple of `newDelay` and an effect schedule. * * After the `schedule` passes, the `newDelay` will get into effect immediately for every * new {defaultAdmin} transfer started with {beginDefaultAdminTransfer}. * * A zero value only in `effectSchedule` indicates no pending delay change. * * NOTE: A zero value only for `newDelay` means that the next {defaultAdminDelay} * will be zero after the effect schedule. */ function pendingDefaultAdminDelay() external view returns (uint48 newDelay, uint48 effectSchedule); /** * @dev Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin} scheduled for acceptance * after the current timestamp plus a {defaultAdminDelay}. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * Emits a DefaultAdminRoleChangeStarted event. */ function beginDefaultAdminTransfer(address newAdmin) external; /** * @dev Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}. * * A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * May emit a DefaultAdminTransferCanceled event. */ function cancelDefaultAdminTransfer() external; /** * @dev Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}. * * After calling the function: * * - `DEFAULT_ADMIN_ROLE` should be granted to the caller. * - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder. * - {pendingDefaultAdmin} should be reset to zero values. * * Requirements: * * - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`. * - The {pendingDefaultAdmin}'s `acceptSchedule` should've passed. */ function acceptDefaultAdminTransfer() external; /** * @dev Initiates a {defaultAdminDelay} update by setting a {pendingDefaultAdminDelay} scheduled for getting * into effect after the current timestamp plus a {defaultAdminDelay}. * * This function guarantees that any call to {beginDefaultAdminTransfer} done between the timestamp this * method is called and the {pendingDefaultAdminDelay} effect schedule will use the current {defaultAdminDelay} * set before calling. * * The {pendingDefaultAdminDelay}'s effect schedule is defined in a way that waiting until the schedule and then * calling {beginDefaultAdminTransfer} with the new delay will take at least the same as another {defaultAdmin} * complete transfer (including acceptance). * * The schedule is designed for two scenarios: * * - When the delay is changed for a larger one the schedule is `block.timestamp + newDelay` capped by * {defaultAdminDelayIncreaseWait}. * - When the delay is changed for a shorter one, the schedule is `block.timestamp + (current delay - new delay)`. * * A {pendingDefaultAdminDelay} that never got into effect will be canceled in favor of a new scheduled change. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * Emits a DefaultAdminDelayChangeScheduled event and may emit a DefaultAdminDelayChangeCanceled event. */ function changeDefaultAdminDelay(uint48 newDelay) external; /** * @dev Cancels a scheduled {defaultAdminDelay} change. * * Requirements: * * - Only can be called by the current {defaultAdmin}. * * May emit a DefaultAdminDelayChangeCanceled event. */ function rollbackDefaultAdminDelay() external; /** * @dev Maximum time in seconds for an increase to {defaultAdminDelay} (that is scheduled using {changeDefaultAdminDelay}) * to take effect. Default to 5 days. * * When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with * the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds) * that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can * be overrode for a custom {defaultAdminDelay} increase scheduling. * * IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise, * there's a risk of setting a high new delay that goes into effect almost immediately without the * possibility of human intervention in the case of an input error (eg. set milliseconds instead of seconds). */ function defaultAdminDelayIncreaseWait() external view returns (uint48); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.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.1.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) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; import {Panic} from "../Panic.sol"; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { 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 success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { 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 success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(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. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2²⁵⁶ + 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²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. 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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. 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⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // 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²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, 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; } } /** * @dev 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) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @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; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @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; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @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: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @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.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.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); }
{ "evmVersion": "paris", "optimizer": { "enabled": true, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"DisabledService","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidCreator","type":"error"},{"inputs":[],"name":"InvalidExecutionState","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"UnauthorizedExecutionAction","type":"error"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"string","name":"serviceType","type":"string"},{"indexed":false,"internalType":"string","name":"visibilityId","type":"string"},{"indexed":false,"internalType":"uint256","name":"creditsCostAmount","type":"uint256"}],"name":"ServiceCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"executionNonce","type":"uint256"},{"indexed":false,"internalType":"string","name":"responseData","type":"string"}],"name":"ServiceExecutionAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"executionNonce","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"string","name":"cancelData","type":"string"}],"name":"ServiceExecutionCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"executionNonce","type":"uint256"},{"indexed":false,"internalType":"string","name":"disputeData","type":"string"}],"name":"ServiceExecutionDisputed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"executionNonce","type":"uint256"},{"indexed":true,"internalType":"address","name":"requester","type":"address"},{"indexed":false,"internalType":"string","name":"requestData","type":"string"}],"name":"ServiceExecutionRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"executionNonce","type":"uint256"},{"indexed":false,"internalType":"bool","name":"refund","type":"bool"},{"indexed":false,"internalType":"string","name":"resolveData","type":"string"}],"name":"ServiceExecutionResolved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"executionNonce","type":"uint256"}],"name":"ServiceExecutionValidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ServiceUpdated","type":"event"},{"inputs":[],"name":"AUTO_VALIDATION_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DISPUTE_RESOLVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"executionNonce","type":"uint256"},{"internalType":"string","name":"responseData","type":"string"}],"name":"acceptServiceExecution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"executionNonce","type":"uint256"},{"internalType":"string","name":"cancelData","type":"string"}],"name":"cancelServiceExecution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"creditsCostAmount","type":"uint256"}],"name":"createAndUpdateFromService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"serviceType","type":"string"},{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"creditsCostAmount","type":"uint256"}],"name":"createService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"executionNonce","type":"uint256"},{"internalType":"string","name":"disputeData","type":"string"}],"name":"disputeServiceExecution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"}],"name":"getService","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"string","name":"serviceType","type":"string"},{"internalType":"string","name":"visibilityId","type":"string"},{"internalType":"uint256","name":"creditsCostAmount","type":"uint256"},{"internalType":"uint256","name":"executionsNonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"executionNonce","type":"uint256"}],"name":"getServiceExecution","outputs":[{"internalType":"enum IVisibilityServices.ExecutionState","name":"state","type":"uint8"},{"internalType":"address","name":"requester","type":"address"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVisibilityCreditsContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"visibilityCredits","type":"address"},{"internalType":"uint48","name":"adminDelay","type":"uint48"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"disputeResolver","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"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":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"string","name":"requestData","type":"string"}],"name":"requestServiceExecution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"executionNonce","type":"uint256"},{"internalType":"bool","name":"refund","type":"bool"},{"internalType":"string","name":"resolveData","type":"string"}],"name":"resolveServiceExecution","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":"rollbackDefaultAdminDelay","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":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"updateService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"serviceNonce","type":"uint256"},{"internalType":"uint256","name":"executionNonce","type":"uint256"}],"name":"validateServiceExecution","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
9c4d535b0000000000000000000000000000000000000000000000000000000000000000010005dfd3919fc5b8e006ee1293359f694e34e8ebd3a58145776e8d28326bde00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x0001000000000002000c00000000000200000000000103550000008003000039000000400030043f0000000100200190000000640000c13d00000060021002700000055602200197000000040020008c00000f380000413d000000000301043b000000e0033002700000055d0030009c000000830000a13d0000055e0030009c0000008e0000a13d0000055f0030009c000000e50000a13d000005600030009c000001780000a13d000005610030009c000003fe0000613d000005620030009c000004100000613d000005630030009c00000f380000c13d000000240020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000401100370000000000101043b000000000010043f0000058d01000041000000200010043f00000040020000390000000001000019155215330000040f0000000003010019000c00000001001d0000000301100039000000000101041a000a00000001001d0000000401300039000000000101041a000900000001001d000000000103041a000800000001001d00000080020000390000000101300039155213e50000040f000000800210008a0000008001000039155213c10000040f0000000c010000290000000201100039000000400200043d000c00000002001d155213e50000040f0000000c0210006a0000000c01000029155213c10000040f000000a001000039000000400300043d000b00000003001d000000200230003900000000001204350000000801000029000000ff001001900000000001000039000000010100c0390000000000130435000000a0023000390000008001000039155213d30000040f00000000020100190000000b030000290000000001310049000000400330003900000000001304350000000c01000029155213d30000040f0000000b0400002900000080024000390000000903000029000000000032043500000060024000390000000a0300002900000000003204350000000001410049000005560040009c00000556040080410000004002400210000005560010009c00000556010080410000006001100210000000000121019f000015530001042e0000000001000416000000000001004b00000f380000c13d0000055701000041000000000101041a0000055800100198000003fa0000c13d0000055902100197000005590020009c0000007e0000613d00000559011001c70000055702000041000000000012041b0000055901000041000000800010043f0000000001000414000005560010009c0000055601008041000000c0011002100000055a011001c70000800d0200003900000001030000390000055b04000041155215480000040f000000010020019000000f380000613d0000002001000039000001000010044300000120000004430000055c01000041000015530001042e000005760030009c000000970000213d000005820030009c000000f20000213d000005880030009c000001860000213d0000058b0030009c000004380000613d0000058c0030009c000000f80000613d00000f380000013d0000056b0030009c000000ff0000213d000005710030009c000001f30000213d000005740030009c000004450000613d000005750030009c0000035e0000613d00000f380000013d000005770030009c0000010b0000213d0000057d0030009c000002160000213d000005800030009c000005830000613d000005810030009c00000f380000c13d000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000402100370000000000202043b000c00000002001d0000002401100370000000000101043b000b00000001001d0000058e0010009c00000f380000213d0000000c01000029000000000001004b0000040c0000613d000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000101100039000000000101041a000a00000001001d000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b00000000020004110000058e02200197000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff00100190000008fe0000c13d0000059601000041000000000010043f0000000001000411000000040010043f0000000a01000029000000240010043f00000597010000410000155400010430000005660030009c0000016e0000213d000005690030009c000003630000613d0000056a0030009c00000f380000c13d0000000001000416000000000001004b00000f380000c13d000005ab01000041000000800010043f000005b301000041000015530001042e000005830030009c000002480000213d000005860030009c0000058c0000613d000005870030009c00000f380000c13d0000000001000416000000000001004b00000f380000c13d000005c001000041000000800010043f000005b301000041000015530001042e0000056c0030009c000002db0000213d0000056f0030009c000005ce0000613d000005700030009c00000f380000c13d0000000001000416000000000001004b00000f380000c13d000000800000043f000005b301000041000015530001042e000005780030009c0000032b0000213d0000057b0030009c000005f60000613d0000057c0030009c00000f380000c13d000000240020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000401100370000000000101043b000c00000001001d0000058e0010009c00000f380000213d00000000010004110000058e01100197000000000010043f0000058f01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff001001900000071a0000613d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000201043b000005bf0020009c000007c10000813d000b00000002001d0000059e01000041000000000101041a000900000001001d000a00d00010027a000009470000c13d0000059101000041000000000101041a000000d0011002700000000b01100029000005980010009c00000a090000213d000b00000001001d000000a00110021000000593011001970000059102000041000000000302041a0000059204300197000000000141019f0000000c011001af000000000012041b00000593003001980000015d0000613d0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d0200003900000001030000390000059504000041155215480000040f000000010020019000000f380000613d000000400100043d0000000b020000290000000000210435000005560010009c000005560100804100000040011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f000005ae011001c70000800d020000390000000203000039000005c4040000410000000c05000029000004330000013d000005670030009c000003c60000613d000005680030009c00000f380000c13d0000000001000416000000000001004b00000f380000c13d155214300000040f0000059801100197000006930000013d000005640030009c0000061f0000613d000005650030009c00000f380000c13d0000000001000416000000000001004b00000f380000c13d1552144e0000040f0000058e01100197000000800010043f0000059801200197000000a00010043f0000059901000041000015530001042e000005890030009c000006300000613d0000058a0030009c00000f380000c13d000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000002402100370000000000202043b000c00000002001d0000000401100370000000000101043b000b00000001001d000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000201043b0000000c01000029000000000010043f000a00000002001d0000000501200039000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000401043b000000000104041a000000ff0210018f000000060020008c000003580000813d000000020020008c00000b290000c13d00000008011002700000058e011001970000000002000411000000000021004b000007d40000c13d000005a901000041000000000701041a000000400600043d000005b40100004100000000001604350000000401600039000000200200003900000000002104350000000a010000290000000205100039000000000105041a000000010210019000000001081002700000007f0880618f0000001f0080008c00000000030000390000000103002039000000000032004b000006190000c13d000700000007001d000500000005001d000800000004001d000900000006001d0000002403600039000600000008001d0000000000830435000000000002004b00000a0f0000613d0000000501000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000606000029000000000006004b000000000300001900000a160000613d00000009020000290000004402200039000000000101043b00000000030000190000000004230019000000000501041a000000000054043500000001011000390000002003300039000000000063004b000001eb0000413d00000a160000013d000005720030009c0000035e0000613d000005730030009c00000f380000c13d000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000002402100370000000000202043b000c00000002001d0000058e0020009c00000f380000213d0000000401100370000000000101043b000000000010043f000005a001000041000000200010043f00000040020000390000000001000019155215330000040f0000000c02000029000000000020043f000000200010043f00000000010000190000004002000039155215330000040f000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f000005b301000041000015530001042e0000057e0030009c000006500000613d0000057f0030009c00000f380000c13d000000440020008c00000f380000413d0000000003000416000000000003004b00000f380000c13d0000000403100370000000000303043b000c00000003001d0000002403100370000000000303043b000005590030009c00000f380000213d0000002304300039000000000024004b00000f380000813d000a00040030003d0000000a01100360000000000101043b000b00000001001d000005590010009c00000f380000213d0000000b013000290000002401100039000000000021004b00000f380000213d0000000c01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000201043b000000000102041a000000ff00100190000007ec0000c13d000005c901000041000000000010043f000005b0010000410000155400010430000005840030009c0000068b0000613d000005850030009c00000f380000c13d000000640020008c00000f380000413d0000000003000416000000000003004b00000f380000c13d0000002403100370000000000303043b000b00000003001d0000000403100370000000000303043b000c00000003001d0000004403100370000000000303043b000005590030009c00000f380000213d0000002304300039000000000024004b00000f380000813d000900040030003d0000000901100360000000000101043b000a00000001001d000005590010009c00000f380000213d0000000a013000290000002401100039000000000021004b00000f380000213d0000000c01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000b02000029000000000020043f0000000501100039000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000800000001001d000000000101041a000000ff0210018f000000050020008c000003580000213d000000020020008c00000b290000c13d00000008021002700000058e022001970000000003000411000000000032004b000007e80000c13d000005db0110019700000003011001bf0000000802000029000000000012041b0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b00000008020000290000000102200039000000000012041b0000002002000039000000400100043d00000000022104360000000a030000290000000000320435000005dc053001980000001f0630018f00000040031000390000000004530019000000090700002900000020077000390000000007700367000002b60000613d000000000807034f0000000009030019000000008a08043c0000000009a90436000000000049004b000002b20000c13d000000000006004b000002c30000613d000000000557034f0000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f00000000005404350000000a04000029000000000343001900000000000304350000001f03400039000005dc02300197000005cd0020009c000005cd020080410000006002200210000005560010009c00000556010080410000004001100210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000121019f000005ce0110009a0000800d020000390000000303000039000005cf040000410000000c050000290000000b06000029000004330000013d0000056d0030009c0000069a0000613d0000056e0030009c00000f380000c13d000000840020008c00000f380000413d0000000003000416000000000003004b00000f380000c13d0000002403100370000000000303043b000b00000003001d0000000403100370000000000303043b000c00000003001d0000004403100370000000000403043b000000000004004b0000000003000039000000010300c039000a00000004001d000000000034004b00000f380000c13d0000006403100370000000000303043b000005590030009c00000f380000213d0000002304300039000000000024004b00000f380000813d0000000404300039000000000141034f000000000101043b000900000001001d000005590010009c00000f380000213d0000002403300039000800000003001d0000000901300029000000000021004b00000f380000213d000005ab01000041000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b00000000020004110000058e02200197000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff0010019000000ac40000c13d0000059601000041000000000010043f0000000001000411000000040010043f000005ab01000041000000240010043f00000597010000410000155400010430000005790030009c000006fe0000613d0000057a0030009c00000f380000c13d000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000002402100370000000000202043b000c00000002001d0000000401100370000000000101043b000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000c02000029000000000020043f0000000501100039000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000301043b000000000203041a000000ff0120018f000000050010008c0000078d0000a13d000005d501000041000000000010043f0000002101000039000000040010043f0000059b0100004100001554000104300000000001000416000000000001004b00000f380000c13d0000059e01000041000005870000013d000000640020008c00000f380000413d0000000003000416000000000003004b00000f380000c13d0000002403100370000000000303043b000b00000003001d0000000403100370000000000303043b000c00000003001d0000004403100370000000000303043b000005590030009c00000f380000213d0000002304300039000000000024004b00000f380000813d0000000404300039000000000141034f000000000101043b000a00000001001d000005590010009c00000f380000213d0000002403300039000900000003001d0000000a01300029000000000021004b00000f380000213d0000000c01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000201043b0000000b01000029000000000010043f000800000002001d0000000501200039000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000700000001001d000000000101041a000000ff0110018f000000050010008c000003580000213d000000010010008c00000b290000c13d00000008010000290000000201100039000000000201041a000000010320019000000001042002700000007f0440618f000800000004001d0000001f0040008c00000000040000390000000104002039000000000442013f0000000100400190000006190000c13d000000400400043d000600000004001d00000008050000290000000004540436000500000004001d000000000003004b00000ca90000613d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000080000006b00000d2c0000c13d000000000100001900000d370000013d000000840020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000402100370000000000202043b000c00000002001d0000058e0020009c00000f380000213d0000002402100370000000000202043b000b00000002001d000005980020009c00000f380000213d0000004402100370000000000202043b000a00000002001d0000058e0020009c00000f380000213d0000006401100370000000000101043b000900000001001d0000058e0010009c00000f380000213d0000055701000041000000000401041a00000558034001970000055901400198000008ed0000613d000000010010008c000003fa0000c13d000700000004001d000800000003001d000005a4010000410000000000100443000000000100041000000004001004430000000001000414000005560010009c0000055601008041000000c001100210000005a5011001c700008002020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000000001004b00000008030000290000000704000029000008ef0000613d000005b201000041000000000010043f000005b0010000410000155400010430000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000402100370000000000202043b0000002401100370000000000101043b000c00000001001d0000058e0010009c00000f380000213d000000000002004b000007260000c13d000005cc01000041000000000010043f000005b00100004100001554000104300000000001000416000000000001004b00000f380000c13d00000000010004110000058e01100197000000000010043f0000058f01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff001001900000071a0000613d0000059101000041000000000201041a0000059203200197000000000031041b0000059300200198000004360000613d0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d0200003900000001030000390000059504000041155215480000040f000000010020019000000f380000613d0000000001000019000015530001042e000000240020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000401100370000000000101043b000005d70010019800000f380000c13d000005d80010009c0000072f0000c13d0000000102000039000007340000013d000000640020008c00000f380000413d0000000003000416000000000003004b00000f380000c13d0000000403100370000000000403043b000005590040009c00000f380000213d0000002303400039000000000023004b00000f380000813d0000000405400039000000000351034f000000000303043b000005590030009c000011880000213d0000001f06300039000005dc066001970000003f06600039000005dc06600197000005bb0060009c000011880000213d0000008006600039000000400060043f000000800030043f00000000043400190000002404400039000000000024004b00000f380000213d0000002004500039000000000541034f000005dc063001980000001f0730018f000000a0046000390000046f0000613d000000a008000039000000000905034f000000009a09043c0000000008a80436000000000048004b0000046b0000c13d000000000007004b0000047c0000613d000000000565034f0000000306700210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f0000000000540435000000a00330003900000000000304350000002403100370000000000403043b000005590040009c00000f380000213d0000002303400039000000000023004b00000f380000813d0000000405400039000000000351034f000000000303043b000005590030009c000011880000213d0000001f06300039000005dc066001970000003f06600039000005dc06600197000000400700043d0000000006670019000c00000007001d000000000076004b00000000070000390000000107004039000005590060009c000011880000213d0000000100700190000011880000c13d000000400060043f0000000c060000290000000006360436000b00000006001d00000000043400190000002404400039000000000024004b00000f380000213d0000002002500039000000000421034f000005dc053001980000001f0630018f0000000b02500029000004ac0000613d000000000704034f0000000b08000029000000007907043c0000000008980436000000000028004b000004a80000c13d000000000006004b000004b90000613d000000000454034f0000000305600210000000000602043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004204350000000b07000029000000000237001900000000000204350000004401100370000000000101043b000900000001001d000005a901000041000000000201041a000000400400043d000005b40100004100000000001404350000000401400039000000200300003900000000003104350000000c01000029000000000101043300000024034000390000000000130435000a00000004001d00000044034000390000058e02200197000000000001004b000004d80000613d000000000400001900000000053400190000000006740019000000000606043300000000006504350000002004400039000000000014004b000004d10000413d0000001f04100039000005dc04400197000000000131001900000000000104350000004401400039000005560010009c000005560100804100000060011002100000000a03000029000005560030009c00000556030080410000004003300210000000000131019f0000000003000414000005560030009c0000055603008041000000c003300210000000000113019f1552154d0000040f00000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f00000060074001900000000a05700029000004fa0000613d000000000801034f0000000a09000029000000008a08043c0000000009a90436000000000059004b000004f60000c13d000000000006004b000005070000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000cb00000613d0000001f01400039000000e00210018f0000000a01200029000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d0000000a0100002900000000010104330000058e0010009c00000f380000213d0000000002000411000000000021004b00000ca50000c13d000005bc01000041000000000101041a000a00000001001d000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000201041a000005db0220019700000001022001bf000000000021041b0000000a01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000800200043d000800000002001d000005590020009c000011880000213d0000000101100039000700000001001d000000000101041a000000010010019000000001021002700000007f0220618f000600000002001d0000001f0020008c00000000020000390000000102002039000000000121013f0000000100100190000006190000c13d0000000601000029000000200010008c0000056f0000413d0000000701000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d00000008030000290000001f023000390000000502200270000000200030008c0000000002004019000000000301043b00000006010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b0000056f0000813d000000000002041b0000000102200039000000000012004b0000056b0000413d00000008010000290000001f0010008c000011ce0000a13d0000000701000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000200200008a0000000802200180000000000101043b000011f40000c13d0000002003000039000012000000013d0000000001000416000000000001004b00000f380000c13d000005a901000041000000000101041a0000058e01100197000000800010043f000005b301000041000015530001042e000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000402100370000000000202043b000c00000002001d0000002401100370000000000201043b000000000002004b0000000001000039000000010100c039000b00000002001d000000000012004b00000f380000c13d0000000c01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000501043b0000000201500039000000000201041a000000010320019000000001072002700000007f0770618f0000001f0070008c00000000040000390000000104002039000000000442013f0000000100400190000006190000c13d000000400600043d0000000009760436000000000003004b000007ce0000613d000700000007001d000800000006001d000900000009001d000a00000005001d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000705000029000000000005004b000009590000c13d00000000010000190000000a050000290000000909000029000009640000013d0000000001000416000000000001004b00000f380000c13d0000059e01000041000000000401041a000000d00340027200000000010000190000000002000019000005ed0000613d000b00000004001d000c00000003001d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b0000000c03000029000000000013004b000000000100001900000000020000190000000b04000029000000a00140827000000598021081970000000001038019000000400300043d000000200430003900000000001404350000000000230435000005560030009c00000556030080410000004001300210000005ba011001c7000015530001042e000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000002402100370000000000202043b000c00000002001d0000000401100370000000000101043b000b00000001001d000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000501043b0000000101500039000000000201041a000000010320019000000001082002700000007f0880618f0000001f0080008c00000000040000390000000104002039000000000442013f0000000100400190000007380000613d000005d501000041000000000010043f0000002201000039000000040010043f0000059b0100004100001554000104300000000001000416000000000001004b00000f380000c13d0000059101000041000000000101041a0000058e021001970000000003000411000000000023004b000007210000c13d000000a0011002700000059802100198000007510000c13d000005a201000041000000000010043f000000040020043f0000059b0100004100001554000104300000000001000416000000000001004b00000f380000c13d00000000010004110000058e01100197000000000010043f0000058f01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff001001900000071a0000613d0000059e01000041000000000101041a000b00000001001d000c00d00010027a0000079c0000c13d0000059e02000041000000000102041a0000058e01100197000000000012041b0000000001000019000015530001042e000000440020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000402100370000000000202043b000c00000002001d0000002401100370000000000101043b000b00000001001d0000058e0010009c00000f380000213d0000000c01000029000000000001004b0000000b04000029000006840000c13d0000059e02000041000000000202041a000000000242013f0000058e00200198000006840000c13d0000059101000041000000000101041a000000a00210027000000598022001970000058e001001980000062b0000c13d000000000002004b0000062b0000613d000a00000002001d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b0000000a02000029000000000012004b0000000c010000290000000b040000290000062b0000813d0000059103000041000000000203041a000005ca02200197000000000023041b0000000002000411000000000024004b0000072c0000613d000005cb01000041000000000010043f000005b0010000410000155400010430000000240020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000401100370000000000101043b1552141e0000040f000000400200043d0000000000120435000005560020009c00000556020080410000004001200210000005a3011001c7000015530001042e000000640020008c00000f380000413d0000000003000416000000000003004b00000f380000c13d0000002403100370000000000303043b000b00000003001d0000000403100370000000000303043b000c00000003001d0000004403100370000000000303043b000005590030009c00000f380000213d0000002304300039000000000024004b00000f380000813d0000000404300039000000000141034f000000000101043b000a00000001001d000005590010009c00000f380000213d0000002403300039000900000003001d0000000a01300029000000000021004b00000f380000213d0000000c01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000201043b0000000b01000029000000000010043f000800000002001d0000000501200039000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000600000001001d000000000101041a000700000001001d000000ff0110018f000000050010008c000003580000213d000000010010008c00000b290000c13d00000008010000290000000201100039000000000201041a000000010320019000000001042002700000007f0440618f000500000004001d0000001f0040008c00000000040000390000000104002039000000000442013f0000000100400190000006190000c13d000000400400043d000400000004001d00000005050000290000000004540436000300000004001d000000000003004b00000cbc0000613d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000050000006b00000df90000c13d000000000100001900000e040000013d000000240020008c00000f380000413d0000000002000416000000000002004b00000f380000c13d0000000401100370000000000101043b000c00000001001d000005980010009c00000f380000213d00000000010004110000058e01100197000000000010043f0000058f01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff00100190000007b30000c13d0000059601000041000000000010043f0000000001000411000000040010043f000000240000043f000005970100004100001554000104300000059a01000041000000000010043f000000040030043f0000059b0100004100001554000104300000000001020019000b00000002001d1552141e0000040f155214540000040f0000000b010000290000000c02000029155214d80000040f0000000001000019000015530001042e000005d90010009c00000000020000390000000102006039000005da0010009c00000001022061bf000000010120018f000000800010043f000005b301000041000015530001042e000000400700043d0000000006870436000000000003004b000007c80000613d000700000008001d000a00000007001d000900000006001d000800000005001d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000705000029000000000005004b000008880000c13d000000000100001900000008050000290000000906000029000008930000013d000c00000002001d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b0000000c02000029000000000012004b0000062b0000813d0000059e01000041000000000201041a000c00000002001d0000059f02200197000000000021041b000000000000043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000c020000290000058e02200197000000000101043b000c00000002001d000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff0010019000000b2d0000c13d00000000010004111552147f0000040f0000059101000041000000000201041a0000059202200197000000000021041b0000000001000019000015530001042e0000000103300039000000000303041a000000400400043d0000004005400039000000000035043500000008022002700000058e02200197000000200340003900000000002304350000000000140435000005560040009c00000556040080410000004001400210000005be011001c7000015530001042e0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b0000000c0010006b000008c80000813d0000000b01000029000000300110021000000592011001970000059102000041000000000302041a000005aa03300197000000000113019f000000000012041b0000064a0000013d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000201043b000005bf0020009c000008d40000413d000005c301000041000000000010043f0000003001000039000000040010043f000000240020043f00000597010000410000155400010430000005db012001970000000000160435000000000008004b00000020010000390000000001006039000008940000013d000005db012001970000000000190435000000000007004b00000020010000390000000001006039000009650000013d000800000004001d0000000101400039000000000101041a000905d2001000a400000a090000813d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000090010006b0000000804000029000001bc0000413d000005d401000041000000000010043f000005b00100004100001554000104300000000401200039000700000001001d000000000101041a000900000001001d000000000010043f000600000002001d0000000501200039000800000001001d000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000201041a000005db0220019700000001022001bf000000000021041b0000000901000029000000000010043f0000000801000029000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d00000000020004110000000802200210000005c602200197000000000101043b000000000301041a000005c703300197000000000232019f000000000021041b0000000901000029000000000010043f0000000801000029000000200010043f0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000800000001001d0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b00000001011000390000000802000029000000000021041b0000000701000029000000000101041a000000010110003a00000a090000613d0000000702000029000000000012041b00000006010000290000000301100039000000000101041a000700000001001d000005a901000041000000000101041a000005a40200004100000000002004430000058e01100197000800000001001d00000004001004430000000001000414000005560010009c0000055601008041000000c001100210000005a5011001c700008002020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000000001004b000000800200003900000f380000613d000000400300043d000005b7010000410000000001130436000400000001001d000500000003001d0000000401300039000000000021043500000006010000290000000201100039000000000201041a000000010320019000000001042002700000007f0440618f000600000004001d0000001f0040008c00000000040000390000000104002039000000000442013f0000000100400190000006190000c13d0000000504000029000000840440003900000006050000290000000000540435000000000003004b00000f3a0000613d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000606000029000000000006004b000000000200001900000f410000613d0000000502000029000000a403200039000000000101043b00000000020000190000000004320019000000000501041a000000000054043500000001011000390000002002200039000000000062004b000008800000413d00000f410000013d000000000201043b000000000100001900000009060000290000000003610019000000000402041a000000000043043500000001022000390000002001100039000000000051004b0000088b0000413d00000008050000290000000a070000290000003f01100039000000200800008a000000000181016f0000000009710019000000000019004b00000000010000390000000101004039000005590090009c000011880000213d0000000100100190000011880000c13d000000400090043f0000000201500039000000000201041a0000000103200190000000010b2002700000007f0bb0618f0000001f00b0008c00000000040000390000000104002039000000000442013f0000000100400190000006190000c13d000000000ab90436000000000003004b000008e70000613d00050000000b001d00060000000a001d000700000009001d000a00000007001d000900000006001d000800000005001d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000050000006b00000b700000c13d0000000001000019000000080500002900000009060000290000000a07000029000000200800008a0000000709000029000000060a00002900000b800000013d0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d020000390000000103000039000005c104000041155215480000040f00000001002001900000064a0000c13d00000f380000013d000b00000002001d0000059e01000041000000000101041a000900000001001d000a00d00010027a000009f00000c13d0000059101000041000000000101041a000000d0011002700000000c020000290000059802200197000000000121004b000a00000002001d00000a020000813d000005c00020009c000005c00100004100000000010240190000000b0200002900000a050000013d000005db0120019700000000001a043500000000000b004b0000002001000039000000000100603900000b800000013d000000000003004b000003fa0000c13d000005a60140019700000001021001bf000005a701400197000005a8011001c7000800000003001d000000000003004b000000000102c0190000055702000041000000000012041b0000000c0000006b00000b590000c13d000005b101000041000000000010043f000005b00100004100001554000104300000000c01000029000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000b02000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff00100190000004360000c13d0000000c01000029000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000b02000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000201041a000005db0220019700000001022001bf000000000021041b0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d020000390000000403000039000005ac040000410000000c050000290000000b060000290000000007000411000004330000013d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b0000000a0010006b000001410000813d0000000901000029000000a0011002700000059801100197000001440000013d000000000201043b000000000100001900000009090000290000000003910019000000000402041a000000000043043500000001022000390000002001100039000000000051004b0000095c0000413d0000000a0500002900000008060000290000003f02100039000005dc022001970000000008620019000000000028004b00000000020000390000000102004039000005590080009c000011880000213d0000000100200190000011880000c13d000a00000005001d000000400080043f000005a902000041000000000202041a000005b403000041000000000038043500000004038000390000002004000039000000000043043500000000030604330000002404800039000000000034043500000044048000390000058e02200197000000000003004b000009870000613d000000000500001900000000064500190000000007590019000000000707043300000000007604350000002005500039000000000035004b000009800000413d0000001f05300039000005dc015001970000000003340019000000000003043500000000018100490000000001410019000005560010009c00000556010080410000006001100210000005560080009c000005560300004100000000030840190000004003300210000000000131019f0000000003000414000005560030009c0000055603008041000000c003300210000000000131019f000900000008001d1552154d0000040f000000090b00002900000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f000000600740019000000000057b0019000009ac0000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b000009a80000c13d000000000006004b000009b90000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f00000000006504350000000100200190000009e40000613d0000001f01400039000000e00210018f0000000001b20019000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d000000090200002900000000020204330000058e0020009c00000f380000213d0000000003000411000000000032004b00000ca50000c13d0000000a04000029000000000204041a000005db022001970000000b03000029000000000232019f000000000024041b0000000000310435000005560010009c000005560100804100000040011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f000005ae011001c70000800d020000390000000203000039000005c5040000410000000c05000029000004330000013d0000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000009eb0000c13d00000c610000013d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b0000000a0010006b000008da0000813d0000000901000029000000a0011002700000059801100197000008dd0000013d000005980010009c0000000b0200002900000a090000213d0000000001210019000900000001001d000005980010009c00000ab60000a13d000005d501000041000000000010043f0000001101000039000000040010043f0000059b010000410000155400010430000005db01100197000000090200002900000044022000390000000000120435000000060000006b0000002003000039000000000300603900000007010000290000058e021001970000000901000029000005560010009c000005560100804100000040011002100000004403300039000005560030009c00000556030080410000006003300210000000000113019f0000000003000414000005560030009c0000055603008041000000c003300210000000000131019f1552154d0000040f00000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f0000006007400190000000090570002900000a360000613d000000000801034f0000000909000029000000008a08043c0000000009a90436000000000059004b00000a320000c13d000000000006004b00000a430000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000b640000613d0000001f01400039000000e00210018f0000000901200029000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d00000009010000290000000001010433000900000001001d0000058e0010009c00000f380000213d0000000802000029000000000102041a000005db0110019700000005011001bf000000000012041b0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b00000008020000290000000102200039000000000012041b0000000a010000290000000301100039000000000101041a000800000001001d000005a901000041000000000101041a000005a40200004100000000002004430000058e01100197000a00000001001d00000004001004430000000001000414000005560010009c0000055601008041000000c001100210000005a5011001c700008002020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000000001004b000000800200003900000f380000613d000000400300043d000005b7010000410000000000130435000700000003001d000000040130003900000000002104350000000501000029000000000101041a000000010210019000000001031002700000007f0330618f000600000003001d0000001f0030008c00000000030000390000000103002039000000000331013f0000000100300190000006190000c13d0000000703000029000000840330003900000006040000290000000000430435000000000002004b000010780000613d0000000501000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000606000029000000000006004b00000000020000190000107f0000613d0000000702000029000000a403200039000000000101043b00000000020000190000000004320019000000000501041a000000000054043500000001011000390000002002200039000000000062004b00000aae0000413d0000107f0000013d0000059e01000041000000000101041a000000d00210027200000c890000613d0000000b0020006c00000c7c0000813d000000300210021000000592022001970000059103000041000000000403041a000005aa04400197000000000224019f000000000023041b00000c890000013d0000000c01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000201043b0000000b01000029000000000010043f000700000002001d0000000501200039000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000500000001001d000000000101041a000600000001001d000000ff0110018f000000050010008c000003580000213d000000030010008c00000b290000c13d000001000100008a000000060110017f0000000a0000006b00000f1d0000c13d00000005011001bf0000000502000029000000000012041b000005a901000041000000000101041a000300000001001d000000400200043d000005b4010000410000000000120435000600000002001d00000004012000390000002002000039000000000021043500000007010000290000000201100039000200000001001d000000000101041a000000010210019000000001031002700000007f0330618f000400000003001d0000001f0030008c00000000030000390000000103002039000000000331013f0000000100300190000006190000c13d0000000603000029000000240330003900000004040000290000000000430435000000000002004b00000f9b0000613d0000000201000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000407000029000000000007004b000000000600001900000fa20000613d00000006020000290000004403200039000000000101043b00000000060000190000000004360019000000000501041a000000000054043500000001011000390000002006600039000000000076004b00000b210000413d00000fa20000013d000005d101000041000000000010043f000005b0010000410000155400010430000000000000043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000c02000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000201041a000005db02200197000000000021041b0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d020000390000000403000039000005a10400004100000000050000190000000c060000290000000007000411155215480000040f0000000100200190000007850000c13d00000f380000013d000005a902000041000000000302041a0000059f033001970000000c033001af000000000032041b000005580010019800000c740000c13d000005af01000041000000000010043f000005b00100004100001554000104300000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000b6b0000c13d00000c610000013d000000000201043b0000000001000019000000060a00002900000005050000290000000003a10019000000000402041a000000000043043500000001022000390000002001100039000000000051004b00000b740000413d000000080500002900000009060000290000000a07000029000000200800008a000000070900002900000000029a004900000000011200190000001f01100039000000000181016f000000000b91001900000000001b004b000000000100003900000001010040390000055900b0009c000011880000213d0000000100100190000011880000c13d000a00000007001d000900000006001d000800000005001d0000004000b0043f000005a901000041000000000201041a000005b40100004100000000001b04350000000401b0003900000020030000390000000000310435000700000009001d00000000010904330000002403b0003900000000001304350000004403b000390000058e02200197000000000001004b00000ba70000613d0000000004000019000000000534001900000000064a0019000000000606043300000000006504350000002004400039000000000014004b00000ba00000413d00060000000a001d0000001f04100039000000000484016f000000000113001900000000000104350000000001b400490000000001310019000005560010009c000005560100804100000060011002100000055600b0009c000005560300004100000000030b40190000004003300210000000000131019f0000000003000414000005560030009c0000055603008041000000c003300210000000000131019f00050000000b001d1552154d0000040f000000050900002900000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f0000006007400190000000000579001900000bcc0000613d000000000801034f000000008a08043c0000000009a90436000000000059004b00000bc80000c13d000000000006004b00000bd90000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000c560000613d0000001f01400039000000e00210018f0000000501200029000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d000000050100002900000000010104330000058e0010009c00000f380000213d0000000002000411000000000021004b00000ca50000c13d000005bc01000041000000000101041a000500000001001d000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000201041a000005db0220019700000001022001bf000000000021041b0000000501000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000a020000290000000002020433000400000002001d000005590020009c000011880000213d0000000101100039000300000001001d000000000101041a000000010010019000000001021002700000007f0220618f000200000002001d0000001f0020008c00000000020000390000000102002039000000000121013f0000000100100190000006190000c13d0000000201000029000000200010008c00000c420000413d0000000301000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d00000004030000290000001f023000390000000502200270000000200030008c0000000002004019000000000301043b00000002010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b00000c420000813d000000000002041b0000000102200039000000000012004b00000c3e0000413d00000004010000290000001f0010008c0000112f0000a13d0000000301000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000200200008a0000000402200180000000000101043b000011580000c13d0000002003000039000011650000013d0000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000c5d0000c13d000000000005004b00000c6e0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000005560020009c00000556020080410000004002200210000000000112019f00001554000104300000000a010000290000058e0010019800000cc30000c13d0000059a01000041000000000010043f000000040000043f0000059b0100004100001554000104300000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d020000390000000103000039000005c104000041155215480000040f000000010020019000000f380000613d0000059e01000041000000000101041a0000058e011001970000000c02000029000000a0022002100000059302200197000000000112019f0000000903000029000000d002300210000000000121019f0000059e02000041000000000012041b000000400100043d000000200210003900000000003204350000000a020000290000000000210435000005560010009c000005560100804100000040011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000590011001c70000800d020000390000000103000039000005c204000041000004330000013d000005d001000041000000000010043f000005b0010000410000155400010430000005db0120019700000005020000290000000000120435000000080000006b0000002001000039000000000100603900000d370000013d0000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000cb70000c13d00000c610000013d000005db0120019700000003020000290000000000120435000000050000006b0000002001000039000000000100603900000e040000013d0000000b01000029000000d0011002100000059102000041000000000302041a000005aa03300197000000000113019f000000000012041b0000000a010000291552147f0000040f000005ab01000041000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000902000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000101041a000000ff0010019000000d170000c13d000005ab01000041000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000902000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b000000000201041a000005db0220019700000001022001bf000000000021041b0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d0200003900000004030000390000000007000411000005ac04000041000005ab050000410000000906000029155215480000040f000000010020019000000f380000613d000000080000006b000004360000c13d0000055701000041000000000201041a000005ad02200197000000000021041b0000000103000039000000400100043d0000000000310435000005560010009c000005560100804100000040011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f000005ae011001c70000800d020000390000055b04000041000004330000013d000000000201043b0000000001000019000000050500002900000008060000290000000003510019000000000402041a000000000043043500000001022000390000002001100039000000000061004b00000d300000413d0000003f01100039000005dc011001970000000602100029000000000012004b00000000010000390000000101004039000800000002001d000005590020009c000011880000213d0000000100100190000011880000c13d0000000804000029000000400040043f000005a901000041000000000201041a000005b4010000410000000000140435000000040140003900000020030000390000000000310435000000060100002900000000010104330000002403400039000000000013043500000044034000390000058e02200197000000000001004b000000050700002900000d5c0000613d000000000400001900000000053400190000000006470019000000000606043300000000006504350000002004400039000000000014004b00000d550000413d0000001f04100039000005dc0440019700000000011300190000000000010435000000080500002900000000015400490000000001310019000005560010009c00000556010080410000006001100210000005560050009c000005560300004100000000030540190000004003300210000000000131019f0000000003000414000005560030009c0000055603008041000000c003300210000000000113019f1552154d0000040f00000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f0000006007400190000000080570002900000d800000613d000000000801034f0000000809000029000000008a08043c0000000009a90436000000000059004b00000d7c0000c13d000000000006004b00000d8d0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000ded0000613d0000001f01400039000000e00210018f0000000801200029000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d000000080100002900000000010104330000058e0010009c00000f380000213d0000000002000411000000000021004b000007e80000c13d0000000703000029000000000103041a000005db0110019700000002011001bf000000000013041b0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b00000007020000290000000102200039000000000012041b000000400100043d000000200200003900000000022104360000000a030000290000000000320435000005dc043001980000001f0530018f000000400210003900000000034200190000000906000029000000000660036700000dc90000613d000000000706034f0000000008020019000000007907043c0000000008980436000000000038004b00000dc50000c13d000000000005004b00000dd60000613d000000000446034f0000000305500210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004304350000000a040000290000001f03400039000005dc03300197000000000242001900000000000204350000004002300039000005560020009c00000556020080410000006002200210000005560010009c00000556010080410000004001100210000000000121019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000594011001c70000800d020000390000000303000039000005b604000041000002d80000013d0000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000df40000c13d00000c610000013d000000000201043b0000000001000019000000030500002900000005060000290000000003510019000000000402041a000000000043043500000001022000390000002001100039000000000061004b00000dfd0000413d0000003f01100039000005dc011001970000000402100029000000000012004b00000000010000390000000101004039000500000002001d000005590020009c000011880000213d0000000100100190000011880000c13d0000000504000029000000400040043f000005a901000041000000000201041a000005b4010000410000000000140435000000040140003900000020030000390000000000310435000000040100002900000000010104330000002403400039000000000013043500000044034000390000058e02200197000000000001004b000000030700002900000e290000613d000000000400001900000000053400190000000006470019000000000606043300000000006504350000002004400039000000000014004b00000e220000413d0000001f04100039000005dc0440019700000000011300190000000000010435000000050500002900000000015400490000000001310019000005560010009c00000556010080410000006001100210000005560050009c000005560300004100000000030540190000004003300210000000000131019f0000000003000414000005560030009c0000055603008041000000c003300210000000000113019f1552154d0000040f00000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f0000006007400190000000050570002900000e4d0000613d000000000801034f0000000509000029000000008a08043c0000000009a90436000000000059004b00000e490000c13d000000000006004b00000e5a0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000f110000613d0000001f01400039000000e00210018f0000000501200029000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d000000050100002900000000010104330000058e0010009c00000f380000213d000000070200002900000008022002700007058e0020019b0000000002000411000000070020006b00000e750000613d000000000021004b000007e80000c13d0000000603000029000000000103041a000005db0110019700000004011001bf000000000013041b0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b00000006020000290000000102200039000000000012041b00000008010000290000000301100039000000000101041a000600000001001d000005a901000041000000000101041a000005a40200004100000000002004430000058e01100197000800000001001d00000004001004430000000001000414000005560010009c0000055601008041000000c001100210000005a5011001c700008002020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000000001004b000000800200003900000f380000613d000000400300043d000005b7010000410000000001130436000200000001001d000000040130003900000000002104350000000401000029000000000101043300000084023000390000000000120435000500000003001d000000a402300039000000000001004b000000030600002900000eb80000613d000000000300001900000000042300190000000005360019000000000505043300000000005404350000002003300039000000000013004b00000eb10000413d0000000003120019000000000003043500000005050000290000006403500039000000060400002900000000004304350000004403500039000000070400002900000000004304350000002403500039000000000400041000000000004304350000001f01100039000005dc0110019700000000015100490000000001210019000005560010009c000005560100804100000060011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f000005560050009c00000556020000410000000002054019000700400020021800000007011001af0000000802000029155215480000040f0000000100200190000011da0000613d0000000501000029000005590010009c000011880000213d0000000505000029000000400050043f0000000a010000290000000202000029000000000012043500000020020000390000000000250435000005dc031001980000001f0410018f000000400150003900000000023100190000000905000029000000000550036700000ef00000613d000000000605034f0000000007010019000000006806043c0000000007870436000000000027004b00000eec0000c13d000000000004004b00000efd0000613d000000000335034f0000000304400210000000000502043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f00000000003204350000000a02000029000000000121001900000000000104350000001f01200039000005dc011001970000004001100039000005560010009c000005560100804100000060011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000007011001af00000594011001c70000800d020000390000000403000039000005b904000041000009430000013d0000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000f180000c13d00000c610000013d00000004011001bf0000000502000029000000000012041b00000007010000290000000301100039000000000101041a000300000001001d000005a901000041000000000101041a000005a40200004100000000002004430000058e01100197000400000001001d00000004001004430000000001000414000005560010009c0000055601008041000000c001100210000005a5011001c700008002020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000000001004b00000080020000390000102c0000c13d00000000010000190000155400010430000005db012001970000000502000029000000a4022000390000000000120435000000060000006b00000020020000390000000002006039000000000100041000000005040000290000006403400039000000070500002900000000005304350000058e011001970000004403400039000000000013043500000000010004110000058e0110019700000024034000390000000000130435000000a401200039000005560010009c000005560100804100000060011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f000005560040009c00000556020000410000000002044019000700400020021800000007011001af0000000802000029155215480000040f00000001002001900000105f0000613d0000000501000029000005590010009c000011880000213d0000000503000029000000400030043f0000000b020000290000000401000029000000000021043500000020010000390000000000130435000005dc042001980000001f0520018f000000400230003900000000034200190000000a060000290000002006600039000000000660036700000f770000613d000000000706034f0000000008020019000000007907043c0000000008980436000000000038004b00000f730000c13d000000000005004b00000f840000613d000000000446034f0000000305500210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004304350000000b03000029000000000232001900000000000204350000001f02300039000005dc012001970000004001100039000005560010009c000005560100804100000060011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000007011001af00000594011001c70000800d020000390000000403000039000005c8040000410000000c0500002900000009060000290000000007000411000004330000013d000005db01100197000000060200002900000044022000390000000000120435000000040000006b0000002006000039000000000600603900000003010000290000058e021001970000000601000029000005560010009c000005560100804100000040011002100000004403600039000005560030009c00000556030080410000006003300210000000000113019f0000000003000414000005560030009c0000055603008041000000c003300210000000000131019f000400000002001d1552154d0000040f00000060031002700000055603300197000000600030008c000000600400003900000000040340190000001f0640018f0000006007400190000000060570002900000fc30000613d000000000801034f0000000609000029000000008a08043c0000000009a90436000000000059004b00000fbf0000c13d000000000006004b00000fd00000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f000000000065043500000001002001900000106c0000613d0000001f01400039000000e00210018f0000000601200029000000000021004b00000000020000390000000102004039000005590010009c000011880000213d0000000100200190000011880000c13d000000400010043f000000600030008c00000f380000413d00000006010000290000000001010433000600000001001d0000058e0010009c00000f380000213d00000007010000290000000301100039000000000101041a000700000001001d000005a4010000410000000000100443000000040100002900000004001004430000000001000414000005560010009c0000055601008041000000c001100210000005a5011001c700008002020000391552154d0000040f00000001002001900000112e0000613d000000000101043b000000000001004b000000800200003900000f380000613d000000400300043d000005b7010000410000000000130435000100000003001d000000040130003900000000002104350000000201000029000000000101041a000000010210019000000001031002700000007f0330618f000300000003001d0000001f0030008c00000000030000390000000103002039000000000331013f0000000100300190000006190000c13d0000000103000029000000840330003900000003040000290000000000430435000000000002004b000012630000613d0000000201000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000306000029000000000006004b00000000020000190000126a0000613d0000000102000029000000a403200039000000000101043b00000000020000190000000004320019000000000501041a000000000054043500000001011000390000002002200039000000000062004b000010240000413d0000126a0000013d000000400300043d000005b7010000410000000000130435000100000003001d0000000401300039000000000021043500000007010000290000000201100039000000000201041a000000010320019000000001042002700000007f0440618f000700000004001d0000001f0040008c00000000040000390000000104002039000000000442013f0000000100400190000006190000c13d0000000104000029000000840440003900000007050000290000000000540435000000000003004b000010ba0000613d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d0000000706000029000000000006004b0000000002000019000010c10000613d0000000102000029000000a403200039000000000101043b00000000020000190000000004320019000000000501041a000000000054043500000001011000390000002002200039000000000062004b000010570000413d000010c10000013d00000060061002700000001f0460018f000005b505600198000000400200043d0000000003520019000011480000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000038004b000010670000c13d000011480000013d0000001f0530018f000005b506300198000000400200043d000000000462001900000c610000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000010730000c13d00000c610000013d000005db011001970000000702000029000000a4022000390000000000120435000000060000006b000000200200003900000000020060390000000001000410000000070500002900000064035000390000000804000029000000000043043500000009030000290000058e03300197000000440450003900000000003404350000058e0110019700000024035000390000000000130435000005560050009c000005560100004100000000010540190000004001100210000000a402200039000005560020009c00000556020080410000006002200210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f0000000a02000029155215480000040f0000000100200190000010ad0000613d0000000701000029000005590010009c000011880000213d0000000701000029000000400010043f0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d020000390000000303000039000005d6040000410000000b050000290000000c06000029000004330000013d00000060061002700000001f0460018f000005b505600198000000400200043d0000000003520019000011480000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000038004b000010b50000c13d000011480000013d000005db012001970000000102000029000000a4022000390000000000120435000000070000006b00000020020000390000000002006039000000060100002900000008011002700000058e0110019700000000030004100000000105000029000000640450003900000003060000290000000000640435000000440450003900000000001404350000058e0130019700000024035000390000000000130435000005560050009c000005560100004100000000010540190000004001100210000000a402200039000005560020009c00000556020080410000006002200210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f0000000402000029155215480000040f00000001002001900000113c0000613d0000000101000029000005590010009c000011880000213d0000000101000029000000400010043f0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000112e0000613d000000000101043b00000005020000290000000102200039000000000012041b000000400100043d0000002002100039000000400300003900000000003204350000000a020000290000000000210435000000400210003900000009030000290000000000320435000005dc053001980000001f0630018f00000060031000390000000004530019000000080700002900000000077003670000110a0000613d000000000807034f0000000009030019000000008a08043c0000000009a90436000000000049004b000011060000c13d000000000006004b000011170000613d000000000557034f0000000306600210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f000000000054043500000009050000290000001f04500039000005dc02400197000000000353001900000000000304350000006002200039000005560020009c00000556020080410000006002200210000005560010009c00000556010080410000004001100210000000000121019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000594011001c70000800d020000390000000303000039000005b804000041000002d80000013d000000000001042f000000040000006b0000000001000019000011340000613d0000000901000029000000000101043300000004040000290000000302400210000005dd0220027f000005dd02200167000000000121016f0000000102400210000000000121019f000011730000013d00000060061002700000001f0460018f000005b505600198000000400200043d0000000003520019000011480000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000038004b000011440000c13d0000055606600197000000000004004b000011560000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000000600160021000000c6f0000013d000000010320008a00000005033002700000000004310019000000200300003900000001044000390000000a0600002900000000056300190000000005050433000000000051041b00000020033000390000000101100039000000000041004b0000115e0000c13d000000040020006c000011700000813d00000004020000290000000302200210000000f80220018f000005dd0220027f000005dd022001670000000a033000290000000003030433000000000223016f000000000021041b0000000401000029000000010110021000000001011001bf0000000302000029000000000012041b0000000501000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b00000007020000290000000002020433000400000002001d000005590020009c0000118e0000a13d000005d501000041000000000010043f0000004101000039000000040010043f0000059b0100004100001554000104300000000201100039000300000001001d000000000101041a000000010010019000000001021002700000007f0220618f000200000002001d0000001f0020008c00000000020000390000000102002039000000000121013f0000000100100190000006190000c13d0000000201000029000000200010008c000011ba0000413d0000000301000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d00000004030000290000001f023000390000000502200270000000200030008c0000000002004019000000000301043b00000002010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b000011ba0000813d000000000002041b0000000102200039000000000012004b000011b60000413d00000004010000290000001f0010008c000011e70000a13d0000000301000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000200200008a0000000402200180000000000101043b000012940000c13d0000002006000039000012a10000013d000000080000006b0000000001000019000011d20000613d000000a00100043d00000008040000290000000302400210000005dd0220027f000005dd02200167000000000121016f0000000102400210000000000121019f0000120e0000013d00000060061002700000001f0460018f000005b505600198000000400200043d0000000003520019000011480000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000038004b000011e20000c13d000011480000013d000000040000006b0000000001000019000011ec0000613d0000000601000029000000000101043300000004040000290000000302400210000005dd0220027f000005dd02200167000000000121016f0000000102400210000000000121019f000012af0000013d000000010320008a000000050330027000000000043100190000002003000039000000010440003900000080053000390000000005050433000000000051041b00000020033000390000000101100039000000000041004b000011f90000c13d000000080020006c0000120b0000813d00000008020000290000000302200210000000f80220018f000005dd0220027f000005dd0220016700000080033000390000000003030433000000000223016f000000000021041b0000000801000029000000010110021000000001011001bf0000000702000029000000000012041b0000000a01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000c020000290000000002020433000800000002001d000005590020009c000011880000213d0000000201100039000700000001001d000000000101041a000000010010019000000001021002700000007f0220618f000600000002001d0000001f0020008c00000000020000390000000102002039000000000121013f0000000100100190000006190000c13d0000000601000029000000200010008c0000124f0000413d0000000701000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d00000008030000290000001f023000390000000502200270000000200030008c0000000002004019000000000301043b00000006010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b0000124f0000813d000000000002041b0000000102200039000000000012004b0000124b0000413d00000008010000290000001f0010008c000013300000a13d0000000701000029000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000200200008a0000000802200180000000000101043b0000133d0000c13d00000020060000390000134a0000013d000005db011001970000000102000029000000a4022000390000000000120435000000030000006b00000020020000390000000002006039000000000100041000000001040000290000006403400039000000070500002900000000005304350000004403400039000000060500002900000000005304350000058e0110019700000024034000390000000000130435000005560040009c000005560100004100000000010440190000004001100210000000a402200039000005560020009c00000556020080410000006002200210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f0000000402000029155215480000040f0000000100200190000010e00000c13d00000060061002700000001f0460018f000005b505600198000000400200043d0000000003520019000011480000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000038004b0000128f0000c13d000011480000013d000000010320008a0000000503300270000000000331001900000020060000390000000103300039000000070500002900000000045600190000000004040433000000000041041b00000020066000390000000101100039000000000031004b0000129a0000c13d000000040020006c000012ac0000813d00000004020000290000000302200210000000f80220018f000005dd0220027f000005dd0220016700000007036000290000000003030433000000000223016f000000000021041b0000000401000029000000010110021000000001011001bf0000000302000029000000000012041b0000000501000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b00000003011000390000000c02000029000000000021041b0000000501000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000401100039000000000001041b000005bc01000041000000000201041a000000010220003a00000a090000613d000000000021041b0000006002000039000000400100043d00000000022104360000000a030000290000000003030433000000600410003900000000003404350000008004100039000000000003004b0000000908000029000012ea0000613d000000000500001900000000064500190000000007580019000000000707043300000000007604350000002005500039000000000035004b000012e30000413d000000000534001900000000000504350000001f03300039000005dc03300197000000000434001900000000031400490000000000320435000000070200002900000000030204330000000002340436000000000003004b0000000607000029000012ff0000613d000000000400001900000000052400190000000006470019000000000606043300000000006504350000002004400039000000000034004b000012f80000413d0000000004320019000000000004043500000040041000390000000c0500002900000000005404350000001f03300039000005dc0330019700000000031300490000000002230019000005560020009c00000556020080410000006002200210000005560010009c00000556010080410000004001100210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000594011001c70000800d020000390000000203000039000005bd040000410000000505000029155215480000040f000000010020019000000f380000613d0000000802000029000000000102041a000005db01100197000000000012041b000000400100043d0000000000010435000005560010009c000005560100804100000040011002100000000002000414000005560020009c0000055602008041000000c002200210000000000112019f000005ae011001c70000800d020000390000000203000039000005c5040000410000000b05000029000004330000013d000000080000006b0000000001000019000013350000613d0000000b01000029000000000101043300000008040000290000000302400210000005dd0220027f000005dd02200167000000000121016f0000000102400210000000000121019f000013580000013d000000010320008a00000005033002700000000003310019000000200600003900000001033000390000000c0500002900000000045600190000000004040433000000000041041b00000020066000390000000101100039000000000031004b000013430000c13d000000080020006c000013550000813d00000008020000290000000302200210000000f80220018f000005dd0220027f000005dd022001670000000c036000290000000003030433000000000223016f000000000021041b0000000801000029000000010110021000000001011001bf0000000702000029000000000012041b0000000a01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b00000003011000390000000902000029000000000021041b0000000a01000029000000000010043f0000058d01000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f000000010020019000000f380000613d000000000101043b0000000401100039000000000001041b000005bc01000041000000000201041a000000010220003a00000a090000613d000000000021041b0000006002000039000000400100043d00000000022104360000006004100039000000800300043d00000000003404350000008004100039000000000003004b000013910000613d00000000050000190000000006450019000000a007500039000000000707043300000000007604350000002005500039000000000035004b0000138a0000413d000000000543001900000000000504350000001f03300039000005dc033001970000000004430019000000000314004900000000003204350000000c0200002900000000030204330000000002340436000000000003004b0000000b07000029000013a60000613d000000000400001900000000052400190000000006740019000000000606043300000000006504350000002004400039000000000034004b0000139f0000413d000000000423001900000000000404350000004004100039000000090500002900000000005404350000001f03300039000005dc0330019700000000021200490000000002320019000005560020009c00000556020080410000006002200210000005560010009c00000556010080410000004001100210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000594011001c70000800d020000390000000203000039000005bd040000410000000a05000029000004330000013d0000001f02200039000005dc022001970000000001120019000000000021004b00000000020000390000000102004039000005590010009c000013cd0000213d0000000100200190000013cd0000c13d000000400010043f000000000001042d000005d501000041000000000010043f0000004101000039000000040010043f0000059b01000041000015540001043000000000430104340000000001320436000000000003004b000013df0000613d000000000200001900000000052100190000000006240019000000000606043300000000006504350000002002200039000000000032004b000013d80000413d000000000231001900000000000204350000001f02300039000005dc022001970000000001210019000000000001042d0002000000000002000000000301041a000000010430019000000001063002700000007f0660618f0000001f0060008c00000000050000390000000105002039000000000054004b000014160000c13d0000000005620436000000000004004b0000140d0000613d000200000006001d000100000005001d000000000010043f0000000001000414000005560010009c0000055601008041000000c001100210000005ae011001c700008010020000391552154d0000040f00000001002001900000141c0000613d0000000206000029000000000006004b000014140000613d000000000201043b000000000100001900000001050000290000000003150019000000000402041a000000000043043500000001022000390000002001100039000000000061004b000014040000413d0000000001150019000000000001042d000005db013001970000000000150435000000000006004b000000200100003900000000010060390000000001150019000000000001042d0000000101000029000000000001042d000005d501000041000000000010043f0000002201000039000000040010043f0000059b01000041000015540001043000000000010000190000155400010430000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f00000001002001900000142e0000613d000000000101043b0000000101100039000000000101041a000000000001042d0000000001000019000015540001043000020000000000020000059e01000041000000000101041a000000d002100272000014490000613d000100000002001d000200000001001d0000059c0100004100000000001004430000000001000414000005560010009c0000055601008041000000c0011002100000059d011001c70000800b020000391552154d0000040f00000001002001900000144d0000613d000000000101043b000000010010006b0000000201000029000014490000813d000000a0011002700000059801100197000000000001042d0000059101000041000000000101041a000000d001100270000000000001042d000000000001042f0000059101000041000000000201041a0000058e01200197000000a0022002700000059802200197000000000001042d0001000000000002000100000001001d000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000014750000613d000000000101043b00000000020004110000058e02200197000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000014750000613d000000000101043b000000000101041a000000ff00100190000014770000613d000000000001042d000000000100001900001554000104300000059601000041000000000010043f0000000001000411000000040010043f0000000101000029000000240010043f0000059701000041000015540001043000010000000000020000059e02000041000000000302041a0000058e00300198000014d40000c13d0001058e0010019b0000059f0130019700000001011001af000000000012041b000000000000043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000014d20000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000014d20000613d000000000101043b000000000101041a000000ff00100190000014d10000c13d000000000000043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000014d20000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000014d20000613d000000000101043b000000000201041a000005db0220019700000001022001bf000000000021041b0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d0200003900000004030000390000000007000411000005ac0400004100000000050000190000000106000029155215480000040f0000000100200190000014d20000613d000000000001042d00000000010000190000155400010430000005cc01000041000000000010043f000005b00100004100001554000104300002000000000002000000000001004b000014e20000c13d0000059e04000041000000000504041a000000000325013f0000058e00300198000014e20000c13d0000059f03500197000000000034041b000100000002001d000200000001001d000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000015300000613d000000000101043b00000001020000290000058e02200197000100000002001d000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000015300000613d000000000101043b000000000101041a000000ff001001900000152f0000613d0000000201000029000000000010043f000005a001000041000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000015300000613d000000000101043b0000000102000029000000000020043f000000200010043f0000000001000414000005560010009c0000055601008041000000c00110021000000590011001c700008010020000391552154d0000040f0000000100200190000015300000613d000000000101043b000000000201041a000005db02200197000000000021041b0000000001000414000005560010009c0000055601008041000000c00110021000000594011001c70000800d0200003900000004030000390000000007000411000005a10400004100000002050000290000000106000029155215480000040f0000000100200190000015300000613d000000000001042d00000000010000190000155400010430000000000001042f000005560010009c00000556010080410000004001100210000005560020009c00000556020080410000006002200210000000000112019f0000000002000414000005560020009c0000055602008041000000c002200210000000000112019f00000594011001c700008010020000391552154d0000040f0000000100200190000015460000613d000000000101043b000000000001042d000000000100001900001554000104300000154b002104210000000102000039000000000001042d0000000002000019000000000001042d00001550002104230000000102000039000000000001042d0000000002000019000000000001042d0000155200000432000015530001042e000015540001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a000000000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff0200000000000000000000000000000000000020000000800000000000000000c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d20000000200000000000000000000000000000040000001000000000000000000000000000000000000000000000000000000000000000000000000007b15f1b500000000000000000000000000000000000000000000000000000000bc46785400000000000000000000000000000000000000000000000000000000cefc142800000000000000000000000000000000000000000000000000000000d547741e00000000000000000000000000000000000000000000000000000000d547741f00000000000000000000000000000000000000000000000000000000d602b9fd00000000000000000000000000000000000000000000000000000000ef0e239b00000000000000000000000000000000000000000000000000000000cefc142900000000000000000000000000000000000000000000000000000000cf6eefb700000000000000000000000000000000000000000000000000000000cc65ec0f00000000000000000000000000000000000000000000000000000000cc65ec1000000000000000000000000000000000000000000000000000000000cc8463c800000000000000000000000000000000000000000000000000000000bc46785500000000000000000000000000000000000000000000000000000000bfe42a3700000000000000000000000000000000000000000000000000000000a1eda53b00000000000000000000000000000000000000000000000000000000a7e52ba900000000000000000000000000000000000000000000000000000000a7e52baa00000000000000000000000000000000000000000000000000000000ab6460f900000000000000000000000000000000000000000000000000000000a1eda53c00000000000000000000000000000000000000000000000000000000a217fddf000000000000000000000000000000000000000000000000000000008da5cb5a000000000000000000000000000000000000000000000000000000008da5cb5b0000000000000000000000000000000000000000000000000000000091d14854000000000000000000000000000000000000000000000000000000007b15f1b60000000000000000000000000000000000000000000000000000000084ef8ffc000000000000000000000000000000000000000000000000000000002bee136c0000000000000000000000000000000000000000000000000000000052a74c0900000000000000000000000000000000000000000000000000000000649a5ec600000000000000000000000000000000000000000000000000000000649a5ec7000000000000000000000000000000000000000000000000000000007372d6d10000000000000000000000000000000000000000000000000000000052a74c0a00000000000000000000000000000000000000000000000000000000634e93da0000000000000000000000000000000000000000000000000000000036568abd0000000000000000000000000000000000000000000000000000000036568abe0000000000000000000000000000000000000000000000000000000045351035000000000000000000000000000000000000000000000000000000002bee136d000000000000000000000000000000000000000000000000000000002f2ff15d000000000000000000000000000000000000000000000000000000001707da2100000000000000000000000000000000000000000000000000000000248a9ca200000000000000000000000000000000000000000000000000000000248a9ca3000000000000000000000000000000000000000000000000000000002add845c000000000000000000000000000000000000000000000000000000001707da220000000000000000000000000000000000000000000000000000000023258943000000000000000000000000000000000000000000000000000000000aa6220a000000000000000000000000000000000000000000000000000000000aa6220b0000000000000000000000000000000000000000000000000000000014879aae0000000000000000000000000000000000000000000000000000000001ffc9a700000000000000000000000000000000000000000000000000000000022d63fb523cffa5e7f48f8e220488f534837697930b9986fe2a9046bebda6761fdc0002000000000000000000000000ffffffffffffffffffffffffffffffffffffffffb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d0200000000000000000000000000000000000040000000000000000000000000eef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698400ffffffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008886ebfc4259abdbc16601dd8fb5678e54878f47b3c34836cfc51154a9605109e2517d3f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffff0000000000000000000000000000000000000040000000800000000000000000c22c8022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d955391320200000200000000000000000000000000000004000000000000000000000000eef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698401ffffffffffffffffffffffff000000000000000000000000000000000000000002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800f6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b19ca5ebb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000010000000000000001523cffa5e7f48f8e220488f534837697930b9986fe2a9046bebda6761fdc0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff7b8bb8356a3f32f5c111ff23f050d97f08988e0883529ea7bff3b918887a6e0e2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0dffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff0200000000000000000000000000000000000020000000000000000000000000d7e6bcf8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000e6c4247b00000000000000000000000000000000000000000000000000000000f92ee8a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000800000000000000000320ba8f70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffe06674fe4e3889c0c30a5f773f296c7b9bd28653d31c7a6f41b9527b5c5a64865bce9823fa0000000000000000000000000000000000000000000000000000000027aa94616bd9e81de882ea7cd522c8462acd5d04addd098dc22f19c3fa721a5062e41e13b583f17bfb0b0dc98117e46d0ac610466d42947b51048922e664209c0000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff7f523cffa5e7f48f8e220488f534837697930b9986fe2a9046bebda6761fdc0001fd2063f0659f491224ea920563cb171b0aebcf360a0961c7cfd86ec2ba1d83380000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000697802b1fa2edafe6f7b9e97c1a9e0c3660e645beb2dcaa2d45bdbf9beaf5472e1ec5f1038c18cf84a56e432fdbfaf746924b7ea511dfe03a6506a0ceba4888788d9b6dfcc650000000000000000000000000000000000000000000000000000000003377dc44241e779dd06afab5b788a35ca5f3b778836e2990bdb26a2a4b2e5ed655fc44033d76f0476604037138695d6580815828e512faec38f21fd51a1f2f9e0000000000000000000000ffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffff0000000000000000000000000000000000000000ff1128462f157ad4012478d49944685c39edb32188b6e59e085743e5162093f305d5dcc8f800000000000000000000000000000000000000000000000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffff6697b232000000000000000000000000000000000000000000000000000000003fc3c27a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffbffdffffffffffffffffffffffffffffffffffffc0000000000000000000000000ef0fefd5a84d762c21fd37b389df01bab2cf55510d49dc3f3d685b705ed8f8c9cb6e5344000000000000000000000000000000000000000000000000000000001a9ffc9800000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff96880fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9687f57d8280c000000000000000000000000000000000000000000000000000000004e487b71000000000000000000000000000000000000000000000000000000009cbf87fb16e55f1556e2d5a42a595be6146f7cfcbe9092a1604e8f17a0617bc400000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff314987860000000000000000000000000000000000000000000000000000000001ffc9a7000000000000000000000000000000000000000000000000000000007965db0b00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff920d56edd33a28d02c00b70310ebe8d48e6e1e16f0b1cd76691c398044f2b40f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.