Base Sepolia Testnet

Contract

0x13ad9f9425979Fcce463Fcc35D3b4d1Ea5E6b761
Source Code Source Code

Overview

ETH Balance

0 ETH

More Info

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Amount

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Amount
378935392026-02-20 2:42:4620 days ago1771555366
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
378935392026-02-20 2:42:4620 days ago1771555366
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
378716532026-02-19 14:33:1421 days ago1771511594
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
378716532026-02-19 14:33:1421 days ago1771511594
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
369868592026-01-30 3:00:0641 days ago1769742006
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
369868592026-01-30 3:00:0641 days ago1769742006
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
357808352026-01-02 4:59:1869 days ago1767329958
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
357808352026-01-02 4:59:1869 days ago1767329958
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
357775182026-01-02 3:08:4469 days ago1767323324
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
357775182026-01-02 3:08:4469 days ago1767323324
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
344322002025-12-01 23:44:48100 days ago1764632688
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
344322002025-12-01 23:44:48100 days ago1764632688
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
344235212025-12-01 18:55:30101 days ago1764615330
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
344235212025-12-01 18:55:30101 days ago1764615330
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
327987302025-10-25 4:15:48138 days ago1761365748
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
327987302025-10-25 4:15:48138 days ago1761365748
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
324772752025-10-17 17:40:38146 days ago1760722838
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
324772752025-10-17 17:40:38146 days ago1760722838
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
323830262025-10-15 13:19:00148 days ago1760534340
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
323830262025-10-15 13:19:00148 days ago1760534340
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
322976842025-10-13 13:54:16150 days ago1760363656
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
322976842025-10-13 13:54:16150 days ago1760363656
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
320007722025-10-06 16:57:12157 days ago1759769832
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
320007722025-10-06 16:57:12157 days ago1759769832
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
320000312025-10-06 16:32:30157 days ago1759768350
0x13ad9f94...Ea5E6b761
 Contract Creation0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PluginResolverFactory

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
No with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

import {PluginResolver} from "../PluginResolver.sol";

/**
 * @title PluginResolverFactory
 * @dev PluginResolverFactory contract to deploy PluginResolver using CREATE2
 */
