OP Sepolia Testnet

Contract

0x3Cc36538cf53A13AF5C28BB693091e23CF5BB567

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Execute Recovery185836942024-10-15 5:25:28157 days ago1728969928IN
0x3Cc36538...3CF5BB567
0 ETH0.0000002646810.00100025
Schedule Recover...185836862024-10-15 5:25:12157 days ago1728969912IN
0x3Cc36538...3CF5BB567
0 ETH0.0000006582550.00100025
Execute Recovery185786762024-10-15 2:38:12158 days ago1728959892IN
0x3Cc36538...3CF5BB567
0 ETH0.0000010951770.00100025
Schedule Recover...185786672024-10-15 2:37:54158 days ago1728959874IN
0x3Cc36538...3CF5BB567
0 ETH0.0000033682580.00100025
Execute Recovery185418102024-10-14 6:09:20158 days ago1728886160IN
0x3Cc36538...3CF5BB567
0 ETH0.0000003257630.00100026
Schedule Recover...185418032024-10-14 6:09:06158 days ago1728886146IN
0x3Cc36538...3CF5BB567
0 ETH0.0000009159250.00100025
Execute Recovery184169612024-10-11 8:47:42161 days ago1728636462IN
0x3Cc36538...3CF5BB567
0 ETH0.0000005392350.00100026
Schedule Recover...184169532024-10-11 8:47:26161 days ago1728636446IN
0x3Cc36538...3CF5BB567
0 ETH0.0000015779580.00100026
Execute Recovery184169462024-10-11 8:47:12161 days ago1728636432IN
0x3Cc36538...3CF5BB567
0 ETH0.0000005489150.00100026
Schedule Recover...184169402024-10-11 8:47:00161 days ago1728636420IN
0x3Cc36538...3CF5BB567
0 ETH0.0000015717650.00100026
Execute Recovery184168122024-10-11 8:42:44161 days ago1728636164IN
0x3Cc36538...3CF5BB567
0 ETH0.0000006385250.00100026
Schedule Recover...184168042024-10-11 8:42:28161 days ago1728636148IN
0x3Cc36538...3CF5BB567
0 ETH0.0000018446350.00100026
Execute Recovery184056292024-10-11 2:29:58162 days ago1728613798IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000774110.00100028
Schedule Recover...184056202024-10-11 2:29:40162 days ago1728613780IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000706530.00100028
Execute Recovery183710682024-10-10 7:17:56162 days ago1728544676IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000773980.00100028
Schedule Recover...183710612024-10-10 7:17:42162 days ago1728544662IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000706070.00100028
Execute Recovery183646752024-10-10 3:44:50163 days ago1728531890IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000773840.00100027
Schedule Recover...183646662024-10-10 3:44:32163 days ago1728531872IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000705940.00100027
Schedule Recover...183642942024-10-10 3:32:08163 days ago1728531128IN
0x3Cc36538...3CF5BB567
0 ETH0.0000000706060.00100028
Execute Recovery179525222024-09-30 14:46:24172 days ago1727707584IN
0x3Cc36538...3CF5BB567
0 ETH0.0000028417410.00100026
Schedule Recover...179525162024-09-30 14:46:12172 days ago1727707572IN
0x3Cc36538...3CF5BB567
0 ETH0.0000093928910.00100025
Execute Recovery179426642024-09-30 9:17:48172 days ago1727687868IN
0x3Cc36538...3CF5BB567
0 ETH0.0000025237550.00100026
Schedule Recover...179426532024-09-30 9:17:26172 days ago1727687846IN
0x3Cc36538...3CF5BB567
0 ETH0.0000081540450.00100025
Execute Recovery169032472024-09-06 7:50:34196 days ago1725609034IN
0x3Cc36538...3CF5BB567
0 ETH0.0001447150780.00100029
Schedule Recover...169032412024-09-06 7:50:22196 days ago1725609022IN
0x3Cc36538...3CF5BB567
0 ETH0.0006162236560.00100029
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
108046182024-04-18 3:42:56338 days ago1713411776  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SocialRecoveryModule

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 100000 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 30 : SocialRecoveryModule.sol
pragma solidity ^0.8.17;

import "../BaseModule.sol";
import "./base/BaseSocialRecovery.sol";

contract SocialRecoveryModule is BaseModule, BaseSocialRecovery {
    bytes4 private constant _FUNC_RESET_OWNER = bytes4(keccak256("resetOwner(bytes32)"));
    bytes4 private constant _FUNC_RESET_OWNERS = bytes4(keccak256("resetOwners(bytes32[])"));
    mapping(address => bool) walletInited;

    constructor() EIP712("SocialRecovery", "1") {}

    function _deInit() internal override {
        address _sender = sender();
        _clearWalletSocialRecoveryInfo(_sender);
        walletInited[_sender] = false;
    }

    function _init(bytes calldata _data) internal override {
        address _sender = sender();
        (bytes32 guardianHash, uint256 delayPeroid) = abi.decode(_data, (bytes32, uint256));
        _setGuardianHash(_sender, guardianHash);
        _setDelayPeriod(_sender, delayPeroid);
        walletInited[_sender] = true;
    }

    function inited(address wallet) internal view override returns (bool) {
        return walletInited[wallet];
    }

    function requiredFunctions() external pure override returns (bytes4[] memory) {
        bytes4[] memory functions = new bytes4[](2);
        functions[0] = _FUNC_RESET_OWNER;
        functions[1] = _FUNC_RESET_OWNERS;
        return functions;
    }
}

File 2 of 30 : BaseModule.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

import "./interfaces/ISoulWalletModule.sol";
import "./../interfaces/ISoulWallet.sol";

/**
 * @title BaseModule
 * @notice An abstract base contract that provides a foundation for other modules.
 * It ensures the initialization, de-initialization, and proper authorization of modules.
 */
abstract contract BaseModule is ISoulWalletModule {
    event ModuleInit(address indexed wallet);
    event ModuleDeInit(address indexed wallet);
    /**
     * @notice Checks if the module is initialized for a particular wallet.
     * @param wallet Address of the wallet.
     * @return True if the module is initialized, false otherwise.
     */

    function inited(address wallet) internal view virtual returns (bool);
    /**
     * @notice Initialization logic for the module.
     * @param data Initialization data for the module.
     */
    function _init(bytes calldata data) internal virtual;
    /**
     * @notice De-initialization logic for the module.
     */
    function _deInit() internal virtual;
    /**
     * @notice Helper function to get the sender of the transaction.
     * @return Address of the transaction sender.
     */

    function sender() internal view returns (address) {
        return msg.sender;
    }
    /**
     * @notice Initializes the module for a wallet.
     * @param data Initialization data for the module.
     */

    function Init(bytes calldata data) external {
        address _sender = sender();
        if (!inited(_sender)) {
            if (!ISoulWallet(_sender).isInstalledModule(address(this))) {
                revert("not authorized module");
            }
            _init(data);
            emit ModuleInit(_sender);
        }
    }
    /**
     * @notice De-initializes the module for a wallet.
     */

    function DeInit() external {
        address _sender = sender();
        if (inited(_sender)) {
            if (ISoulWallet(_sender).isInstalledModule(address(this))) {
                revert("authorized module");
            }
            _deInit();
            emit ModuleDeInit(_sender);
        }
    }
    /**
     * @notice Verifies if the module supports a specific interface.
     * @param interfaceId ID of the interface to be checked.
     * @return True if the module supports the given interface, false otherwise.
     */

    function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
        return interfaceId == type(ISoulWalletModule).interfaceId || interfaceId == type(IModule).interfaceId;
    }
}

File 3 of 30 : BaseSocialRecovery.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

import "../interfaces/ISocialRecovery.sol";
import "../../../interfaces/ISoulWallet.sol";
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