contract PluginResolverFactory {
    /// @notice Array of deployed PluginResolver contracts
    PluginResolver[] public contracts;

    /// @notice Emitted when a new PluginResolver is deployed
    event ResolverDeployed(
        address indexed deployer, address indexed initOwner, PluginResolver indexed deployedContract
    );

    /// @notice Deploys a new PluginResolver contract
    /// @param _salt The salt for CREATE2 deployment
    /// @param _owner The owner of the new resolver. If address(0), msg.sender is used
    /// @param _eas The EAS contract address
    /// @return The newly deployed PluginResolver contract
    function deploy(bytes32 _salt, address _owner, address _eas)
        external
        returns (PluginResolver)
    {
        if (_owner == address(0)) {
            _owner = msg.sender;
        }
        PluginResolver resolver = new PluginResolver{salt: _salt}(_owner, _eas);
        contracts.push(resolver);
        emit ResolverDeployed(msg.sender, _owner, resolver);
        return resolver;
    }

    /// @notice Computes the deterministic address for a PluginResolver deployment
    /// @param _salt The salt for CREATE2 deployment
    /// @param _bytecode The contract bytecode
    /// @return The computed address
    function computeAddress(bytes32 _salt, bytes memory _bytecode) public view returns (address) {
        bytes32 bytecodeHash = keccak256(_bytecode);
        return address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), _salt, bytecodeHash)))));
    }

    /// @notice Gets the initialization bytecode for a PluginResolver
    /// @param _owner The owner address to initialize with
    /// @return The contract bytecode with constructor arguments
    function getBytecode(address _owner) public pure returns (bytes memory) {
        return abi.encodePacked(type(PluginResolver).creationCode, abi.encode(_owner));
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {Ownable, Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {SchemaResolver} from "eas-contracts/resolver/SchemaResolver.sol";
import {IEAS, Attestation} from "eas-contracts/IEAS.sol";

import {Semver} from "./utils/Semver.sol";
import {EnumerableValidatingResolverSet} from "./utils/EnumerableValidatingResolverSet.sol";
import {EnumerableExecutingResolverSet} from "./utils/EnumerableExecutingResolverSet.sol";
import {IValidatingResolver} from "./interfaces/IValidatingResolver.sol";
import {IExecutingResolver} from "./interfaces/IExecutingResolver.sol";
import {IPluginResolver} from "./interfaces/IPluginResolver.sol";

/**
 * @title PluginResolver
 * @author Kyle Kaplan
 * @dev PluginResolver to add an array of validating and executing resolver contracts onAttest and onRevoke
 */
contract PluginResolver is Semver, Ownable2Step, SchemaResolver, IPluginResolver {
    using EnumerableValidatingResolverSet for EnumerableValidatingResolverSet.Set;
    using EnumerableExecutingResolverSet for EnumerableExecutingResolverSet.Set;

    ////////////////////////////// State //////////////////////////////

    // array of validating resolvers
    EnumerableValidatingResolverSet.Set private s_validatingResolvers;
    // array of executing resolvers
    EnumerableExecutingResolverSet.Set private s_executingResolvers;
    // mapping of executing resolvers to whether to catch their errors
    mapping(IExecutingResolver => bool) private s_catchExecutingResolverErrors;

    ////////////////////////////// Constructor //////////////////////////////

    /**
     * @notice Constructor for PluginResolver
     * @param _owner The address of the owner of the PluginResolver
     * @param _eas The address of the EAS contract
     */
    constructor(address _owner, address _eas) Semver(0, 0, 1) SchemaResolver(IEAS(_eas)) Ownable(_owner) {}

    ////////////////////////////// External Functions //////////////////////////////

    /// @inheritdoc IPluginResolver
    function setExecutingResolverErrorCatching(IExecutingResolver resolver, bool catchErrors) external onlyOwner {
        // Verify the resolver is actually in our set
        if (!s_executingResolvers.contains(resolver)) {
            revert PluginResolver__ResolverNotFound(address(resolver));
        }
        s_catchExecutingResolverErrors[resolver] = catchErrors;
        emit ExecutingResolverErrorCatchingSet(resolver, catchErrors);
    }

    /// @inheritdoc IPluginResolver
    function addValidatingResolver(IValidatingResolver resolver) external onlyOwner {
        if (address(resolver) == address(0)) {
            revert PluginResolver__InvalidResolver(address(resolver));
        }
        if (!s_validatingResolvers.add(resolver)) {
            revert PluginResolver__DuplicateResolver(address(resolver));
        }
        emit ValidatingResolverAdded(resolver);
    }

    /// @inheritdoc IPluginResolver
    function removeValidatingResolver(IValidatingResolver resolver) external onlyOwner {
        if (!s_validatingResolvers.remove(resolver)) {
            revert PluginResolver__InvalidResolver(address(resolver));
        }
        emit ValidatingResolverRemoved(resolver);
    }

    /// @inheritdoc IPluginResolver
    function addExecutingResolver(IExecutingResolver resolver, bool catchErrors) external onlyOwner {
        if (address(resolver) == address(0)) {
            revert PluginResolver__InvalidResolver(address(resolver));
        }
        if (!s_executingResolvers.add(resolver)) {
            revert PluginResolver__DuplicateResolver(address(resolver));
        }
        // Set the error catching behavior for this resolver
        s_catchExecutingResolverErrors[resolver] = catchErrors;
        emit ExecutingResolverAdded(resolver);
    }

    /// @inheritdoc IPluginResolver
    function removeExecutingResolver(IExecutingResolver resolver) external onlyOwner {
        if (!s_executingResolvers.remove(resolver)) {
            revert PluginResolver__InvalidResolver(address(resolver));
        }
        // Clean up the mapping
        delete s_catchExecutingResolverErrors[resolver];
        emit ExecutingResolverRemoved(resolver);
    }

    /// @inheritdoc IPluginResolver
    function getExecutingResolverErrorCatching(IExecutingResolver resolver) external view returns (bool) {
        return s_catchExecutingResolverErrors[resolver];
    }

    /// @inheritdoc IPluginResolver
    function getValidatingResolversLength() external view returns (uint256) {
        return s_validatingResolvers.length();
    }

    /// @inheritdoc IPluginResolver
    function getValidatingResolverAt(uint256 index) external view returns (IValidatingResolver) {
        if (index >= s_validatingResolvers.length()) {
            revert PluginResolver__IndexOutOfBounds(index, s_validatingResolvers.length());
        }
        return s_validatingResolvers.at(index);
    }

    /// @notice Returns all validating resolver addresses for off-chain enumeration
    /// @dev This function is intended for off-chain use as iterating over a dynamic array can be gas intensive
    /// @return Array of all validating resolver addresses
    function getValidatingResolvers() external view returns (IValidatingResolver[] memory) {
        return s_validatingResolvers.values();
    }

    /// @inheritdoc IPluginResolver
    function getExecutingResolversLength() external view returns (uint256) {
        return s_executingResolvers.length();
    }

    /// @inheritdoc IPluginResolver
    function getExecutingResolverAt(uint256 index) external view returns (IExecutingResolver) {
        if (index >= s_executingResolvers.length()) {
            revert PluginResolver__IndexOutOfBounds(index, s_executingResolvers.length());
        }
        return s_executingResolvers.at(index);
    }

    /// @notice Returns all executing resolver addresses for off-chain enumeration
    /// @dev This function is intended for off-chain use as iterating over a dynamic array can be gas intensive
    /// @return Array of all executing resolver addresses
    function getExecutingResolvers() external view returns (IExecutingResolver[] memory) {
        return s_executingResolvers.values();
    }

    ////////////////////////////// Internal Functions //////////////////////////////

    /// @notice First loops through the validatingResolvers and calls onAttest on each,
    ///         if all validatingResolvers return true, it then (and only then)
    ///         loops through the executingResolvers and calls onAttest on each
    /// @dev This function is called by the EAS contract when an attestation is made and protected by the onlyEAS modifier
    /// @param attestation The attestation to validate
    /// @param value The value of the attestation
    function onAttest(Attestation calldata attestation, uint256 value) internal override returns (bool) {
        // iterate over validatingResolvers and call onAttest on each
        uint256 validatingResolversLength = s_validatingResolvers.length();
        for (uint256 i = 0; i < validatingResolversLength; i++) {
            if (!s_validatingResolvers.at(i).onAttest(attestation, value)) {
                return false;
            }
        }
        // iterate over executingResolvers and call onAttest on each
        uint256 executingResolversLength = s_executingResolvers.length();
        for (uint256 i = 0; i < executingResolversLength; i++) {
            IExecutingResolver resolver = s_executingResolvers.at(i);
            if (s_catchExecutingResolverErrors[resolver]) {
                try resolver.onAttest(attestation, value) {
                    // Execution successful, continue to the next resolver
                } catch {
                    // Emit event with the address of the failed executing resolver
                    emit ExecutingResolverFailed(resolver, true);
                }
            } else {
                // Don't catch errors, let them bubble up
                resolver.onAttest(attestation, value);
            }
        }
        return true;
    }

    /// @notice First loops through the validatingResolvers and calls onRevoke on each,
    ///         if all validatingResolvers return true, it then (and only then)
    ///         loops through the executingResolvers and calls onRevoke on each
    /// @dev This function is called by the EAS contract when an attestation is revoked and protected by the onlyEAS modifier
    /// @param attestation The attestation to revoke
    /// @param value The value of the attestation
    function onRevoke(Attestation calldata attestation, uint256 value) internal override returns (bool) {
        // iterate over validatingResolvers and call onRevoke on each
        uint256 validatingResolversLength = s_validatingResolvers.length();
        for (uint256 i = 0; i < validatingResolversLength; i++) {
            if (!s_validatingResolvers.at(i).onRevoke(attestation, value)) {
                return false;
            }
        }
        // iterate over executingResolvers and call onRevoke on each
        uint256 executingResolversLength = s_executingResolvers.length();
        for (uint256 i = 0; i < executingResolversLength; i++) {
            IExecutingResolver resolver = s_executingResolvers.at(i);
            if (s_catchExecutingResolverErrors[resolver]) {
                try resolver.onRevoke(attestation, value) {
                    // Execution successful, continue to the next resolver
                } catch {
                    // Emit event with the address of the failed executing resolver
                    emit ExecutingResolverFailed(resolver, false);
                }
            } else {
                // Don't catch errors, let them bubble up
                resolver.onRevoke(attestation, value);
            }
        }
        return true;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This extension of the {Ownable} contract includes a two-step mechanism to transfer
 * ownership, where the new owner must call {acceptOwnership} in order to replace the
 * old one. This can help prevent common mistakes, such as transfers of ownership to
 * incorrect accounts, or to contracts that are unable to interact with the
 * permission system.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     *
     * Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import { AccessDenied, InvalidEAS, InvalidLength } from "./../Common.sol";
import { IEAS, Attestation } from "./../IEAS.sol";
import { Semver } from "./../Semver.sol";
import { ISchemaResolver } from "./ISchemaResolver.sol";

/// @title SchemaResolver
/// @notice The base schema resolver contract.
abstract contract SchemaResolver is ISchemaResolver, Semver {
    error InsufficientValue();
    error NotPayable();

    // The global EAS contract.
    IEAS internal immutable _eas;

    /// @dev Creates a new resolver.
    /// @param eas The address of the global EAS contract.
    constructor(IEAS eas) Semver(1, 4, 0) {
        if (address(eas) == address(0)) {
            revert InvalidEAS();
        }

        _eas = eas;
    }

    /// @dev Ensures that only the EAS contract can make this call.
    modifier onlyEAS() {
        _onlyEAS();

        _;
    }

    /// @inheritdoc ISchemaResolver
    function isPayable() public pure virtual returns (bool) {
        return false;
    }

    /// @dev ETH callback.
    receive() external payable virtual {
        if (!isPayable()) {
            revert NotPayable();
        }
    }

    /// @inheritdoc ISchemaResolver
    function attest(Attestation calldata attestation) external payable onlyEAS returns (bool) {
        return onAttest(attestation, msg.value);
    }

    /// @inheritdoc ISchemaResolver
    function multiAttest(
        Attestation[] calldata attestations,
        uint256[] calldata values
    ) external payable onlyEAS returns (bool) {
        uint256 length = attestations.length;
        if (length != values.length) {
            revert InvalidLength();
        }

        // We are keeping track of the remaining ETH amount that can be sent to resolvers and will keep deducting
        // from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
        // some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
        // possible to send too much ETH anyway.
        uint256 remainingValue = msg.value;

        for (uint256 i = 0; i < length; ++i) {
            // Ensure that the attester/revoker doesn't try to spend more than available.
            uint256 value = values[i];
            if (value > remainingValue) {
                revert InsufficientValue();
            }

            // Forward the attestation to the underlying resolver and return false in case it isn't approved.
            if (!onAttest(attestations[i], value)) {
                return false;
            }

            unchecked {
                // Subtract the ETH amount, that was provided to this attestation, from the global remaining ETH amount.
                remainingValue -= value;
            }
        }

        return true;
    }

    /// @inheritdoc ISchemaResolver
    function revoke(Attestation calldata attestation) external payable onlyEAS returns (bool) {
        return onRevoke(attestation, msg.value);
    }

    /// @inheritdoc ISchemaResolver
    function multiRevoke(
        Attestation[] calldata attestations,
        uint256[] calldata values
    ) external payable onlyEAS returns (bool) {
        uint256 length = attestations.length;
        if (length != values.length) {
            revert InvalidLength();
        }

        // We are keeping track of the remaining ETH amount that can be sent to resolvers and will keep deducting
        // from it to verify that there isn't any attempt to send too much ETH to resolvers. Please note that unless
        // some ETH was stuck in the contract by accident (which shouldn't happen in normal conditions), it won't be
        // possible to send too much ETH anyway.
        uint256 remainingValue = msg.value;

        for (uint256 i = 0; i < length; ++i) {
            // Ensure that the attester/revoker doesn't try to spend more than available.
            uint256 value = values[i];
            if (value > remainingValue) {
                revert InsufficientValue();
            }

            // Forward the revocation to the underlying resolver and return false in case it isn't approved.
            if (!onRevoke(attestations[i], value)) {
                return false;
            }

            unchecked {
                // Subtract the ETH amount, that was provided to this attestation, from the global remaining ETH amount.
                remainingValue -= value;
            }
        }

        return true;
    }

    /// @notice A resolver callback that should be implemented by child contracts.
    /// @param attestation The new attestation.
    /// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
    ///     both attest() and multiAttest() callbacks EAS-only callbacks and that in case of multi attestations, it'll
    ///     usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the
    ///     attestations in the batch.
    /// @return Whether the attestation is valid.
    function onAttest(Attestation calldata attestation, uint256 value) internal virtual returns (bool);

    /// @notice Processes an attestation revocation and verifies if it can be revoked.
    /// @param attestation The existing attestation to be revoked.
    /// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
    ///     both revoke() and multiRevoke() callbacks EAS-only callbacks and that in case of multi attestations, it'll
    ///     usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the
    ///     attestations in the batch.
    /// @return Whether the attestation can be revoked.
    function onRevoke(Attestation calldata attestation, uint256 value) internal virtual returns (bool);

    /// @dev Ensures that only the EAS contract can make this call.
    function _onlyEAS() private view {
        if (msg.sender != address(_eas)) {
            revert AccessDenied();
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { ISchemaRegistry } from "./ISchemaRegistry.sol";
import { ISemver } from "./ISemver.sol";
import { Attestation, Signature } from "./Common.sol";

/// @notice A struct representing the arguments of the attestation request.
struct AttestationRequestData {
    address recipient; // The recipient of the attestation.
    uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
    bool revocable; // Whether the attestation is revocable.
    bytes32 refUID; // The UID of the related attestation.
    bytes data; // Custom attestation data.
    uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user errors.
}

/// @notice A struct representing the full arguments of the attestation request.
struct AttestationRequest {
    bytes32 schema; // The unique identifier of the schema.
    AttestationRequestData data; // The arguments of the attestation request.
}

/// @notice A struct representing the full arguments of the full delegated attestation request.
struct DelegatedAttestationRequest {
    bytes32 schema; // The unique identifier of the schema.
    AttestationRequestData data; // The arguments of the attestation request.
    Signature signature; // The ECDSA signature data.
    address attester; // The attesting account.
    uint64 deadline; // The deadline of the signature/request.
}

/// @notice A struct representing the full arguments of the multi attestation request.
struct MultiAttestationRequest {
    bytes32 schema; // The unique identifier of the schema.
    AttestationRequestData[] data; // The arguments of the attestation request.
}

/// @notice A struct representing the full arguments of the delegated multi attestation request.
struct MultiDelegatedAttestationRequest {
    bytes32 schema; // The unique identifier of the schema.
    AttestationRequestData[] data; // The arguments of the attestation requests.
    Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with increasing nonces.
    address attester; // The attesting account.
    uint64 deadline; // The deadline of the signature/request.
}

/// @notice A struct representing the arguments of the revocation request.
struct RevocationRequestData {
    bytes32 uid; // The UID of the attestation to revoke.
    uint256 value; // An explicit ETH amount to send to the resolver. This is important to prevent accidental user errors.
}

/// @notice A struct representing the full arguments of the revocation request.
struct RevocationRequest {
    bytes32 schema; // The unique identifier of the schema.
    RevocationRequestData data; // The arguments of the revocation request.
}

/// @notice A struct representing the arguments of the full delegated revocation request.
struct DelegatedRevocationRequest {
    bytes32 schema; // The unique identifier of the schema.
    RevocationRequestData data; // The arguments of the revocation request.
    Signature signature; // The ECDSA signature data.
    address revoker; // The revoking account.
    uint64 deadline; // The deadline of the signature/request.
}

/// @notice A struct representing the full arguments of the multi revocation request.
struct MultiRevocationRequest {
    bytes32 schema; // The unique identifier of the schema.
    RevocationRequestData[] data; // The arguments of the revocation request.
}

/// @notice A struct representing the full arguments of the delegated multi revocation request.
struct MultiDelegatedRevocationRequest {
    bytes32 schema; // The unique identifier of the schema.
    RevocationRequestData[] data; // The arguments of the revocation requests.
    Signature[] signatures; // The ECDSA signatures data. Please note that the signatures are assumed to be signed with increasing nonces.
    address revoker; // The revoking account.
    uint64 deadline; // The deadline of the signature/request.
}

/// @title IEAS
/// @notice EAS - Ethereum Attestation Service interface.
interface IEAS is ISemver {
    /// @notice Emitted when an attestation has been made.
    /// @param recipient The recipient of the attestation.
    /// @param attester The attesting account.
    /// @param uid The UID of the new attestation.
    /// @param schemaUID The UID of the schema.
    event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID);

    /// @notice Emitted when an attestation has been revoked.
    /// @param recipient The recipient of the attestation.
    /// @param attester The attesting account.
    /// @param schemaUID The UID of the schema.
    /// @param uid The UID the revoked attestation.
    event Revoked(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID);

    /// @notice Emitted when a data has been timestamped.
    /// @param data The data.
    /// @param timestamp The timestamp.
    event Timestamped(bytes32 indexed data, uint64 indexed timestamp);

    /// @notice Emitted when a data has been revoked.
    /// @param revoker The address of the revoker.
    /// @param data The data.
    /// @param timestamp The timestamp.
    event RevokedOffchain(address indexed revoker, bytes32 indexed data, uint64 indexed timestamp);

    /// @notice Returns the address of the global schema registry.
    /// @return The address of the global schema registry.
    function getSchemaRegistry() external view returns (ISchemaRegistry);

    /// @notice Attests to a specific schema.
    /// @param request The arguments of the attestation request.
    /// @return The UID of the new attestation.
    ///
    /// Example:
    ///     attest({
    ///         schema: "0facc36681cbe2456019c1b0d1e7bedd6d1d40f6f324bf3dd3a4cef2999200a0",
    ///         data: {
    ///             recipient: "0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf",
    ///             expirationTime: 0,
    ///             revocable: true,
    ///             refUID: "0x0000000000000000000000000000000000000000000000000000000000000000",
    ///             data: "0xF00D",
    ///             value: 0
    ///         }
    ///     })
    function attest(AttestationRequest calldata request) external payable returns (bytes32);

    /// @notice Attests to a specific schema via the provided ECDSA signature.
    /// @param delegatedRequest The arguments of the delegated attestation request.
    /// @return The UID of the new attestation.
    ///
    /// Example:
    ///     attestByDelegation({
    ///         schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
    ///         data: {
    ///             recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
    ///             expirationTime: 1673891048,
    ///             revocable: true,
    ///             refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
    ///             data: '0x1234',
    ///             value: 0
    ///         },
    ///         signature: {
    ///             v: 28,
    ///             r: '0x148c...b25b',
    ///             s: '0x5a72...be22'
    ///         },
    ///         attester: '0xc5E8740aD971409492b1A63Db8d83025e0Fc427e',
    ///         deadline: 1673891048
    ///     })
    function attestByDelegation(
        DelegatedAttestationRequest calldata delegatedRequest
    ) external payable returns (bytes32);

    /// @notice Attests to multiple schemas.
    /// @param multiRequests The arguments of the multi attestation requests. The requests should be grouped by distinct
    ///     schema ids to benefit from the best batching optimization.
    /// @return The UIDs of the new attestations.
    ///
    /// Example:
    ///     multiAttest([{
    ///         schema: '0x33e9094830a5cba5554d1954310e4fbed2ef5f859ec1404619adea4207f391fd',
    ///         data: [{
    ///             recipient: '0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf',
    ///             expirationTime: 1673891048,
    ///             revocable: true,
    ///             refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
    ///             data: '0x1234',
    ///             value: 1000
    ///         },
    ///         {
    ///             recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
    ///             expirationTime: 0,
    ///             revocable: false,
    ///             refUID: '0x480df4a039efc31b11bfdf491b383ca138b6bde160988222a2a3509c02cee174',
    ///             data: '0x00',
    ///             value: 0
    ///         }],
    ///     },
    ///     {
    ///         schema: '0x5ac273ce41e3c8bfa383efe7c03e54c5f0bff29c9f11ef6ffa930fc84ca32425',
    ///         data: [{
    ///             recipient: '0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf',
    ///             expirationTime: 0,
    ///             revocable: true,
    ///             refUID: '0x75bf2ed8dca25a8190c50c52db136664de25b2449535839008ccfdab469b214f',
    ///             data: '0x12345678',
    ///             value: 0
    ///         },
    ///     }])
    function multiAttest(MultiAttestationRequest[] calldata multiRequests) external payable returns (bytes32[] memory);

    /// @notice Attests to multiple schemas using via provided ECDSA signatures.
    /// @param multiDelegatedRequests The arguments of the delegated multi attestation requests. The requests should be
    ///     grouped by distinct schema ids to benefit from the best batching optimization.
    /// @return The UIDs of the new attestations.
    ///
    /// Example:
    ///     multiAttestByDelegation([{
    ///         schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
    ///         data: [{
    ///             recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
    ///             expirationTime: 1673891048,
    ///             revocable: true,
    ///             refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
    ///             data: '0x1234',
    ///             value: 0
    ///         },
    ///         {
    ///             recipient: '0xdEADBeAFdeAdbEafdeadbeafDeAdbEAFdeadbeaf',
    ///             expirationTime: 0,
    ///             revocable: false,
    ///             refUID: '0x0000000000000000000000000000000000000000000000000000000000000000',
    ///             data: '0x00',
    ///             value: 0
    ///         }],
    ///         signatures: [{
    ///             v: 28,
    ///             r: '0x148c...b25b',
    ///             s: '0x5a72...be22'
    ///         },
    ///         {
    ///             v: 28,
    ///             r: '0x487s...67bb',
    ///             s: '0x12ad...2366'
    ///         }],
    ///         attester: '0x1D86495b2A7B524D747d2839b3C645Bed32e8CF4',
    ///         deadline: 1673891048
    ///     }])
    function multiAttestByDelegation(
        MultiDelegatedAttestationRequest[] calldata multiDelegatedRequests
    ) external payable returns (bytes32[] memory);

    /// @notice Revokes an existing attestation to a specific schema.
    /// @param request The arguments of the revocation request.
    ///
    /// Example:
    ///     revoke({
    ///         schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
    ///         data: {
    ///             uid: '0x101032e487642ee04ee17049f99a70590c735b8614079fc9275f9dd57c00966d',
    ///             value: 0
    ///         }
    ///     })
    function revoke(RevocationRequest calldata request) external payable;

    /// @notice Revokes an existing attestation to a specific schema via the provided ECDSA signature.
    /// @param delegatedRequest The arguments of the delegated revocation request.
    ///
    /// Example:
    ///     revokeByDelegation({
    ///         schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
    ///         data: {
    ///             uid: '0xcbbc12102578c642a0f7b34fe7111e41afa25683b6cd7b5a14caf90fa14d24ba',
    ///             value: 0
    ///         },
    ///         signature: {
    ///             v: 27,
    ///             r: '0xb593...7142',
    ///             s: '0x0f5b...2cce'
    ///         },
    ///         revoker: '0x244934dd3e31bE2c81f84ECf0b3E6329F5381992',
    ///         deadline: 1673891048
    ///     })
    function revokeByDelegation(DelegatedRevocationRequest calldata delegatedRequest) external payable;

    /// @notice Revokes existing attestations to multiple schemas.
    /// @param multiRequests The arguments of the multi revocation requests. The requests should be grouped by distinct
    ///     schema ids to benefit from the best batching optimization.
    ///
    /// Example:
    ///     multiRevoke([{
    ///         schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
    ///         data: [{
    ///             uid: '0x211296a1ca0d7f9f2cfebf0daaa575bea9b20e968d81aef4e743d699c6ac4b25',
    ///             value: 1000
    ///         },
    ///         {
    ///             uid: '0xe160ac1bd3606a287b4d53d5d1d6da5895f65b4b4bab6d93aaf5046e48167ade',
    ///             value: 0
    ///         }],
    ///     },
    ///     {
    ///         schema: '0x5ac273ce41e3c8bfa383efe7c03e54c5f0bff29c9f11ef6ffa930fc84ca32425',
    ///         data: [{
    ///             uid: '0x053d42abce1fd7c8fcddfae21845ad34dae287b2c326220b03ba241bc5a8f019',
    ///             value: 0
    ///         },
    ///     }])
    function multiRevoke(MultiRevocationRequest[] calldata multiRequests) external payable;

    /// @notice Revokes existing attestations to multiple schemas via provided ECDSA signatures.
    /// @param multiDelegatedRequests The arguments of the delegated multi revocation attestation requests. The requests
    ///     should be grouped by distinct schema ids to benefit from the best batching optimization.
    ///
    /// Example:
    ///     multiRevokeByDelegation([{
    ///         schema: '0x8e72f5bc0a8d4be6aa98360baa889040c50a0e51f32dbf0baa5199bd93472ebc',
    ///         data: [{
    ///             uid: '0x211296a1ca0d7f9f2cfebf0daaa575bea9b20e968d81aef4e743d699c6ac4b25',
    ///             value: 1000
    ///         },
    ///         {
    ///             uid: '0xe160ac1bd3606a287b4d53d5d1d6da5895f65b4b4bab6d93aaf5046e48167ade',
    ///             value: 0
    ///         }],
    ///         signatures: [{
    ///             v: 28,
    ///             r: '0x148c...b25b',
    ///             s: '0x5a72...be22'
    ///         },
    ///         {
    ///             v: 28,
    ///             r: '0x487s...67bb',
    ///             s: '0x12ad...2366'
    ///         }],
    ///         revoker: '0x244934dd3e31bE2c81f84ECf0b3E6329F5381992',
    ///         deadline: 1673891048
    ///     }])
    function multiRevokeByDelegation(
        MultiDelegatedRevocationRequest[] calldata multiDelegatedRequests
    ) external payable;

    /// @notice Timestamps the specified bytes32 data.
    /// @param data The data to timestamp.
    /// @return The timestamp the data was timestamped with.
    function timestamp(bytes32 data) external returns (uint64);

    /// @notice Timestamps the specified multiple bytes32 data.
    /// @param data The data to timestamp.
    /// @return The timestamp the data was timestamped with.
    function multiTimestamp(bytes32[] calldata data) external returns (uint64);

    /// @notice Revokes the specified bytes32 data.
    /// @param data The data to timestamp.
    /// @return The timestamp the data was revoked with.
    function revokeOffchain(bytes32 data) external returns (uint64);

    /// @notice Revokes the specified multiple bytes32 data.
    /// @param data The data to timestamp.
    /// @return The timestamp the data was revoked with.
    function multiRevokeOffchain(bytes32[] calldata data) external returns (uint64);

    /// @notice Returns an existing attestation by UID.
    /// @param uid The UID of the attestation to retrieve.
    /// @return The attestation data members.
    function getAttestation(bytes32 uid) external view returns (Attestation memory);

    /// @notice Checks whether an attestation exists.
    /// @param uid The UID of the attestation to retrieve.
    /// @return Whether an attestation exists.
    function isAttestationValid(bytes32 uid) external view returns (bool);

    /// @notice Returns the timestamp that the specified data was timestamped with.
    /// @param data The data to query.
    /// @return The timestamp the data was timestamped with.
    function getTimestamp(bytes32 data) external view returns (uint64);

    /// @notice Returns the timestamp that the specified data was timestamped with.
    /// @param data The data to query.
    /// @return The timestamp the data was timestamped with.
    function getRevokeOffchain(address revoker, bytes32 data) external view returns (uint64);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";

import {ISemver} from "./interfaces/ISemver.sol";

/// @title Semver
/// @notice A simple contract for managing contract versions.
contract Semver is ISemver {
    // Contract's major version number.
    uint256 private immutable I_MAJOR;

    // Contract's minor version number.
    uint256 private immutable I_MINOR;

    // Contract's patch version number.
    uint256 private immutable I_PATCH;

    /// @dev Create a new Semver instance.
    /// @param major Major version number.
    /// @param minor Minor version number.
    /// @param patch Patch version number.
    constructor(uint256 major, uint256 minor, uint256 patch) {
        I_MAJOR = major;
        I_MINOR = minor;
        I_PATCH = patch;
    }

    /// @notice Returns the full semver contract version.
    /// @return Semver contract version as a string.
    function getVersion() external view returns (string memory) {
        return string(
            abi.encodePacked(Strings.toString(I_MAJOR), ".", Strings.toString(I_MINOR), ".", Strings.toString(I_PATCH))
        );
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {IValidatingResolver} from "../interfaces/IValidatingResolver.sol";

/// @title EnumerableValidatingResolverSet
/// @notice Library for managing a set of IValidatingResolver contracts
/// @dev Utilizes OpenZeppelin's EnumerableSet library with custom type casting for IValidatingResolver
library EnumerableValidatingResolverSet {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    struct Set {
        EnumerableSet.Bytes32Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Set storage set, IValidatingResolver value) internal returns (bool) {
        return set._inner.add(bytes32(uint256(uint160(address(value)))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Set storage set, IValidatingResolver value) internal returns (bool) {
        return set._inner.remove(bytes32(uint256(uint160(address(value)))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Set storage set, IValidatingResolver value) internal view returns (bool) {
        return set._inner.contains(bytes32(uint256(uint160(address(value)))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Set storage set) internal view returns (uint256) {
        return set._inner.length();
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Set storage set, uint256 index) internal view returns (IValidatingResolver) {
        return IValidatingResolver(address(uint160(uint256(set._inner.at(index)))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Set storage set) internal view returns (IValidatingResolver[] memory) {
        bytes32[] memory store = set._inner.values();
        IValidatingResolver[] memory result = new IValidatingResolver[](store.length);

        for (uint256 i = 0; i < store.length; i++) {
            result[i] = IValidatingResolver(address(uint160(uint256(store[i]))));
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {IExecutingResolver} from "../interfaces/IExecutingResolver.sol";

/// @title EnumerableExecutingResolverSet
/// @notice Library for managing a set of IExecutingResolver contracts
/// @dev Utilizes OpenZeppelin's EnumerableSet library with custom type casting for IExecutingResolver
library EnumerableExecutingResolverSet {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    struct Set {
        EnumerableSet.Bytes32Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Set storage set, IExecutingResolver value) internal returns (bool) {
        return set._inner.add(bytes32(uint256(uint160(address(value)))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Set storage set, IExecutingResolver value) internal returns (bool) {
        return set._inner.remove(bytes32(uint256(uint160(address(value)))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Set storage set, IExecutingResolver value) internal view returns (bool) {
        return set._inner.contains(bytes32(uint256(uint160(address(value)))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Set storage set) internal view returns (uint256) {
        return set._inner.length();
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Set storage set, uint256 index) internal view returns (IExecutingResolver) {
        return IExecutingResolver(address(uint160(uint256(set._inner.at(index)))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Set storage set) internal view returns (IExecutingResolver[] memory) {
        bytes32[] memory store = set._inner.values();
        IExecutingResolver[] memory result = new IExecutingResolver[](store.length);

        for (uint256 i = 0; i < store.length; i++) {
            result[i] = IExecutingResolver(address(uint160(uint256(store[i]))));
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {Attestation} from "eas-contracts/IEAS.sol";

interface IValidatingResolver {
    /// @notice A resolver callback that should be called by the plugin resolver.
    /// @param attestation The new attestation.
    /// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
    ///     both attest() and multiAttest() callbacks EAS-only callbacks and that in case of multi attestations, it'll
    ///     usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the
    ///     attestations in the batch.
    /// @return Whether the attestation is valid.
    function onAttest(Attestation calldata attestation, uint256 value) external returns (bool);

    /// @notice A resolver callback that should be called by the plugin resolver.
    /// @param attestation The existing attestation to be revoked.
    /// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
    ///     both revoke() and multiRevoke() callbacks EAS-only callbacks and that in case of multi attestations, it'll
    ///     usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the
    ///     attestations in the batch.
    /// @return Whether the attestation can be revoked.
    function onRevoke(Attestation calldata attestation, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {Attestation} from "eas-contracts/IEAS.sol";

interface IExecutingResolver {
    /// @notice A resolver callback that should be called by the plugin resolver.
    /// @param attestation The new attestation.
    /// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
    ///     both attest() and multiAttest() callbacks EAS-only callbacks and that in case of multi attestations, it'll
    ///     usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the
    ///     attestations in the batch.
    function onAttest(Attestation calldata attestation, uint256 value) external;

    /// @notice A resolver callback that should be called by the plugin resolver.
    /// @param attestation The existing attestation to be revoked.
    /// @param value An explicit ETH amount that was sent to the resolver. Please note that this value is verified in
    ///     both revoke() and multiRevoke() callbacks EAS-only callbacks and that in case of multi attestations, it'll
    ///     usually hold that msg.value != value, since msg.value aggregated the sent ETH amounts for all the
    ///     attestations in the batch.
    function onRevoke(Attestation calldata attestation, uint256 value) external;
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.28;

import {ISchemaResolver} from "eas-contracts/resolver/ISchemaResolver.sol";

import {IValidatingResolver} from "./IValidatingResolver.sol";
import {IExecutingResolver} from "./IExecutingResolver.sol";

/**
 * @title IPluginResolver
 * @author Kyle Kaplan
 * @dev Interface for the PluginResolver contract which manages an array of validating and executing resolver contracts
 */
interface IPluginResolver is ISchemaResolver {
    ////////////////////////////// Events //////////////////////////////

    /// @notice Emitted when an executing resolver fails, but the error is caught
    event ExecutingResolverFailed(IExecutingResolver indexed resolver, bool indexed isAttestation);

    /// @notice Emitted when a validating resolver is added.
    event ValidatingResolverAdded(IValidatingResolver indexed resolver);

    /// @notice Emitted when a validating resolver is removed.
    event ValidatingResolverRemoved(IValidatingResolver indexed resolver);

    /// @notice Emitted when an executing resolver is added.
    event ExecutingResolverAdded(IExecutingResolver indexed resolver);

    /// @notice Emitted when an executing resolver is removed.
    event ExecutingResolverRemoved(IExecutingResolver indexed resolver);

    /// @notice Emitted when an executing resolver's error catching setting is updated
    /// @param resolver The executing resolver whose setting was updated
    /// @param catchErrors Whether to catch errors for this resolver
    event ExecutingResolverErrorCatchingSet(IExecutingResolver indexed resolver, bool catchErrors);

    ////////////////////////////// Errors //////////////////////////////

    error PluginResolver__IndexOutOfBounds(uint256 index, uint256 length);
    error PluginResolver__InvalidResolver(address resolver);
    error PluginResolver__DuplicateResolver(address resolver);
    error PluginResolver__ResolverNotFound(address resolver);

    ////////////////////////////// Functions //////////////////////////////

    /// @notice Sets whether to catch errors for a specific executing resolver
    /// @param resolver The executing resolver to configure
    /// @param catchErrors Whether to catch errors for this resolver
    function setExecutingResolverErrorCatching(IExecutingResolver resolver, bool catchErrors) external;

    /// @notice Returns whether errors are caught for a specific executing resolver
    /// @param resolver The executing resolver to check
    /// @return Whether errors are caught for this resolver
    function getExecutingResolverErrorCatching(IExecutingResolver resolver) external view returns (bool);

    /// @notice Adds a validating resolver to the array
    /// @param resolver The resolver to add
    function addValidatingResolver(IValidatingResolver resolver) external;

    /// @notice Removes a validating resolver from the array
    /// @param resolver The resolver to remove
    function removeValidatingResolver(IValidatingResolver resolver) external;

    /// @notice Returns the length of the validatingResolvers array
    /// @return The number of validating resolvers
    function getValidatingResolversLength() external view returns (uint256);

    /// @notice Returns the validating resolver at the given index
    /// @param index The index of the resolver to return
    /// @return The validating resolver at the given index
    function getValidatingResolverAt(uint256 index) external view returns (IValidatingResolver);

    /// @notice Adds an executing resolver to the array
    /// @param resolver The resolver to add
    /// @param catchErrors Whether to catch errors for this resolver
    function addExecutingResolver(IExecutingResolver resolver, bool catchErrors) external;

    /// @notice Removes an executing resolver from the array
    /// @param resolver The resolver to remove
    function removeExecutingResolver(IExecutingResolver resolver) external;

    /// @notice Returns the length of the executingResolvers array
    /// @return The number of executing resolvers
    function getExecutingResolversLength() external view returns (uint256);

    /// @notice Returns the executing resolver at the given index
    /// @param index The index of the resolver to return
    /// @return The executing resolver at the given index
    function getExecutingResolverAt(uint256 index) external view returns (IExecutingResolver);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 13 of 25 : Common.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// A representation of an empty/uninitialized UID.
bytes32 constant EMPTY_UID = 0;

// A zero expiration represents an non-expiring attestation.
uint64 constant NO_EXPIRATION_TIME = 0;

error AccessDenied();
error DeadlineExpired();
error InvalidEAS();
error InvalidLength();
error InvalidSignature();
error NotFound();

/// @notice A struct representing ECDSA signature data.
struct Signature {
    uint8 v; // The recovery ID.
    bytes32 r; // The x-coordinate of the nonce R.
    bytes32 s; // The signature data.
}

/// @notice A struct representing a single attestation.
struct Attestation {
    bytes32 uid; // A unique identifier of the attestation.
    bytes32 schema; // The unique identifier of the schema.
    uint64 time; // The time when the attestation was created (Unix timestamp).
    uint64 expirationTime; // The time when the attestation expires (Unix timestamp).
    uint64 revocationTime; // The time when the attestation was revoked (Unix timestamp).
    bytes32 refUID; // The UID of the related attestation.
    address recipient; // The recipient of the attestation.
    address attester; // The attester/sender of the attestation.
    bool revocable; // Whether the attestation is revocable.
    bytes data; // Custom attestation data.
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";

import { ISemver } from "./ISemver.sol";

/// @title Semver
/// @notice A simple contract for managing contract versions.
contract Semver is ISemver {
    // Contract's major version number.
    uint256 private immutable _major;

    // Contract's minor version number.
    uint256 private immutable _minor;

    // Contract's patch version number.
    uint256 private immutable _patch;

    /// @dev Create a new Semver instance.
    /// @param major Major version number.
    /// @param minor Minor version number.
    /// @param patch Patch version number.
    constructor(uint256 major, uint256 minor, uint256 patch) {
        _major = major;
        _minor = minor;
        _patch = patch;
    }

    /// @notice Returns the full semver contract version.
    /// @return Semver contract version as a string.
    function version() external view returns (string memory) {
        return
            string(
                abi.encodePacked(Strings.toString(_major), ".", Strings.toString(_minor), ".", Strings.toString(_patch))
            );
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { Attestation } from "./../Common.sol";
import { ISemver } from "./../ISemver.sol";

/// @title ISchemaResolver
/// @notice The interface of an optional schema resolver.
interface ISchemaResolver is ISemver {
    /// @notice Checks if the resolver can be sent ETH.
    /// @return Whether the resolver supports ETH transfers.
    function isPayable() external pure returns (bool);

    /// @notice Processes an attestation and verifies whether it's valid.
    /// @param attestation The new attestation.
    /// @return Whether the attestation is valid.
    function attest(Attestation calldata attestation) external payable returns (bool);

    /// @notice Processes multiple attestations and verifies whether they are valid.
    /// @param attestations The new attestations.
    /// @param values Explicit ETH amounts which were sent with each attestation.
    /// @return Whether all the attestations are valid.
    function multiAttest(
        Attestation[] calldata attestations,
        uint256[] calldata values
    ) external payable returns (bool);

    /// @notice Processes an attestation revocation and verifies if it can be revoked.
    /// @param attestation The existing attestation to be revoked.
    /// @return Whether the attestation can be revoked.
    function revoke(Attestation calldata attestation) external payable returns (bool);

    /// @notice Processes revocation of multiple attestation and verifies they can be revoked.
    /// @param attestations The existing attestations to be revoked.
    /// @param values Explicit ETH amounts which were sent with each revocation.
    /// @return Whether the attestations can be revoked.
    function multiRevoke(
        Attestation[] calldata attestations,
        uint256[] calldata values
    ) external payable returns (bool);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { ISemver } from "./ISemver.sol";

import { ISchemaResolver } from "./resolver/ISchemaResolver.sol";

/// @notice A struct representing a record for a submitted schema.
struct SchemaRecord {
    bytes32 uid; // The unique identifier of the schema.
    ISchemaResolver resolver; // Optional schema resolver.
    bool revocable; // Whether the schema allows revocations explicitly.
    string schema; // Custom specification of the schema (e.g., an ABI).
}

/// @title ISchemaRegistry
/// @notice The interface of global attestation schemas for the Ethereum Attestation Service protocol.
interface ISchemaRegistry is ISemver {
    /// @notice Emitted when a new schema has been registered
    /// @param uid The schema UID.
    /// @param registerer The address of the account used to register the schema.
    /// @param schema The schema data.
    event Registered(bytes32 indexed uid, address indexed registerer, SchemaRecord schema);

    /// @notice Submits and reserves a new schema
    /// @param schema The schema data schema.
    /// @param resolver An optional schema resolver.
    /// @param revocable Whether the schema allows revocations explicitly.
    /// @return The UID of the new schema.
    function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32);

    /// @notice Returns an existing schema by UID
    /// @param uid The UID of the schema to retrieve.
    /// @return The schema data members.
    function getSchema(bytes32 uid) external view returns (SchemaRecord memory);
}

File 17 of 25 : ISemver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title ISemver
/// @notice A semver interface.
interface ISemver {
    /// @notice Returns the full semver contract version.
    /// @return Semver contract version as a string.
    function version() external view returns (string memory);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SafeCast} from "./math/SafeCast.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    using SafeCast for *;

    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev The string being parsed contains characters that are not in scope of the given base.
     */
    error StringsInvalidChar();

    /**
     * @dev The string being parsed is not a properly formatted address.
     */
    error StringsInvalidAddressFormat();

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            assembly ("memory-safe") {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                assembly ("memory-safe") {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
     * representation, according to EIP-55.
     */
    function toChecksumHexString(address addr) internal pure returns (string memory) {
        bytes memory buffer = bytes(toHexString(addr));

        // hash the hex part of buffer (skip length + 2 bytes, length 40)
        uint256 hashValue;
        assembly ("memory-safe") {
            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
        }

        for (uint256 i = 41; i > 1; --i) {
            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
                // case shift by xoring with 0x20
                buffer[i] ^= 0x20;
            }
            hashValue >>= 4;
        }
        return string(buffer);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }

    /**
     * @dev Parse a decimal string and returns the value as a `uint256`.
     *
     * Requirements:
     * - The string must be formatted as `[0-9]*`
     * - The result must fit into an `uint256` type
     */
    function parseUint(string memory input) internal pure returns (uint256) {
        return parseUint(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `[0-9]*`
     * - The result must fit into an `uint256` type
     */
    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
        (bool success, uint256 value) = tryParseUint(input, begin, end);
        if (!success) revert StringsInvalidChar();
        return value;
    }

    /**
     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
     * character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseUint(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, uint256 value) {
        if (end > bytes(input).length || begin > end) return (false, 0);
        return _tryParseUintUncheckedBounds(input, begin, end);
    }

    /**
     * @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that
     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.
     */
    function _tryParseUintUncheckedBounds(
        string memory input,
        uint256 begin,
        uint256 end
    ) private pure returns (bool success, uint256 value) {
        bytes memory buffer = bytes(input);

        uint256 result = 0;
        for (uint256 i = begin; i < end; ++i) {
            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
            if (chr > 9) return (false, 0);
            result *= 10;
            result += chr;
        }
        return (true, result);
    }

    /**
     * @dev Parse a decimal string and returns the value as a `int256`.
     *
     * Requirements:
     * - The string must be formatted as `[-+]?[0-9]*`
     * - The result must fit in an `int256` type.
     */
    function parseInt(string memory input) internal pure returns (int256) {
        return parseInt(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `[-+]?[0-9]*`
     * - The result must fit in an `int256` type.
     */
    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
        (bool success, int256 value) = tryParseInt(input, begin, end);
        if (!success) revert StringsInvalidChar();
        return value;
    }

    /**
     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
     * the result does not fit in a `int256`.
     *
     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
     */
    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
    }

    uint256 private constant ABS_MIN_INT256 = 2 ** 255;

    /**
     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
     * character or if the result does not fit in a `int256`.
     *
     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
     */
    function tryParseInt(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, int256 value) {
        if (end > bytes(input).length || begin > end) return (false, 0);
        return _tryParseIntUncheckedBounds(input, begin, end);
    }

    /**
     * @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that
     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.
     */
    function _tryParseIntUncheckedBounds(
        string memory input,
        uint256 begin,
        uint256 end
    ) private pure returns (bool success, int256 value) {
        bytes memory buffer = bytes(input);

        // Check presence of a negative sign.
        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
        bool positiveSign = sign == bytes1("+");
        bool negativeSign = sign == bytes1("-");
        uint256 offset = (positiveSign || negativeSign).toUint();

        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);

        if (absSuccess && absValue < ABS_MIN_INT256) {
            return (true, negativeSign ? -int256(absValue) : int256(absValue));
        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
            return (true, type(int256).min);
        } else return (false, 0);
    }

    /**
     * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
     *
     * Requirements:
     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`
     * - The result must fit in an `uint256` type.
     */
    function parseHexUint(string memory input) internal pure returns (uint256) {
        return parseHexUint(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
     * - The result must fit in an `uint256` type.
     */
    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
        (bool success, uint256 value) = tryParseHexUint(input, begin, end);
        if (!success) revert StringsInvalidChar();
        return value;
    }

    /**
     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
     * invalid character.
     *
     * NOTE: This function will revert if the result does not fit in a `uint256`.
     */
    function tryParseHexUint(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, uint256 value) {
        if (end > bytes(input).length || begin > end) return (false, 0);
        return _tryParseHexUintUncheckedBounds(input, begin, end);
    }

    /**
     * @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that
     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.
     */
    function _tryParseHexUintUncheckedBounds(
        string memory input,
        uint256 begin,
        uint256 end
    ) private pure returns (bool success, uint256 value) {
        bytes memory buffer = bytes(input);

        // skip 0x prefix if present
        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
        uint256 offset = hasPrefix.toUint() * 2;

        uint256 result = 0;
        for (uint256 i = begin + offset; i < end; ++i) {
            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
            if (chr > 15) return (false, 0);
            result *= 16;
            unchecked {
                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
                // This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.
                result += chr;
            }
        }
        return (true, result);
    }

    /**
     * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
     *
     * Requirements:
     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
     */
    function parseAddress(string memory input) internal pure returns (address) {
        return parseAddress(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and
     * `end` (excluded).
     *
     * Requirements:
     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
     */
    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
        (bool success, address value) = tryParseAddress(input, begin, end);
        if (!success) revert StringsInvalidAddressFormat();
        return value;
    }

    /**
     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
     * formatted address. See {parseAddress} requirements.
     */
    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
        return tryParseAddress(input, 0, bytes(input).length);
    }

    /**
     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
     * formatted address. See {parseAddress} requirements.
     */
    function tryParseAddress(
        string memory input,
        uint256 begin,
        uint256 end
    ) internal pure returns (bool success, address value) {
        if (end > bytes(input).length || begin > end) return (false, address(0));

        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;

        // check that input is the correct length
        if (end - begin == expectedLength) {
            // length guarantees that this does not overflow, and value is at most type(uint160).max
            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
            return (s, address(uint160(v)));
        } else {
            return (false, address(0));
        }
    }

    function _tryParseChr(bytes1 chr) private pure returns (uint8) {
        uint8 value = uint8(chr);

        // Try to parse `chr`:
        // - Case 1: [0-9]
        // - Case 2: [a-f]
        // - Case 3: [A-F]
        // - otherwise not supported
        unchecked {
            if (value > 47 && value < 58) value -= 48;
            else if (value > 96 && value < 103) value -= 87;
            else if (value > 64 && value < 71) value -= 55;
            else return type(uint8).max;
        }

        return value;
    }

    /**
     * @dev Reads a bytes32 from a bytes array without bounds checking.
     *
     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
     * assembly block as such would prevent some optimizations.
     */
    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
        // This is not memory safe in the general case, but all calls to this private function are within bounds.
        assembly ("memory-safe") {
            value := mload(add(buffer, add(0x20, offset)))
        }
    }
}

File 19 of 25 : ISemver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title ISemver
/// @notice A semver interface.
interface ISemver {
    /// @notice Returns the full semver contract version.
    /// @return Semver contract version as a string.
    function getVersion() external view returns (string memory);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.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 x) internal pure returns (uint256 r) {
        // If value has upper 128 bits set, log2 result is at least 128
        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
        // If upper 64 bits of 128-bit half set, add 64 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
        // If upper 32 bits of 64-bit half set, add 32 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
        // If upper 16 bits of 32-bit half set, add 16 to result
        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
        // If upper 8 bits of 16-bit half set, add 8 to result
        r |= SafeCast.toUint((x >> r) > 0xff) << 3;
        // If upper 4 bits of 8-bit half set, add 4 to result
        r |= SafeCast.toUint((x >> r) > 0xf) << 2;

        // Shifts value right by the current result and use it as an index into this lookup table:
        //
        // | x (4 bits) |  index  | table[index] = MSB position |
        // |------------|---------|-----------------------------|
        // |    0000    |    0    |        table[0] = 0         |
        // |    0001    |    1    |        table[1] = 0         |
        // |    0010    |    2    |        table[2] = 1         |
        // |    0011    |    3    |        table[3] = 1         |
        // |    0100    |    4    |        table[4] = 2         |
        // |    0101    |    5    |        table[5] = 2         |
        // |    0110    |    6    |        table[6] = 2         |
        // |    0111    |    7    |        table[7] = 2         |
        // |    1000    |    8    |        table[8] = 3         |
        // |    1001    |    9    |        table[9] = 3         |
        // |    1010    |   10    |        table[10] = 3        |
        // |    1011    |   11    |        table[11] = 3        |
        // |    1100    |   12    |        table[12] = 3        |
        // |    1101    |   13    |        table[13] = 3        |
        // |    1110    |   14    |        table[14] = 3        |
        // |    1111    |   15    |        table[15] = 3        |
        //
        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.
        assembly ("memory-safe") {
            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))
        }
    }

    /**
     * @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 x) internal pure returns (uint256 r) {
        // If value has upper 128 bits set, log2 result is at least 128
        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
        // If upper 64 bits of 128-bit half set, add 64 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
        // If upper 32 bits of 64-bit half set, add 32 to result
        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
        // If upper 16 bits of 32-bit half set, add 16 to result
        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8
        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);
    }

    /**
     * @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;
    }
}

File 23 of 25 : SafeCast.sol
// 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/SignedMath.sol)

pragma solidity ^0.8.20;

import {SafeCast} from "./SafeCast.sol";

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @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, int256 a, int256 b) internal pure returns (int256) {
        unchecked {
            // branchless ternary works because:
            // b ^ (a ^ b) == a
            // b ^ 0 == b
            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
        }
    }

    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return ternary(a > b, a, b);
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return ternary(a < b, a, b);
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
            // taking advantage of the most significant (or "sign" bit) in two's complement representation.
            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
            int256 mask = n >> 255;

            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
            return uint256((n + mask) ^ mask);
        }
    }
}

// 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)
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "eas-contracts/=lib/eas-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false
}

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":true,"internalType":"address","name":"initOwner","type":"address"},{"indexed":true,"internalType":"contract PluginResolver","name":"deployedContract","type":"address"}],"name":"ResolverDeployed","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_salt","type":"bytes32"},{"internalType":"bytes","name":"_bytecode","type":"bytes"}],"name":"computeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"contracts","outputs":[{"internalType":"contract PluginResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_salt","type":"bytes32"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_eas","type":"address"}],"name":"deploy","outputs":[{"internalType":"contract PluginResolver","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getBytecode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}]

6080604052348015600e575f5ffd5b50613a2b8061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061004a575f3560e01c80630c6008af1461004e578063474da79a1461007e578063ca9ffe94146100ae578063cf9d137c146100de575b5f5ffd5b610068600480360381019061006391906103c3565b61010e565b604051610075919061045e565b60405180910390f35b610098600480360381019061009391906104b1565b61017b565b6040516100a59190610537565b60405180910390f35b6100c860048036038101906100c391906106af565b6101b5565b6040516100d59190610718565b60405180910390f35b6100f860048036038101906100f39190610731565b6101fd565b6040516101059190610537565b60405180910390f35b6060604051806020016101209061034b565b6020820181038252601f19601f82011660405250826040516020016101459190610718565b6040516020818303038152906040526040516020016101659291906107bb565b6040516020818303038152906040529050919050565b5f8181548110610189575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5f8280519060200120905060ff60f81b3085836040516020016101dc949392919061088e565b604051602081830303815290604052805190602001205f1c91505092915050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610235573392505b5f8484846040516102459061034b565b6102509291906108db565b8190604051809103905ff590508015801561026d573d5f5f3e3d5ffd5b5090505f81908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fec56ce297b5c05d0fa72b6899e6f716615f8e72604cea92dce38071f59304b8e60405160405180910390a4809150509392505050565b6130f38061090383390190565b5f604051905090565b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61039282610369565b9050919050565b6103a281610388565b81146103ac575f5ffd5b50565b5f813590506103bd81610399565b92915050565b5f602082840312156103d8576103d7610361565b5b5f6103e5848285016103af565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610430826103ee565b61043a81856103f8565b935061044a818560208601610408565b61045381610416565b840191505092915050565b5f6020820190508181035f8301526104768184610426565b905092915050565b5f819050919050565b6104908161047e565b811461049a575f5ffd5b50565b5f813590506104ab81610487565b92915050565b5f602082840312156104c6576104c5610361565b5b5f6104d38482850161049d565b91505092915050565b5f819050919050565b5f6104ff6104fa6104f584610369565b6104dc565b610369565b9050919050565b5f610510826104e5565b9050919050565b5f61052182610506565b9050919050565b61053181610517565b82525050565b5f60208201905061054a5f830184610528565b92915050565b5f819050919050565b61056281610550565b811461056c575f5ffd5b50565b5f8135905061057d81610559565b92915050565b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6105c182610416565b810181811067ffffffffffffffff821117156105e0576105df61058b565b5b80604052505050565b5f6105f2610358565b90506105fe82826105b8565b919050565b5f67ffffffffffffffff82111561061d5761061c61058b565b5b61062682610416565b9050602081019050919050565b828183375f83830152505050565b5f61065361064e84610603565b6105e9565b90508281526020810184848401111561066f5761066e610587565b5b61067a848285610633565b509392505050565b5f82601f83011261069657610695610583565b5b81356106a6848260208601610641565b91505092915050565b5f5f604083850312156106c5576106c4610361565b5b5f6106d28582860161056f565b925050602083013567ffffffffffffffff8111156106f3576106f2610365565b5b6106ff85828601610682565b9150509250929050565b61071281610388565b82525050565b5f60208201905061072b5f830184610709565b92915050565b5f5f5f6060848603121561074857610747610361565b5b5f6107558682870161056f565b9350506020610766868287016103af565b9250506040610777868287016103af565b9150509250925092565b5f81905092915050565b5f610795826103ee565b61079f8185610781565b93506107af818560208601610408565b80840191505092915050565b5f6107c6828561078b565b91506107d2828461078b565b91508190509392505050565b5f7fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b5f819050919050565b61082361081e826107de565b610809565b82525050565b5f8160601b9050919050565b5f61083f82610829565b9050919050565b5f61085082610835565b9050919050565b61086861086382610388565b610846565b82525050565b5f819050919050565b61088861088382610550565b61086e565b82525050565b5f6108998287610812565b6001820191506108a98286610857565b6014820191506108b98285610877565b6020820191506108c98284610877565b60208201915081905095945050505050565b5f6040820190506108ee5f830185610709565b6108fb6020830184610709565b939250505056fe610160604052348015610010575f5ffd5b506040516130f33803806130f3833981810160405281019061003291906102ec565b80600160045f855f5f600182608081815250508160a081815250508060c081815250505050505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100c8575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100bf9190610339565b60405180910390fd5b6100d78161019760201b60201c565b508260e081815250508161010081815250508061012081815250505050505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361015a576040517f83780ffe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166101408173ffffffffffffffffffffffffffffffffffffffff1681525050505050610352565b60015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556101ca816101cd60201b60201c565b50565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102bb82610292565b9050919050565b6102cb816102b1565b81146102d5575f5ffd5b50565b5f815190506102e6816102c2565b92915050565b5f5f604083850312156103025761030161028e565b5b5f61030f858286016102d8565b9250506020610320858286016102d8565b9150509250929050565b610333816102b1565b82525050565b5f60208201905061034c5f83018461032a565b92915050565b60805160a05160c05160e051610100516101205161014051612d506103a35f395f61148601525f61073901525f61071001525f6106e701525f61067501525f61064c01525f6106230152612d505ff3fe60806040526004361061014e575f3560e01c806391e4db78116100b5578063e49617e11161006e578063e49617e11461048b578063e4cc9460146104bb578063e60c3505146104f7578063f2fde38b14610527578063f657b5b21461054f578063fa7828ab1461057757610193565b806391e4db7814610381578063ba78613f146103a9578063c7d980ca146103d3578063ce46e0461461040f578063e2bb114514610439578063e30c39781461046157610193565b8063715018a611610107578063715018a6146102a357806379ba5097146102b9578063889a3531146102cf57806388e5b2d9146102f75780638da5cb5b1461032757806391db0b7e1461035157610193565b806305fa3ac8146101975780630d8e6e2c146101d35780631c592c64146101fd5780634e5ab9491461022757806354fd4d501461025157806367b4136a1461027b57610193565b366101935761015b6105a1565b610191576040517f1574f9f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b5f5ffd5b3480156101a2575f5ffd5b506101bd60048036038101906101b891906120b7565b6105a8565b6040516101ca919061215c565b60405180910390f35b3480156101de575f5ffd5b506101e761061c565b6040516101f491906121e5565b60405180910390f35b348015610208575f5ffd5b506102116106bf565b60405161021e9190612214565b60405180910390f35b348015610232575f5ffd5b5061023b6106cf565b60405161024891906122f5565b60405180910390f35b34801561025c575f5ffd5b506102656106e0565b60405161027291906121e5565b60405180910390f35b348015610286575f5ffd5b506102a1600480360381019061029c9190612396565b610783565b005b3480156102ae575f5ffd5b506102b7610886565b005b3480156102c4575f5ffd5b506102cd610899565b005b3480156102da575f5ffd5b506102f560048036038101906102f09190612396565b610927565b005b610311600480360381019061030c919061248a565b610a8f565b60405161031e9190612517565b60405180910390f35b348015610332575f5ffd5b5061033b610ba2565b604051610348919061253f565b60405180910390f35b61036b6004803603810190610366919061248a565b610bc9565b6040516103789190612517565b60405180910390f35b34801561038c575f5ffd5b506103a760048036038101906103a29190612593565b610cdc565b005b3480156103b4575f5ffd5b506103bd610d7f565b6040516103ca9190612665565b60405180910390f35b3480156103de575f5ffd5b506103f960048036038101906103f491906120b7565b610d90565b6040516104069190612694565b60405180910390f35b34801561041a575f5ffd5b506104236105a1565b6040516104309190612517565b60405180910390f35b348015610444575f5ffd5b5061045f600480360381019061045a9190612593565b610e04565b005b34801561046c575f5ffd5b50610475610f17565b604051610482919061253f565b60405180910390f35b6104a560048036038101906104a091906126d0565b610f3f565b6040516104b29190612517565b60405180910390f35b3480156104c6575f5ffd5b506104e160048036038101906104dc9190612717565b610f59565b6040516104ee9190612517565b60405180910390f35b610511600480360381019061050c91906126d0565b610fab565b60405161051e9190612517565b60405180910390f35b348015610532575f5ffd5b5061054d6004803603810190610548919061276c565b610fc5565b005b34801561055a575f5ffd5b5061057560048036038101906105709190612717565b611071565b005b348015610582575f5ffd5b5061058b611160565b6040516105989190612214565b60405180910390f35b5f5f905090565b5f6105b36002611170565b821061060157816105c46002611170565b6040517f1181dd000000000000000000000000000000000000000000000000000000000081526004016105f8929190612797565b60405180910390fd5b61061582600261118390919063ffffffff16565b9050919050565b60606106477f00000000000000000000000000000000000000000000000000000000000000006111a3565b6106707f00000000000000000000000000000000000000000000000000000000000000006111a3565b6106997f00000000000000000000000000000000000000000000000000000000000000006111a3565b6040516020016106ab93929190612842565b604051602081830303815290604052905090565b5f6106ca6002611170565b905090565b60606106db600461126d565b905090565b606061070b7f00000000000000000000000000000000000000000000000000000000000000006111a3565b6107347f00000000000000000000000000000000000000000000000000000000000000006111a3565b61075d7f00000000000000000000000000000000000000000000000000000000000000006111a3565b60405160200161076f93929190612842565b604051602081830303815290604052905090565b61078b61135a565b61079f8260046113e190919063ffffffff16565b6107e057816040517fb195685e0000000000000000000000000000000000000000000000000000000081526004016107d7919061253f565b60405180910390fd5b8060065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fa2af4c7b2fbf6be440f097b4a6bffa9c4b2273f12e5142eff6f4e065674d59728260405161087a9190612517565b60405180910390a25050565b61088e61135a565b6108975f611417565b565b5f6108a2611447565b90508073ffffffffffffffffffffffffffffffffffffffff166108c3610f17565b73ffffffffffffffffffffffffffffffffffffffff161461091b57806040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610912919061253f565b60405180910390fd5b61092481611417565b50565b61092f61135a565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361099f57816040517fb1588d31000000000000000000000000000000000000000000000000000000008152600401610996919061253f565b60405180910390fd5b6109b382600461144e90919063ffffffff16565b6109f457816040517faa918c230000000000000000000000000000000000000000000000000000000081526004016109eb919061253f565b60405180910390fd5b8060065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fb2223b5747922b851a000893077f89894300287c81dfafd802f4ffef75fb974760405160405180910390a25050565b5f610a98611484565b5f858590509050838390508114610adb576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3490505f5f90505b82811015610b92575f868683818110610b0057610aff612888565b5b90506020020135905082811115610b43576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b71898984818110610b5957610b58612888565b5b9050602002810190610b6b91906128b9565b8261150b565b610b81575f945050505050610b9a565b808303925050806001019050610ae4565b506001925050505b949350505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f610bd2611484565b5f858590509050838390508114610c15576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3490505f5f90505b82811015610ccc575f868683818110610c3a57610c39612888565b5b90506020020135905082811115610c7d576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cab898984818110610c9357610c92612888565b5b9050602002810190610ca591906128b9565b8261178d565b610cbb575f945050505050610cd4565b808303925050806001019050610c1e565b506001925050505b949350505050565b610ce461135a565b610cf8816002611a1090919063ffffffff16565b610d3957806040517fb1588d31000000000000000000000000000000000000000000000000000000008152600401610d30919061253f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f743b5c0fa172f05b8e8d9307e79c798f39bea2136eae804905cca7b43285e2fa60405160405180910390a250565b6060610d8b6002611a46565b905090565b5f610d9b6004611b33565b8210610de95781610dac6004611b33565b6040517f1181dd00000000000000000000000000000000000000000000000000000000008152600401610de0929190612797565b60405180910390fd5b610dfd826004611b4690919063ffffffff16565b9050919050565b610e0c61135a565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e7c57806040517fb1588d31000000000000000000000000000000000000000000000000000000008152600401610e73919061253f565b60405180910390fd5b610e90816002611b6690919063ffffffff16565b610ed157806040517faa918c23000000000000000000000000000000000000000000000000000000008152600401610ec8919061253f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f31be779d6b17f5e97f997ce93ed74f1a169b63c441a59788481c50dd1430267160405160405180910390a250565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f610f48611484565b610f52823461150b565b9050919050565b5f60065f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b5f610fb4611484565b610fbe823461178d565b9050919050565b610fcd61135a565b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1661102c610ba2565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b61107961135a565b61108d816004611b9c90919063ffffffff16565b6110ce57806040517fb1588d310000000000000000000000000000000000000000000000000000000081526004016110c5919061253f565b60405180910390fd5b60065f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81549060ff02191690558073ffffffffffffffffffffffffffffffffffffffff167f33117cab2b31077c31e4317e07b1c0cb9becd171c5cd7885a66b5165899c604e60405160405180910390a250565b5f61116b6004611b33565b905090565b5f61117c825f01611bd2565b9050919050565b5f61119982845f01611be590919063ffffffff16565b5f1c905092915050565b60605f60016111b184611bfa565b0190505f8167ffffffffffffffff8111156111cf576111ce6128e1565b5b6040519080825280601f01601f1916602001820160405280156112015781602001600182028036833780820191505090505b5090505f82602001820190505b600115611262578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816112575761125661290e565b5b0494505f850361120e575b819350505050919050565b60605f61127b835f01611d4b565b90505f815167ffffffffffffffff811115611299576112986128e1565b5b6040519080825280602002602001820160405280156112c75781602001602082028036833780820191505090505b5090505f5f90505b825181101561134f578281815181106112eb576112ea612888565b5b60200260200101515f1c82828151811061130857611307612888565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506112cf565b508092505050919050565b611362611447565b73ffffffffffffffffffffffffffffffffffffffff16611380610ba2565b73ffffffffffffffffffffffffffffffffffffffff16146113df576113a3611447565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016113d6919061253f565b60405180910390fd5b565b5f61140f8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611d6a90919063ffffffff16565b905092915050565b60015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905561144481611d7f565b50565b5f33905090565b5f61147c8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e4090919063ffffffff16565b905092915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611509576040517f4ca8886700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f5f6115176002611170565b90505f5f90505b818110156115cf5761153a81600261118390919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663587a229686866040518363ffffffff1660e01b8152600401611574929190612c20565b6020604051808303815f875af1158015611590573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115b49190612c62565b6115c2575f92505050611787565b808060010191505061151e565b505f6115db6004611b33565b90505f5f90505b8181101561177f575f6115ff826004611b4690919063ffffffff16565b905060065f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615611708578073ffffffffffffffffffffffffffffffffffffffff1663587a229688886040518363ffffffff1660e01b815260040161168b929190612c20565b5f604051808303815f87803b1580156116a2575f5ffd5b505af19250505080156116b3575060015b611702575f15158173ffffffffffffffffffffffffffffffffffffffff167f7a910e823765957ca8442109225d99d637d0f99ce2a2f8a687a153bb562eb41460405160405180910390a3611703565b5b611771565b8073ffffffffffffffffffffffffffffffffffffffff1663587a229688886040518363ffffffff1660e01b8152600401611743929190612c20565b5f604051808303815f87803b15801561175a575f5ffd5b505af115801561176c573d5f5f3e3d5ffd5b505050505b5080806001019150506115e2565b506001925050505b92915050565b5f5f6117996002611170565b90505f5f90505b81811015611851576117bc81600261118390919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663a01968ee86866040518363ffffffff1660e01b81526004016117f6929190612c20565b6020604051808303815f875af1158015611812573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118369190612c62565b611844575f92505050611a0a565b80806001019150506117a0565b505f61185d6004611b33565b90505f5f90505b81811015611a02575f611881826004611b4690919063ffffffff16565b905060065f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161561198b578073ffffffffffffffffffffffffffffffffffffffff1663a01968ee88886040518363ffffffff1660e01b815260040161190d929190612c20565b5f604051808303815f87803b158015611924575f5ffd5b505af1925050508015611935575060015b61198557600115158173ffffffffffffffffffffffffffffffffffffffff167f7a910e823765957ca8442109225d99d637d0f99ce2a2f8a687a153bb562eb41460405160405180910390a3611986565b5b6119f4565b8073ffffffffffffffffffffffffffffffffffffffff1663a01968ee88886040518363ffffffff1660e01b81526004016119c6929190612c20565b5f604051808303815f87803b1580156119dd575f5ffd5b505af11580156119ef573d5f5f3e3d5ffd5b505050505b508080600101915050611864565b506001925050505b92915050565b5f611a3e8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e5590919063ffffffff16565b905092915050565b60605f611a54835f01611d4b565b90505f815167ffffffffffffffff811115611a7257611a716128e1565b5b604051908082528060200260200182016040528015611aa05781602001602082028036833780820191505090505b5090505f5f90505b8251811015611b2857828181518110611ac457611ac3612888565b5b60200260200101515f1c828281518110611ae157611ae0612888565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611aa8565b508092505050919050565b5f611b3f825f01611bd2565b9050919050565b5f611b5c82845f01611be590919063ffffffff16565b5f1c905092915050565b5f611b948273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e4090919063ffffffff16565b905092915050565b5f611bca8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e5590919063ffffffff16565b905092915050565b5f611bde825f01611e6a565b9050919050565b5f611bf2835f0183611e79565b905092915050565b5f5f5f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611c56577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381611c4c57611c4b61290e565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611c93576d04ee2d6d415b85acef81000000008381611c8957611c8861290e565b5b0492506020810190505b662386f26fc100008310611cc257662386f26fc100008381611cb857611cb761290e565b5b0492506010810190505b6305f5e1008310611ceb576305f5e1008381611ce157611ce061290e565b5b0492506008810190505b6127108310611d10576127108381611d0657611d0561290e565b5b0492506004810190505b60648310611d335760648381611d2957611d2861290e565b5b0492506002810190505b600a8310611d42576001810190505b80915050919050565b60605f611d59835f01611ea0565b905060608190508092505050919050565b5f611d77835f0183611ef9565b905092915050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f611e4d835f0183611f19565b905092915050565b5f611e62835f0183611f80565b905092915050565b5f815f01805490509050919050565b5f825f018281548110611e8f57611e8e612888565b5b905f5260205f200154905092915050565b6060815f01805480602002602001604051908101604052809291908181526020018280548015611eed57602002820191905f5260205f20905b815481526020019060010190808311611ed9575b50505050509050919050565b5f5f836001015f8481526020019081526020015f20541415905092915050565b5f611f248383611ef9565b611f7657825f0182908060018154018082558091505060019003905f5260205f20015f9091909190915055825f0180549050836001015f8481526020019081526020015f208190555060019050611f7a565b5f90505b92915050565b5f5f836001015f8481526020019081526020015f205490505f8114612071575f600182611fad9190612cba565b90505f6001865f0180549050611fc39190612cba565b9050808214612029575f865f018281548110611fe257611fe1612888565b5b905f5260205f200154905080875f01848154811061200357612002612888565b5b905f5260205f20018190555083876001015f8381526020019081526020015f2081905550505b855f0180548061203c5761203b612ced565b5b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050612076565b5f9150505b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b61209681612084565b81146120a0575f5ffd5b50565b5f813590506120b18161208d565b92915050565b5f602082840312156120cc576120cb61207c565b5b5f6120d9848285016120a3565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61212461211f61211a846120e2565b612101565b6120e2565b9050919050565b5f6121358261210a565b9050919050565b5f6121468261212b565b9050919050565b6121568161213c565b82525050565b5f60208201905061216f5f83018461214d565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6121b782612175565b6121c1818561217f565b93506121d181856020860161218f565b6121da8161219d565b840191505092915050565b5f6020820190508181035f8301526121fd81846121ad565b905092915050565b61220e81612084565b82525050565b5f6020820190506122275f830184612205565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f6122608261212b565b9050919050565b61227081612256565b82525050565b5f6122818383612267565b60208301905092915050565b5f602082019050919050565b5f6122a38261222d565b6122ad8185612237565b93506122b883612247565b805f5b838110156122e85781516122cf8882612276565b97506122da8361228d565b9250506001810190506122bb565b5085935050505092915050565b5f6020820190508181035f83015261230d8184612299565b905092915050565b5f61231f826120e2565b9050919050565b5f61233082612315565b9050919050565b61234081612326565b811461234a575f5ffd5b50565b5f8135905061235b81612337565b92915050565b5f8115159050919050565b61237581612361565b811461237f575f5ffd5b50565b5f813590506123908161236c565b92915050565b5f5f604083850312156123ac576123ab61207c565b5b5f6123b98582860161234d565b92505060206123ca85828601612382565b9150509250929050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126123f5576123f46123d4565b5b8235905067ffffffffffffffff811115612412576124116123d8565b5b60208301915083602082028301111561242e5761242d6123dc565b5b9250929050565b5f5f83601f84011261244a576124496123d4565b5b8235905067ffffffffffffffff811115612467576124666123d8565b5b602083019150836020820283011115612483576124826123dc565b5b9250929050565b5f5f5f5f604085870312156124a2576124a161207c565b5b5f85013567ffffffffffffffff8111156124bf576124be612080565b5b6124cb878288016123e0565b9450945050602085013567ffffffffffffffff8111156124ee576124ed612080565b5b6124fa87828801612435565b925092505092959194509250565b61251181612361565b82525050565b5f60208201905061252a5f830184612508565b92915050565b61253981612315565b82525050565b5f6020820190506125525f830184612530565b92915050565b5f61256282612315565b9050919050565b61257281612558565b811461257c575f5ffd5b50565b5f8135905061258d81612569565b92915050565b5f602082840312156125a8576125a761207c565b5b5f6125b58482850161257f565b91505092915050565b5f81519050919050565b5f819050602082019050919050565b6125e08161213c565b82525050565b5f6125f183836125d7565b60208301905092915050565b5f602082019050919050565b5f612613826125be565b61261d8185612237565b9350612628836125c8565b805f5b8381101561265857815161263f88826125e6565b975061264a836125fd565b92505060018101905061262b565b5085935050505092915050565b5f6020820190508181035f83015261267d8184612609565b905092915050565b61268e81612256565b82525050565b5f6020820190506126a75f830184612685565b92915050565b5f5ffd5b5f61014082840312156126c7576126c66126ad565b5b81905092915050565b5f602082840312156126e5576126e461207c565b5b5f82013567ffffffffffffffff81111561270257612701612080565b5b61270e848285016126b1565b91505092915050565b5f6020828403121561272c5761272b61207c565b5b5f6127398482850161234d565b91505092915050565b61274b81612315565b8114612755575f5ffd5b50565b5f8135905061276681612742565b92915050565b5f602082840312156127815761278061207c565b5b5f61278e84828501612758565b91505092915050565b5f6040820190506127aa5f830185612205565b6127b76020830184612205565b9392505050565b5f81905092915050565b5f6127d282612175565b6127dc81856127be565b93506127ec81856020860161218f565b80840191505092915050565b7f2e000000000000000000000000000000000000000000000000000000000000005f82015250565b5f61282c6001836127be565b9150612837826127f8565b600182019050919050565b5f61284d82866127c8565b915061285882612820565b915061286482856127c8565b915061286f82612820565b915061287b82846127c8565b9150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5ffd5b5f82356001610140038336030381126128d5576128d46128b5565b5b80830191505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f819050919050565b61294d8161293b565b8114612957575f5ffd5b50565b5f8135905061296881612944565b92915050565b5f61297c602084018461295a565b905092915050565b61298d8161293b565b82525050565b5f67ffffffffffffffff82169050919050565b6129af81612993565b81146129b9575f5ffd5b50565b5f813590506129ca816129a6565b92915050565b5f6129de60208401846129bc565b905092915050565b6129ef81612993565b82525050565b5f612a036020840184612758565b905092915050565b612a1481612315565b82525050565b5f612a286020840184612382565b905092915050565b612a3981612361565b82525050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83356001602003843603038112612a6757612a66612a47565b5b83810192508235915060208301925067ffffffffffffffff821115612a8f57612a8e612a3f565b5b600182023603831315612aa557612aa4612a43565b5b509250929050565b5f82825260208201905092915050565b828183375f83830152505050565b5f612ad68385612aad565b9350612ae3838584612abd565b612aec8361219d565b840190509392505050565b5f6101408301612b095f84018461296e565b612b155f860182612984565b50612b23602084018461296e565b612b306020860182612984565b50612b3e60408401846129d0565b612b4b60408601826129e6565b50612b5960608401846129d0565b612b6660608601826129e6565b50612b7460808401846129d0565b612b8160808601826129e6565b50612b8f60a084018461296e565b612b9c60a0860182612984565b50612baa60c08401846129f5565b612bb760c0860182612a0b565b50612bc560e08401846129f5565b612bd260e0860182612a0b565b50612be1610100840184612a1a565b612bef610100860182612a30565b50612bfe610120840184612a4b565b858303610120870152612c12838284612acb565b925050508091505092915050565b5f6040820190508181035f830152612c388185612af7565b9050612c476020830184612205565b9392505050565b5f81519050612c5c8161236c565b92915050565b5f60208284031215612c7757612c7661207c565b5b5f612c8484828501612c4e565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612cc482612084565b9150612ccf83612084565b9250828203905081811115612ce757612ce6612c8d565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffdfea2646970667358221220a2d67e05153ad385d721c2dcac352fad055aa9414d800f6ff13ce419dc14a4c164736f6c634300081c0033a2646970667358221220a0c2c32e88d15db5e01c7c667756ac6836aae453e0cffdf243891cc75251ca1e64736f6c634300081c0033

Deployed Bytecode

0x608060405234801561000f575f5ffd5b506004361061004a575f3560e01c80630c6008af1461004e578063474da79a1461007e578063ca9ffe94146100ae578063cf9d137c146100de575b5f5ffd5b610068600480360381019061006391906103c3565b61010e565b604051610075919061045e565b60405180910390f35b610098600480360381019061009391906104b1565b61017b565b6040516100a59190610537565b60405180910390f35b6100c860048036038101906100c391906106af565b6101b5565b6040516100d59190610718565b60405180910390f35b6100f860048036038101906100f39190610731565b6101fd565b6040516101059190610537565b60405180910390f35b6060604051806020016101209061034b565b6020820181038252601f19601f82011660405250826040516020016101459190610718565b6040516020818303038152906040526040516020016101659291906107bb565b6040516020818303038152906040529050919050565b5f8181548110610189575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5f8280519060200120905060ff60f81b3085836040516020016101dc949392919061088e565b604051602081830303815290604052805190602001205f1c91505092915050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610235573392505b5f8484846040516102459061034b565b6102509291906108db565b8190604051809103905ff590508015801561026d573d5f5f3e3d5ffd5b5090505f81908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fec56ce297b5c05d0fa72b6899e6f716615f8e72604cea92dce38071f59304b8e60405160405180910390a4809150509392505050565b6130f38061090383390190565b5f604051905090565b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61039282610369565b9050919050565b6103a281610388565b81146103ac575f5ffd5b50565b5f813590506103bd81610399565b92915050565b5f602082840312156103d8576103d7610361565b5b5f6103e5848285016103af565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610430826103ee565b61043a81856103f8565b935061044a818560208601610408565b61045381610416565b840191505092915050565b5f6020820190508181035f8301526104768184610426565b905092915050565b5f819050919050565b6104908161047e565b811461049a575f5ffd5b50565b5f813590506104ab81610487565b92915050565b5f602082840312156104c6576104c5610361565b5b5f6104d38482850161049d565b91505092915050565b5f819050919050565b5f6104ff6104fa6104f584610369565b6104dc565b610369565b9050919050565b5f610510826104e5565b9050919050565b5f61052182610506565b9050919050565b61053181610517565b82525050565b5f60208201905061054a5f830184610528565b92915050565b5f819050919050565b61056281610550565b811461056c575f5ffd5b50565b5f8135905061057d81610559565b92915050565b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6105c182610416565b810181811067ffffffffffffffff821117156105e0576105df61058b565b5b80604052505050565b5f6105f2610358565b90506105fe82826105b8565b919050565b5f67ffffffffffffffff82111561061d5761061c61058b565b5b61062682610416565b9050602081019050919050565b828183375f83830152505050565b5f61065361064e84610603565b6105e9565b90508281526020810184848401111561066f5761066e610587565b5b61067a848285610633565b509392505050565b5f82601f83011261069657610695610583565b5b81356106a6848260208601610641565b91505092915050565b5f5f604083850312156106c5576106c4610361565b5b5f6106d28582860161056f565b925050602083013567ffffffffffffffff8111156106f3576106f2610365565b5b6106ff85828601610682565b9150509250929050565b61071281610388565b82525050565b5f60208201905061072b5f830184610709565b92915050565b5f5f5f6060848603121561074857610747610361565b5b5f6107558682870161056f565b9350506020610766868287016103af565b9250506040610777868287016103af565b9150509250925092565b5f81905092915050565b5f610795826103ee565b61079f8185610781565b93506107af818560208601610408565b80840191505092915050565b5f6107c6828561078b565b91506107d2828461078b565b91508190509392505050565b5f7fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b5f819050919050565b61082361081e826107de565b610809565b82525050565b5f8160601b9050919050565b5f61083f82610829565b9050919050565b5f61085082610835565b9050919050565b61086861086382610388565b610846565b82525050565b5f819050919050565b61088861088382610550565b61086e565b82525050565b5f6108998287610812565b6001820191506108a98286610857565b6014820191506108b98285610877565b6020820191506108c98284610877565b60208201915081905095945050505050565b5f6040820190506108ee5f830185610709565b6108fb6020830184610709565b939250505056fe610160604052348015610010575f5ffd5b506040516130f33803806130f3833981810160405281019061003291906102ec565b80600160045f855f5f600182608081815250508160a081815250508060c081815250505050505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100c8575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100bf9190610339565b60405180910390fd5b6100d78161019760201b60201c565b508260e081815250508161010081815250508061012081815250505050505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361015a576040517f83780ffe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166101408173ffffffffffffffffffffffffffffffffffffffff1681525050505050610352565b60015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556101ca816101cd60201b60201c565b50565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102bb82610292565b9050919050565b6102cb816102b1565b81146102d5575f5ffd5b50565b5f815190506102e6816102c2565b92915050565b5f5f604083850312156103025761030161028e565b5b5f61030f858286016102d8565b9250506020610320858286016102d8565b9150509250929050565b610333816102b1565b82525050565b5f60208201905061034c5f83018461032a565b92915050565b60805160a05160c05160e051610100516101205161014051612d506103a35f395f61148601525f61073901525f61071001525f6106e701525f61067501525f61064c01525f6106230152612d505ff3fe60806040526004361061014e575f3560e01c806391e4db78116100b5578063e49617e11161006e578063e49617e11461048b578063e4cc9460146104bb578063e60c3505146104f7578063f2fde38b14610527578063f657b5b21461054f578063fa7828ab1461057757610193565b806391e4db7814610381578063ba78613f146103a9578063c7d980ca146103d3578063ce46e0461461040f578063e2bb114514610439578063e30c39781461046157610193565b8063715018a611610107578063715018a6146102a357806379ba5097146102b9578063889a3531146102cf57806388e5b2d9146102f75780638da5cb5b1461032757806391db0b7e1461035157610193565b806305fa3ac8146101975780630d8e6e2c146101d35780631c592c64146101fd5780634e5ab9491461022757806354fd4d501461025157806367b4136a1461027b57610193565b366101935761015b6105a1565b610191576040517f1574f9f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b5f5ffd5b3480156101a2575f5ffd5b506101bd60048036038101906101b891906120b7565b6105a8565b6040516101ca919061215c565b60405180910390f35b3480156101de575f5ffd5b506101e761061c565b6040516101f491906121e5565b60405180910390f35b348015610208575f5ffd5b506102116106bf565b60405161021e9190612214565b60405180910390f35b348015610232575f5ffd5b5061023b6106cf565b60405161024891906122f5565b60405180910390f35b34801561025c575f5ffd5b506102656106e0565b60405161027291906121e5565b60405180910390f35b348015610286575f5ffd5b506102a1600480360381019061029c9190612396565b610783565b005b3480156102ae575f5ffd5b506102b7610886565b005b3480156102c4575f5ffd5b506102cd610899565b005b3480156102da575f5ffd5b506102f560048036038101906102f09190612396565b610927565b005b610311600480360381019061030c919061248a565b610a8f565b60405161031e9190612517565b60405180910390f35b348015610332575f5ffd5b5061033b610ba2565b604051610348919061253f565b60405180910390f35b61036b6004803603810190610366919061248a565b610bc9565b6040516103789190612517565b60405180910390f35b34801561038c575f5ffd5b506103a760048036038101906103a29190612593565b610cdc565b005b3480156103b4575f5ffd5b506103bd610d7f565b6040516103ca9190612665565b60405180910390f35b3480156103de575f5ffd5b506103f960048036038101906103f491906120b7565b610d90565b6040516104069190612694565b60405180910390f35b34801561041a575f5ffd5b506104236105a1565b6040516104309190612517565b60405180910390f35b348015610444575f5ffd5b5061045f600480360381019061045a9190612593565b610e04565b005b34801561046c575f5ffd5b50610475610f17565b604051610482919061253f565b60405180910390f35b6104a560048036038101906104a091906126d0565b610f3f565b6040516104b29190612517565b60405180910390f35b3480156104c6575f5ffd5b506104e160048036038101906104dc9190612717565b610f59565b6040516104ee9190612517565b60405180910390f35b610511600480360381019061050c91906126d0565b610fab565b60405161051e9190612517565b60405180910390f35b348015610532575f5ffd5b5061054d6004803603810190610548919061276c565b610fc5565b005b34801561055a575f5ffd5b5061057560048036038101906105709190612717565b611071565b005b348015610582575f5ffd5b5061058b611160565b6040516105989190612214565b60405180910390f35b5f5f905090565b5f6105b36002611170565b821061060157816105c46002611170565b6040517f1181dd000000000000000000000000000000000000000000000000000000000081526004016105f8929190612797565b60405180910390fd5b61061582600261118390919063ffffffff16565b9050919050565b60606106477f00000000000000000000000000000000000000000000000000000000000000006111a3565b6106707f00000000000000000000000000000000000000000000000000000000000000006111a3565b6106997f00000000000000000000000000000000000000000000000000000000000000006111a3565b6040516020016106ab93929190612842565b604051602081830303815290604052905090565b5f6106ca6002611170565b905090565b60606106db600461126d565b905090565b606061070b7f00000000000000000000000000000000000000000000000000000000000000006111a3565b6107347f00000000000000000000000000000000000000000000000000000000000000006111a3565b61075d7f00000000000000000000000000000000000000000000000000000000000000006111a3565b60405160200161076f93929190612842565b604051602081830303815290604052905090565b61078b61135a565b61079f8260046113e190919063ffffffff16565b6107e057816040517fb195685e0000000000000000000000000000000000000000000000000000000081526004016107d7919061253f565b60405180910390fd5b8060065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fa2af4c7b2fbf6be440f097b4a6bffa9c4b2273f12e5142eff6f4e065674d59728260405161087a9190612517565b60405180910390a25050565b61088e61135a565b6108975f611417565b565b5f6108a2611447565b90508073ffffffffffffffffffffffffffffffffffffffff166108c3610f17565b73ffffffffffffffffffffffffffffffffffffffff161461091b57806040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610912919061253f565b60405180910390fd5b61092481611417565b50565b61092f61135a565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361099f57816040517fb1588d31000000000000000000000000000000000000000000000000000000008152600401610996919061253f565b60405180910390fd5b6109b382600461144e90919063ffffffff16565b6109f457816040517faa918c230000000000000000000000000000000000000000000000000000000081526004016109eb919061253f565b60405180910390fd5b8060065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fb2223b5747922b851a000893077f89894300287c81dfafd802f4ffef75fb974760405160405180910390a25050565b5f610a98611484565b5f858590509050838390508114610adb576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3490505f5f90505b82811015610b92575f868683818110610b0057610aff612888565b5b90506020020135905082811115610b43576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b71898984818110610b5957610b58612888565b5b9050602002810190610b6b91906128b9565b8261150b565b610b81575f945050505050610b9a565b808303925050806001019050610ae4565b506001925050505b949350505050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f610bd2611484565b5f858590509050838390508114610c15576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3490505f5f90505b82811015610ccc575f868683818110610c3a57610c39612888565b5b90506020020135905082811115610c7d576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cab898984818110610c9357610c92612888565b5b9050602002810190610ca591906128b9565b8261178d565b610cbb575f945050505050610cd4565b808303925050806001019050610c1e565b506001925050505b949350505050565b610ce461135a565b610cf8816002611a1090919063ffffffff16565b610d3957806040517fb1588d31000000000000000000000000000000000000000000000000000000008152600401610d30919061253f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f743b5c0fa172f05b8e8d9307e79c798f39bea2136eae804905cca7b43285e2fa60405160405180910390a250565b6060610d8b6002611a46565b905090565b5f610d9b6004611b33565b8210610de95781610dac6004611b33565b6040517f1181dd00000000000000000000000000000000000000000000000000000000008152600401610de0929190612797565b60405180910390fd5b610dfd826004611b4690919063ffffffff16565b9050919050565b610e0c61135a565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e7c57806040517fb1588d31000000000000000000000000000000000000000000000000000000008152600401610e73919061253f565b60405180910390fd5b610e90816002611b6690919063ffffffff16565b610ed157806040517faa918c23000000000000000000000000000000000000000000000000000000008152600401610ec8919061253f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f31be779d6b17f5e97f997ce93ed74f1a169b63c441a59788481c50dd1430267160405160405180910390a250565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f610f48611484565b610f52823461150b565b9050919050565b5f60065f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b5f610fb4611484565b610fbe823461178d565b9050919050565b610fcd61135a565b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1661102c610ba2565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b61107961135a565b61108d816004611b9c90919063ffffffff16565b6110ce57806040517fb1588d310000000000000000000000000000000000000000000000000000000081526004016110c5919061253f565b60405180910390fd5b60065f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81549060ff02191690558073ffffffffffffffffffffffffffffffffffffffff167f33117cab2b31077c31e4317e07b1c0cb9becd171c5cd7885a66b5165899c604e60405160405180910390a250565b5f61116b6004611b33565b905090565b5f61117c825f01611bd2565b9050919050565b5f61119982845f01611be590919063ffffffff16565b5f1c905092915050565b60605f60016111b184611bfa565b0190505f8167ffffffffffffffff8111156111cf576111ce6128e1565b5b6040519080825280601f01601f1916602001820160405280156112015781602001600182028036833780820191505090505b5090505f82602001820190505b600115611262578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816112575761125661290e565b5b0494505f850361120e575b819350505050919050565b60605f61127b835f01611d4b565b90505f815167ffffffffffffffff811115611299576112986128e1565b5b6040519080825280602002602001820160405280156112c75781602001602082028036833780820191505090505b5090505f5f90505b825181101561134f578281815181106112eb576112ea612888565b5b60200260200101515f1c82828151811061130857611307612888565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506112cf565b508092505050919050565b611362611447565b73ffffffffffffffffffffffffffffffffffffffff16611380610ba2565b73ffffffffffffffffffffffffffffffffffffffff16146113df576113a3611447565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016113d6919061253f565b60405180910390fd5b565b5f61140f8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611d6a90919063ffffffff16565b905092915050565b60015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905561144481611d7f565b50565b5f33905090565b5f61147c8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e4090919063ffffffff16565b905092915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611509576040517f4ca8886700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f5f6115176002611170565b90505f5f90505b818110156115cf5761153a81600261118390919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663587a229686866040518363ffffffff1660e01b8152600401611574929190612c20565b6020604051808303815f875af1158015611590573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115b49190612c62565b6115c2575f92505050611787565b808060010191505061151e565b505f6115db6004611b33565b90505f5f90505b8181101561177f575f6115ff826004611b4690919063ffffffff16565b905060065f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615611708578073ffffffffffffffffffffffffffffffffffffffff1663587a229688886040518363ffffffff1660e01b815260040161168b929190612c20565b5f604051808303815f87803b1580156116a2575f5ffd5b505af19250505080156116b3575060015b611702575f15158173ffffffffffffffffffffffffffffffffffffffff167f7a910e823765957ca8442109225d99d637d0f99ce2a2f8a687a153bb562eb41460405160405180910390a3611703565b5b611771565b8073ffffffffffffffffffffffffffffffffffffffff1663587a229688886040518363ffffffff1660e01b8152600401611743929190612c20565b5f604051808303815f87803b15801561175a575f5ffd5b505af115801561176c573d5f5f3e3d5ffd5b505050505b5080806001019150506115e2565b506001925050505b92915050565b5f5f6117996002611170565b90505f5f90505b81811015611851576117bc81600261118390919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663a01968ee86866040518363ffffffff1660e01b81526004016117f6929190612c20565b6020604051808303815f875af1158015611812573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118369190612c62565b611844575f92505050611a0a565b80806001019150506117a0565b505f61185d6004611b33565b90505f5f90505b81811015611a02575f611881826004611b4690919063ffffffff16565b905060065f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161561198b578073ffffffffffffffffffffffffffffffffffffffff1663a01968ee88886040518363ffffffff1660e01b815260040161190d929190612c20565b5f604051808303815f87803b158015611924575f5ffd5b505af1925050508015611935575060015b61198557600115158173ffffffffffffffffffffffffffffffffffffffff167f7a910e823765957ca8442109225d99d637d0f99ce2a2f8a687a153bb562eb41460405160405180910390a3611986565b5b6119f4565b8073ffffffffffffffffffffffffffffffffffffffff1663a01968ee88886040518363ffffffff1660e01b81526004016119c6929190612c20565b5f604051808303815f87803b1580156119dd575f5ffd5b505af11580156119ef573d5f5f3e3d5ffd5b505050505b508080600101915050611864565b506001925050505b92915050565b5f611a3e8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e5590919063ffffffff16565b905092915050565b60605f611a54835f01611d4b565b90505f815167ffffffffffffffff811115611a7257611a716128e1565b5b604051908082528060200260200182016040528015611aa05781602001602082028036833780820191505090505b5090505f5f90505b8251811015611b2857828181518110611ac457611ac3612888565b5b60200260200101515f1c828281518110611ae157611ae0612888565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611aa8565b508092505050919050565b5f611b3f825f01611bd2565b9050919050565b5f611b5c82845f01611be590919063ffffffff16565b5f1c905092915050565b5f611b948273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e4090919063ffffffff16565b905092915050565b5f611bca8273ffffffffffffffffffffffffffffffffffffffff165f1b845f01611e5590919063ffffffff16565b905092915050565b5f611bde825f01611e6a565b9050919050565b5f611bf2835f0183611e79565b905092915050565b5f5f5f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611c56577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381611c4c57611c4b61290e565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611c93576d04ee2d6d415b85acef81000000008381611c8957611c8861290e565b5b0492506020810190505b662386f26fc100008310611cc257662386f26fc100008381611cb857611cb761290e565b5b0492506010810190505b6305f5e1008310611ceb576305f5e1008381611ce157611ce061290e565b5b0492506008810190505b6127108310611d10576127108381611d0657611d0561290e565b5b0492506004810190505b60648310611d335760648381611d2957611d2861290e565b5b0492506002810190505b600a8310611d42576001810190505b80915050919050565b60605f611d59835f01611ea0565b905060608190508092505050919050565b5f611d77835f0183611ef9565b905092915050565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f611e4d835f0183611f19565b905092915050565b5f611e62835f0183611f80565b905092915050565b5f815f01805490509050919050565b5f825f018281548110611e8f57611e8e612888565b5b905f5260205f200154905092915050565b6060815f01805480602002602001604051908101604052809291908181526020018280548015611eed57602002820191905f5260205f20905b815481526020019060010190808311611ed9575b50505050509050919050565b5f5f836001015f8481526020019081526020015f20541415905092915050565b5f611f248383611ef9565b611f7657825f0182908060018154018082558091505060019003905f5260205f20015f9091909190915055825f0180549050836001015f8481526020019081526020015f208190555060019050611f7a565b5f90505b92915050565b5f5f836001015f8481526020019081526020015f205490505f8114612071575f600182611fad9190612cba565b90505f6001865f0180549050611fc39190612cba565b9050808214612029575f865f018281548110611fe257611fe1612888565b5b905f5260205f200154905080875f01848154811061200357612002612888565b5b905f5260205f20018190555083876001015f8381526020019081526020015f2081905550505b855f0180548061203c5761203b612ced565b5b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050612076565b5f9150505b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b61209681612084565b81146120a0575f5ffd5b50565b5f813590506120b18161208d565b92915050565b5f602082840312156120cc576120cb61207c565b5b5f6120d9848285016120a3565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61212461211f61211a846120e2565b612101565b6120e2565b9050919050565b5f6121358261210a565b9050919050565b5f6121468261212b565b9050919050565b6121568161213c565b82525050565b5f60208201905061216f5f83018461214d565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6121b782612175565b6121c1818561217f565b93506121d181856020860161218f565b6121da8161219d565b840191505092915050565b5f6020820190508181035f8301526121fd81846121ad565b905092915050565b61220e81612084565b82525050565b5f6020820190506122275f830184612205565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f6122608261212b565b9050919050565b61227081612256565b82525050565b5f6122818383612267565b60208301905092915050565b5f602082019050919050565b5f6122a38261222d565b6122ad8185612237565b93506122b883612247565b805f5b838110156122e85781516122cf8882612276565b97506122da8361228d565b9250506001810190506122bb565b5085935050505092915050565b5f6020820190508181035f83015261230d8184612299565b905092915050565b5f61231f826120e2565b9050919050565b5f61233082612315565b9050919050565b61234081612326565b811461234a575f5ffd5b50565b5f8135905061235b81612337565b92915050565b5f8115159050919050565b61237581612361565b811461237f575f5ffd5b50565b5f813590506123908161236c565b92915050565b5f5f604083850312156123ac576123ab61207c565b5b5f6123b98582860161234d565b92505060206123ca85828601612382565b9150509250929050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126123f5576123f46123d4565b5b8235905067ffffffffffffffff811115612412576124116123d8565b5b60208301915083602082028301111561242e5761242d6123dc565b5b9250929050565b5f5f83601f84011261244a576124496123d4565b5b8235905067ffffffffffffffff811115612467576124666123d8565b5b602083019150836020820283011115612483576124826123dc565b5b9250929050565b5f5f5f5f604085870312156124a2576124a161207c565b5b5f85013567ffffffffffffffff8111156124bf576124be612080565b5b6124cb878288016123e0565b9450945050602085013567ffffffffffffffff8111156124ee576124ed612080565b5b6124fa87828801612435565b925092505092959194509250565b61251181612361565b82525050565b5f60208201905061252a5f830184612508565b92915050565b61253981612315565b82525050565b5f6020820190506125525f830184612530565b92915050565b5f61256282612315565b9050919050565b61257281612558565b811461257c575f5ffd5b50565b5f8135905061258d81612569565b92915050565b5f602082840312156125a8576125a761207c565b5b5f6125b58482850161257f565b91505092915050565b5f81519050919050565b5f819050602082019050919050565b6125e08161213c565b82525050565b5f6125f183836125d7565b60208301905092915050565b5f602082019050919050565b5f612613826125be565b61261d8185612237565b9350612628836125c8565b805f5b8381101561265857815161263f88826125e6565b975061264a836125fd565b92505060018101905061262b565b5085935050505092915050565b5f6020820190508181035f83015261267d8184612609565b905092915050565b61268e81612256565b82525050565b5f6020820190506126a75f830184612685565b92915050565b5f5ffd5b5f61014082840312156126c7576126c66126ad565b5b81905092915050565b5f602082840312156126e5576126e461207c565b5b5f82013567ffffffffffffffff81111561270257612701612080565b5b61270e848285016126b1565b91505092915050565b5f6020828403121561272c5761272b61207c565b5b5f6127398482850161234d565b91505092915050565b61274b81612315565b8114612755575f5ffd5b50565b5f8135905061276681612742565b92915050565b5f602082840312156127815761278061207c565b5b5f61278e84828501612758565b91505092915050565b5f6040820190506127aa5f830185612205565b6127b76020830184612205565b9392505050565b5f81905092915050565b5f6127d282612175565b6127dc81856127be565b93506127ec81856020860161218f565b80840191505092915050565b7f2e000000000000000000000000000000000000000000000000000000000000005f82015250565b5f61282c6001836127be565b9150612837826127f8565b600182019050919050565b5f61284d82866127c8565b915061285882612820565b915061286482856127c8565b915061286f82612820565b915061287b82846127c8565b9150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5ffd5b5f82356001610140038336030381126128d5576128d46128b5565b5b80830191505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f819050919050565b61294d8161293b565b8114612957575f5ffd5b50565b5f8135905061296881612944565b92915050565b5f61297c602084018461295a565b905092915050565b61298d8161293b565b82525050565b5f67ffffffffffffffff82169050919050565b6129af81612993565b81146129b9575f5ffd5b50565b5f813590506129ca816129a6565b92915050565b5f6129de60208401846129bc565b905092915050565b6129ef81612993565b82525050565b5f612a036020840184612758565b905092915050565b612a1481612315565b82525050565b5f612a286020840184612382565b905092915050565b612a3981612361565b82525050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83356001602003843603038112612a6757612a66612a47565b5b83810192508235915060208301925067ffffffffffffffff821115612a8f57612a8e612a3f565b5b600182023603831315612aa557612aa4612a43565b5b509250929050565b5f82825260208201905092915050565b828183375f83830152505050565b5f612ad68385612aad565b9350612ae3838584612abd565b612aec8361219d565b840190509392505050565b5f6101408301612b095f84018461296e565b612b155f860182612984565b50612b23602084018461296e565b612b306020860182612984565b50612b3e60408401846129d0565b612b4b60408601826129e6565b50612b5960608401846129d0565b612b6660608601826129e6565b50612b7460808401846129d0565b612b8160808601826129e6565b50612b8f60a084018461296e565b612b9c60a0860182612984565b50612baa60c08401846129f5565b612bb760c0860182612a0b565b50612bc560e08401846129f5565b612bd260e0860182612a0b565b50612be1610100840184612a1a565b612bef610100860182612a30565b50612bfe610120840184612a4b565b858303610120870152612c12838284612acb565b925050508091505092915050565b5f6040820190508181035f830152612c388185612af7565b9050612c476020830184612205565b9392505050565b5f81519050612c5c8161236c565b92915050565b5f60208284031215612c7757612c7661207c565b5b5f612c8484828501612c4e565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612cc482612084565b9150612ccf83612084565b9250828203905081811115612ce757612ce6612c8d565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffdfea2646970667358221220a2d67e05153ad385d721c2dcac352fad055aa9414d800f6ff13ce419dc14a4c164736f6c634300081c0033a2646970667358221220a0c2c32e88d15db5e01c7c667756ac6836aae453e0cffdf243891cc75251ca1e64736f6c634300081c0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x13ad9f9425979Fcce463Fcc35D3b4d1Ea5E6b761
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.