abstract contract BaseSocialRecovery is ISocialRecovery, EIP712 {
    using ECDSA for bytes32;

    event GuardianSet(address wallet, bytes32 newGuardianHash);
    event DelayPeriodSet(address wallet, uint256 newDelay);
    event RecoveryCancelled(address wallet, bytes32 recoveryId);
    event RecoveryScheduled(address wallet, bytes32 recoveryId, uint256 operationValidTime);
    event RecoveryExecuted(address wallet, bytes32 recoveryId);
    event ApproveHash(address indexed guardian, bytes32 hash);
    event RejectHash(address indexed guardian, bytes32 hash);

    error UNEXPECTED_OPERATION_STATE(address wallet, bytes32 recoveryId, bytes32 expectedStates);
    error HASH_ALREADY_APPROVED();
    error GUARDIAN_SIGNATURE_INVALID();
    error HASH_ALREADY_REJECTED();

    mapping(address => SocialRecoveryInfo) socialRecoveryInfo;
    mapping(bytes32 => uint256) public approvedHashes;
    uint256 internal constant _DONE_TIMESTAMP = uint256(1);

    bytes32 private constant _TYPE_HASH_SOCIAL_RECOVERY =
        keccak256("SocialRecovery(address wallet,uint256 nonce,bytes32[] newOwners)");

    function walletNonce(address wallet) public view override returns (uint256 _nonce) {
        return socialRecoveryInfo[wallet].nonce;
    }

    /**
     * @notice Returns the social recovery information for a given wallet.
     */
    function getSocialRecoveryInfo(address wallet)
        public
        view
        returns (bytes32 guardianHash, uint256 nonce, uint256 delayPeriod)
    {
        return (
            socialRecoveryInfo[wallet].guardianHash,
            socialRecoveryInfo[wallet].nonce,
            socialRecoveryInfo[wallet].delayPeriod
        );
    }

    function getOperationState(address wallet, bytes32 id) public view returns (OperationState) {
        uint256 timestamp = getOperationValidTime(wallet, id);
        if (timestamp == 0) {
            return OperationState.Unset;
        } else if (timestamp == _DONE_TIMESTAMP) {
            return OperationState.Done;
        } else if (timestamp > block.timestamp) {
            return OperationState.Waiting;
        } else {
            return OperationState.Ready;
        }
    }
    /**
     * @dev Returns whether an operation is pending or not. Note that a "pending" operation may also be "ready".
     */

    function isOperationPending(address wallet, bytes32 id) public view returns (bool) {
        OperationState state = getOperationState(wallet, id);
        return state == OperationState.Waiting || state == OperationState.Ready;
    }
    /**
     * @dev Returns whether an operation is ready for execution. Note that a "ready" operation is also "pending".
     */

    function isOperationReady(address wallet, bytes32 id) public view returns (bool) {
        return getOperationState(wallet, id) == OperationState.Ready;
    }
    /**
     * @dev Returns whether an id corresponds to a registered operation. This
     * includes both Waiting, Ready, and Done operations.
     */

    function isOperationSet(address wallet, bytes32 id) public view returns (bool) {
        return getOperationState(wallet, id) != OperationState.Unset;
    }

    function getOperationValidTime(address wallet, bytes32 id) public view returns (uint256) {
        return socialRecoveryInfo[wallet].operationValidAt[id];
    }

    function setGuardian(bytes32 newGuardianHash) external {
        address wallet = _msgSender();
        socialRecoveryInfo[wallet].guardianHash = newGuardianHash;
        _increaseNonce(wallet);
        emit GuardianSet(wallet, newGuardianHash);
    }

    function setDelayPeriod(uint256 newDelay) external {
        address wallet = _msgSender();
        socialRecoveryInfo[wallet].delayPeriod = newDelay;
        _increaseNonce(wallet);
        emit DelayPeriodSet(wallet, newDelay);
    }

    function cancelAllRecovery() external {
        address wallet = _msgSender();
        _increaseNonce(wallet);
        emit RecoveryCancelled(wallet, 0);
    }
    /**
     * @dev Considering that not all contract are EIP-1271 compatible
     */

    function approveHash(bytes32 hash) external {
        bytes32 key = _approveKey(msg.sender, hash);
        if (approvedHashes[key] == 1) {
            revert HASH_ALREADY_APPROVED();
        }
        approvedHashes[key] = 1;
        emit ApproveHash(msg.sender, hash);
    }

    function rejectHash(bytes32 hash) external {
        bytes32 key = _approveKey(msg.sender, hash);
        if (approvedHashes[key] == 0) {
            revert HASH_ALREADY_REJECTED();
        }
        approvedHashes[key] = 0;
        emit RejectHash(msg.sender, hash);
    }

    function scheduleRecovery(
        address wallet,
        bytes32[] calldata newOwners,
        bytes calldata rawGuardian,
        bytes calldata guardianSignature
    ) external override returns (bytes32 recoveryId) {
        recoveryId = hashOperation(wallet, walletNonce(wallet), abi.encode(newOwners));
        if (isOperationSet(wallet, recoveryId)) {
            revert UNEXPECTED_OPERATION_STATE(wallet, recoveryId, _encodeStateBitmap(OperationState.Unset));
        }
        bytes32 guardianHash = _getGuardianHash(rawGuardian);
        _checkGuardianHash(wallet, guardianHash);
        _verifyGuardianSignature(wallet, walletNonce(wallet), newOwners, rawGuardian, guardianSignature);
        uint256 scheduleTime = _setTimeStamp(wallet, recoveryId);
        emit RecoveryScheduled(wallet, recoveryId, scheduleTime);
    }

    function executeRecovery(address wallet, bytes32[] calldata newOwners) external override {
        bytes32 recoveryId = hashOperation(wallet, walletNonce(wallet), abi.encode(newOwners));
        if (!isOperationReady(wallet, recoveryId)) {
            revert UNEXPECTED_OPERATION_STATE(wallet, recoveryId, _encodeStateBitmap(OperationState.Ready));
        }
        _recoveryOwner(wallet, newOwners);

        _setRecoveryDone(wallet, recoveryId);
        _increaseNonce(wallet);
        emit RecoveryExecuted(wallet, recoveryId);
    }

    function _setRecoveryDone(address wallet, bytes32 recoveryId) internal {
        socialRecoveryInfo[wallet].operationValidAt[recoveryId] = _DONE_TIMESTAMP;
    }

    function _recoveryOwner(address wallet, bytes32[] memory newOwners) internal {
        ISoulWallet soulwallet = ISoulWallet(payable(wallet));
        soulwallet.resetOwners(newOwners);
    }

    function _verifyGuardianSignature(
        address wallet,
        uint256 nonce,
        bytes32[] calldata newOwners,
        bytes calldata rawGuardian,
        bytes calldata guardianSignature
    ) internal view {
        bytes32 digest = _hashTypedDataV4(
            keccak256(abi.encode(_TYPE_HASH_SOCIAL_RECOVERY, wallet, nonce, keccak256(abi.encodePacked(newOwners))))
        );
        GuardianData memory guardianData = _parseGuardianData(rawGuardian);
        uint256 guardiansLen = guardianData.guardians.length;

        // for extreme cases
        if (guardianData.threshold > guardiansLen) guardianData.threshold = guardiansLen;

        /*
        keySignature structure:
        ┌──────────────┬──────────────┬──────────────┬──────────────┐
        │              │              │              │              │
        │   signature1 │   signature2 │      ...     │   signatureN │
        │              │              │              │              │
        └──────────────┴──────────────┴──────────────┴──────────────┘

        one signature structure:
        ┌──────────┬──────────────┬──────────┬────────────────┐
        │          │              │          │                │
        │    v     │       s      │   r      │  dynamic data  │
        │  bytes1  │bytes4|bytes32│  bytes32 │     dynamic    │
        │  (must)  │  (optional)  │(optional)│   (optional)   │
        └──────────┴──────────────┴──────────┴────────────────┘

        data logic description:
            v = 0
                EIP-1271 signature
                s: bytes4 Length of signature data
                r: no set
                dynamic data: signature data

            v = 1
                approved hash
                r: no set
                s: no set

            v = 2
                skip
                s: bytes4 skip times
                r: no set

            v > 2
                EOA signature
                r: bytes32
                s: bytes32

        ==============================================================
        Note: Why is the definition of 's' unstable (bytes4|bytes32)?
              If 's' is defined as bytes32, it incurs lower read costs( shr(224, calldataload() -> calldataload() ). However, to prevent arithmetic overflow, all calculations involving 's' need to be protected against overflow, which leads to higher overhead.
              If, in certain cases, 's' is defined as bytes4 (up to 4GB), there is no need to perform overflow prevention under the current known block gas limit.
              Overall, it is more suitable for both Layer1 and Layer2.
     */
        uint8 v;
        uint256 cursor = 0;

        uint256 skipCount = 0;
        uint256 guardianSignatureLen = guardianSignature.length;
        for (uint256 i = 0; i < guardiansLen;) {
            if (cursor >= guardianSignatureLen) break;
            bytes calldata signatures = guardianSignature[cursor:];
            assembly ("memory-safe") {
                v := byte(0, calldataload(signatures.offset))
            }

            if (v == 0) {
                /*
                v = 0
                    EIP-1271 signature
                    s: bytes4 Length of signature data
                    r: no set
                    dynamic data: signature data
             */
                uint256 cursorEnd;
                assembly ("memory-safe") {
                    // read 's' as bytes4
                    let sigLen := shr(224, calldataload(add(signatures.offset, 1)))

                    cursorEnd := add(5, sigLen) // see Note line 223
                    cursor := add(cursor, cursorEnd)
                }

                bytes calldata dynamicData = signatures[5:cursorEnd];
                {
                    (bool success, bytes memory result) = guardianData.guardians[i].staticcall(
                        abi.encodeWithSelector(IERC1271.isValidSignature.selector, digest, dynamicData)
                    );
                    require(
                        success && result.length == 32
                            && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector),
                        "contract signature invalid"
                    );
                }
            } else if (v == 1) {
                /*
                v = 1
                    approved hash
                    r: no set
                    s: no set
             */
                bytes32 key = _approveKey(guardianData.guardians[i], digest);
                require(approvedHashes[key] == 1, "hash not approved");
                unchecked {
                    cursor += 1; // see Note line 223
                }
            } else if (v == 2) {
                /*
                v = 2
                    skip
                    s: bytes4 skip times
                    r: no set
             */
                assembly ("memory-safe") {
                    // read 's' as bytes4
                    let skipTimes := shr(224, calldataload(add(signatures.offset, 1)))

                    i := add(i, skipTimes) // see Note line 223
                    skipCount := add(skipCount, add(skipTimes, 1))
                    cursor := add(cursor, 5)
                }
            } else {
                /*
                v > 2
                    EOA signature
             */
                bytes32 s;
                bytes32 r;
                assembly ("memory-safe") {
                    s := calldataload(add(signatures.offset, 1))
                    r := calldataload(add(signatures.offset, 33))

                    cursor := add(cursor, 65) // see Note line 223
                }
                require(guardianData.guardians[i] == ECDSA.recover(digest, v, r, s), "guardian signature invalid");
            }
            unchecked {
                i++; // see Note line 223
            }
        }
        if (guardiansLen - skipCount < guardianData.threshold) {
            revert GUARDIAN_SIGNATURE_INVALID();
        }
    }

    function _approveKey(address sender, bytes32 hash) private pure returns (bytes32 key) {
        key = keccak256(abi.encode(sender, hash));
    }

    function _checkGuardianHash(address wallet, bytes32 guardianHash) internal view {
        if (socialRecoveryInfo[wallet].guardianHash != guardianHash) {
            revert("Invalid guardian hash");
        }
    }
    /**
     * @notice This function is executed during module uninstallation.
     * @dev Even during uninstallation, the nonce data is not cleared to prevent replay of historical data once reinstall this moudule agian.
     * The nonce is permanently incrementing. Other variables can be reset.
     * @param wallet The address of the wallet for which the social recovery info is to be cleared.
     */

    function _clearWalletSocialRecoveryInfo(address wallet) internal {
        _increaseNonce(wallet);
        socialRecoveryInfo[wallet].guardianHash = bytes32(0);
        socialRecoveryInfo[wallet].delayPeriod = 0;
    }

    function _getGuardianHash(bytes calldata rawGuardian) internal pure returns (bytes32 guardianHash) {
        return keccak256(rawGuardian);
    }

    function _setTimeStamp(address wallet, bytes32 id) internal returns (uint256) {
        uint256 scheduleTime = block.timestamp + socialRecoveryInfo[wallet].delayPeriod;
        socialRecoveryInfo[wallet].operationValidAt[id] = scheduleTime;
        return scheduleTime;
    }

    function _msgSender() internal view virtual returns (address payable) {
        return payable(msg.sender);
    }

    function _increaseNonce(address wallet) internal {
        uint256 _newNonce = walletNonce(wallet) + 1;
        socialRecoveryInfo[wallet].nonce = _newNonce;
    }

    function _setGuardianHash(address wallet, bytes32 guardianHash) internal {
        socialRecoveryInfo[wallet].guardianHash = guardianHash;
    }

    function _setDelayPeriod(address wallet, uint256 delayPeriod) internal {
        socialRecoveryInfo[wallet].delayPeriod = delayPeriod;
    }

    /**
     * @param   wallet  the address to recover
     * @param   nonce  Add a nonce for the hash operation. When recovery is cancelled or the guardian is modified, the nonce can automatically invalidate the previous operation
     * @return  bytes32  return recoveryId
     */
    function hashOperation(address wallet, uint256 nonce, bytes memory data) internal view virtual returns (bytes32) {
        return keccak256(abi.encode(wallet, nonce, data, address(this), block.chainid));
    }

    function _encodeStateBitmap(OperationState operationState) internal pure returns (bytes32) {
        return bytes32(1 << uint8(operationState));
    }

    function _parseGuardianData(bytes calldata rawGuardian) internal pure returns (GuardianData memory) {
        (address[] memory guardians, uint256 threshold, uint256 salt) =
            abi.decode(rawGuardian, (address[], uint256, uint256));
        return GuardianData({guardians: guardians, threshold: threshold, salt: salt});
    }
}

File 4 of 30 : ISoulWalletModule.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;
import {IModule} from "@soulwallet-core/contracts/interface/IModule.sol";

interface ISoulWalletModule is IModule {
    function requiredFunctions() external pure returns (bytes4[] memory);
}

File 5 of 30 : ISoulWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ISoulWalletHookManager} from "../interfaces/ISoulWalletHookManager.sol";
import {ISoulWalletModuleManager} from "../interfaces/ISoulWalletModuleManager.sol";
import {ISoulWalletOwnerManager} from "../interfaces/ISoulWalletOwnerManager.sol";
import {ISoulWalletOwnerManager} from "../interfaces/ISoulWalletOwnerManager.sol";
import {IUpgradable} from "../interfaces/IUpgradable.sol";
import {IStandardExecutor} from "@soulwallet-core/contracts/interface/IStandardExecutor.sol";

interface ISoulWallet is
    ISoulWalletHookManager,
    ISoulWalletModuleManager,
    ISoulWalletOwnerManager,
    IStandardExecutor,
    IUpgradable
{
    function initialize(
        bytes32[] calldata owners,
        address defalutCallbackHandler,
        bytes[] calldata modules,
        bytes[] calldata hooks
    ) external;
}

File 6 of 30 : ISocialRecovery.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

interface ISocialRecovery {
    struct SocialRecoveryInfo {
        bytes32 guardianHash;
        uint256 nonce;
        // id to operation valid time
        mapping(bytes32 id => uint256) operationValidAt;
        uint256 delayPeriod;
    }

    function walletNonce(address wallet) external view returns (uint256 _nonce);

    /**
     * @notice  .
     * @dev     .
     * @param   wallet to recovery
     * @param   newOwners bytes32[] owners
     * @param   rawGuardian abi.encode(GuardianData)
     *  struct GuardianData {
     *     address[] guardians;
     *     uint256 threshold;
     *     uint256 salt;
     * }
     * @param   guardianSignature  .
     * @return  recoveryId  .
     */
    function scheduleRecovery(
        address wallet,
        bytes32[] calldata newOwners,
        bytes calldata rawGuardian,
        bytes calldata guardianSignature
    ) external returns (bytes32 recoveryId);

    function executeRecovery(address wallet, bytes32[] calldata newOwners) external;

    function setGuardian(bytes32 newGuardianHash) external;
    function setDelayPeriod(uint256 newDelay) external;

    enum OperationState {
        Unset,
        Waiting,
        Ready,
        Done
    }

    struct GuardianData {
        address[] guardians;
        uint256 threshold;
        uint256 salt;
    }
}

File 7 of 30 : IERC1271.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

File 8 of 30 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.20;

import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
 * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
 * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
 * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _name which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Name() internal view returns (string memory) {
        return _name.toStringWithFallback(_nameFallback);
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _version which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Version() internal view returns (string memory) {
        return _version.toStringWithFallback(_versionFallback);
    }
}

File 9 of 30 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS
    }

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError, bytes32) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS, s);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature, bytes32(0));
        }

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

File 10 of 30 : IModule.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

interface IModule is IPluggable {
/*
        NOTE: All implemention must ensure that the DeInit() function can be covered by 100,000 gas in all scenarios.
     */
}

File 11 of 30 : ISoulWalletHookManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IHookManager} from "@soulwallet-core/contracts/interface/IHookManager.sol";

interface ISoulWalletHookManager is IHookManager {
    function installHook(bytes calldata hookAndData, uint8 capabilityFlags) external;
}

File 12 of 30 : ISoulWalletModuleManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IModuleManager} from "@soulwallet-core/contracts/interface/IModuleManager.sol";

interface ISoulWalletModuleManager is IModuleManager {
    function installModule(bytes calldata moduleAndData) external;
}

File 13 of 30 : ISoulWalletOwnerManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {IOwnerManager} from "@soulwallet-core/contracts/interface/IOwnerManager.sol";
interface ISoulWalletOwnerManager is IOwnerManager {
    function addOwners(bytes32[] calldata owners) external;
    function resetOwners(bytes32[] calldata newOwners) external;
}

File 14 of 30 : IUpgradable.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

/**
 * @title Upgradable Interface
 * @dev This interface provides functionalities to upgrade the implementation of a contract
 * It emits an event when the implementation is changed, either to a new version or from an old version
 */
interface IUpgradable {
    event Upgraded(address indexed oldImplementation, address indexed newImplementation);

    /**
     * @dev Upgrade the current implementation to the provided new implementation address
     * @param newImplementation The address of the new contract implementation
     */
    function upgradeTo(address newImplementation) external;

    /**
     * @dev Upgrade from the current implementation, given the old implementation address
     * @param oldImplementation The address of the old contract implementation that is being replaced
     */
    function upgradeFrom(address oldImplementation) external;
}

File 15 of 30 : IStandardExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

struct Execution {
    // The target contract for account to execute.
    address target;
    // The value for the execution.
    uint256 value;
    // The call data for the execution.
    bytes data;
}

interface IStandardExecutor {
    /// @dev Standard execute method.
    /// @param target The target contract for account to execute.
    /// @param value The value for the execution.
    /// @param data The call data for the execution.
    function execute(address target, uint256 value, bytes calldata data) external payable;

    /// @dev Standard executeBatch method.
    /// @param executions The array of executions.
    function executeBatch(Execution[] calldata executions) external payable;
}

File 16 of 30 : MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an ERC-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

File 17 of 30 : ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.20;

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

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using
     * {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 18 of 30 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.20;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 19 of 30 : IPluggable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

/**
 * @title Pluggable Interface
 * @dev This interface provides functionalities for initializing and deinitializing wallet-related plugins or modules
 */
interface IPluggable is IERC165 {
    /**
     * @notice Initializes a specific module or plugin for the wallet with the provided data
     * @param data Initialization data required for the module or plugin
     */
    function Init(bytes calldata data) external;

    /*
        NOTE: All implemention must ensure that the DeInit() function can be covered by 100,000 gas in all scenarios.
     */

    /**
     * @notice Deinitializes a specific module or plugin from the wallet
     */
    function DeInit() external;
}

File 20 of 30 : IHookManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

interface IHookManager {
    /**
     * @notice Emitted when a hook is installed
     * @param hook hook
     */
    event HookInstalled(address hook);

    /**
     * @notice Emitted when a hook is uninstalled
     * @param hook hook
     */
    event HookUninstalled(address hook);

    /**
     * @notice Emitted when a hook is uninstalled with error
     * @param hook hook
     */
    event HookUninstalledwithError(address hook);

    function uninstallHook(address hookAddress) external;

    function isInstalledHook(address hook) external view returns (bool);

    function listHook()
        external
        view
        returns (address[] memory preIsValidSignatureHooks, address[] memory preUserOpValidationHooks);
}

File 21 of 30 : IModuleManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

interface IModuleManager {
    /**
     * @notice Emitted when a module is installed
     * @param module module
     */
    event ModuleInstalled(address module);

    /**
     * @notice Emitted when a module is uninstalled
     * @param module module
     */
    event ModuleUninstalled(address module);

    /**
     * @notice Emitted when a module is uninstalled with error
     * @param module module
     */
    event ModuleUninstalledwithError(address module);

    function uninstallModule(address moduleAddress) external;

    function isInstalledModule(address module) external view returns (bool);

    /**
     * @notice Provides a list of all added modules and their respective authorized function selectors
     * @return modules An array of the addresses of all added modules
     * @return selectors A 2D array where each inner array represents the function selectors
     * that the corresponding module in the 'modules' array is allowed to call
     */
    function listModule() external view returns (address[] memory modules, bytes4[][] memory selectors);
    /**
     * @notice Allows a module to execute a function within the system. This ensures that the
     * module can only call functions it is permitted to, based on its declared `requiredFunctions`
     * @param dest The address of the destination contract where the function will be executed
     * @param value The amount of ether (in wei) to be sent with the function call
     * @param func The function data to be executed
     */
    function executeFromModule(address dest, uint256 value, bytes calldata func) external;
}

File 22 of 30 : IOwnerManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

interface IOwnerManager is IOwnable {
    /**
     * @notice Emitted when an owner is added
     * @param owner owner
     */
    event OwnerAdded(bytes32 indexed owner);

    /**
     * @notice Emitted when an owner is removed
     * @param owner owner
     */
    event OwnerRemoved(bytes32 indexed owner);

    /**
     * @notice Emitted when all owners are removed
     */
    event OwnerCleared();

    /**
     * @notice Adds a new owner to the system
     * @param owner The bytes32 ID of the owner to be added
     */
    function addOwner(bytes32 owner) external;

    /**
     * @notice Removes an existing owner from the system
     * @param owner The bytes32 ID of the owner to be removed
     */
    function removeOwner(bytes32 owner) external;

    /**
     * @notice Resets the entire owner set, replacing it with a single new owner
     * @param newOwner The bytes32 ID of the new owner
     */
    function resetOwner(bytes32 newOwner) external;

    /**
     * @notice Provides a list of all added owners
     * @return owners An array of bytes32 IDs representing the owners
     */
    function listOwner() external view returns (bytes32[] memory owners);
}

File 23 of 30 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev String operations.
 */
library Strings {
    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 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;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    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 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));
    }
}

File 24 of 30 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC-1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 25 of 30 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 26 of 30 : IOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

interface IOwnable {
    /**
     * @notice Checks if a given bytes32 ID corresponds to an owner within the system
     * @param owner The bytes32 ID to check
     * @return True if the ID corresponds to an owner, false otherwise
     */
    function isOwner(bytes32 owner) external view returns (bool);
}

File 27 of 30 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.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 Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

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

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            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 a == 0 ? 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
            // 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(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, expect 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 Ferma's little theorem and get the
     * inverse using `Math.modExp(a, n - 2, n)`.
     */
    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 x < 0 ? (n - uint256(-x)) : uint256(x); // Wrap the result if it's negative.
        }
    }

    /**
     * @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 has 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);
        /// @solidity memory-safe-assembly
        assembly {
            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);

        /// @solidity memory-safe-assembly
        assembly {
            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 the middle of that interval minimizes the error.
            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
            // This is going to be our x_0 (and ε_0)
            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)

            // From here, Newton's method give us:
            // x_{n+1} = (x_n + a / x_n) / 2
            //
            // One should note that:
            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
            //              = ((x_n² + a) / (2 * x_n))² - a
            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
            //              = (x_n² - a)² / (2 * x_n)²
            //              = ((x_n² - a) / (2 * x_n))²
            //              ≥ 0
            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
            //
            // This gives us the proof of quadratic convergence of the sequence:
            // ε_{n+1} = | x_{n+1} - sqrt(a) |
            //         = | (x_n + a / x_n) / 2 - sqrt(a) |
            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
            //         = | (x_n - sqrt(a))² / (2 * x_n) |
            //         = | ε_n² / (2 * x_n) |
            //         = ε_n² / | (2 * x_n) |
            //
            // For the first iteration, we have a special case where x_0 is known:
            // ε_1 = ε_0² / | (2 * x_0) |
            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))
            //     ≤ 2**(e-3) / 3
            //     ≤ 2**(e-3-log2(3))
            //     ≤ 2**(e-4.5)
            //
            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
            // ε_{n+1} = ε_n² / | (2 * x_n) |
            //         ≤ (2**(e-k))² / (2 * 2**(e-1))
            //         ≤ 2**(2*e-2*k) / 2**e
            //         ≤ 2**(e-2*k)
            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above
            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5
            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9
            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18
            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36
            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72

            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
            // sqrt(a) or sqrt(a) + 1.
            return xn - SafeCast.toUint(xn > a / xn);
        }
    }

    /**
     * @dev Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        uint256 exp;
        unchecked {
            exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);
            value >>= exp;
            result += exp;

            exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);
            value >>= exp;
            result += exp;

            exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);
            value >>= exp;
            result += exp;

            exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);
            value >>= exp;
            result += exp;

            exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);
            value >>= exp;
            result += exp;

            exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);
            value >>= exp;
            result += exp;

            exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);
            value >>= exp;
            result += exp;

            result += SafeCast.toUint(value > 1);
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        uint256 isGt;
        unchecked {
            isGt = SafeCast.toUint(value > (1 << 128) - 1);
            value >>= isGt * 128;
            result += isGt * 16;

            isGt = SafeCast.toUint(value > (1 << 64) - 1);
            value >>= isGt * 64;
            result += isGt * 8;

            isGt = SafeCast.toUint(value > (1 << 32) - 1);
            value >>= isGt * 32;
            result += isGt * 4;

            isGt = SafeCast.toUint(value > (1 << 16) - 1);
            value >>= isGt * 16;
            result += isGt * 2;

            result += SafeCast.toUint(value > (1 << 8) - 1);
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 28 of 30 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return 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 `bytes(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
            int256 mask = n >> 255;

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

File 29 of 30 : Panic.sol
// SPDX-License-Identifier: MIT

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].
 */
// 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 {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x4e487b71)
            mstore(0x20, code)
            revert(0x1c, 0x24)
        }
    }
}

File 30 of 30 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.20;

/**
 * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeCast {
    /**
     * @dev Value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);

    /**
     * @dev An int value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedIntToUint(int256 value);

    /**
     * @dev Value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);

    /**
     * @dev An uint value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedUintToInt(uint256 value);

    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        if (value > type(uint248).max) {
            revert SafeCastOverflowedUintDowncast(248, value);
        }
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        if (value > type(uint240).max) {
            revert SafeCastOverflowedUintDowncast(240, value);
        }
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        if (value > type(uint232).max) {
            revert SafeCastOverflowedUintDowncast(232, value);
        }
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        if (value > type(uint224).max) {
            revert SafeCastOverflowedUintDowncast(224, value);
        }
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        if (value > type(uint216).max) {
            revert SafeCastOverflowedUintDowncast(216, value);
        }
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        if (value > type(uint208).max) {
            revert SafeCastOverflowedUintDowncast(208, value);
        }
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        if (value > type(uint200).max) {
            revert SafeCastOverflowedUintDowncast(200, value);
        }
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        if (value > type(uint192).max) {
            revert SafeCastOverflowedUintDowncast(192, value);
        }
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        if (value > type(uint184).max) {
            revert SafeCastOverflowedUintDowncast(184, value);
        }
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        if (value > type(uint176).max) {
            revert SafeCastOverflowedUintDowncast(176, value);
        }
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        if (value > type(uint168).max) {
            revert SafeCastOverflowedUintDowncast(168, value);
        }
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        if (value > type(uint160).max) {
            revert SafeCastOverflowedUintDowncast(160, value);
        }
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        if (value > type(uint152).max) {
            revert SafeCastOverflowedUintDowncast(152, value);
        }
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        if (value > type(uint144).max) {
            revert SafeCastOverflowedUintDowncast(144, value);
        }
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        if (value > type(uint136).max) {
            revert SafeCastOverflowedUintDowncast(136, value);
        }
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        if (value > type(uint128).max) {
            revert SafeCastOverflowedUintDowncast(128, value);
        }
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        if (value > type(uint120).max) {
            revert SafeCastOverflowedUintDowncast(120, value);
        }
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        if (value > type(uint112).max) {
            revert SafeCastOverflowedUintDowncast(112, value);
        }
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        if (value > type(uint104).max) {
            revert SafeCastOverflowedUintDowncast(104, value);
        }
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        if (value > type(uint96).max) {
            revert SafeCastOverflowedUintDowncast(96, value);
        }
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        if (value > type(uint88).max) {
            revert SafeCastOverflowedUintDowncast(88, value);
        }
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        if (value > type(uint80).max) {
            revert SafeCastOverflowedUintDowncast(80, value);
        }
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert SafeCastOverflowedUintDowncast(72, value);
        }
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        if (value > type(uint64).max) {
            revert SafeCastOverflowedUintDowncast(64, value);
        }
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        if (value > type(uint56).max) {
            revert SafeCastOverflowedUintDowncast(56, value);
        }
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        if (value > type(uint48).max) {
            revert SafeCastOverflowedUintDowncast(48, value);
        }
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        if (value > type(uint40).max) {
            revert SafeCastOverflowedUintDowncast(40, value);
        }
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        if (value > type(uint32).max) {
            revert SafeCastOverflowedUintDowncast(32, value);
        }
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        if (value > type(uint24).max) {
            revert SafeCastOverflowedUintDowncast(24, value);
        }
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        if (value > type(uint16).max) {
            revert SafeCastOverflowedUintDowncast(16, value);
        }
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        if (value > type(uint8).max) {
            revert SafeCastOverflowedUintDowncast(8, value);
        }
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        if (value < 0) {
            revert SafeCastOverflowedIntToUint(value);
        }
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(248, value);
        }
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(240, value);
        }
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(232, value);
        }
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(224, value);
        }
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(216, value);
        }
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(208, value);
        }
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(200, value);
        }
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(192, value);
        }
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(184, value);
        }
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(176, value);
        }
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(168, value);
        }
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(160, value);
        }
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(152, value);
        }
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(144, value);
        }
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(136, value);
        }
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(128, value);
        }
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(120, value);
        }
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(112, value);
        }
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(104, value);
        }
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(96, value);
        }
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(88, value);
        }
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(80, value);
        }
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(72, value);
        }
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(64, value);
        }
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(56, value);
        }
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(48, value);
        }
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(40, value);
        }
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(32, value);
        }
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(24, value);
        }
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(16, value);
        }
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        if (downcasted != value) {
            revert SafeCastOverflowedIntDowncast(8, value);
        }
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        if (value > uint256(type(int256).max)) {
            revert SafeCastOverflowedUintToInt(value);
        }
        return int256(value);
    }

    /**
     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
     */
    function toUint(bool b) internal pure returns (uint256 u) {
        /// @solidity memory-safe-assembly
        assembly {
            u := iszero(iszero(b))
        }
    }
}

Settings
{
  "remappings": [
    "@soulwallet-core/=lib/soulwallet-core/",
    "@source/=contracts/",
    "@arbitrum/nitro-contracts/=lib/nitro-contracts/",
    "@solady/=lib/solady/",
    "@solenv/=lib/solenv/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@account-abstraction/=lib/account-abstraction/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "account-abstraction/=lib/account-abstraction/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "nitro-contracts/=lib/nitro-contracts/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solady/=lib/solady/src/",
    "solenv/=lib/solenv/",
    "solidity-stringutils/=lib/solenv/lib/solidity-stringutils/",
    "soulwallet-core/=lib/soulwallet-core/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"GUARDIAN_SIGNATURE_INVALID","type":"error"},{"inputs":[],"name":"HASH_ALREADY_APPROVED","type":"error"},{"inputs":[],"name":"HASH_ALREADY_REJECTED","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32","name":"recoveryId","type":"bytes32"},{"internalType":"bytes32","name":"expectedStates","type":"bytes32"}],"name":"UNEXPECTED_OPERATION_STATE","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"guardian","type":"address"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"ApproveHash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"DelayPeriodSet","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"bytes32","name":"newGuardianHash","type":"bytes32"}],"name":"GuardianSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"}],"name":"ModuleDeInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"}],"name":"ModuleInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"bytes32","name":"recoveryId","type":"bytes32"}],"name":"RecoveryCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"bytes32","name":"recoveryId","type":"bytes32"}],"name":"RecoveryExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"bytes32","name":"recoveryId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"operationValidTime","type":"uint256"}],"name":"RecoveryScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"guardian","type":"address"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"RejectHash","type":"event"},{"inputs":[],"name":"DeInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"Init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"approveHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"approvedHashes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelAllRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32[]","name":"newOwners","type":"bytes32[]"}],"name":"executeRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getOperationState","outputs":[{"internalType":"enum ISocialRecovery.OperationState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getOperationValidTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"getSocialRecoveryInfo","outputs":[{"internalType":"bytes32","name":"guardianHash","type":"bytes32"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"delayPeriod","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperationPending","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperationReady","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"isOperationSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"rejectHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requiredFunctions","outputs":[{"internalType":"bytes4[]","name":"","type":"bytes4[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32[]","name":"newOwners","type":"bytes32[]"},{"internalType":"bytes","name":"rawGuardian","type":"bytes"},{"internalType":"bytes","name":"guardianSignature","type":"bytes"}],"name":"scheduleRecovery","outputs":[{"internalType":"bytes32","name":"recoveryId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"setDelayPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newGuardianHash","type":"bytes32"}],"name":"setGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"walletNonce","outputs":[{"internalType":"uint256","name":"_nonce","type":"uint256"}],"stateMutability":"view","type":"function"}]

61016080604052346200015357620000178162000158565b600e8152602081016d536f6369616c5265636f7665727960901b815260405191620000428362000158565b6001835260208301603160f81b81526200005c8262000174565b926101209384526200006e8562000347565b92610140938452519020938460e05251902091610100938385524660a0526040519360208501917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8352604086015260608501524660808501523060a085015260a0845260c084019380851060018060401b038611176200013d57846040525190206080523060c0526122d69384620004f585396080518461203d015260a05184612109015260c0518461200e015260e0518461208c015251836120b2015251826112240152518161124e0152f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b604081019081106001600160401b038211176200013d57604052565b8051602091908281101562000213575090601f825111620001b25780825192015190808310620001a357501790565b82600019910360031b1b161790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b828510620001f9575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620001d5565b6001600160401b0381116200013d576000928354926001938481811c911680156200033c575b838210146200032857601f8111620002f2575b5081601f84116001146200028b575092829391839286946200027f575b50501b916000199060031b1c191617905560ff90565b01519250388062000269565b919083601f1981168780528488209488905b88838310620002d75750505010620002bd575b505050811b01905560ff90565b015160001960f88460031b161c19169055388080620002b0565b8587015188559096019594850194879350908101906200029d565b85805284601f848820920160051c820191601f860160051c015b8281106200031c5750506200024c565b8781550185906200030c565b634e487b7160e01b86526022600452602486fd5b90607f169062000239565b805160209081811015620003d55750601f825111620003745780825192015190808310620001a357501790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b828510620003bb575050604492506000838284010152601f80199101168101030190fd5b848101820151868601604401529381019385935062000397565b9192916001600160401b0381116200013d5760019182548381811c91168015620004e9575b82821014620004d357601f81116200049a575b5080601f83116001146200044d57508192939460009262000441575b5050600019600383901b1c191690821b17905560ff90565b01519050388062000429565b90601f198316958460005282600020926000905b888210620004825750508385969710620002bd57505050811b01905560ff90565b80878596829496860151815501950193019062000461565b8360005283601f83600020920160051c820191601f850160051c015b828110620004c65750506200040d565b60008155018490620004b6565b634e487b7160e01b600052602260045260246000fd5b90607f1690620003fa56fe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a71461192c5750806320f25c4e146118bc5780632d56bdff1461185257806335333ab5146117ec5780633d5721071461176e5780634b8d633a1461171e5780635ae8c30d1461146f5780636d676f0c1461133757806384b0196e146111f057806387bd84cc146111a85780638c1dcf3714610fed5780639315e33514610f725780639eae840a14610f21578063d28a426114610e95578063d394622114610cfe578063d4d9bdcd14610c46578063e3b5747514610b91578063f06646a914610b43578063f6e4013214610ac95763fd58ff22146100fd57600080fd5b34610ac65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576101346119c9565b60243567ffffffffffffffff8111610ac2576101549036906004016119ec565b909260443567ffffffffffffffff8111610abe57610176903690600401611a7b565b9460643567ffffffffffffffff8111610aba57610197903690600401611a7b565b9173ffffffffffffffffffffffffffffffffffffffff871685526002602052610209600160408720015460405190610203826101d78b8760208401611ae2565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283611b5c565b89611cb4565b956102148789611be1565b61021d81611aa9565b610a665761022a89611d6c565b6102376040519182611b5c565b898152368a8701116109c957898660208301378660208b830101526020815191012073ffffffffffffffffffffffffffffffffffffffff891687526002602052604087205403610a085773ffffffffffffffffffffffffffffffffffffffff881686526002602052600160408720015491604051917f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610a0457826102f19260209260051b8091848401378101038084520182611b5c565b60208151910120604051917f599ae64941626c28fb13013916faca3c70dc7c19106400b9bfe4faa0bb442414602084015273ffffffffffffffffffffffffffffffffffffffff8916604084015260608301526080820152608081528060a081011067ffffffffffffffff60a0830111176109d5578060a0604292016040526020815191012061037e611ff7565b90604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522084604080516103bf81611b24565b60608152826020820152015260608489810103126109d15783359367ffffffffffffffff85116109cd57888101601f8683010112156109cd5761040485820135611b9d565b946104126040519687611b5c565b8082013586526020860199820160208284013560051b8385010101116109c957602081830101995b828201803560051b016020018b1061099a575050602095969798506040519461046286611b24565b8086528682013587870152604082013560408701525195869101351161098f575b859283805b8781106105e1575b505050505082039182116105b457602001511161058a5773ffffffffffffffffffffffffffffffffffffffff831681526002602052600360408220015442019081421161055b5783827f983abc34c66accaa22280bf5b810270a09eecd6aa49a131530d9aa3e7552957693604060609473ffffffffffffffffffffffffffffffffffffffff602099168152600289526002828220018882528952205573ffffffffffffffffffffffffffffffffffffffff6040519216825284868301526040820152a1604051908152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60046040517fc8e9d6fe000000000000000000000000000000000000000000000000000000008152fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b8282101561098a578282116109855784820182840381358b1a6107e5576005600183013560e01c94850181019481019081106107e157116107ca5789809173ffffffffffffffffffffffffffffffffffffffff61063f858c51611bb5565b51166106e4604051927f1626ba7e00000000000000000000000000000000000000000000000000000000602085015289602485015260406044850152600181013560e01c6064850152837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60016084948181013560e01c600582018787013789868383013560e01c87010152013560e01c01168101036064810185520183611b5c565b602082519201905afa3d156107da573d6106fd81611d6c565b9061070b6040519283611b5c565b81523d8b602083013e5b816107ce575b8161078f575b5015610731576001905b01610488565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f636f6e7472616374207369676e617475726520696e76616c69640000000000006044820152fd5b90506020818051810103126107ca57602001517f1626ba7e000000000000000000000000000000000000000000000000000000001438610721565b8980fd5b8051602014915061071b565b6060610715565b8b80fd5b5090919080358a1a60010361089c57506108208473ffffffffffffffffffffffffffffffffffffffff610819858b51611bb5565b5116611d34565b89526003602052600160408a20540361083e5760018091019161072b565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f68617368206e6f7420617070726f7665640000000000000000000000000000006044820152fd5b90959190878a8235811a6002036108ca5750506001809281600593013560e01c80910194010196019161072b565b6109106109199173ffffffffffffffffffffffffffffffffffffffff6108f887604183979a9e019951611bb5565b51169460018101359160218201359135901a8a61212f565b909291926121cc565b16036109275760019061072b565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f677561726469616e207369676e617475726520696e76616c69640000000000006044820152fd5b600080fd5b610490565b846020850152610483565b8a359073ffffffffffffffffffffffffffffffffffffffff821682036109855790815260209a8b019a0161043a565b8680fd5b8580fd5b8480fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8780fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e76616c696420677561726469616e206861736800000000000000000000006044820152fd5b6064888873ffffffffffffffffffffffffffffffffffffffff604051927f7f3e3c21000000000000000000000000000000000000000000000000000000008452166004830152602482015260016044820152fd5b8380fd5b5080fd5b8280fd5b80fd5b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576020610b0f610b066119c9565b60243590611be1565b610b1881611aa9565b60018114908115610b2f575b506040519015158152f35b60029150610b3c81611aa9565b1482610b24565b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576020610b80610b066119c9565b60405190610b8d81611aa9565b8152f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657600435610bce8133611d34565b8083526003602052604083205415610c1c57825260036020528160408120556040519081527f0bf1866921252df0579b89b031a745845f96ed91273831a897ff6b6c23b2862260203392a280f35b60046040517ff93f5f93000000000000000000000000000000000000000000000000000000008152fd5b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657600435610c838133611d34565b80835260036020526001604084205414610cd45782526003602052600160408320556040519081527f02a62c535e077f15ec58ff8440ddeb490c3fc2f86c7dedc590799eab2835cbeb60203392a280f35b60046040517ff934c05f000000000000000000000000000000000000000000000000000000008152fd5b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac65733815260206004815260ff604083205416610d46575080f35b6040517f68d547d20000000000000000000000000000000000000000000000000000000081523060048201528181602481335afa908115610e8a578391610e5d575b50610dff57600490610d9933611c42565b3383526002815282600360408220828155015552604081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008154169055337fc40cdf4341ec984cbdf8ee01d99ea3a417537c7d76f069c9c44e0a613c1a8aab8280a280f35b606490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601160248201527f617574686f72697a6564206d6f64756c650000000000000000000000000000006044820152fd5b610e7d9150823d8411610e83575b610e758183611b5c565b810190611bc9565b38610d88565b503d610e6b565b6040513d85823e3d90fd5b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6577f9cfb9082b62f5704fec00986155b73acbc488b3e2277769e2ec4e6e9e3ccb225610f1b6004353384526002602052806040852055610f0333611c42565b60408051338152602081019290925290918291820190565b0390a180f35b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576020610f5e610b066119c9565b610f6781611aa9565b600260405191148152f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657604060609173ffffffffffffffffffffffffffffffffffffffff610fc46119c9565b168152600260205220805490600360018201549101549060405192835260208301526040820152f35b5034610ac6576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610abe5760043567ffffffffffffffff8111610ac25761103e903690600401611a7b565b9190913384526004825260ff60408520541615611059578380f35b6040517f68d547d20000000000000000000000000000000000000000000000000000000081523060048201528281602481335afa90811561119d578591611180575b5015611122578260409181010312610ac257600491338452600282526003826040862092803584550135910155526040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055337fcdddfb4e53d2f7d725fae607b33383443789359047546dbdbd01f85d21adf61c8280a23880808380f35b606482604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601560248201527f6e6f7420617574686f72697a6564206d6f64756c6500000000000000000000006044820152fd5b6111979150833d8511610e8357610e758183611b5c565b3861109b565b6040513d87823e3d90fd5b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac65760406020916004358152600383522054604051908152f35b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576112487f0000000000000000000000000000000000000000000000000000000000000000611da6565b906112727f0000000000000000000000000000000000000000000000000000000000000000611f1e565b9060405190602090602083019383851067ffffffffffffffff8611176109d55792849260206112ed88966112df986040528585526040519889987f0f000000000000000000000000000000000000000000000000000000000000008a5260e0858b015260e08a0190611a1d565b9088820360408a0152611a1d565b924660608801523060808801528460a088015286840360c088015251928381520193925b82811061132057505050500390f35b835185528695509381019392810192600101611311565b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576040519061137382611b24565b6002825260209160208101906040368337805115611440577f6df3948700000000000000000000000000000000000000000000000000000000825280519360019460011015611440579192817ffc63e00e0000000000000000000000000000000000000000000000000000000060408794015260405193602085019160208652518092526040850195925b82811061140b5785870386f35b83517fffffffff00000000000000000000000000000000000000000000000000000000168752958101959281019284016113fe565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576114a76119c9565b67ffffffffffffffff90602435828111610aba576114c99036906004016119ec565b91909273ffffffffffffffffffffffffffffffffffffffff82169384865260209160028352600194611517600160408a20015460405190611511826101d786898b8401611ae2565b87611cb4565b9560026115248888611be1565b61152d81611aa9565b036116e05761153b82611b9d565b936115496040519586611b5c565b828552858501809360051b8201913683116107e1578790915b8383106116d05750505050873b156116cc576040517ffc63e00e00000000000000000000000000000000000000000000000000000000815260048101869052935160248501819052899285926044840192855b898282106116b357505050505081900381838a5af180156116a85761164b575b50507fa7bff9a0bd8a845247607f620dd86270e8e2b5b5568de684b6ca5df8294f5380938552600281526002604086200190838652526001604085205561161b81611c42565b6040805173ffffffffffffffffffffffffffffffffffffffff909216825260208201929092529081908101610f1b565b811161167b576040527fa7bff9a0bd8a845247607f620dd86270e8e2b5b5568de684b6ca5df8294f5380386115d5565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b6040513d89823e3d90fd5b845186528e9750899650948501949093019282016115b5565b8880fd5b8235815291810191889101611562565b60648888604051917f7f3e3c210000000000000000000000000000000000000000000000000000000083526004830152602482015260046044820152fd5b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657602061175b610b066119c9565b61176481611aa9565b6040519015158152f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6577ff6e4433c2288422e1dbe0e65936652be292eff737c461d04c14ff55935da84686040600435338452600260205280600383862001556117dd33611c42565b8151903382526020820152a180f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576001604060209273ffffffffffffffffffffffffffffffffffffffff6118406119c9565b16815260028452200154604051908152f35b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac65761188a33611c42565b7f5ec34f3f384538319a5eb81bc3f45fb37b28d5e456474f7a62318ef7a713094960408051338152836020820152a180f35b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657604060209173ffffffffffffffffffffffffffffffffffffffff61190e6119c9565b16815260028352600282822001602435825283522054604051908152f35b905034610abe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610abe576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103610ac257602092507f6d676f0c0000000000000000000000000000000000000000000000000000000081149081156119c0575b5015158152f35b905015386119b9565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361098557565b9181601f840112156109855782359167ffffffffffffffff8311610985576020808501948460051b01011161098557565b919082519283825260005b848110611a675750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201611a28565b9181601f840112156109855782359167ffffffffffffffff8311610985576020838186019501011161098557565b60041115611ab357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b602081528260208201527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116109855760409260051b809284830137010190565b6060810190811067ffffffffffffffff8211176109d557604052565b6040810190811067ffffffffffffffff8211176109d557604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109d557604052565b67ffffffffffffffff81116109d55760051b60200190565b80518210156114405760209160051b010190565b90816020910312610985575180151581036109855790565b73ffffffffffffffffffffffffffffffffffffffff1660005260026020526002604060002001906000526020526040600020548015600014611c235750600090565b60018103611c315750600390565b421015611c3d57600190565b600290565b73ffffffffffffffffffffffffffffffffffffffff166000818152600260205260016040822001549160018301809311611c8757815260026020526040902060010155565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b9190611d2e90611cf660405193849273ffffffffffffffffffffffffffffffffffffffff6020850197168752604084015260a0606084015260c0830190611a1d565b3060808301524660a0830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282611b5c565b51902090565b6040805173ffffffffffffffffffffffffffffffffffffffff9290921660208301908152828201939093528152611d2e606082611b5c565b67ffffffffffffffff81116109d557601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60ff8114611dfc5760ff811690601f8211611dd25760405191611dc883611b40565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600080549060018260011c9060018416938415611f14575b6020948584108114611ee75783875286949392918115611ea85750600114611e4c575b5050611e4992500382611b5c565b90565b60008080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56395935091905b818310611e90575050611e4993508201013880611e3b565b85548784018501529485019486945091830191611e78565b9050611e499593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201013880611e3b565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526022600452fd5b91607f1691611e18565b60ff8114611f405760ff811690601f8211611dd25760405191611dc883611b40565b506040516000600190600154918260011c9060018416938415611fed575b6020948584108114611ee75783875286949392918115611ea85750600114611f8e575050611e4992500382611b5c565b9093915060016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6936000915b818310611fd5575050611e4993508201013880611e3b565b85548784018501529485019486945091830191611fbd565b91607f1691611f5e565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016301480612106575b1561205f577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176109d55760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614612036565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084116121c057926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa156121b457805173ffffffffffffffffffffffffffffffffffffffff8116156121ab57918190565b50809160019190565b604051903d90823e3d90fd5b50505060009160039190565b6121d581611aa9565b806121de575050565b6121e781611aa9565b600181036122195760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b61222281611aa9565b6002810361225b57602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b80612267600392611aa9565b1461226f5750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fdfea26469706673582212203e99f8b4cac6a03a34e009897e89691547fe87660614e9f5074fc082fa0837d864736f6c63430008170033

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a71461192c5750806320f25c4e146118bc5780632d56bdff1461185257806335333ab5146117ec5780633d5721071461176e5780634b8d633a1461171e5780635ae8c30d1461146f5780636d676f0c1461133757806384b0196e146111f057806387bd84cc146111a85780638c1dcf3714610fed5780639315e33514610f725780639eae840a14610f21578063d28a426114610e95578063d394622114610cfe578063d4d9bdcd14610c46578063e3b5747514610b91578063f06646a914610b43578063f6e4013214610ac95763fd58ff22146100fd57600080fd5b34610ac65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576101346119c9565b60243567ffffffffffffffff8111610ac2576101549036906004016119ec565b909260443567ffffffffffffffff8111610abe57610176903690600401611a7b565b9460643567ffffffffffffffff8111610aba57610197903690600401611a7b565b9173ffffffffffffffffffffffffffffffffffffffff871685526002602052610209600160408720015460405190610203826101d78b8760208401611ae2565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283611b5c565b89611cb4565b956102148789611be1565b61021d81611aa9565b610a665761022a89611d6c565b6102376040519182611b5c565b898152368a8701116109c957898660208301378660208b830101526020815191012073ffffffffffffffffffffffffffffffffffffffff891687526002602052604087205403610a085773ffffffffffffffffffffffffffffffffffffffff881686526002602052600160408720015491604051917f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610a0457826102f19260209260051b8091848401378101038084520182611b5c565b60208151910120604051917f599ae64941626c28fb13013916faca3c70dc7c19106400b9bfe4faa0bb442414602084015273ffffffffffffffffffffffffffffffffffffffff8916604084015260608301526080820152608081528060a081011067ffffffffffffffff60a0830111176109d5578060a0604292016040526020815191012061037e611ff7565b90604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522084604080516103bf81611b24565b60608152826020820152015260608489810103126109d15783359367ffffffffffffffff85116109cd57888101601f8683010112156109cd5761040485820135611b9d565b946104126040519687611b5c565b8082013586526020860199820160208284013560051b8385010101116109c957602081830101995b828201803560051b016020018b1061099a575050602095969798506040519461046286611b24565b8086528682013587870152604082013560408701525195869101351161098f575b859283805b8781106105e1575b505050505082039182116105b457602001511161058a5773ffffffffffffffffffffffffffffffffffffffff831681526002602052600360408220015442019081421161055b5783827f983abc34c66accaa22280bf5b810270a09eecd6aa49a131530d9aa3e7552957693604060609473ffffffffffffffffffffffffffffffffffffffff602099168152600289526002828220018882528952205573ffffffffffffffffffffffffffffffffffffffff6040519216825284868301526040820152a1604051908152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60046040517fc8e9d6fe000000000000000000000000000000000000000000000000000000008152fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b8282101561098a578282116109855784820182840381358b1a6107e5576005600183013560e01c94850181019481019081106107e157116107ca5789809173ffffffffffffffffffffffffffffffffffffffff61063f858c51611bb5565b51166106e4604051927f1626ba7e00000000000000000000000000000000000000000000000000000000602085015289602485015260406044850152600181013560e01c6064850152837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60016084948181013560e01c600582018787013789868383013560e01c87010152013560e01c01168101036064810185520183611b5c565b602082519201905afa3d156107da573d6106fd81611d6c565b9061070b6040519283611b5c565b81523d8b602083013e5b816107ce575b8161078f575b5015610731576001905b01610488565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f636f6e7472616374207369676e617475726520696e76616c69640000000000006044820152fd5b90506020818051810103126107ca57602001517f1626ba7e000000000000000000000000000000000000000000000000000000001438610721565b8980fd5b8051602014915061071b565b6060610715565b8b80fd5b5090919080358a1a60010361089c57506108208473ffffffffffffffffffffffffffffffffffffffff610819858b51611bb5565b5116611d34565b89526003602052600160408a20540361083e5760018091019161072b565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f68617368206e6f7420617070726f7665640000000000000000000000000000006044820152fd5b90959190878a8235811a6002036108ca5750506001809281600593013560e01c80910194010196019161072b565b6109106109199173ffffffffffffffffffffffffffffffffffffffff6108f887604183979a9e019951611bb5565b51169460018101359160218201359135901a8a61212f565b909291926121cc565b16036109275760019061072b565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f677561726469616e207369676e617475726520696e76616c69640000000000006044820152fd5b600080fd5b610490565b846020850152610483565b8a359073ffffffffffffffffffffffffffffffffffffffff821682036109855790815260209a8b019a0161043a565b8680fd5b8580fd5b8480fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8780fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e76616c696420677561726469616e206861736800000000000000000000006044820152fd5b6064888873ffffffffffffffffffffffffffffffffffffffff604051927f7f3e3c21000000000000000000000000000000000000000000000000000000008452166004830152602482015260016044820152fd5b8380fd5b5080fd5b8280fd5b80fd5b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576020610b0f610b066119c9565b60243590611be1565b610b1881611aa9565b60018114908115610b2f575b506040519015158152f35b60029150610b3c81611aa9565b1482610b24565b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576020610b80610b066119c9565b60405190610b8d81611aa9565b8152f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657600435610bce8133611d34565b8083526003602052604083205415610c1c57825260036020528160408120556040519081527f0bf1866921252df0579b89b031a745845f96ed91273831a897ff6b6c23b2862260203392a280f35b60046040517ff93f5f93000000000000000000000000000000000000000000000000000000008152fd5b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657600435610c838133611d34565b80835260036020526001604084205414610cd45782526003602052600160408320556040519081527f02a62c535e077f15ec58ff8440ddeb490c3fc2f86c7dedc590799eab2835cbeb60203392a280f35b60046040517ff934c05f000000000000000000000000000000000000000000000000000000008152fd5b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac65733815260206004815260ff604083205416610d46575080f35b6040517f68d547d20000000000000000000000000000000000000000000000000000000081523060048201528181602481335afa908115610e8a578391610e5d575b50610dff57600490610d9933611c42565b3383526002815282600360408220828155015552604081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008154169055337fc40cdf4341ec984cbdf8ee01d99ea3a417537c7d76f069c9c44e0a613c1a8aab8280a280f35b606490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601160248201527f617574686f72697a6564206d6f64756c650000000000000000000000000000006044820152fd5b610e7d9150823d8411610e83575b610e758183611b5c565b810190611bc9565b38610d88565b503d610e6b565b6040513d85823e3d90fd5b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6577f9cfb9082b62f5704fec00986155b73acbc488b3e2277769e2ec4e6e9e3ccb225610f1b6004353384526002602052806040852055610f0333611c42565b60408051338152602081019290925290918291820190565b0390a180f35b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576020610f5e610b066119c9565b610f6781611aa9565b600260405191148152f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657604060609173ffffffffffffffffffffffffffffffffffffffff610fc46119c9565b168152600260205220805490600360018201549101549060405192835260208301526040820152f35b5034610ac6576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610abe5760043567ffffffffffffffff8111610ac25761103e903690600401611a7b565b9190913384526004825260ff60408520541615611059578380f35b6040517f68d547d20000000000000000000000000000000000000000000000000000000081523060048201528281602481335afa90811561119d578591611180575b5015611122578260409181010312610ac257600491338452600282526003826040862092803584550135910155526040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055337fcdddfb4e53d2f7d725fae607b33383443789359047546dbdbd01f85d21adf61c8280a23880808380f35b606482604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601560248201527f6e6f7420617574686f72697a6564206d6f64756c6500000000000000000000006044820152fd5b6111979150833d8511610e8357610e758183611b5c565b3861109b565b6040513d87823e3d90fd5b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac65760406020916004358152600383522054604051908152f35b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576112487f536f6369616c5265636f7665727900000000000000000000000000000000000e611da6565b906112727f3100000000000000000000000000000000000000000000000000000000000001611f1e565b9060405190602090602083019383851067ffffffffffffffff8611176109d55792849260206112ed88966112df986040528585526040519889987f0f000000000000000000000000000000000000000000000000000000000000008a5260e0858b015260e08a0190611a1d565b9088820360408a0152611a1d565b924660608801523060808801528460a088015286840360c088015251928381520193925b82811061132057505050500390f35b835185528695509381019392810192600101611311565b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576040519061137382611b24565b6002825260209160208101906040368337805115611440577f6df3948700000000000000000000000000000000000000000000000000000000825280519360019460011015611440579192817ffc63e00e0000000000000000000000000000000000000000000000000000000060408794015260405193602085019160208652518092526040850195925b82811061140b5785870386f35b83517fffffffff00000000000000000000000000000000000000000000000000000000168752958101959281019284016113fe565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576114a76119c9565b67ffffffffffffffff90602435828111610aba576114c99036906004016119ec565b91909273ffffffffffffffffffffffffffffffffffffffff82169384865260209160028352600194611517600160408a20015460405190611511826101d786898b8401611ae2565b87611cb4565b9560026115248888611be1565b61152d81611aa9565b036116e05761153b82611b9d565b936115496040519586611b5c565b828552858501809360051b8201913683116107e1578790915b8383106116d05750505050873b156116cc576040517ffc63e00e00000000000000000000000000000000000000000000000000000000815260048101869052935160248501819052899285926044840192855b898282106116b357505050505081900381838a5af180156116a85761164b575b50507fa7bff9a0bd8a845247607f620dd86270e8e2b5b5568de684b6ca5df8294f5380938552600281526002604086200190838652526001604085205561161b81611c42565b6040805173ffffffffffffffffffffffffffffffffffffffff909216825260208201929092529081908101610f1b565b811161167b576040527fa7bff9a0bd8a845247607f620dd86270e8e2b5b5568de684b6ca5df8294f5380386115d5565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b6040513d89823e3d90fd5b845186528e9750899650948501949093019282016115b5565b8880fd5b8235815291810191889101611562565b60648888604051917f7f3e3c210000000000000000000000000000000000000000000000000000000083526004830152602482015260046044820152fd5b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657602061175b610b066119c9565b61176481611aa9565b6040519015158152f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6577ff6e4433c2288422e1dbe0e65936652be292eff737c461d04c14ff55935da84686040600435338452600260205280600383862001556117dd33611c42565b8151903382526020820152a180f35b5034610ac65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac6576001604060209273ffffffffffffffffffffffffffffffffffffffff6118406119c9565b16815260028452200154604051908152f35b5034610ac657807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac65761188a33611c42565b7f5ec34f3f384538319a5eb81bc3f45fb37b28d5e456474f7a62318ef7a713094960408051338152836020820152a180f35b5034610ac65760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610ac657604060209173ffffffffffffffffffffffffffffffffffffffff61190e6119c9565b16815260028352600282822001602435825283522054604051908152f35b905034610abe5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610abe576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103610ac257602092507f6d676f0c0000000000000000000000000000000000000000000000000000000081149081156119c0575b5015158152f35b905015386119b9565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361098557565b9181601f840112156109855782359167ffffffffffffffff8311610985576020808501948460051b01011161098557565b919082519283825260005b848110611a675750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201611a28565b9181601f840112156109855782359167ffffffffffffffff8311610985576020838186019501011161098557565b60041115611ab357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b602081528260208201527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116109855760409260051b809284830137010190565b6060810190811067ffffffffffffffff8211176109d557604052565b6040810190811067ffffffffffffffff8211176109d557604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109d557604052565b67ffffffffffffffff81116109d55760051b60200190565b80518210156114405760209160051b010190565b90816020910312610985575180151581036109855790565b73ffffffffffffffffffffffffffffffffffffffff1660005260026020526002604060002001906000526020526040600020548015600014611c235750600090565b60018103611c315750600390565b421015611c3d57600190565b600290565b73ffffffffffffffffffffffffffffffffffffffff166000818152600260205260016040822001549160018301809311611c8757815260026020526040902060010155565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b9190611d2e90611cf660405193849273ffffffffffffffffffffffffffffffffffffffff6020850197168752604084015260a0606084015260c0830190611a1d565b3060808301524660a0830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282611b5c565b51902090565b6040805173ffffffffffffffffffffffffffffffffffffffff9290921660208301908152828201939093528152611d2e606082611b5c565b67ffffffffffffffff81116109d557601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60ff8114611dfc5760ff811690601f8211611dd25760405191611dc883611b40565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600080549060018260011c9060018416938415611f14575b6020948584108114611ee75783875286949392918115611ea85750600114611e4c575b5050611e4992500382611b5c565b90565b60008080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56395935091905b818310611e90575050611e4993508201013880611e3b565b85548784018501529485019486945091830191611e78565b9050611e499593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201013880611e3b565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526022600452fd5b91607f1691611e18565b60ff8114611f405760ff811690601f8211611dd25760405191611dc883611b40565b506040516000600190600154918260011c9060018416938415611fed575b6020948584108114611ee75783875286949392918115611ea85750600114611f8e575050611e4992500382611b5c565b9093915060016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6936000915b818310611fd5575050611e4993508201013880611e3b565b85548784018501529485019486945091830191611fbd565b91607f1691611f5e565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000003cc36538cf53a13af5c28bb693091e23cf5bb56716301480612106575b1561205f577fb52552ce7d8a33e783c11664d30c500fe99e495056c0b1e69400026adabfbc6c90565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527fad4b5d7dfa19f68d355e3bb5addbac9b388e8c17194aa70a85619c87e84af9eb60408201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176109d55760405251902090565b507f0000000000000000000000000000000000000000000000000000000000aa37dc4614612036565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084116121c057926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa156121b457805173ffffffffffffffffffffffffffffffffffffffff8116156121ab57918190565b50809160019190565b604051903d90823e3d90fd5b50505060009160039190565b6121d581611aa9565b806121de575050565b6121e781611aa9565b600181036122195760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b61222281611aa9565b6002810361225b57602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b80612267600392611aa9565b1461226f5750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fdfea26469706673582212203e99f8b4cac6a03a34e009897e89691547fe87660614e9f5074fc082fa0837d864736f6c63430008170033

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
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.