false
true
0

Contract Address Details

0x0B42393d4DBA08892d339b32Cd3064248003f11a

Contract Name
Escrow
Creator
0xc3c7e0–8a5d11 at 0x12af4f–6e9de7
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
5 Transactions
Transfers
0 Transfers
Gas Used
0
Last Balance Update
25958198
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
Escrow




Optimization enabled
true
Compiler version
v0.8.18+commit.87f61d96




Optimization runs
200
EVM Version
default




Verified at
2026-01-12T22:06:41.965403Z

Constructor Arguments

0x000000000000000000000000c3c7e05d1ba19563693d891e5c38f0fc988a5d1100000000000000000000000000000000000000000000000000000000000001710000000000000000000000006a4ff1950be05995dee75920cf27cd8febb6597a000000000000000000000000948eb6d3a08beb29dc1d08d09753862573a9412200000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000015180

Arg [0] (address) : 0xc3c7e05d1ba19563693d891e5c38f0fc988a5d11
Arg [1] (uint256) : 369
Arg [2] (address) : 0x6a4ff1950be05995dee75920cf27cd8febb6597a
Arg [3] (address) : 0x948eb6d3a08beb29dc1d08d09753862573a94122
Arg [4] (uint256) : 100000
Arg [5] (uint256) : 200
Arg [6] (uint256) : 86400

              

contracts/Escrow.sol

//SPDX-License-Identifier: MIT

import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import { AddressArrayUtils } from "./external/AddressArrayUtils.sol";
import { Bytes32ArrayUtils } from "./external/Bytes32ArrayUtils.sol";
import { StringArrayUtils } from "./external/StringArrayUtils.sol";
import { Uint256ArrayUtils } from "./external/Uint256ArrayUtils.sol";

import { IEscrow } from "./interfaces/IEscrow.sol";
import { IOrchestrator } from "./interfaces/IOrchestrator.sol";
import { IPostIntentHook } from "./interfaces/IPostIntentHook.sol";
import { IPaymentVerifier } from "./interfaces/IPaymentVerifier.sol";
import { IPaymentVerifierRegistry } from "./interfaces/IPaymentVerifierRegistry.sol";
import { IPostIntentHookRegistry } from "./interfaces/IPostIntentHookRegistry.sol";
import { IRelayerRegistry } from "./interfaces/IRelayerRegistry.sol";
pragma solidity ^0.8.18;

/**
 * @title Escrow
 * @notice Escrows deposits and manages deposit lifecycle.
 */
contract Escrow is Ownable, Pausable, ReentrancyGuard, IEscrow {

    using AddressArrayUtils for address[];
    using Bytes32ArrayUtils for bytes32[];
    using ECDSA for bytes32;
    using SafeERC20 for IERC20;
    using SignatureChecker for address;
    using StringArrayUtils for string[];
    using Uint256ArrayUtils for uint256[];

    /* ============ Constants ============ */
    uint256 internal constant PRECISE_UNIT = 1e18;
    uint256 internal constant MAX_DUST_THRESHOLD = 1e6;            // 1 USDC
    uint256 internal constant MAX_TOTAL_INTENT_EXPIRATION_PERIOD = 86400 * 5; // 5 days
    uint256 internal constant PRUNE_ALL_EXPIRED_INTENTS = type(uint256).max;
    
    /* ============ State Variables ============ */

    IOrchestrator public orchestrator;                               // Address of the orchestrator contract
    IPaymentVerifierRegistry public paymentVerifierRegistry;         // Address of the payment verifier registry contract
    uint256 immutable public chainId;                                // chainId of the chain the escrow is deployed on

    mapping(address => uint256[]) internal accountDeposits;          // Mapping of address to depositIds

    // Mapping of depositId to verifier address to deposit's verification data. A single deposit can support multiple payment 
    // services. Each payment service has it's own verification data which includes the payee details hash and the data used for 
    // payment verification.
    // Example: Deposit 1 => Venmo => payeeDetails: 0x123, data: 0x456
    //                    => Revolut => payeeDetails: 0x789, data: 0xabc
    mapping(uint256 => mapping(bytes32 => DepositPaymentMethodData)) internal depositPaymentMethodData;
    mapping(uint256 => bytes32[]) internal depositPaymentMethods;          // Handy mapping to get all payment methods for a deposit
    mapping(uint256 => mapping(bytes32 => bool)) internal depositPaymentMethodActive; // Handy mapping for checking if a payment method is active for a deposit
    // Track if a payment method has ever been listed for this deposit (to avoid array contains checks and duplicates in depositPaymentMethods)
    mapping(uint256 => mapping(bytes32 => bool)) internal depositPaymentMethodListed;
    
    // Mapping of depositId to verifier address to mapping of fiat currency to min conversion rate. Each payment service can support
    // multiple currencies. Depositor can specify list of currencies and min conversion rates for each payment service.
    // Example: Deposit 1 => Venmo => USD: 1e18
    //                    => Revolut => USD: 1e18, EUR: 1.2e18, SGD: 1.5e18
    mapping(uint256 => mapping(bytes32 => mapping(bytes32 => uint256))) internal depositCurrencyMinRate;
    mapping(uint256 => mapping(bytes32 => bytes32[])) internal depositCurrencies; // Handy mapping to get all currencies for a deposit and verifier
    // Do not need to track if a currency is active; if it's min rate is 0 then it's not active
    // Track if a currency code has ever been listed for this deposit+paymentMethod (avoid contains scans and duplicates in depositCurrencies)
    mapping(uint256 => mapping(bytes32 => mapping(bytes32 => bool))) internal depositCurrencyListed;

    mapping(uint256 => Deposit) internal deposits;                          // Mapping of depositIds to deposit structs
    mapping(uint256 => bytes32[]) internal depositIntentHashes;             // Mapping of depositId to array of intentHashes
    mapping(uint256 => mapping(bytes32 => Intent)) internal depositIntents; // Mapping of depositId to intentHash to intent

    uint256 public depositCounter;          // Counter for depositIds
    
    address public dustRecipient;           // Address that receives dust
    uint256 public dustThreshold;           // Amount below which deposits are considered dust and can be closed
    uint256 public maxIntentsPerDeposit;    // Maximum active intents per deposit (suggested to keep below 100 to prevent deposit withdraw DOS)
    uint256 public intentExpirationPeriod;  // Time period after which an intent expires

    /* ============ Modifiers ============ */

    /**
     * @notice Modifier to check if caller is depositor or their delegate for a specific deposit
     * @param _depositId The deposit ID to check authorization for
     */
    modifier onlyDepositorOrDelegate(uint256 _depositId) {
        Deposit storage deposit = deposits[_depositId];
        if (!(deposit.depositor == msg.sender || 
            (deposit.delegate != address(0) && deposit.delegate == msg.sender))) {
            revert UnauthorizedCallerOrDelegate(msg.sender, deposit.depositor, deposit.delegate);
        }
        _;
    }

    /**
     * @notice Modifier to restrict access to orchestrator-only functions
     */
    modifier onlyOrchestrator() {
        if (msg.sender != address(orchestrator)) revert UnauthorizedCaller(msg.sender, address(orchestrator));
        _;
    }

    /* ============ Constructor ============ */
    constructor(
        address _owner,
        uint256 _chainId,
        address _paymentVerifierRegistry,
        address _dustRecipient,
        uint256 _dustThreshold,
        uint256 _maxIntentsPerDeposit,
        uint256 _intentExpirationPeriod
    )
        Ownable()
    {
        chainId = _chainId;
        paymentVerifierRegistry = IPaymentVerifierRegistry(_paymentVerifierRegistry);
        dustRecipient = _dustRecipient;
        dustThreshold = _dustThreshold;
        maxIntentsPerDeposit = _maxIntentsPerDeposit;
        intentExpirationPeriod = _intentExpirationPeriod;

        transferOwnership(_owner);
    }

    /* ============ Deposit Owner Only (External Functions) ============ */

    /**
     * @notice Creates a deposit entry by locking liquidity in the escrow contract that can be taken by signaling intents. This function will 
     * not add to previous deposits. Every deposit has it's own unique identifier. User must approve the contract to transfer the deposit amount
     * of deposit token. Every deposit specifies the payment methods it supports by specifying their verification data, supported currencies and 
     * their min conversion rates for each payment method. Optionally, a delegate to manage the deposit can be specified.
     * Note that the order of the payment methods, verification data, and currency data must match.
     */
    function createDeposit(CreateDepositParams calldata _params) external whenNotPaused {
        // Checks
        if (_params.intentAmountRange.min == 0) revert ZeroMinValue();
        if (_params.intentAmountRange.min > _params.intentAmountRange.max) { 
            revert InvalidRange(_params.intentAmountRange.min, _params.intentAmountRange.max);
        }
        if (_params.amount < _params.intentAmountRange.min) {
            revert AmountBelowMin(_params.amount, _params.intentAmountRange.min);
        }
        
        // Effects
        uint256 depositId = depositCounter++;
        accountDeposits[msg.sender].push(depositId);
        deposits[depositId] = Deposit({
            depositor: msg.sender,
            delegate: _params.delegate,
            token: _params.token,
            intentAmountRange: _params.intentAmountRange,
            acceptingIntents: true,
            remainingDeposits: _params.amount,
            outstandingIntentAmount: 0,
            intentGuardian: _params.intentGuardian,
            retainOnEmpty: _params.retainOnEmpty
        });

        emit DepositReceived(
            depositId, 
            msg.sender, 
            _params.token,
            _params.amount,
            _params.intentAmountRange, 
            _params.delegate, 
            _params.intentGuardian
        );

        _addPaymentMethodsToDeposit(depositId, _params.paymentMethods, _params.paymentMethodData, _params.currencies);

        // Interactions
        _params.token.safeTransferFrom(msg.sender, address(this), _params.amount);
    }

    /**
     * @notice Adds additional funds to an existing deposit. Any EOA or contract can add funds.
     * The funds will be added to the remaining deposits amount, making it available for new intents.
     *
     * @param _depositId    The deposit ID to add funds to
     * @param _amount       The amount of tokens to add
     */
    function addFunds(uint256 _depositId, uint256 _amount)
        external
        whenNotPaused
    {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        if (deposit.depositor == address(0)) revert DepositNotFound(_depositId);
        if (_amount == 0) revert ZeroValue();
        
        // Effects
        deposit.remainingDeposits += _amount;
        
        emit DepositFundsAdded(_depositId, msg.sender, _amount);
        
        // Interactions
        deposit.token.safeTransferFrom(msg.sender, address(this), _amount);
    }

    /**
     * @notice Removes funds from an existing deposit. Only the depositor can remove funds. If the amount to remove is greater
     * than the remaining deposits, then expired intents will be pruned to reclaim liquidity. If the remaining deposits is less than
     * the min intent amount, then the deposit will be marked as not accepting intents. 
     *
     * @param _depositId    The deposit ID to remove funds from
     * @param _amount       The amount of tokens to remove
     */
    function removeFunds(uint256 _depositId, uint256 _amount)
        external
        nonReentrant
        whenNotPaused
    {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        if (deposit.depositor != msg.sender) revert UnauthorizedCaller(msg.sender, deposit.depositor);
        if (_amount == 0) revert ZeroValue();
        
        // Effects
        bytes32[] memory expiredIntents = _reclaimLiquidityIfNecessary(deposit, _depositId, _amount);
        if (deposit.remainingDeposits < _amount) {
            revert InsufficientDepositLiquidity(_depositId, deposit.remainingDeposits, _amount);
        }

        deposit.remainingDeposits -= _amount;
        _handleAcceptingIntentsState(_depositId);

        emit DepositWithdrawn(_depositId, msg.sender, _amount);
        
        // Interactions
        deposit.token.safeTransfer(msg.sender, _amount);

        // Prune intents on the orchestrator
        if (expiredIntents.length > 0) {
            _tryOrchestratorPruneIntents(expiredIntents);
        }
    }

    /**
     * @notice Depositor is returned all remaining deposits and any outstanding intents that are expired. Only the depositor can withdraw. 
     * If an intent is not expired then those funds will not be returned. Deposit is marked as to not accept new intents and the funds
     * locked due to intents can be withdrawn once they expire by calling this function again. Deposit will be deleted as long as there are
     * no more outstanding intents.
     *
     * @param _depositId   DepositId the depositor is attempting to withdraw
     */
    function withdrawDeposit(uint256 _depositId) external nonReentrant {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        if (deposit.depositor != msg.sender) revert UnauthorizedCaller(msg.sender, deposit.depositor);

        // Effects
        bytes32[] memory expiredIntents = _reclaimLiquidityIfNecessary(deposit, _depositId, PRUNE_ALL_EXPIRED_INTENTS);

        uint256 returnAmount = deposit.remainingDeposits;
        IERC20 token = deposit.token;
        delete deposit.remainingDeposits;
        delete deposit.acceptingIntents;

        emit DepositWithdrawn(_depositId, deposit.depositor, returnAmount);

        _closeDepositIfNecessary(_depositId, deposit);
        
        // Interactions
        token.safeTransfer(msg.sender, returnAmount);

        // Prune intents on the orchestrator
        if (expiredIntents.length > 0) {
            _tryOrchestratorPruneIntents(expiredIntents);
        }
    }

    /* ============ Deposit Delegate management ============ */

    /**
     * @notice Allows depositor to set a delegate address that can manage a specific deposit
     *
     * @param _depositId    The deposit ID
     * @param _delegate     The address to set as delegate (address(0) to remove delegate)
     */
    
    function setDelegate(uint256 _depositId, address _delegate) external whenNotPaused {
        Deposit storage deposit = deposits[_depositId];
        if (deposit.depositor != msg.sender) revert UnauthorizedCaller(msg.sender, deposit.depositor);
        if (_delegate == address(0)) revert ZeroAddress();
        
        deposit.delegate = _delegate;
        
        emit DepositDelegateSet(_depositId, msg.sender, _delegate);
    }

    /**
     * @notice Allows depositor to remove the delegate for a specific deposit
     *
     * @param _depositId    The deposit ID
     */
    function removeDelegate(uint256 _depositId) external whenNotPaused {
        Deposit storage deposit = deposits[_depositId];
        if (deposit.depositor != msg.sender) revert UnauthorizedCaller(msg.sender, deposit.depositor);
        if (deposit.delegate == address(0)) revert DelegateNotFound(_depositId);
        
        delete deposit.delegate;
        
        emit DepositDelegateRemoved(_depositId, msg.sender);
    }

    /* ============ Deposit Owner OR Delegate Only (External Functions) ============ */

    /**
     * @notice Only callable by the depositor/delegate for a deposit. Allows depositor/delegate to update the min conversion rate for a 
     * currency for a payment verifier provided the currency was previously listed (otherwise use addCurrenciesToDepositPaymentMethod). 
     * Since intent's store the conversion rate at the time of intent, changing the min conversion rate will not affect any intents that 
     * have already been signaled.
     *
     * @param _depositId                The deposit ID
     * @param _paymentMethod            The payment method to update the min conversion rate for
     * @param _fiatCurrency             The fiat currency code to update the min conversion rate for
     * @param _newMinConversionRate     The new min conversion rate. Must be greater than 0.
     */
    function setCurrencyMinRate(
        uint256 _depositId, 
        bytes32 _paymentMethod, 
        bytes32 _fiatCurrency, 
        uint256 _newMinConversionRate
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        // Allow reactivation from 0 if currency was previously listed
        if (!depositCurrencyListed[_depositId][_paymentMethod][_fiatCurrency]) {
            revert CurrencyNotSupported(_paymentMethod, _fiatCurrency);
        }
        if (_newMinConversionRate == 0) revert ZeroConversionRate();

        depositCurrencyMinRate[_depositId][_paymentMethod][_fiatCurrency] = _newMinConversionRate;

        emit DepositMinConversionRateUpdated(_depositId, _paymentMethod, _fiatCurrency, _newMinConversionRate);
    }

    /**
     * @notice Allows depositor to update the intent amount range for a deposit. Since intent's are already created within the
     * previous intent amount range, changing the intent amount range will not affect any intents that have already been signaled.
     *
     * @param _depositId                The deposit ID
     * @param _intentAmountRange        The new intent amount range
     */
    function setIntentRange(
        uint256 _depositId, 
        Range calldata _intentAmountRange
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        Deposit storage deposit = deposits[_depositId];
        if (_intentAmountRange.min == 0) revert ZeroMinValue();
        if (_intentAmountRange.min > _intentAmountRange.max) revert InvalidRange(_intentAmountRange.min, _intentAmountRange.max);

        deposit.intentAmountRange = _intentAmountRange;
        
        _handleAcceptingIntentsState(_depositId);

        emit DepositIntentAmountRangeUpdated(_depositId, _intentAmountRange);
    }

    /**
     * @notice Allows depositor to add a new payment verifier and its associated currencies to an existing deposit.
     * @dev WARNING: Adding excessive payment methods or currencies may cause withdrawal to exceed gas limits. Depositors
     * can remove entries individually if needed. Recommended: <10 payment methods, <50 currencies each.
     *
     * @param _depositId             The deposit ID
     * @param _paymentMethods        The payment methods to add
     * @param _paymentMethodData     The payment verification data for the payment methods
     * @param _currencies            The currencies for the payment methods
     */
    function addPaymentMethods(
        uint256 _depositId,
        bytes32[] calldata _paymentMethods,
        DepositPaymentMethodData[] calldata _paymentMethodData,
        Currency[][] calldata _currencies
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        _addPaymentMethodsToDeposit(_depositId, _paymentMethods, _paymentMethodData, _currencies);
    }

    /**
     * @notice Allows depositor or delegate to toggle a payment method's active state without removing it.
     * This function allows depositor to remove an existing payment verifier from a deposit by setting active to false. The
     * deposit and currencies data is not deleted immediately and instead deferred to when the deposit is fully closed.
     * NOTE: This function does not delete the payment method data to allow existing intents to be fulfilled.
     *
     * @param _depositId     The deposit ID
     * @param _paymentMethod The payment method
     * @param _isActive      New active state
     */
    function setPaymentMethodActive(
        uint256 _depositId,
        bytes32 _paymentMethod,
        bool _isActive
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        if (!depositPaymentMethodListed[_depositId][_paymentMethod]) revert PaymentMethodNotListed(_depositId, _paymentMethod);
        if (depositPaymentMethodActive[_depositId][_paymentMethod] == _isActive) {
            revert DepositAlreadyInState(_depositId, _isActive);
        }
        depositPaymentMethodActive[_depositId][_paymentMethod] = _isActive;
        emit DepositPaymentMethodActiveUpdated(_depositId, _paymentMethod, _isActive);
    }

    /**
     * @notice Allows depositor to add a new currencies to an existing verifier for a deposit.
     * @dev WARNING: Adding excessive currencies may cause withdrawal to exceed gas limits. Depositors
     * can remove entries individually if needed. Recommended: <50 currencies per payment method.
     *
     * @param _depositId             The deposit ID
     * @param _paymentMethod         The payment method
     * @param _currencies            The currencies to add (code and conversion rate)
     */
    function addCurrencies(
        uint256 _depositId,
        bytes32 _paymentMethod,
        Currency[] calldata _currencies
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        if (!depositPaymentMethodActive[_depositId][_paymentMethod]) revert PaymentMethodNotActive(_depositId, _paymentMethod);
        
        for (uint256 i = 0; i < _currencies.length; i++) {
            _addCurrencyToDeposit(
                _depositId, 
                _paymentMethod, 
                _currencies[i].code, 
                _currencies[i].minConversionRate
            );
        }
    }

    /**
     * @notice Allows depositor to deactivate a currency from a verifier for a deposit. The currency is deactivated.
     *
     * @param _depositId             The deposit ID
     * @param _paymentMethod         The payment method
     * @param _currencyCode          The currency code to deactivate
     */
    function deactivateCurrency(
        uint256 _depositId,
        bytes32 _paymentMethod,
        bytes32 _currencyCode
    )   
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        if (!depositPaymentMethodActive[_depositId][_paymentMethod]) revert PaymentMethodNotActive(_depositId, _paymentMethod);
        if (!depositCurrencyListed[_depositId][_paymentMethod][_currencyCode]) revert CurrencyNotFound(_paymentMethod, _currencyCode);
        
        depositCurrencyMinRate[_depositId][_paymentMethod][_currencyCode] = 0;

        emit DepositMinConversionRateUpdated(_depositId, _paymentMethod, _currencyCode, 0);
    }

    /**
     * @notice Allows depositor or delegateto set the accepting intents state for a deposit.
     *
     * @param _depositId             The deposit ID
     * @param _acceptingIntents      The new accepting intents state
     */
    function setAcceptingIntents(
        uint256 _depositId, 
        bool _acceptingIntents
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        Deposit storage deposit = deposits[_depositId];
        if (deposit.acceptingIntents == _acceptingIntents) revert DepositAlreadyInState(_depositId, _acceptingIntents);

        // If accepting intents, check if there is enough liquidity to accept the minimum intent amount
        if (
            _acceptingIntents && 
            deposit.remainingDeposits < deposit.intentAmountRange.min
        ) revert InsufficientDepositLiquidity(_depositId, deposit.remainingDeposits, deposit.intentAmountRange.min);
        
        
        deposit.acceptingIntents = _acceptingIntents;
        emit DepositAcceptingIntentsUpdated(_depositId, _acceptingIntents);
    }

    /**
     * @notice Allows depositor or delegate to set the retain-on-empty behavior for a deposit. When true, the deposit
     * will not auto-close or sweep dust when empty; config (payment methods, currencies, rate etc) stays for reuse.
     *
     * @param _depositId        The deposit ID
     * @param _retainOnEmpty    New retain-on-empty flag value
     */
    function setRetainOnEmpty(
        uint256 _depositId,
        bool _retainOnEmpty
    )
        external
        whenNotPaused
        onlyDepositorOrDelegate(_depositId)
    {
        Deposit storage deposit = deposits[_depositId];
        if (deposit.retainOnEmpty == _retainOnEmpty) revert DepositAlreadyInState(_depositId, _retainOnEmpty);
        
        deposit.retainOnEmpty = _retainOnEmpty;
        
        emit DepositRetainOnEmptyUpdated(_depositId, _retainOnEmpty);
    }

    /* ============ Anyone callable (External Functions) ============ */

    /**
     * @notice ANYONE: Can be called by anyone to clean up expired intents.
     * 
     * @param _depositId The deposit ID to prune expired intents for
     */
    function pruneExpiredIntents(uint256 _depositId) external nonReentrant {
        // Checks, Effects
        bytes32[] memory expiredIntents = _reclaimLiquidityIfNecessary(
            deposits[_depositId], 
            _depositId, 
            PRUNE_ALL_EXPIRED_INTENTS     // Prune all expired intents
        );

        // Interactions
        if (expiredIntents.length > 0) {
            _tryOrchestratorPruneIntents(expiredIntents);
        }
    }

    /* ============ Orchestrator-Only Locking and Unlocking Functions ============ */

    /**
     * @notice ORCHESTRATOR ONLY: Locks funds for an intent with expiry time. Only callable by orchestrator.
     * Places a lock on the deposit, stores lock amount along with it's expiry timestamp for unlocking later.
     * 
     * @param _depositId The deposit ID to lock funds from
     * @param _amount The amount to lock
     * @param _intentHash The intent hash this intent corresponds to
     */
    function lockFunds(
        uint256 _depositId, 
        bytes32 _intentHash,
        uint256 _amount
    ) 
        external
        nonReentrant
        onlyOrchestrator 
    {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        if (deposit.depositor == address(0)) revert DepositNotFound(_depositId);
        if (!deposit.acceptingIntents) revert DepositNotAcceptingIntents(_depositId);
        if (_amount < deposit.intentAmountRange.min) revert AmountBelowMin(_amount, deposit.intentAmountRange.min);
        if (_amount > deposit.intentAmountRange.max) revert AmountAboveMax(_amount, deposit.intentAmountRange.max);
        // Prevent duplicate intent hashes which can corrupt liquidity accounting
        if (depositIntents[_depositId][_intentHash].intentHash != bytes32(0)) {
            revert IntentAlreadyExists(_depositId, _intentHash);
        }
        
        // Effects
        // Check if we need to reclaim expired liquidity first; if so, then reclaims and updates the deposit state
        bytes32[] memory expiredIntents = _reclaimLiquidityIfNecessary(deposit, _depositId, _amount);
    
        // Check if we have enough liquidity after reclaiming expired liquidity
        if (deposit.remainingDeposits < _amount) {
            revert InsufficientDepositLiquidity(_depositId, deposit.remainingDeposits, _amount);
        }

        // Check if we exceeded the maximum number of intents after expiring intents and adding the new intent
        uint256 newIntentCount = depositIntentHashes[_depositId].length + 1;
        if (newIntentCount > maxIntentsPerDeposit) {
            revert MaxIntentsExceeded(_depositId, newIntentCount, maxIntentsPerDeposit);
        }
        
        // Update deposit state due to the new intent
        deposit.remainingDeposits -= _amount;
        deposit.outstandingIntentAmount += _amount;
        
        depositIntentHashes[_depositId].push(_intentHash);
        uint256 expiryTime = block.timestamp + intentExpirationPeriod;
        depositIntents[_depositId][_intentHash] = Intent({
            intentHash: _intentHash,
            amount: _amount,
            timestamp: block.timestamp,
            expiryTime: expiryTime
        });
        
        emit FundsLocked(_depositId, _intentHash, _amount, expiryTime);

        // Interactions
        if (expiredIntents.length > 0) {
            _tryOrchestratorPruneIntents(expiredIntents);
        }
    }

    /**
     * @notice ORCHESTRATOR ONLY: Unlocks funds from a cancelled intent by removing the specific intent. 
     * Releases the lock on deposit liquidity and adds it back to the deposit.
     * 
     * @param _depositId The deposit ID to unlock funds from
     * @param _intentHash The intent hash to find and remove the intent for
     */
    function unlockFunds(uint256 _depositId, bytes32 _intentHash) 
        external 
        nonReentrant
        onlyOrchestrator 
    {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        Intent memory intent = depositIntents[_depositId][_intentHash];

        if (deposit.depositor == address(0)) revert DepositNotFound(_depositId);
        if (intent.intentHash == bytes32(0)) revert IntentNotFound(_intentHash);

        // Effects
        deposit.remainingDeposits += intent.amount;
        deposit.outstandingIntentAmount -= intent.amount;

        _pruneIntent(_depositId, _intentHash);

        emit FundsUnlocked(_depositId, _intentHash, intent.amount);
    }

    /**
     * @notice ORCHESTRATOR ONLY: Unlocks and transfers funds from a fulfilled intent by removing the specific intent.
     * Only callable by orchestrator. Releases the lock on deposlit liquidity and transfers out partial/full locked
     * amount to the given to address.
     * 
     * @param _depositId The deposit ID to transfer from
     * @param _intentHash The intent hash to find and remove the intent for
     * @param _transferAmount The amount to actually transfer (may be less than intent amount)
     * @param _to The address to transfer to (orchestrator)
     */
    function unlockAndTransferFunds(
        uint256 _depositId, 
        bytes32 _intentHash,
        uint256 _transferAmount, 
        address _to
    ) 
        external 
        nonReentrant
        onlyOrchestrator 
    {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        Intent memory intent = depositIntents[_depositId][_intentHash];
        
        if (deposit.depositor == address(0)) revert DepositNotFound(_depositId);
        if (intent.intentHash == bytes32(0)) revert IntentNotFound(_intentHash);
        if (_transferAmount == 0) revert ZeroValue();
        if (_transferAmount > intent.amount) revert AmountExceedsAvailable(_transferAmount, intent.amount);
        
        // Effects
        deposit.outstandingIntentAmount -= intent.amount;
        
        // If this is a partial release, return the unused portion to remainingDeposits
        if (_transferAmount < intent.amount) {
            deposit.remainingDeposits += (intent.amount - _transferAmount);
        }

        _pruneIntent(_depositId, _intentHash);
        
        IERC20 token = deposit.token;
        _closeDepositIfNecessary(_depositId, deposit);
        
        emit FundsUnlockedAndTransferred(
            _depositId, _intentHash, intent.amount, _transferAmount, _to
        );

        // Interactions
        token.safeTransfer(_to, _transferAmount);
    }

    /* ============ Intent Guardian Only (External Functions) ============ */

    /**
     * @notice INTENT GUARDIAN ONLY: Extends the expiry time of an existing intent. Only callable by intent guardian.
     * This function reverts if the total intent expiry period is greater than the maximum allowed to prevent griefing
     * by extending the intent expiry period indefinitely.
     * 
     * @param _depositId The deposit ID containing the intent
     * @param _intentHash The intent hash to extend expiry for
     * @param _additionalTime The additional time to extend the expiry by
     */
    function extendIntentExpiry(
        uint256 _depositId, 
        bytes32 _intentHash,
        uint256 _additionalTime
    ) 
        external 
    {
        // Checks
        Deposit storage deposit = deposits[_depositId];
        Intent storage intent = depositIntents[_depositId][_intentHash];
        
        if (deposit.depositor == address(0)) revert DepositNotFound(_depositId);
        if (intent.intentHash == bytes32(0)) revert IntentNotFound(_intentHash);
        if (deposit.intentGuardian != msg.sender) revert UnauthorizedCaller(msg.sender, deposit.intentGuardian);
        if (_additionalTime == 0) revert ZeroValue();
        if (intent.expiryTime + _additionalTime > intent.timestamp + MAX_TOTAL_INTENT_EXPIRATION_PERIOD) {
            revert AmountAboveMax(_additionalTime, MAX_TOTAL_INTENT_EXPIRATION_PERIOD);
        }
        
        // Effects
        intent.expiryTime += _additionalTime;
        
        emit IntentExpiryExtended(_depositId, _intentHash, intent.expiryTime);
    }

    /* ============ Governance Functions ============ */
    
    /**
     * @notice GOVERNANCE ONLY: Sets the orchestrator contract address. Only callable by owner.
     *
     * @param _orchestrator The orchestrator contract address
     */
    function setOrchestrator(address _orchestrator) external onlyOwner {
        if (_orchestrator == address(0)) revert ZeroAddress();
        
        orchestrator = IOrchestrator(_orchestrator);
        emit OrchestratorUpdated(_orchestrator);
    }

    /**
     * @notice GOVERNANCE ONLY: Updates the payment verifier registry address.
     *
     * @param _paymentVerifierRegistry   New payment verifier registry address
     */
    function setPaymentVerifierRegistry(address _paymentVerifierRegistry) external onlyOwner {
        if (_paymentVerifierRegistry == address(0)) revert ZeroAddress();
        
        paymentVerifierRegistry = IPaymentVerifierRegistry(_paymentVerifierRegistry);
        emit PaymentVerifierRegistryUpdated(_paymentVerifierRegistry);
    }

    /** 
     * @notice GOVERNANCE ONLY: Sets the dust recipient address.
     *
     * @param _dustRecipient The new dust recipient address
     */
    function setDustRecipient(address _dustRecipient) external onlyOwner {
        if (_dustRecipient == address(0)) revert ZeroAddress();
        
        dustRecipient = _dustRecipient;
        emit DustRecipientUpdated(_dustRecipient);
    }

    /**
     * @notice GOVERNANCE ONLY: Sets the dust threshold below which deposits can be closed automatically.
     *
     * @param _dustThreshold The new dust threshold amount
     */
    function setDustThreshold(uint256 _dustThreshold) external onlyOwner {
        if (_dustThreshold > MAX_DUST_THRESHOLD) revert AmountAboveMax(_dustThreshold, MAX_DUST_THRESHOLD);
        
        dustThreshold = _dustThreshold;
        emit DustThresholdUpdated(_dustThreshold);
    }

    /**
     * @notice GOVERNANCE ONLY: Sets the maximum number of active intents per deposit.
     *
     * @param _maxIntentsPerDeposit The new maximum number of active intents per deposit
     */
    function setMaxIntentsPerDeposit(uint256 _maxIntentsPerDeposit) external onlyOwner {
        if (_maxIntentsPerDeposit == 0) revert ZeroValue();
        
        maxIntentsPerDeposit = _maxIntentsPerDeposit;
        emit MaxIntentsPerDepositUpdated(_maxIntentsPerDeposit);
    }

    /**
     * @notice GOVERNANCE ONLY: Sets the intent expiration period.
     *
     * @param _intentExpirationPeriod The new intent expiration period in seconds
     */
    function setIntentExpirationPeriod(uint256 _intentExpirationPeriod) external onlyOwner {
        if (_intentExpirationPeriod == 0) revert ZeroValue();
        
        intentExpirationPeriod = _intentExpirationPeriod;
        emit IntentExpirationPeriodUpdated(_intentExpirationPeriod);
    }

    /**
     * @notice GOVERNANCE ONLY: Pauses deposit modifications and new deposit creation.
     * 
     * Functionalities that are paused:
     * - Deposit creation (createDeposit)
     * - Adding/removing funds to deposits (addFunds, removeFunds)
     * - Updating deposit parameters (conversion rates, intent ranges, accepting intents state)
     * - Adding/removing payment methods and currencies
     *
     * Functionalities that remain unpaused to allow users to rescue funds:
     * - Full deposit withdrawal (withdrawDeposit)
     * - Expired intent pruning (pruneExpiredIntentsAndReclaimLiquidity)
     * - Orchestrator operations (lockFunds, unlockFunds, unlockAndTransferFunds)
     * - Intent expiry extensions by guardian
     * - All view functions
     */
    function pauseEscrow() external onlyOwner {
        _pause();
    }

    /**
     * @notice GOVERNANCE ONLY: Restarts paused functionality for the escrow.
     */
    function unpauseEscrow() external onlyOwner {
        _unpause();
    }

    /* ============ External View Functions ============ */

    function getDeposit(uint256 _depositId) external view returns (Deposit memory) {
        return deposits[_depositId];
    }

    function getDepositIntentHashes(uint256 _depositId) external view returns (bytes32[] memory) {
        return depositIntentHashes[_depositId];
    }

    function getDepositIntent(uint256 _depositId, bytes32 _intentHash) external view returns (Intent memory) {
        return depositIntents[_depositId][_intentHash];
    }

    function getDepositPaymentMethods(uint256 _depositId) external view returns (bytes32[] memory) {
        return depositPaymentMethods[_depositId];
    }

    function getDepositCurrencies(uint256 _depositId, bytes32 _paymentMethod) external view returns (bytes32[] memory) {
        return depositCurrencies[_depositId][_paymentMethod];
    }

    function getDepositCurrencyMinRate(uint256 _depositId, bytes32 _paymentMethod, bytes32 _currencyCode) external view returns (uint256) {
        return depositCurrencyMinRate[_depositId][_paymentMethod][_currencyCode];
    }

    function getDepositCurrencyListed(uint256 _depositId, bytes32 _paymentMethod, bytes32 _currencyCode) external view returns (bool) {
        return depositCurrencyListed[_depositId][_paymentMethod][_currencyCode];
    }

    function getDepositPaymentMethodListed(uint256 _depositId, bytes32 _paymentMethod) external view returns (bool) {
        return depositPaymentMethodListed[_depositId][_paymentMethod];
    }

    function getDepositPaymentMethodData(uint256 _depositId, bytes32 _paymentMethod) external view returns (DepositPaymentMethodData memory) {
        return depositPaymentMethodData[_depositId][_paymentMethod];
    }

    function getDepositPaymentMethodActive(uint256 _depositId, bytes32 _paymentMethod) external view returns (bool) {
        return depositPaymentMethodActive[_depositId][_paymentMethod];
    }

    function getDepositGatingService(uint256 _depositId, bytes32 _paymentMethod) external view returns (address) {
        return depositPaymentMethodData[_depositId][_paymentMethod].intentGatingService;
    }

    function getAccountDeposits(address _account) external view returns (uint256[] memory) {
        return accountDeposits[_account];
    }
    
    function getExpiredIntents(uint256 _depositId) external view returns (bytes32[] memory expiredIntents, uint256 reclaimableAmount) {
        return _getExpiredIntents(_depositId);
    }


    /* ============ Internal Functions ============ */

    /**
     * @notice Cycles through all intents currently open on a deposit and sees if any have expired. If they have expired
     * the outstanding amounts are summed and returned alongside the intentHashes.
     * Note: This function compacts the expired intents array to remove any empty slots.
     */
    function _getExpiredIntents(
        uint256 _depositId
    )
        internal
        view
        returns(bytes32[] memory expiredIntents, uint256 reclaimableAmount)
    {
        bytes32[] memory intentHashes = depositIntentHashes[_depositId];
        bytes32[] memory verboseExpiredIntents = new bytes32[](intentHashes.length);
        uint256 numExpiredIntents = 0;

        for (uint256 i = 0; i < intentHashes.length; ++i) {
            Intent memory intent = depositIntents[_depositId][intentHashes[i]];
            if (intent.expiryTime < block.timestamp) {
                verboseExpiredIntents[i] = intentHashes[i];
                reclaimableAmount += intent.amount;
                numExpiredIntents++;
            }
        }

        // Compact the expired intents array
        expiredIntents = new bytes32[](numExpiredIntents);
        uint256 compactedIndex = 0;
        for (uint256 i = 0; i < intentHashes.length; ++i) {
            if (verboseExpiredIntents[i] != bytes32(0)) {
                expiredIntents[compactedIndex++] = verboseExpiredIntents[i];
            }
        }
    }

    /**
     * @notice Free up deposit liquidity by reclaiming liquidity from expired intents. Only reclaims if remaining deposits amount
     * is less than the minimum required amount. Returns the expired intents that need to be pruned. Only does local state updates, 
     * does not call any external contracts. Whenever this function is called, the calling function should also call _tryOrchestratorPruneIntents
     * with the returned intents to expire the intents on the orchestrator contract.
     */
    function _reclaimLiquidityIfNecessary(
        Deposit storage _deposit, 
        uint256 _depositId, 
        uint256 _minRequiredAmount
    )
        internal
        returns (bytes32[] memory expiredIntents)
    {
        if (
            _deposit.remainingDeposits < _minRequiredAmount || 
            depositIntentHashes[_depositId].length == maxIntentsPerDeposit
        ) {
            // If the deposit has insufficient liquidity or is at max intents, reclaim liquidity from expired intents
            uint256 reclaimedAmount;
            
            (expiredIntents, reclaimedAmount) = _getExpiredIntents(_depositId);    
            _deposit.remainingDeposits += reclaimedAmount;
            _deposit.outstandingIntentAmount -= reclaimedAmount;

            // Prune intents locally and emit funds unlocked events
            for (uint256 i = 0; i < expiredIntents.length; i++) {
                Intent memory intent = depositIntents[_depositId][expiredIntents[i]];
                _pruneIntent(_depositId, intent.intentHash);
                
                emit FundsUnlocked(_depositId, intent.intentHash, intent.amount);
            }
        }
    }

    /**
     * @notice Prunes an intent from a deposit locally. Does not call orchestrator.
     */
    function _pruneIntent(uint256 _depositId, bytes32 _intentHash) internal {
        delete depositIntents[_depositId][_intentHash];
        depositIntentHashes[_depositId].removeStorage(_intentHash);
    }

    /**
      * @notice Calls the orchestrator to clean up intents. 
      * Note: If the orchestrator reverts, it is caught and ignored to allow the function to continue execution.
      */
    function _tryOrchestratorPruneIntents(bytes32[] memory _intents) internal {
        try IOrchestrator(orchestrator).pruneIntents(_intents) {} catch {}
    }

    /**
     * @notice Updates acceptingIntents based on remaining liquidity. One-way demotion only: if remainingDeposits 
     * falls below min and acceptingIntents is true, set it to false. If acceptingIntents is false, it will remain 
     * false even if remainingDeposits is increased above min. The depositor has to manually re-enable accepting 
     * intents by calling setDepositAcceptingIntents.
     */
    function _handleAcceptingIntentsState(uint256 _depositId) internal {
        Deposit storage deposit = deposits[_depositId];
        if (deposit.acceptingIntents && deposit.remainingDeposits < deposit.intentAmountRange.min) {
            deposit.acceptingIntents = false;
            emit DepositAcceptingIntentsUpdated(_depositId, false);
        }
    }

    /**
     * @notice Removes a deposit if no outstanding intents AND remaining funds is dust. Before deletion, transfers any remaining
     * dust to the protocol dust recipient.
     */
    function _closeDepositIfNecessary(uint256 _depositId, Deposit storage _deposit) internal {
        // Close if no outstanding intents and remaining deposits are at or below dust
        uint256 totalRemaining = _deposit.remainingDeposits;
        if (_deposit.outstandingIntentAmount == 0 && totalRemaining <= dustThreshold && !_deposit.retainOnEmpty) {
            // Close deposit (and sweep any dust) when retention is not enabled
            IERC20 token = _deposit.token;
            _closeDeposit(_depositId, _deposit);

            if (totalRemaining > 0) {
                token.safeTransfer(dustRecipient, totalRemaining);
                emit DustCollected(_depositId, totalRemaining, dustRecipient);
            }
        }
    }

    /**
     * @notice Closes a deposit. Deleting a deposit deletes it from the deposits mapping and removes tracking
     * it in the user's accountDeposits mapping. Also deletes the verification and currency data for the deposit.
     */
    function _closeDeposit(uint256 _depositId, Deposit storage _deposit) internal {
        address depositor = _deposit.depositor;
        accountDeposits[depositor].removeStorage(_depositId);
        
        _deleteDepositPaymentMethodAndCurrencyData(_depositId);
        
        delete deposits[_depositId];
        delete _deposit.acceptingIntents;  // Might have been set to false, but delete it to be safe
        
        emit DepositClosed(_depositId, depositor);
    }

    /**
     * @notice Iterates through all verifiers for a deposit and deletes the corresponding verifier data and currencies.
     */
    function _deleteDepositPaymentMethodAndCurrencyData(uint256 _depositId) internal {
        bytes32[] memory paymentMethods = depositPaymentMethods[_depositId];
        for (uint256 i = 0; i < paymentMethods.length; i++) {
            bytes32 paymentMethod = paymentMethods[i];
            delete depositPaymentMethodData[_depositId][paymentMethod];
            delete depositPaymentMethodActive[_depositId][paymentMethod];
            delete depositPaymentMethodListed[_depositId][paymentMethod];
            bytes32[] memory currencies = depositCurrencies[_depositId][paymentMethod];
            for (uint256 j = 0; j < currencies.length; j++) {
                bytes32 currencyCode = currencies[j];
                delete depositCurrencyMinRate[_depositId][paymentMethod][currencyCode];
                delete depositCurrencyListed[_depositId][paymentMethod][currencyCode];
            }
            delete depositCurrencies[_depositId][paymentMethod];
        }
        delete depositPaymentMethods[_depositId];
    }

    /**
     * @notice Adds list of payment methods and corresponding verification data and currencies to a deposit.
     */
    function _addPaymentMethodsToDeposit(
        uint256 _depositId,
        bytes32[] calldata _paymentMethods,
        DepositPaymentMethodData[] calldata _paymentMethodData,
        Currency[][] calldata _currencies
    ) internal {

        // Check that the length of the payment methods, depositPaymentMethodData, and currencies arrays are the same
        if (_paymentMethods.length != _paymentMethodData.length) revert ArrayLengthMismatch(_paymentMethods.length, _paymentMethodData.length);
        if (_paymentMethods.length != _currencies.length) revert ArrayLengthMismatch(_paymentMethods.length, _currencies.length);

        for (uint256 i = 0; i < _paymentMethods.length; i++) {
            bytes32 paymentMethod = _paymentMethods[i];
            
            // Validate payment method
            if (paymentMethod == bytes32(0)) revert ZeroAddress();
            if (!paymentVerifierRegistry.isPaymentMethod(paymentMethod)) {
                revert PaymentMethodNotWhitelisted(paymentMethod);
            }
            if (_paymentMethodData[i].payeeDetails == bytes32(0)) revert EmptyPayeeDetails();
            // Prevent duplicates using O(1) listed flag; if already listed (active or inactive) revert
            if (depositPaymentMethodListed[_depositId][paymentMethod]) revert PaymentMethodAlreadyExists(_depositId, paymentMethod);

            // Add payment method
            depositPaymentMethodData[_depositId][paymentMethod] = _paymentMethodData[i];
            depositPaymentMethods[_depositId].push(paymentMethod);
            depositPaymentMethodListed[_depositId][paymentMethod] = true;
            depositPaymentMethodActive[_depositId][paymentMethod] = true;

            emit DepositPaymentMethodAdded(_depositId, paymentMethod, _paymentMethodData[i].payeeDetails, _paymentMethodData[i].intentGatingService);

            for (uint256 j = 0; j < _currencies[i].length; j++) {
                Currency memory currency = _currencies[i][j];

                _addCurrencyToDeposit(
                    _depositId, 
                    paymentMethod, 
                    currency.code, 
                    currency.minConversionRate
                );
            }
        }
    }

    /**
     * @notice Adds a currency to a deposit.
     */
    function _addCurrencyToDeposit(
        uint256 _depositId,
        bytes32 _paymentMethod,
        bytes32 _currencyCode,
        uint256 _minConversionRate
    ) internal {
        // Validate currency
        if (!paymentVerifierRegistry.isCurrency(_paymentMethod, _currencyCode)) {
            revert CurrencyNotSupported(_paymentMethod, _currencyCode);
        }
        if (_minConversionRate == 0) revert ZeroConversionRate();
        if (depositCurrencyListed[_depositId][_paymentMethod][_currencyCode]) {
            revert CurrencyAlreadyExists(_paymentMethod, _currencyCode);
        }

        // Add currency
        depositCurrencyMinRate[_depositId][_paymentMethod][_currencyCode] = _minConversionRate;
        depositCurrencies[_depositId][_paymentMethod].push(_currencyCode);
        depositCurrencyListed[_depositId][_paymentMethod][_currencyCode] = true;

        emit DepositCurrencyAdded(_depositId, _paymentMethod, _currencyCode, _minConversionRate);
    }
}
        

@openzeppelin/contracts/access/Ownable.sol

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

@openzeppelin/contracts/interfaces/IERC1271.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
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);
}
          

@openzeppelin/contracts/security/Pausable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}
          

@openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
          

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
          

contracts/interfaces/IPaymentVerifierRegistry.sol

//SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

interface IPaymentVerifierRegistry {
    function isPaymentMethod(bytes32 _paymentMethod) external view returns (bool);
    function getPaymentMethods() external view returns (bytes32[] memory);
    function getVerifier(bytes32 _paymentMethod) external view returns (address);
    function isCurrency(bytes32 _paymentMethod, bytes32 _currencyCode) external view returns (bool);
    function getCurrencies(bytes32 _paymentMethod) external view returns (bytes32[] memory);
}
          

contracts/interfaces/IPostIntentHook.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

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

/**
 * @title IPostIntentHook
 * @notice Interface for post-intent hooks
 */
interface IPostIntentHook {

    /**
     * @notice Post-intent hook
     * @param _intent The intent data structure containing all intent information
     * @param _fulfillIntentData The data passed to fulfillIntent
     */
    function execute(
        IOrchestrator.Intent memory _intent,
        uint256 _amountNetFees,
        bytes calldata _fulfillIntentData
    ) external;
}
          

@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}
          

@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}
          

@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

@openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

@openzeppelin/contracts/utils/Strings.sol

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

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @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), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(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) {
        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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        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 keccak256(bytes(a)) == keccak256(bytes(b));
    }
}
          

@openzeppelin/contracts/utils/cryptography/ECDSA.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @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,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode 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 {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]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        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);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode 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 {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        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[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        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.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // 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);
        }

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

        return (signer, RecoverError.NoError);
    }

    /**
     * @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) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}
          

@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/SignatureChecker.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";
import "../../interfaces/IERC1271.sol";

/**
 * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
 * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
 * Argent and Gnosis Safe.
 *
 * _Available since v4.1._
 */
library SignatureChecker {
    /**
     * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
     * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
     *
     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
     * change through time. It could return true at block N and false at block N+1 (or the opposite).
     */
    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
        (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);
        return
            (error == ECDSA.RecoverError.NoError && recovered == signer) ||
            isValidERC1271SignatureNow(signer, hash, signature);
    }

    /**
     * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated
     * against the signer smart contract using ERC1271.
     *
     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
     * change through time. It could return true at block N and false at block N+1 (or the opposite).
     */
    function isValidERC1271SignatureNow(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal view returns (bool) {
        (bool success, bytes memory result) = signer.staticcall(
            abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
        );
        return (success &&
            result.length >= 32 &&
            abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
    }
}
          

@openzeppelin/contracts/utils/math/Math.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @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 up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv 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.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

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

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

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

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

@openzeppelin/contracts/utils/math/SignedMath.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @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 {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}
          

contracts/interfaces/IPostIntentHookRegistry.sol

//SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

interface IPostIntentHookRegistry {
    function isWhitelistedHook(address _hook) external view returns (bool);
    function getWhitelistedHooks() external view returns (address[] memory);
}
          

contracts/interfaces/IRelayerRegistry.sol

//SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

interface IRelayerRegistry {
    function isWhitelistedRelayer(address _relayer) external view returns (bool);
    function getWhitelistedRelayers() external view returns (address[] memory);
}
          

contracts/external/AddressArrayUtils.sol

/*
    Copyright 2020 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    SPDX-License-Identifier: MIT
*/

pragma solidity ^0.8.17;

/**
 * @title AddressArrayUtils
 * @author Set Protocol
 *
 * Utility functions to handle Address Arrays
 *
 * CHANGELOG:
 * - 4/21/21: Added validatePairsWithArray methods
 */
library AddressArrayUtils {

    uint256 constant internal MAX_INT = 2**256 - 1;

    /**
     * Finds the index of the first occurrence of the given element.
     * @param A The input array to search
     * @param a The value to find
     * @return Returns (index and isIn) for the first occurrence starting from index 0
     */
    function indexOf(address[] memory A, address a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = 0; i < length; i++) {
            if (A[i] == a) {
                return (i, true);
            }
        }
        return (MAX_INT, false);
    }

    /**
    * Returns true if the value is present in the list. Uses indexOf internally.
    * @param A The input array to search
    * @param a The value to find
    * @return Returns isIn for the first occurrence starting from index 0
    */
    function contains(address[] memory A, address a) internal pure returns (bool) {
        (, bool isIn) = indexOf(A, a);
        return isIn;
    }

    /**
    * Returns true if there are 2 elements that are the same in an array
    * @param A The input array to search
    * @return Returns boolean for the first occurrence of a duplicate
    */
    function hasDuplicate(address[] memory A) internal pure returns(bool) {
        require(A.length > 0, "A is empty");

        for (uint256 i = 0; i < A.length - 1; i++) {
            address current = A[i];
            for (uint256 j = i + 1; j < A.length; j++) {
                if (current == A[j]) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * @param A The input array to search
     * @param a The address to remove
     * @return Returns the array with the object removed.
     */
    function remove(address[] memory A, address a)
        internal
        pure
        returns (address[] memory)
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Address not in array.");
        } else {
            (address[] memory _A,) = pop(A, index);
            return _A;
        }
    }

    /**
     * @param A The input array to search
     * @param a The address to remove
     */
    function removeStorage(address[] storage A, address a)
        internal
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Address not in array.");
        } else {
            uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
            if (index != lastIndex) { A[index] = A[lastIndex]; }
            A.pop();
        }
    }

    /**
    * Removes specified index from array
    * @param A The input array to search
    * @param index The index to remove
    * @return Returns the new array and the removed entry
    */
    function pop(address[] memory A, uint256 index)
        internal
        pure
        returns (address[] memory, address)
    {
        uint256 length = A.length;
        require(index < A.length, "Index must be < A length");
        address[] memory newAddresses = new address[](length - 1);
        for (uint256 i = 0; i < index; i++) {
            newAddresses[i] = A[i];
        }
        for (uint256 j = index + 1; j < length; j++) {
            newAddresses[j - 1] = A[j];
        }
        return (newAddresses, A[index]);
    }
}
          

contracts/external/Bytes32ArrayUtils.sol

//SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

/**
 * @title Bytes32ArrayUtils
 * @author ZKP2P
 *
 * Fork of Set Protocol's AddressArrayUtils library adapted for usage with bytes32 arrays.
 */
library Bytes32ArrayUtils {

    uint256 constant internal MAX_INT = 2**256 - 1;

    /**
     * Finds the index of the first occurrence of the given element.
     * @param A The input array to search
     * @param a The value to find
     * @return Returns (index and isIn) for the first occurrence starting from index 0
     */
    function indexOf(bytes32[] memory A, bytes32 a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = 0; i < length; i++) {
            if (A[i] == a) {
                return (i, true);
            }
        }
        return (MAX_INT, false);
    }

    /**
    * Returns true if the value is present in the list. Uses indexOf internally.
    * @param A The input array to search
    * @param a The value to find
    * @return Returns isIn for the first occurrence starting from index 0
    */
    function contains(bytes32[] memory A, bytes32 a) internal pure returns (bool) {
        (, bool isIn) = indexOf(A, a);
        return isIn;
    }

    /**
    * Returns true if there are 2 elements that are the same in an array
    * @param A The input array to search
    * @return Returns boolean for the first occurrence of a duplicate
    */
    function hasDuplicate(bytes32[] memory A) internal pure returns(bool) {
        require(A.length > 0, "A is empty");

        for (uint256 i = 0; i < A.length - 1; i++) {
            bytes32 current = A[i];
            for (uint256 j = i + 1; j < A.length; j++) {
                if (current == A[j]) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * @param A The input array to search
     * @param a The bytes32 to remove
     * @return Returns the array with the object removed.
     */
    function remove(bytes32[] memory A, bytes32 a)
        internal
        pure
        returns (bytes32[] memory)
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("bytes32 not in array.");
        } else {
            (bytes32[] memory _A,) = pop(A, index);
            return _A;
        }
    }

    /**
     * @param A The input array to search
     * @param a The bytes32 to remove
     */
    function removeStorage(bytes32[] storage A, bytes32 a)
        internal
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("bytes32 not in array.");
        } else {
            uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
            if (index != lastIndex) { A[index] = A[lastIndex]; }
            A.pop();
        }
    }

    /**
    * Removes specified index from array
    * @param A The input array to search
    * @param index The index to remove
    * @return Returns the new array and the removed entry
    */
    function pop(bytes32[] memory A, uint256 index)
        internal
        pure
        returns (bytes32[] memory, bytes32)
    {
        uint256 length = A.length;
        require(index < A.length, "Index must be < A length");
        bytes32[] memory newBytes = new bytes32[](length - 1);
        for (uint256 i = 0; i < index; i++) {
            newBytes[i] = A[i];
        }
        for (uint256 j = index + 1; j < length; j++) {
            newBytes[j - 1] = A[j];
        }
        return (newBytes, A[index]);
    }
}
          

contracts/external/StringArrayUtils.sol

/*
    Copyright 2020 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    SPDX-License-Identifier: Apache-2.0
*/

pragma solidity ^0.8.18;

/**
 * @title StringArrayUtils
 * @author Set Protocol
 *
 * Utility functions to handle String Arrays
 */
library StringArrayUtils {

    /**
     * Finds the index of the first occurrence of the given element.
     * @param A The input string to search
     * @param a The value to find
     * @return Returns (index and isIn) for the first occurrence starting from index 0
     */
    function indexOf(string[] memory A, string memory a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = 0; i < length; i++) {
            if (keccak256(bytes(A[i])) == keccak256(bytes(a))) {
                return (i, true);
            }
        }
        return (type(uint256).max, false);
    }

    /**
     * @param A The input array to search
     * @param a The string to remove
     */
    function removeStorage(string[] storage A, string memory a)
        internal
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("String not in array.");
        } else {
            uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
            if (index != lastIndex) { A[index] = A[lastIndex]; }
            A.pop();
        }
    }
}
          

contracts/external/Uint256ArrayUtils.sol

/*
    Copyright 2020 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    SPDX-License-Identifier: Apache-2.0
*/

pragma solidity ^0.8.18;

/**
 * @title Uint256ArrayUtils
 * @author Set Protocol
 *
 * Utility functions to handle Uint256 Arrays
 */
library Uint256ArrayUtils {

    uint256 constant internal MAX_INT = 2**256 - 1;

    /**
     * Finds the index of the first occurrence of the given element.
     * @param A The input array to search
     * @param a The value to find
     * @return Returns (index and isIn) for the first occurrence starting from index 0
     */
    function indexOf(uint256[] memory A, uint256 a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = 0; i < length; i++) {
            if (A[i] == a) {
                return (i, true);
            }
        }
        return (MAX_INT, false);
    }

    /**
     * Returns the combination of the two arrays
     * @param A The first array
     * @param B The second array
     * @return Returns A extended by B
     */
    function extend(uint256[] memory A, uint256[] memory B) internal pure returns (uint256[] memory) {
        uint256 aLength = A.length;
        uint256 bLength = B.length;
        uint256[] memory newUints = new uint256[](aLength + bLength);
        for (uint256 i = 0; i < aLength; i++) {
            newUints[i] = A[i];
        }
        for (uint256 j = 0; j < bLength; j++) {
            newUints[aLength + j] = B[j];
        }
        return newUints;
    }

    /**
     * @param A The input array to search
     * @param a The bytes32 to remove
     */
    function removeStorage(uint256[] storage A, uint256 a)
        internal
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("uint256 not in array.");
        } else {
            uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
            if (index != lastIndex) { A[index] = A[lastIndex]; }
            A.pop();
        }
    }
}
          

contracts/interfaces/IEscrow.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IPostIntentHook } from "./IPostIntentHook.sol";

interface IEscrow {
    
    /* ============ Structs ============ */

    struct Intent {
        bytes32 intentHash;                        // Unique identifier for the intent
        uint256 amount;                            // Amount locked
        uint256 timestamp;                         // When this intent was created
        uint256 expiryTime;                        // When this intent expires
    }

    struct Range {
        uint256 min;                                // Minimum value
        uint256 max;                                // Maximum value
    }

    struct Deposit {
        address depositor;                          // Address of depositor
        address delegate;                           // Address that can manage this deposit (address(0) if no delegate)
        IERC20 token;                               // Address of deposit token
        Range intentAmountRange;                    // Range of take amount per intent
        // Deposit state
        bool acceptingIntents;                      // State: True if the deposit is accepting intents, False otherwise
        uint256 remainingDeposits;                  // State: Amount of liquidity immediately available to lock
        uint256 outstandingIntentAmount;            // State: Amount of outstanding intents (may include expired intents)
        // Intent guardian
        address intentGuardian;                     // Address that can extend intent expiry times (address(0) if no guardian)
        // Retention behavior
        bool retainOnEmpty;                         // If true, do not auto-close/sweep when empty; keep config for reuse
    }

    struct Currency {
        bytes32 code;                               // Currency code (keccak256 hash of the currency code)
        uint256 minConversionRate;                  // Minimum rate of deposit token to fiat currency (in preciseUnits)
    }

    struct DepositPaymentMethodData {
        address intentGatingService;                // Public key of gating service that will be used to verify intents
        bytes32 payeeDetails;                       // Payee details, has to be hash of payee details
        bytes data;                                 // Verification Data: Additional data used for payment verification; Can hold attester address
                                                    // in case of TLS proofs, domain key hash in case of zkEmail proofs, currency code etc.
    }

    struct CreateDepositParams {
        IERC20 token;                                // The token to be deposited
        uint256 amount;                              // The amount of token to deposit
        Range intentAmountRange;                     // The max and min take amount for each intent
        bytes32[] paymentMethods;                    // The payment methods that deposit supports
        DepositPaymentMethodData[] paymentMethodData;// The payment verification data for each payment method that deposit supports
        Currency[][] currencies;                     // The currencies for each payment method that deposit supports
        address delegate;                            // Optional delegate address that can manage this deposit (address(0) for no delegate)
        address intentGuardian;                      // Optional intent guardian address that can extend intent expiry times (address(0) for no guardian)
        bool retainOnEmpty;                          // Opt-in: keep deposit and config when empty
    }

    /* ============ Events ============ */

    event DepositReceived(uint256 indexed depositId, address indexed depositor, IERC20 indexed token, uint256 amount, Range intentAmountRange, address delegate, address intentGuardian);

    event DepositPaymentMethodAdded(uint256 indexed depositId, bytes32 indexed paymentMethod, bytes32 indexed payeeDetails, address intentGatingService);
    event DepositPaymentMethodActiveUpdated(uint256 indexed depositId, bytes32 indexed paymentMethod, bool active);

    event DepositCurrencyAdded(uint256 indexed depositId, bytes32 indexed paymentMethod, bytes32 indexed currency, uint256 minConversionRate);
    event DepositMinConversionRateUpdated(uint256 indexed depositId, bytes32 indexed paymentMethod, bytes32 indexed currency, uint256 newMinConversionRate);
    
    event DepositFundsAdded(uint256 indexed depositId, address indexed depositor, uint256 amount);
    event DepositWithdrawn(uint256 indexed depositId, address indexed depositor, uint256 amount);
    event DepositClosed(uint256 depositId, address depositor);
    event DepositAcceptingIntentsUpdated(uint256 indexed depositId, bool acceptingIntents);

    event DepositIntentAmountRangeUpdated(uint256 indexed depositId, Range intentAmountRange);
    event DepositRetainOnEmptyUpdated(uint256 indexed depositId, bool retainOnEmpty);

    event DepositDelegateSet(uint256 indexed depositId, address indexed depositor, address indexed delegate);
    event DepositDelegateRemoved(uint256 indexed depositId, address indexed depositor);

    event MinDepositAmountSet(uint256 minDepositAmount);

    event OrchestratorUpdated(address indexed orchestrator);
    event PaymentVerifierRegistryUpdated(address indexed paymentVerifierRegistry);

    event FundsLocked(uint256 indexed depositId, bytes32 indexed intentHash, uint256 amount, uint256 expiryTime);
    event FundsUnlocked(uint256 indexed depositId, bytes32 indexed intentHash, uint256 amount);
    event FundsUnlockedAndTransferred(
        uint256 indexed depositId, 
        bytes32 indexed intentHash, 
        uint256 unlockedAmount, 
        uint256 transferredAmount, 
        address to
    );
    event IntentExpiryExtended(uint256 indexed depositId, bytes32 indexed intentHash, uint256 newExpiryTime);

    event DustRecipientUpdated(address indexed dustRecipient);
    event DustCollected(uint256 indexed depositId, uint256 dustAmount, address indexed dustRecipient);
    event DustThresholdUpdated(uint256 dustThreshold);
    event MaxIntentsPerDepositUpdated(uint256 maxIntentsPerDeposit);
    event IntentExpirationPeriodUpdated(uint256 intentExpirationPeriod);

    /* ============ Standardized Custom Errors ============ */
    
    // Zero value errors
    error ZeroAddress();
    error ZeroValue();
    error ZeroMinValue();
    error ZeroConversionRate();

    // Authorization errors
    error UnauthorizedCaller(address caller, address authorized);
    error UnauthorizedCallerOrDelegate(address caller, address owner, address delegate);

    // Range and amount errors
    error InvalidRange(uint256 min, uint256 max);
    error AmountBelowMin(uint256 amount, uint256 min);
    error AmountAboveMax(uint256 amount, uint256 max);
    error AmountExceedsAvailable(uint256 requested, uint256 available);

    // Not found errors
    error DepositNotFound(uint256 depositId);
    error IntentNotFound(bytes32 intentHash);
    error PaymentMethodNotActive(uint256 depositId, bytes32 paymentMethod);
    error PaymentMethodNotListed(uint256 depositId, bytes32 paymentMethod);
    error CurrencyNotFound(bytes32 paymentMethod, bytes32 currency);
    error DelegateNotFound(uint256 depositId);

    // Already exists errors
    error PaymentMethodAlreadyExists(uint256 depositId, bytes32 paymentMethod);
    error CurrencyAlreadyExists(bytes32 paymentMethod, bytes32 currency);
    error IntentAlreadyExists(uint256 depositId, bytes32 intentHash);

    // State errors
    error DepositNotAcceptingIntents(uint256 depositId);
    error DepositAlreadyInState(uint256 depositId, bool currentState);
    error InsufficientDepositLiquidity(uint256 depositId, uint256 available, uint256 required);
    error MaxIntentsExceeded(uint256 depositId, uint256 current, uint256 max);

    // Validation errors
    error EmptyPayeeDetails();
    error ArrayLengthMismatch(uint256 length1, uint256 length2);

    // Payment method errors
    error PaymentMethodNotWhitelisted(bytes32 paymentMethod);
    error CurrencyNotSupported(bytes32 paymentMethod, bytes32 currency);

    
    /* ============ External Functions for Orchestrator ============ */

    function lockFunds(uint256 _depositId, bytes32 _intentHash, uint256 _amount) external;
    function unlockFunds(uint256 _depositId, bytes32 _intentHash) external;
    function unlockAndTransferFunds(uint256 _depositId, bytes32 _intentHash, uint256 _transferAmount, address _to) external;
    function extendIntentExpiry(uint256 _depositId, bytes32 _intentHash, uint256 _newExpiryTime) external;

    /* ============ View Functions ============ */

    function getDeposit(uint256 _depositId) external view returns (Deposit memory);
    function getDepositIntent(uint256 _depositId, bytes32 _intentHash) external view returns (Intent memory);
    function getDepositPaymentMethods(uint256 _depositId) external view returns (bytes32[] memory);
    function getDepositCurrencies(uint256 _depositId, bytes32 _paymentMethod) external view returns (bytes32[] memory);
    function getDepositCurrencyMinRate(uint256 _depositId, bytes32 _paymentMethod, bytes32 _currencyCode) external view returns (uint256);
    function getDepositPaymentMethodData(uint256 _depositId, bytes32 _paymentMethod) external view returns (DepositPaymentMethodData memory);
    function getDepositPaymentMethodActive(uint256 _depositId, bytes32 _paymentMethod) external view returns (bool);
    function getDepositGatingService(uint256 _depositId, bytes32 _paymentMethod) external view returns (address);
    function getAccountDeposits(address _account) external view returns (uint256[] memory);
    function getDepositIntentHashes(uint256 _depositId) external view returns (bytes32[] memory);
    function getExpiredIntents(uint256 _depositId) external view returns (bytes32[] memory expiredIntents, uint256 reclaimableAmount);
}
          

contracts/interfaces/IOrchestrator.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IPostIntentHook } from "./IPostIntentHook.sol";

interface IOrchestrator {
    
    /* ============ Structs ============ */

    struct Intent {
        address owner;                              // Address of the intent owner  
        address to;                                 // Address to forward funds to (can be same as owner)
        address escrow;                             // Address of the escrow contract holding the deposit
        uint256 depositId;                          // ID of the deposit the intent is associated with
        uint256 amount;                             // Amount of the deposit.token the owner wants to take
        uint256 timestamp;                          // Timestamp of the intent
        bytes32 paymentMethod;                      // The payment method to be used for the offchain payment
        bytes32 fiatCurrency;                       // Currency code that the owner is paying in offchain (keccak256 hash of the currency code)
        uint256 conversionRate;                     // Conversion rate of deposit token to fiat currency at the time of intent
        bytes32 payeeId;                            // Hashed payee identifier to whom the owner will pay offchain
        address referrer;                           // Address of the referrer who brought this intent (if any)
        uint256 referrerFee;                        // Fee to be paid to the referrer in preciseUnits (1e16 = 1%)
        IPostIntentHook postIntentHook;             // Address of the post-intent hook that will execute any post-intent actions
        bytes data;                                 // Additional data to be passed to the post-intent hook contract
    }

    struct SignalIntentParams {
        address escrow;                             // The escrow contract where the deposit is held
        uint256 depositId;                          // The ID of the deposit the taker intends to use
        uint256 amount;                             // The amount of deposit.token the user wants to take
        address to;                                 // Address to forward funds to
        bytes32 paymentMethod;                      // The payment method to be used for the offchain payment
        bytes32 fiatCurrency;                       // The currency code for offchain payment
        uint256 conversionRate;                     // The conversion rate agreed offchain
        address referrer;                           // Address of the referrer (address(0) if no referrer)
        uint256 referrerFee;                        // Fee to be paid to the referrer
        bytes gatingServiceSignature;               // Signature from the deposit's gating service
        uint256 signatureExpiration;                // Timestamp when the gating service signature expires
        IPostIntentHook postIntentHook;             // Optional post-intent hook (address(0) for no hook)
        bytes data;                                 // Additional data for the intent
    }

    struct FulfillIntentParams {
        bytes paymentProof;                         // Payment proof. Can be Groth16 Proof, TLSNotary proof, TLSProxy proof, attestation etc.
        bytes32 intentHash;                         // Identifier of intent being fulfilled
        bytes verificationData;                     // Additional data for payment verifier
        bytes postIntentHookData;                   // Additional data for post intent hook
    }

    /* ============ Events ============ */

    event IntentSignaled(
        bytes32 indexed intentHash, 
        address indexed escrow,
        uint256 indexed depositId, 
        bytes32 paymentMethod, 
        address owner, 
        address to, 
        uint256 amount, 
        bytes32 fiatCurrency, 
        uint256 conversionRate, 
        uint256 timestamp
    );

    event IntentPruned(
        bytes32 indexed intentHash
    );

    event IntentFulfilled(
        bytes32 indexed intentHash,
        address indexed fundsTransferredTo,   // Address that funds were transferred to; can be intent.to or postIntentHook address
        uint256 amount,
        bool isManualRelease
    );

    event AllowMultipleIntentsUpdated(bool allowMultiple);

    event PaymentVerifierRegistryUpdated(address indexed paymentVerifierRegistry);
    event PostIntentHookRegistryUpdated(address indexed postIntentHookRegistry);
    event RelayerRegistryUpdated(address indexed relayerRegistry);
    event EscrowRegistryUpdated(address indexed escrowRegistry);

    event ProtocolFeeUpdated(uint256 protocolFee);
    event ProtocolFeeRecipientUpdated(address indexed protocolFeeRecipient);
    event PartialManualReleaseDelayUpdated(uint256 partialManualReleaseDelay);

    /* ============ Standardized Custom Errors ============ */
    
    // Zero value errors
    error ZeroAddress();
    error ZeroValue();
    
    // Authorization errors
    error UnauthorizedEscrowCaller(address caller);
    error UnauthorizedCaller(address caller, address authorized);
    
    // Not found errors
    error IntentNotFound(bytes32 intentHash);
    error PaymentMethodDoesNotExist(bytes32 paymentMethod);
    error PaymentMethodNotSupported(bytes32 paymentMethod);
    error CurrencyNotSupported(bytes32 paymentMethod, bytes32 currency);
    
    // Whitelist errors
    error PaymentMethodNotWhitelisted(bytes32 paymentMethod);
    error PostIntentHookNotWhitelisted(address hook);
    error EscrowNotWhitelisted(address escrow);
    
    // Amount and fee errors
    error AmountBelowMin(uint256 amount, uint256 min);
    error AmountAboveMax(uint256 amount, uint256 max);
    error AmountExceedsLimit(uint256 amount, uint256 limit);
    error FeeExceedsMaximum(uint256 fee, uint256 maximum);
    error RateBelowMinimum(uint256 rate, uint256 minRate);
    
    // Validation errors
    error AccountHasActiveIntent(address account, bytes32 existingIntent);
    error InvalidReferrerFeeConfiguration();
    error InvalidSignature();
    error SignatureExpired(uint256 expiration, uint256 currentTime);
    error PartialReleaseNotAllowedYet(uint256 currentTime, uint256 allowedTime);

    // Verification errors
    error PaymentVerificationFailed();
    error HashMismatch(bytes32 expected, bytes32 actual);
     
    // Transfer errors
    error TransferFailed(address recipient, uint256 amount);
    error EscrowLockFailed();

    /* ============ View Functions ============ */

    function getIntent(bytes32 intentHash) external view returns (Intent memory);
    function getAccountIntents(address account) external view returns (bytes32[] memory);
    
    /* ============ External Functions for Users ============ */

    function signalIntent(SignalIntentParams calldata params) external;

    function cancelIntent(bytes32 intentHash) external;

    function fulfillIntent(FulfillIntentParams calldata params) external;

    function releaseFundsToPayer(bytes32 intentHash) external;

    /* ============ External Functions for Escrow ============ */

    function pruneIntents(bytes32[] calldata intentIds) external;
}
          

contracts/interfaces/IPaymentVerifier.sol

//SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;


interface IPaymentVerifier {

    /* ============ Structs ============ */

    struct VerifyPaymentData {
        bytes32 intentHash;                     // The hash of the intent being fulfilled
        bytes paymentProof;                     // Payment proof
        bytes data;                             // Additional data provided by the taker
    }

    struct PaymentVerificationResult {
        bool success;                           // Whether the payment verification succeeded
        bytes32 intentHash;                     // The hash of the intent being fulfilled
        uint256 releaseAmount;                  // The amount of tokens to release
    }

    /* ============ External Functions ============ */

    function verifyPayment(
        VerifyPaymentData calldata _verifyPaymentData
    )   
        external
        returns(PaymentVerificationResult memory result);

}
          

Compiler Settings

{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","devdoc","userdoc","storageLayout","evm.gasEstimates"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_owner","internalType":"address"},{"type":"uint256","name":"_chainId","internalType":"uint256"},{"type":"address","name":"_paymentVerifierRegistry","internalType":"address"},{"type":"address","name":"_dustRecipient","internalType":"address"},{"type":"uint256","name":"_dustThreshold","internalType":"uint256"},{"type":"uint256","name":"_maxIntentsPerDeposit","internalType":"uint256"},{"type":"uint256","name":"_intentExpirationPeriod","internalType":"uint256"}]},{"type":"error","name":"AmountAboveMax","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]},{"type":"error","name":"AmountBelowMin","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min","internalType":"uint256"}]},{"type":"error","name":"AmountExceedsAvailable","inputs":[{"type":"uint256","name":"requested","internalType":"uint256"},{"type":"uint256","name":"available","internalType":"uint256"}]},{"type":"error","name":"ArrayLengthMismatch","inputs":[{"type":"uint256","name":"length1","internalType":"uint256"},{"type":"uint256","name":"length2","internalType":"uint256"}]},{"type":"error","name":"CurrencyAlreadyExists","inputs":[{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"currency","internalType":"bytes32"}]},{"type":"error","name":"CurrencyNotFound","inputs":[{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"currency","internalType":"bytes32"}]},{"type":"error","name":"CurrencyNotSupported","inputs":[{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"currency","internalType":"bytes32"}]},{"type":"error","name":"DelegateNotFound","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"}]},{"type":"error","name":"DepositAlreadyInState","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"bool","name":"currentState","internalType":"bool"}]},{"type":"error","name":"DepositNotAcceptingIntents","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"}]},{"type":"error","name":"DepositNotFound","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"}]},{"type":"error","name":"EmptyPayeeDetails","inputs":[]},{"type":"error","name":"InsufficientDepositLiquidity","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"uint256","name":"available","internalType":"uint256"},{"type":"uint256","name":"required","internalType":"uint256"}]},{"type":"error","name":"IntentAlreadyExists","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"bytes32","name":"intentHash","internalType":"bytes32"}]},{"type":"error","name":"IntentNotFound","inputs":[{"type":"bytes32","name":"intentHash","internalType":"bytes32"}]},{"type":"error","name":"InvalidRange","inputs":[{"type":"uint256","name":"min","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]},{"type":"error","name":"MaxIntentsExceeded","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"uint256","name":"current","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]},{"type":"error","name":"PaymentMethodAlreadyExists","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"}]},{"type":"error","name":"PaymentMethodNotActive","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"}]},{"type":"error","name":"PaymentMethodNotListed","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256"},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"}]},{"type":"error","name":"PaymentMethodNotWhitelisted","inputs":[{"type":"bytes32","name":"paymentMethod","internalType":"bytes32"}]},{"type":"error","name":"UnauthorizedCaller","inputs":[{"type":"address","name":"caller","internalType":"address"},{"type":"address","name":"authorized","internalType":"address"}]},{"type":"error","name":"UnauthorizedCallerOrDelegate","inputs":[{"type":"address","name":"caller","internalType":"address"},{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"delegate","internalType":"address"}]},{"type":"error","name":"ZeroAddress","inputs":[]},{"type":"error","name":"ZeroConversionRate","inputs":[]},{"type":"error","name":"ZeroMinValue","inputs":[]},{"type":"error","name":"ZeroValue","inputs":[]},{"type":"event","name":"DepositAcceptingIntentsUpdated","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bool","name":"acceptingIntents","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"DepositClosed","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":false},{"type":"address","name":"depositor","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"DepositCurrencyAdded","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"currency","internalType":"bytes32","indexed":true},{"type":"uint256","name":"minConversionRate","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DepositDelegateRemoved","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"address","name":"depositor","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DepositDelegateSet","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"address","name":"depositor","internalType":"address","indexed":true},{"type":"address","name":"delegate","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DepositFundsAdded","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"address","name":"depositor","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DepositIntentAmountRangeUpdated","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"tuple","name":"intentAmountRange","internalType":"struct IEscrow.Range","indexed":false,"components":[{"type":"uint256","name":"min","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]}],"anonymous":false},{"type":"event","name":"DepositMinConversionRateUpdated","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"currency","internalType":"bytes32","indexed":true},{"type":"uint256","name":"newMinConversionRate","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DepositPaymentMethodActiveUpdated","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32","indexed":true},{"type":"bool","name":"active","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"DepositPaymentMethodAdded","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"paymentMethod","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"payeeDetails","internalType":"bytes32","indexed":true},{"type":"address","name":"intentGatingService","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"DepositReceived","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"address","name":"depositor","internalType":"address","indexed":true},{"type":"address","name":"token","internalType":"contract IERC20","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"tuple","name":"intentAmountRange","internalType":"struct IEscrow.Range","indexed":false,"components":[{"type":"uint256","name":"min","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]},{"type":"address","name":"delegate","internalType":"address","indexed":false},{"type":"address","name":"intentGuardian","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"DepositRetainOnEmptyUpdated","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bool","name":"retainOnEmpty","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"DepositWithdrawn","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"address","name":"depositor","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DustCollected","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"uint256","name":"dustAmount","internalType":"uint256","indexed":false},{"type":"address","name":"dustRecipient","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DustRecipientUpdated","inputs":[{"type":"address","name":"dustRecipient","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DustThresholdUpdated","inputs":[{"type":"uint256","name":"dustThreshold","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FundsLocked","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"intentHash","internalType":"bytes32","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"expiryTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FundsUnlocked","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"intentHash","internalType":"bytes32","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FundsUnlockedAndTransferred","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"intentHash","internalType":"bytes32","indexed":true},{"type":"uint256","name":"unlockedAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"transferredAmount","internalType":"uint256","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"IntentExpirationPeriodUpdated","inputs":[{"type":"uint256","name":"intentExpirationPeriod","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"IntentExpiryExtended","inputs":[{"type":"uint256","name":"depositId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"intentHash","internalType":"bytes32","indexed":true},{"type":"uint256","name":"newExpiryTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MaxIntentsPerDepositUpdated","inputs":[{"type":"uint256","name":"maxIntentsPerDeposit","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MinDepositAmountSet","inputs":[{"type":"uint256","name":"minDepositAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OrchestratorUpdated","inputs":[{"type":"address","name":"orchestrator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PaymentVerifierRegistryUpdated","inputs":[{"type":"address","name":"paymentVerifierRegistry","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addCurrencies","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"},{"type":"tuple[]","name":"_currencies","internalType":"struct IEscrow.Currency[]","components":[{"type":"bytes32","name":"code","internalType":"bytes32"},{"type":"uint256","name":"minConversionRate","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addFunds","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPaymentMethods","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32[]","name":"_paymentMethods","internalType":"bytes32[]"},{"type":"tuple[]","name":"_paymentMethodData","internalType":"struct IEscrow.DepositPaymentMethodData[]","components":[{"type":"address","name":"intentGatingService","internalType":"address"},{"type":"bytes32","name":"payeeDetails","internalType":"bytes32"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"tuple[][]","name":"_currencies","internalType":"struct IEscrow.Currency[][]","components":[{"type":"bytes32","name":"code","internalType":"bytes32"},{"type":"uint256","name":"minConversionRate","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"chainId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createDeposit","inputs":[{"type":"tuple","name":"_params","internalType":"struct IEscrow.CreateDepositParams","components":[{"type":"address","name":"token","internalType":"contract IERC20"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"tuple","name":"intentAmountRange","internalType":"struct IEscrow.Range","components":[{"type":"uint256","name":"min","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]},{"type":"bytes32[]","name":"paymentMethods","internalType":"bytes32[]"},{"type":"tuple[]","name":"paymentMethodData","internalType":"struct IEscrow.DepositPaymentMethodData[]","components":[{"type":"address","name":"intentGatingService","internalType":"address"},{"type":"bytes32","name":"payeeDetails","internalType":"bytes32"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"tuple[][]","name":"currencies","internalType":"struct IEscrow.Currency[][]","components":[{"type":"bytes32","name":"code","internalType":"bytes32"},{"type":"uint256","name":"minConversionRate","internalType":"uint256"}]},{"type":"address","name":"delegate","internalType":"address"},{"type":"address","name":"intentGuardian","internalType":"address"},{"type":"bool","name":"retainOnEmpty","internalType":"bool"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deactivateCurrency","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"_currencyCode","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"depositCounter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"dustRecipient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"dustThreshold","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"extendIntentExpiry","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_intentHash","internalType":"bytes32"},{"type":"uint256","name":"_additionalTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getAccountDeposits","inputs":[{"type":"address","name":"_account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEscrow.Deposit","components":[{"type":"address","name":"depositor","internalType":"address"},{"type":"address","name":"delegate","internalType":"address"},{"type":"address","name":"token","internalType":"contract IERC20"},{"type":"tuple","name":"intentAmountRange","internalType":"struct IEscrow.Range","components":[{"type":"uint256","name":"min","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]},{"type":"bool","name":"acceptingIntents","internalType":"bool"},{"type":"uint256","name":"remainingDeposits","internalType":"uint256"},{"type":"uint256","name":"outstandingIntentAmount","internalType":"uint256"},{"type":"address","name":"intentGuardian","internalType":"address"},{"type":"bool","name":"retainOnEmpty","internalType":"bool"}]}],"name":"getDeposit","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"","internalType":"bytes32[]"}],"name":"getDepositCurrencies","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"getDepositCurrencyListed","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"_currencyCode","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDepositCurrencyMinRate","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"_currencyCode","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getDepositGatingService","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEscrow.Intent","components":[{"type":"bytes32","name":"intentHash","internalType":"bytes32"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"timestamp","internalType":"uint256"},{"type":"uint256","name":"expiryTime","internalType":"uint256"}]}],"name":"getDepositIntent","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_intentHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"","internalType":"bytes32[]"}],"name":"getDepositIntentHashes","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"getDepositPaymentMethodActive","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IEscrow.DepositPaymentMethodData","components":[{"type":"address","name":"intentGatingService","internalType":"address"},{"type":"bytes32","name":"payeeDetails","internalType":"bytes32"},{"type":"bytes","name":"data","internalType":"bytes"}]}],"name":"getDepositPaymentMethodData","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"getDepositPaymentMethodListed","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"","internalType":"bytes32[]"}],"name":"getDepositPaymentMethods","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32[]","name":"expiredIntents","internalType":"bytes32[]"},{"type":"uint256","name":"reclaimableAmount","internalType":"uint256"}],"name":"getExpiredIntents","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"intentExpirationPeriod","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"lockFunds","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_intentHash","internalType":"bytes32"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxIntentsPerDeposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOrchestrator"}],"name":"orchestrator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pauseEscrow","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPaymentVerifierRegistry"}],"name":"paymentVerifierRegistry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pruneExpiredIntents","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeDelegate","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeFunds","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAcceptingIntents","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bool","name":"_acceptingIntents","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCurrencyMinRate","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"},{"type":"bytes32","name":"_fiatCurrency","internalType":"bytes32"},{"type":"uint256","name":"_newMinConversionRate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDelegate","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"address","name":"_delegate","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDustRecipient","inputs":[{"type":"address","name":"_dustRecipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDustThreshold","inputs":[{"type":"uint256","name":"_dustThreshold","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIntentExpirationPeriod","inputs":[{"type":"uint256","name":"_intentExpirationPeriod","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIntentRange","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"tuple","name":"_intentAmountRange","internalType":"struct IEscrow.Range","components":[{"type":"uint256","name":"min","internalType":"uint256"},{"type":"uint256","name":"max","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxIntentsPerDeposit","inputs":[{"type":"uint256","name":"_maxIntentsPerDeposit","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOrchestrator","inputs":[{"type":"address","name":"_orchestrator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPaymentMethodActive","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_paymentMethod","internalType":"bytes32"},{"type":"bool","name":"_isActive","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPaymentVerifierRegistry","inputs":[{"type":"address","name":"_paymentVerifierRegistry","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRetainOnEmpty","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bool","name":"_retainOnEmpty","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unlockAndTransferFunds","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_intentHash","internalType":"bytes32"},{"type":"uint256","name":"_transferAmount","internalType":"uint256"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unlockFunds","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"},{"type":"bytes32","name":"_intentHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpauseEscrow","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawDeposit","inputs":[{"type":"uint256","name":"_depositId","internalType":"uint256"}]}]
              

Contract Creation Code

0x60a0346200019f57601f62003f8938819003918201601f19168301916001600160401b03831184841017620001a45780849260e0946040528339810103126200019f576200004d81620001ba565b9060208101516200006160408301620001ba565b6200006f60608401620001ba565b92608081015160c060a0830151920151926200008b33620001cf565b6000549460ff60a01b1986166000556001805560805260018060a01b0380968160018060a01b031993168360035416176003551690601054161760105560115560125560135581339116036200015b578116156200010757620000ee90620001cf565b604051613d72908162000217823960805181610c3a0152f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200019f57565b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6080604052600436101561001257600080fd5b60003560e01c806309207525146123b65780630be8d2911461227657806317192c29146121355780631a251a58146120375780631abcbe6314611c5c5780631cfd5c1614611b3657806320d8005a14611af7578063236a8d9b1461199e578063240c1781146119635780632692b459146118215780632d7b036f146117e957806333289a461461171757806337a6b5e21461167b5780633abb7c0614611649578063407c8d43146114d35780634298734914611480578063432e707b1461135957806343f1a2af146112f05780634de088ff1461129d5780635081d9521461121257806359955d5d146111ce5780635c975abb146111a857806368b9646e14611172578063715018a6146111195780637414f907146110e157806381ceb735146110b857806385f45250146110115780638ced63b414610f185780638d08e55014610e7d5780638da5cb5b14610e5457806394dcf2e614610dc557806395fe9a5e14610d6357806397f2ab9014610c5d5780639a8a059214610c225780639f9fb96814610a88578063a16087d214610a6a578063a1a954b714610a4c578063aaa3e37714610a23578063ad7e55ba146109ac578063ad8054821461096f578063b74795d914610946578063c1ce1cde14610909578063c84b5cf9146107c9578063cd28ef0d14610760578063ceb5e29b1461069b578063e7433b6e14610646578063e8462e8f14610628578063eb14f669146105ad578063ec3453c2146104a8578063ecb3dc881461048a578063f2fde38b146103c15763f802ad8a1461025857600080fd5b346103bc5760603660031901126103bc576044356024356001600160401b036004358184116103bc57366023850112156103bc5783600401359182116103bc576024840193602436918460061b0101116103bc576102b4612868565b80600052602093600c8552604060002060018060a01b038082541691338314801561039a575b15610360575050508160005260078552604060002084600052855260ff60406000205416156103425760005b83811061030f57005b8061033861032161033d938786612ba4565b358861032e848988612ba4565b0135908887613b74565b612754565b610306565b604482856040519163016f65ad60e01b835260048301526024820152fd5b60010154604051639a313e5960e01b81523360048201526001600160a01b03938416602482015291169091166044820152606490fd5b0390fd5b508160018201541680151590816103b2575b506102da565b90503314386103ac565b600080fd5b346103bc5760203660031901126103bc576103da612682565b6103e26126fc565b6001600160a01b0390811690811561043657600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346103bc5760003660031901126103bc576020600f54604051908152f35b346103bc5760803660031901126103bc576004356001600160401b036024358181116103bc576104dc9036906004016126cc565b916044358181116103bc576104f59036906004016126cc565b916064359081116103bc5761050e9036906004016126cc565b949093610519612868565b6000878152600c6020526040902080546001600160a01b039081169891338a14801561058b575b1561055357505061055197506136a6565b005b60010154604051639a313e5960e01b81523360048201526001600160a01b038b81166024830152929091169091166044820152606490fd5b508160018201541680151590816105a3575b50610540565b905033148b61059d565b346103bc5760203660031901126103bc576105c6612682565b6105ce6126fc565b6001600160a01b0316801561061657600380546001600160a01b031916821790557fe94f9ee78059bc733bb08fb7b593ad1873182fd795acdaefe39664192e202882600080a2005b60405163d92e233d60e01b8152600490fd5b346103bc5760003660031901126103bc576020601154604051908152f35b346103bc5760203660031901126103bc57600435600052600660205261069761067c610683604060002060405192838092612bda565b0382612812565b604051918291602083526020830190612698565b0390f35b346103bc5760203660031901126103bc576004356106b7612868565b6000818152600c6020526040902080546001600160a01b039190821633810361073757506001019081549081161561071e576001600160a01b031916905533907fa8461c8fb28662d101f3bf3eb596a71303b9c564229ee651fba61bc142ecbf99600080a3005b604051632dd920ef60e01b815260048101849052602490fd5b60405163536dd9ef60e01b81523360048201526001600160a01b03919091166024820152604490fd5b346103bc5760203660031901126103bc57610779612682565b6107816126fc565b6001600160a01b0316801561061657600280546001600160a01b031916821790557fdde46f8c71b67178c4fdd3cd7e4a49fac7292e29d2bb2ef7d2b9819be1fb890a600080a2005b346103bc576107d736612603565b82600093929352600c602052604060002090600e60205260406000208460005260205260406000209160018060a01b039081815416156108f0578354156108d7576008015416338103610737575080156108c5576003820191825490600261083f8484612af6565b91015462069780918282018092116108af57116108915750916108856020927f25d8768b3a9457fb1df954be09208c92c28109be47542d0eb8726e83ab48c5c794612af6565b809155604051908152a3005b8260449160405191637e53d67d60e11b835260048301526024820152fd5b634e487b7160e01b600052601160045260246000fd5b604051637c946ed760e01b8152600490fd5b604051639481f8b960e01b815260048101879052602490fd5b604051631585bdab60e31b815260048101869052602490fd5b346103bc5760203660031901126103bc5761093c610928600435612cae565b604051928392604084526040840190612698565b9060208301520390f35b346103bc5760003660031901126103bc576002546040516001600160a01b039091168152602090f35b346103bc5761097d3661261d565b90600052600a60205260406000209060005260205261069761067c610683604060002060405192838092612bda565b346103bc5760203660031901126103bc576004356109c86126fc565b620f4240808211610a04577f4514c31bd13e0eecf1250995ffc6e6fb3eaec9377d728cc3325b3c87a58a323a60208380601155604051908152a1005b604051637e53d67d60e11b815260048101929092526024820152604490fd5b346103bc5760003660031901126103bc576010546040516001600160a01b039091168152602090f35b346103bc5760003660031901126103bc576020601354604051908152f35b346103bc5760003660031901126103bc576020601254604051908152f35b346103bc5760203660031901126103bc576000610100604051610aaa816127db565b828152826020820152826040820152604051610ac5816127f7565b83815283602082015260608201528260808201528260a08201528260c08201528260e08201520152600435600052600c602052610140604060002060ff600860405192610b11846127db565b80546001600160a01b03908116855260018201548116602086015260028201541660408086019190915251610b45816127f7565b600382015481526004820154602082015260608501528260058201541615156080850152600681015460a0850152600781015460c0850152015460018060a01b03811660e084015260a01c1615156101008201526101006040519160018060a01b03815116835260018060a01b03602082015116602084015260018060a01b0360408201511660408401526020606082015180516060860152015160808401526080810151151560a084015260a081015160c084015260c081015160e084015260018060a01b0360e0820151168284015201511515610120820152f35b346103bc5760003660031901126103bc5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346103bc5760403660031901126103bc57600435610c79612673565b90610c82612868565b6000818152600c6020526040902080546001600160a01b03908116913383148015610d41575b156103605750505080600052600c602052600860406000200160ff815460a01c16908315158092151514610d1d57805460ff60a01b191684151560a01b60ff60a01b161790557ff31750caa046b294dda58b65be18389f4e94ad6ecb4858b6efab8c7cf2ef24e7906020905b604051908152a2005b50506040516358efc88160e01b815260048101919091529015156024820152604490fd5b50816001820154168015159081610d59575b50610ca8565b9050331486610d53565b346103bc5760003660031901126103bc57610d7c6126fc565b610d84612868565b6000805460ff60a01b1916600160a01b1790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1005b346103bc5760403660031901126103bc576001600160a01b0360243581811691600435918390036103bc57610df8612868565b81600052600c602052604060002090815416338103610737575082156106165760010180546001600160a01b0319168317905533907f177e76a486c6b85fe60246345e71d615cb0c8448a2290461819040cafdbfe71a600080a4005b346103bc5760003660031901126103bc576000546040516001600160a01b039091168152602090f35b346103bc57610e8b3661261d565b9060006060604051610e9c816127a5565b8281528260208201528260408201520152600052600e60205260406000209060005260205260806040600020604051610ed4816127a5565b815491828252600181015460208301908152606060036002840154936040860194855201549301928352604051938452516020840152516040830152516060820152f35b346103bc57610f263661261d565b610f2e612b10565b610f36612868565b6000828152600c6020526040902080546001600160a01b039291908316338103610737575081156108c557610f6c828583612f12565b926006820194855495848710610fea57610f8a85610fce9798612b03565b9055610f958161313e565b604051908482527fae1f357660ab777dcfd38c0ab6357834684ec26289ecfa07ec65dbf6c3c6431260203393a360023392015416612b66565b8051610fdb575b60018055005b610fe4906130df565b80610fd5565b60405163c3df48f360e01b8152600481018390526024810188905260448101869052606490fd5b346103bc5761101f3661261d565b611027612868565b6000828152600c60205260409020805490926001600160a01b03918216156110a05782156108c5578360029160066105519601611065868254612af6565b9055604051908582527f6dd055b2e2bf3452b033736068d30d709ffb26f2016b48ba9a612c3701bf33a960203393a3015416309033906128af565b60249060405190631585bdab60e31b82526004820152fd5b346103bc5760003660031901126103bc576003546040516001600160a01b039091168152602090f35b346103bc576110ef3661261d565b906000526007602052604060002090600052602052602060ff604060002054166040519015158152f35b346103bc5760003660031901126103bc576111326126fc565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103bc5760203660031901126103bc57600435600052600d60205261069761067c610683604060002060405192838092612bda565b346103bc5760003660031901126103bc57602060ff60005460a01c166040519015158152f35b346103bc576111dc36612603565b91600052600b602052604060002090600052602052604060002090600052602052602060ff604060002054166040519015158152f35b346103bc576020806003193601126103bc57611254906001600160a01b03611238612682565b166000526004815261125b604060002060405193848092612bda565b0383612812565b6040519181839283018184528251809152816040850193019160005b82811061128657505050500390f35b835185528695509381019392810192600101611277565b346103bc5760203660031901126103bc576004356112b96126fc565b80156108c5576020817f079e53dc927596d8e1015cfdf0b2e3135c2e06774fa76e2e4bff009fd030d7a292601255604051908152a1005b346103bc5760203660031901126103bc57611309612682565b6113116126fc565b6001600160a01b0316801561061657601080546001600160a01b031916821790557fc76447012850d72eea0bcd2c87f26d6fa622f7708b07d0ed3d1de5cf3f58a6b7600080a2005b346103bc576113673661261d565b90611370612b10565b6002546001600160a01b0390811633819003610737575081600052600c6020526040600020600e602052604060002084600052602052604060002091604051906113b9826127a5565b8354825260036001850154946020840195865260028101546040850152015460608301528254161561146757511561144e57816020917f683f6606eec92f04a68f1797d32d15f840b9b3d410a8ec9b4fdab4c30813796d935161142160068301918254612af6565b9055611434600783519201918254612b03565b90556114408585612fb7565b51604051908152a360018055005b604051639481f8b960e01b815260048101859052602490fd5b604051631585bdab60e31b815260048101859052602490fd5b346103bc5760203660031901126103bc5760043561149c6126fc565b80156108c5576020817f084016fbffe5e2f11ac2b66a265f9d57ae10335d188ff1ca7d9d1efb35b71e0f92601355604051908152a1005b346103bc5760803660031901126103bc576064356001600160a01b0381811691604435916024356004358584036103bc5761150c612b10565b8260025416803303610737575080600052600c602052604060002092600e60205260406000208360005260205260406000209060405161154b816127a5565b825481526003600184015493602083019485526002810154604084015201546060820152818654161561146757511561144e5786156108c557815180881161162b5750610fd597826115f16060937f45625e0810f65b3c601b5c91bdacdf9e8f9ec7098fce927c57a8a65a823fd61795516115cb60078b01918254612b03565b905582518b81811061160a575b50506115e48888612fb7565b60028901541697866131af565b51906040519182528860208301526040820152a3612b66565b61161391612b03565b61162260068b01918254612af6565b90558c8b6115d8565b87604491604051916368d9260360e01b835260048301526024820152fd5b346103bc5760203660031901126103bc57610fce600435611668612b10565b80600052600c6020526040600020612df3565b346103bc5760003660031901126103bc576116946126fc565b60005460ff8160a01c16156116db5760ff60a01b19166000556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b346103bc5760203660031901126103bc57600435611733612b10565b6000818152600c6020526040902080546001600160a01b03908116923384036117c25790816117bb611768610fce9486612df3565b94600681019283549460008160028501541695556005830160ff198154169055825416817fae1f357660ab777dcfd38c0ab6357834684ec26289ecfa07ec65dbf6c3c643126020604051898152a36131af565b3390612b66565b60405163536dd9ef60e01b81523360048201526001600160a01b0385166024820152604490fd5b346103bc576117f73661261d565b906000526008602052604060002090600052602052602060ff604060002054166040519015158152f35b346103bc5760403660031901126103bc5760043561183d612673565b611845612868565b6000828152600c6020526040902080546001600160a01b03908116913383148015611941575b156103605750505081600052600c6020526040600020906005820160ff81541692821515809415151461192057828061190f575b6118de575091610d146020927f184e3738774b2dc98019706750a38aeb01148b3b0c263e9b3374288835adc07d949060ff801983541691151516179055565b600681015460039091015460405163c3df48f360e01b81526004810187905260248101929092526044820152606490fd5b50600681015460038201541161189f565b6040516358efc88160e01b8152600481018690528315156024820152604490fd5b50816001820154168015159081611959575b5061186b565b9050331486611953565b346103bc576119713661261d565b906000526005602052604060002090600052602052602060018060a01b0360406000205416604051908152f35b346103bc5760603660031901126103bc576024356004356044358015158082036103bc576119ca612868565b82600052602091600c8352604060002060018060a01b0380825416913383148015611ad5575b15610360575050508360005260088352604060002085600052835260ff6040600020541615611ab757836000526007835260406000208560005283528160ff60406000205416151514611a965790611a8d7ffc0fae2131c415309f829a0025dc0c5e27bd3c891bfb77cc0d2269a19ac0437993928560005260078452604060002087600052845260406000209060ff801983541691151516179055565b604051908152a3005b6040516358efc88160e01b8152600481018590529015156024820152604490fd5b60448486604051916336626ad160e11b835260048301526024820152fd5b50816001820154168015159081611aed575b506119f0565b9050331489611ae7565b346103bc57611b0536612603565b9160005260096020526040600020906000526020526040600020906000526020526020604060002054604051908152f35b346103bc5760803660031901126103bc57604435602435600435606435611b5b612868565b816000526020600c8152604060002060018060a01b0380825416913383148015611c3a575b156103605750505082600052600b81526040600020846000528152604060002085600052815260ff6040600020541615611c1c578115611c0a577fd12c0bb04d0c36c3143ef1c16a65cddd4ec064708de79e997d96e86f3bbd15979183600052600982526040600020856000528252604060002086600052825280604060002055604051908152a4005b60405163123d7ce760e11b8152600490fd5b6044848660405191636bb6647d60e11b835260048301526024820152fd5b50816001820154168015159081611c52575b50611b80565b9050331489611c4c565b346103bc576003196020368201126103bc576001600160401b03600435116103bc5761014060043560040191600435360301126103bc57611c9b612868565b604460043501351561202557606460043501356044600435013511611ffd57604460043501356024600435013510611fd557600f5490611cda82612754565b600f5533600052600460205260406000208054600160401b811015611fbf57611d0d8185936001611d2494018155612763565b819391549060031b91821b91600019901b19161790565b9055611d3460e460043501612791565b90611d3e81612791565b611d4d61010460043501612791565b9361012460043501359182151583036103bc5760405194611d6d866127db565b3386526001600160a01b03908116602087015216604080860191909152600435360360431901126103bc57611ee1611fae94611fa99361055197604051611db3816127f7565b6044600435013581526064600435013560208201526060840152600160808401526024600435013560a0840152600060c084015260018060a01b031660e08301526101008201901515815283600052600c6020526040600020600860018060a01b03845116916bffffffffffffffffffffffff60a01b92838254161781556001810160018060a01b03602087015116848254161790556002810160018060a01b0360408701511684825416179055602060608601518051600384015501516004820155611e9560808601511515600583019060ff801983541691151516179055565b60a085810151600683015560c0860151600783015560e09095015191018054935160ff60a01b90151590951b949094166001600160a01b039091169190921660ff60a01b191617179055565b611eea83612791565b611ef860e460043501612791565b90611f0861010460043501612791565b60408051600435602481013582526044810135602083015260640135918101919091526001600160a01b0393841660608201529083166080820152911690339083907f1236dbdc184b6c8721974cce53dabb6018679bca9a43784ab2ad71bcdb1d7dd19060a090a4611f7f60846004350184612833565b611f9160a46004949394350186612833565b91611fa160c46004350188612833565b9590946136a6565b612791565b6024600435013590309033906128af565b634e487b7160e01b600052604160045260246000fd5b60446040516338fcec4360e01b81526024600435013560048201528160043501356024820152fd5b6044604051632457cde760e01b81528160043501356004820152606460043501356024820152fd5b6040516314d323eb60e21b8152600490fd5b346103bc5760603660031901126103bc5760043560403660231901126103bc5761205f612868565b6000818152600c6020526040902080546001600160a01b03908116913383148015612113575b15610360578380600052600c602052604060002060243590811561202557604435908183116120f55791816040926004858460037fdf91c8dff53bac50f3157cba47dee1c65eeeafe480d9f529e9db0c5bc4a9ba3998015501556120e88561313e565b82519182526020820152a2005b6044838360405191632457cde760e01b835260048301526024820152fd5b5081600182015416801515908161212b575b50612085565b9050331485612125565b346103bc576121433661261d565b60405191612150836127c0565b600083526060604060209460008682015201526000526005825260406000209060005281526040600020604051612186816127c0565b81546001600160a01b039081168252600183810154858401908152604051600290950180549395939192600092916121bd83612c17565b808752928281169081156122545750600114612216575b505050946121e9836106979596970384612812565b60408501928352604051958695828752511690850152516040840152516060808401526080830190612633565b6000908152888120909893505b828910612241575091968401870191506121e99050836106976121d4565b8054868a01850152978301978101612223565b60ff1916878b0152505050151560051b8301860190506121e9836106976121d4565b346103bc5761228436612603565b9161228d612868565b806000526020600c8152604060002060018060a01b0380825416913383148015612394575b15610360575050508160005260078152604060002083600052815260ff60406000205416156123765781600052600b81526040600020836000528152604060002084600052815260ff6040600020541615612358577fd12c0bb04d0c36c3143ef1c16a65cddd4ec064708de79e997d96e86f3bbd1597908260005260098152604060002084600052815260406000208560005281526000604081205560405160008152a4005b6044838560405191630dca536360e41b835260048301526024820152fd5b506044916040519163016f65ad60e01b835260048301526024820152fd5b508160018201541680151590816123ac575b506122b2565b90503314886123a6565b346103bc576123c436612603565b916123cd612b10565b6002546001600160a01b0393908416338190036107375750816000526020600c8152604060002094855416156125ea5760ff600586015416156125d15760038501548083106125b357506004850154808311610891575082600052600e815260406000208460005281526040600020546125955761244c828487612f12565b9460068101805484811061256d5785600052600d8452604060002054600181018091116108af576012548082116125475750508492604094926124b27fb40d75557428cec6806c7ebb58634796f8a5870a0874bcd0d299328b5518665b97600794612b03565b9055016124c0838254612af6565b905584600052600d81526124d78684600020612bb4565b6124e360135442612af6565b9083516124ef816127a5565b878152600382820185815286830142815260608401918683528a600052600e8652886000208c60005286528860002094518555516001850155516002840155519101558351928352820152a38051610fdb5760018055005b6040516344d2ea2360e01b81526004810189905260248101929092526044820152606490fd5b60405163c3df48f360e01b815260048101879052602481019190915260448101859052606490fd5b6044838560405191631817de9d60e21b835260048301526024820152fd5b82604491604051916338fcec4360e01b835260048301526024820152fd5b6040516333b4460d60e11b815260048101849052602490fd5b604051631585bdab60e31b815260048101849052602490fd5b60609060031901126103bc57600435906024359060443590565b60409060031901126103bc576004359060243590565b919082519283825260005b84811061265f575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161263e565b6024359081151582036103bc57565b600435906001600160a01b03821682036103bc57565b90815180825260208080930193019160005b8281106126b8575050505090565b8351855293810193928101926001016126aa565b9181601f840112156103bc578235916001600160401b0383116103bc576020808501948460051b0101116103bc57565b6000546001600160a01b0316330361271057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60001981146108af5760010190565b805482101561277b5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036103bc5790565b608081019081106001600160401b03821117611fbf57604052565b606081019081106001600160401b03821117611fbf57604052565b61012081019081106001600160401b03821117611fbf57604052565b604081019081106001600160401b03821117611fbf57604052565b90601f801991011681019081106001600160401b03821117611fbf57604052565b903590601e19813603018212156103bc57018035906001600160401b0382116103bc57602001918160051b360383136103bc57565b60ff60005460a01c1661287757565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a08101918183106001600160401b03841117611fbf5761290792604052612921565b565b908160209103126103bc575180151581036103bc5790565b6040516001600160a01b0390911692919061293b816127f7565b6020918282527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564838301526000808285829451910182895af13d15612a51573d956001600160401b038711612a3d576129b5949596604051906129a788601f19601f8401160183612812565b81528093873d92013e612a5d565b805190828215928315612a25575b505050156129ce5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b612a359350820181019101612909565b3882816129c3565b634e487b7160e01b83526041600452602483fd5b6129b593949591506060915b91929015612abf5750815115612a71575090565b3b15612a7a5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612ad25750805190602001fd5b60405162461bcd60e51b815260206004820152908190610396906024830190612633565b919082018092116108af57565b919082039182116108af57565b600260015414612b21576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261290791612b9f826127a5565b612921565b919081101561277b5760061b0190565b805490600160401b821015611fbf5781611d0d916001612bd694018155612763565b9055565b90815480825260208092019260005281600020916000905b828210612c00575050505090565b835485529384019360019384019390910190612bf2565b90600182811c92168015612c47575b6020831014612c3157565b634e487b7160e01b600052602260045260246000fd5b91607f1691612c26565b6001600160401b038111611fbf5760051b60200190565b90612c7282612c51565b612c7f6040519182612812565b8281528092612c90601f1991612c51565b0190602036910137565b805182101561277b5760209160051b010190565b90612cd5600092600093818552602094600d86526040612cdc818320825196878092612bda565b0386612812565b612ce68551612c68565b918094815b8751811015612d8d57818352600e8a52838320612d08828a612c9a565b5184528a528960608585206003875191612d21836127a5565b805483526001810154948301948552600281015489840152015491829101524211612d56575b50612d5190612754565b612ceb565b612d80829897612d8692612d6d612d51958d612c9a565b51612d788c8b612c9a565b525190612af6565b96612754565b9690612d47565b5050949596505091612d9e90612c68565b94835b8551811015612deb5780612db8612dc29286612c9a565b51612dc757612754565b612da1565b612dd18186612c9a565b51612de5612dde88612754565b978a612c9a565b52612754565b509250925050565b91909160608093600683019283549060001982108015612ef9575b612e1a575b5050505050565b909192939550612e476007612e2e85612cae565b939098612e3c858b97612af6565b905501918254612b03565b905560005b8551811015612eea57612ee590836000526020600e8152847f683f6606eec92f04a68f1797d32d15f840b9b3d410a8ec9b4fdab4c30813796d60409283600020612e96868d612c9a565b51600052815283600020938051612eac816127a5565b612ed786548083526003600189015498868501998a5260028101548686015201548d84015286612fb7565b5194519051908152a3612754565b612e4c565b50935050503880808080612e13565b5082600052600d60205260406000205460125414612e0e565b6006810180546060959491938693909282108015612f9e575b612f36575050505050565b909192939550612f4a6007612e2e85612cae565b905560005b8551811015612eea57612f9990836000526020600e8152847f683f6606eec92f04a68f1797d32d15f840b9b3d410a8ec9b4fdab4c30813796d60409283600020612e96868d612c9a565b612f4f565b5082600052600d60205260406000205460125414612f2b565b90600091808352600e602052604083208284526020528260036040822082815582600182015582600282015501558252600d60205261300a60408320916040516130058161067c8187612bda565b613cf8565b90929061304e5760405162461bcd60e51b8152602060048201526015602482015274313cba32b99999103737ba1034b71030b93930bc9760591b6044820152606490fd5b815460001993908481019081116130cb578082036130a4575b5050815490811561309057508201916130808383612763565b909182549160031b1b1916905555565b634e487b7160e01b81526031600452602490fd5b611d0d6130b46130c29286612763565b90549060031b1c9285612763565b90553880613067565b634e487b7160e01b83526011600452602483fd5b6002546001600160a01b0316803b156103bc57604051632cc410dd60e01b815260206004820152916000918391829084908290613120906024830190612698565b03925af161312b5750565b6001600160401b038111611fbf57604052565b80600052600c6020526040600020600581019081549060ff8216908161319c575b5061316957505050565b60ff191690557f184e3738774b2dc98019706750a38aeb01148b3b0c263e9b3374288835adc07d602060405160008152a2565b905060036006820154910154113861315f565b9060068101549160078083015415806135e8575b806135d6575b6131d4575b50505050565b9091929360018060a01b036002850154169460018060a01b03855416958660005260046020526040600020966132178661067c6130058b60405192838092612bda565b6132585760405162461bcd60e51b81526020600482015260156024820152743ab4b73a191a9b103737ba1034b71030b93930bc9760591b6044820152606490fd5b885460001991908281019081116108af57808203613595575b5050885498891561357f57816132be9a019161328d8383612763565b909182549160031b1b19169055559296919590938560005260066020526132c5604060002060405194858092612bda565b0384612812565b6000965b835188101561348a579761338b986132e18986612c9a565b519688600052600580602052604060002089600052602052600260406000206000815560006001820155016133168154612c17565b80613449575b5050508860005283602052604060002088600052602052604060002060ff198154169055886000526008602052604060002088600052602052604060002060ff19815416905588600052600a60205260406000208860005260205261339260406000206040519c8d8092612bda565b038c612812565b60005b8b5181101561340d57806133ac613408928e612c9a565b518b600052600960205260406000208b600052602052604060002081600052602052600060408120558b600052600b60205260406000208b600052602052604060002090600052602052604060002060ff198154169055612754565b613395565b5093989094995061343d9195929688600052600a602052604060002090600052602052610338604060002061360b565b969194909397926132c9565b600092601f80831160011461346557505050555b38808061331c565b8391613483918694958552602085209501901c8401600185016135f4565b555561345d565b9650604092507f8ac07cc6e38c6222dd0309c80353c1962354bacf222b825d7401cc80e93ff3cc93916000600860059389835260066020526134cd87842061360b565b898352600c6020528287812091818355816001840155816002840155816003840155816004840155818784015581600684015582015501550160ff1981541690558151908582526020820152a182613526575b806131ce565b60105461353e9184916001600160a01b031690612b66565b6010546040519283526001600160a01b0316917f3e73fc0f76c9d35dff306ff859166692f079fb15a5686aa4997177493cc5562f90602090a3388080613520565b634e487b7160e01b600052603160045260246000fd5b6135b0916135a66135cd928d612763565b939054918d612763565b91909360031b1c9083549060031b91821b91600019901b19161790565b90553880613271565b5060ff600884015460a01c16156131c9565b506011548411156131c3565b8181106135ff575050565b600081556001016135f4565b8054906000908181558261361e57505050565b815260208120918201915b82811061363557505050565b818155600101613629565b919081101561277b5760051b81013590605e19813603018212156103bc570190565b919081101561277b5760051b81013590601e19813603018212156103bc5701908135916001600160401b0383116103bc576020018260061b360381136103bc579190565b919392959095838503613b5657818503613b38576000945b8086106136cf575050505050505050565b60059891929394959697989587871b8a01351561061657600354604051634839762760e11b815289891b8c013560048083019190915291602491906020908290849082906001600160a01b03165afa908115613b2c57600091613afd575b5015613ae45760206137408b8589613640565b013515613ad45787600052600860205260406000208a8a1b8d013560005260205260ff60406000205416613ab157505061377b888286613640565b6000878152602089815260408083208c8c1b8f0135845290915290206001600160a01b036137a883612791565b82546001600160a01b031916911617815560208201356001820155604082013536839003601e19018112156103bc576001600160401b0381840135116103bc57808301353603602082850101136103bc57868b858f94808d958f92986138126002879b0154612c17565b90601f91828111613a70575b5060009183820135116001146139b357947f70bc150f4694f93722b39f936610105e3af883bc610a906afc7750c9c286e4ec97611fa995602098939560026138fd968b986139079b600091838201356139a4575b508281013560011b9260001991013560031b1c1916179101555b8a600052600686526138a784821b8d01356040600020612bb4565b8a60005260088652604060002084821b8d0135600052865260406000209060ff19916001838254161790558b60005260078752846040600020911b8d013560005286526001604060002091825416179055613640565b013596888c613640565b6040516001600160a01b0390911681528d8d1b9094013593a460005b61392e89878c613662565b905081101561398b5761394c816139468b898e613662565b90612ba4565b906040823603126103bc576103386020613986938e60405161396d816127f7565b83833593848352013593849101528d8d1b01358b613b74565b613923565b509493929198979661399e919650612754565b946136be565b838201018b0135915038613872565b906002840181526020812090805b83850135601f19168110613a4e575097611fa99560209893956002600187896139079c977f70bc150f4694f93722b39f936610105e3af883bc610a906afc7750c9c286e4ec9f8f9c9b6138fd9c0135601f19858501351610613a2d575b50500135811b0191015561388c565b8c60001960f88686013560031b161c19918585010101351690553880613a1e565b6020848601830181013584558d99508e985060019093019291820191016139c1565b613aa29060028601600052602060002084808786013501891c82019260208887013510613aa8575b01881c01906135f4565b3861381e565b92508192613a98565b60405163de5a6b7360e01b815291820188905289891b8c01359082015260449150fd5b50604051635fd1a61d60e11b8152fd5b60405163060f97e560e01b81528a8a1b8d013581840152fd5b613b1f915060203d602011613b25575b613b178183612812565b810190612909565b3861372d565b503d613b0d565b6040513d6000823e3d90fd5b6044858360405191631f4bb7c160e31b835260048301526024820152fd5b6044858560405191631f4bb7c160e31b835260048301526024820152fd5b93929360018060a01b0360035416604095865180926354e7105560e11b825285600483015286602483015281604460209586935afa908115613ced57600091613cd0575b5015613cb3578015613ca25782600052600b8252866000208460005282528660002085600052825260ff876000205416613c855782939495967f4eb2088b4fe1a7bcb1a232b3842804fd8290524696748bc7cc886d137fde15549360005260098352806000208660005283528060002087600052835281816000205584600052600a835280600020866000528352613c538782600020612bb4565b84600052600b8352806000208660005283528060002087600052835280600020600160ff1982541617905551908152a4565b6044848689519163ce83125960e01b835260048301526024820152fd5b865163123d7ce760e11b8152600490fd5b60448486895191636bb6647d60e11b835260048301526024820152fd5b613ce79150833d8511613b2557613b178183612812565b38613bb8565b88513d6000823e3d90fd5b9081519160005b838110613d13575050505060001990600090565b82613d1e8284612c9a565b5114613d3257613d2d90612754565b613cff565b925050509060019056fea26469706673582212201a57c3bb69c0b043a0b513b852560de552b71618f63fa8c6f894b3c0f2181da864736f6c63430008120033000000000000000000000000c3c7e05d1ba19563693d891e5c38f0fc988a5d1100000000000000000000000000000000000000000000000000000000000001710000000000000000000000006a4ff1950be05995dee75920cf27cd8febb6597a000000000000000000000000948eb6d3a08beb29dc1d08d09753862573a9412200000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000015180

Deployed ByteCode

0x6080604052600436101561001257600080fd5b60003560e01c806309207525146123b65780630be8d2911461227657806317192c29146121355780631a251a58146120375780631abcbe6314611c5c5780631cfd5c1614611b3657806320d8005a14611af7578063236a8d9b1461199e578063240c1781146119635780632692b459146118215780632d7b036f146117e957806333289a461461171757806337a6b5e21461167b5780633abb7c0614611649578063407c8d43146114d35780634298734914611480578063432e707b1461135957806343f1a2af146112f05780634de088ff1461129d5780635081d9521461121257806359955d5d146111ce5780635c975abb146111a857806368b9646e14611172578063715018a6146111195780637414f907146110e157806381ceb735146110b857806385f45250146110115780638ced63b414610f185780638d08e55014610e7d5780638da5cb5b14610e5457806394dcf2e614610dc557806395fe9a5e14610d6357806397f2ab9014610c5d5780639a8a059214610c225780639f9fb96814610a88578063a16087d214610a6a578063a1a954b714610a4c578063aaa3e37714610a23578063ad7e55ba146109ac578063ad8054821461096f578063b74795d914610946578063c1ce1cde14610909578063c84b5cf9146107c9578063cd28ef0d14610760578063ceb5e29b1461069b578063e7433b6e14610646578063e8462e8f14610628578063eb14f669146105ad578063ec3453c2146104a8578063ecb3dc881461048a578063f2fde38b146103c15763f802ad8a1461025857600080fd5b346103bc5760603660031901126103bc576044356024356001600160401b036004358184116103bc57366023850112156103bc5783600401359182116103bc576024840193602436918460061b0101116103bc576102b4612868565b80600052602093600c8552604060002060018060a01b038082541691338314801561039a575b15610360575050508160005260078552604060002084600052855260ff60406000205416156103425760005b83811061030f57005b8061033861032161033d938786612ba4565b358861032e848988612ba4565b0135908887613b74565b612754565b610306565b604482856040519163016f65ad60e01b835260048301526024820152fd5b60010154604051639a313e5960e01b81523360048201526001600160a01b03938416602482015291169091166044820152606490fd5b0390fd5b508160018201541680151590816103b2575b506102da565b90503314386103ac565b600080fd5b346103bc5760203660031901126103bc576103da612682565b6103e26126fc565b6001600160a01b0390811690811561043657600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346103bc5760003660031901126103bc576020600f54604051908152f35b346103bc5760803660031901126103bc576004356001600160401b036024358181116103bc576104dc9036906004016126cc565b916044358181116103bc576104f59036906004016126cc565b916064359081116103bc5761050e9036906004016126cc565b949093610519612868565b6000878152600c6020526040902080546001600160a01b039081169891338a14801561058b575b1561055357505061055197506136a6565b005b60010154604051639a313e5960e01b81523360048201526001600160a01b038b81166024830152929091169091166044820152606490fd5b508160018201541680151590816105a3575b50610540565b905033148b61059d565b346103bc5760203660031901126103bc576105c6612682565b6105ce6126fc565b6001600160a01b0316801561061657600380546001600160a01b031916821790557fe94f9ee78059bc733bb08fb7b593ad1873182fd795acdaefe39664192e202882600080a2005b60405163d92e233d60e01b8152600490fd5b346103bc5760003660031901126103bc576020601154604051908152f35b346103bc5760203660031901126103bc57600435600052600660205261069761067c610683604060002060405192838092612bda565b0382612812565b604051918291602083526020830190612698565b0390f35b346103bc5760203660031901126103bc576004356106b7612868565b6000818152600c6020526040902080546001600160a01b039190821633810361073757506001019081549081161561071e576001600160a01b031916905533907fa8461c8fb28662d101f3bf3eb596a71303b9c564229ee651fba61bc142ecbf99600080a3005b604051632dd920ef60e01b815260048101849052602490fd5b60405163536dd9ef60e01b81523360048201526001600160a01b03919091166024820152604490fd5b346103bc5760203660031901126103bc57610779612682565b6107816126fc565b6001600160a01b0316801561061657600280546001600160a01b031916821790557fdde46f8c71b67178c4fdd3cd7e4a49fac7292e29d2bb2ef7d2b9819be1fb890a600080a2005b346103bc576107d736612603565b82600093929352600c602052604060002090600e60205260406000208460005260205260406000209160018060a01b039081815416156108f0578354156108d7576008015416338103610737575080156108c5576003820191825490600261083f8484612af6565b91015462069780918282018092116108af57116108915750916108856020927f25d8768b3a9457fb1df954be09208c92c28109be47542d0eb8726e83ab48c5c794612af6565b809155604051908152a3005b8260449160405191637e53d67d60e11b835260048301526024820152fd5b634e487b7160e01b600052601160045260246000fd5b604051637c946ed760e01b8152600490fd5b604051639481f8b960e01b815260048101879052602490fd5b604051631585bdab60e31b815260048101869052602490fd5b346103bc5760203660031901126103bc5761093c610928600435612cae565b604051928392604084526040840190612698565b9060208301520390f35b346103bc5760003660031901126103bc576002546040516001600160a01b039091168152602090f35b346103bc5761097d3661261d565b90600052600a60205260406000209060005260205261069761067c610683604060002060405192838092612bda565b346103bc5760203660031901126103bc576004356109c86126fc565b620f4240808211610a04577f4514c31bd13e0eecf1250995ffc6e6fb3eaec9377d728cc3325b3c87a58a323a60208380601155604051908152a1005b604051637e53d67d60e11b815260048101929092526024820152604490fd5b346103bc5760003660031901126103bc576010546040516001600160a01b039091168152602090f35b346103bc5760003660031901126103bc576020601354604051908152f35b346103bc5760003660031901126103bc576020601254604051908152f35b346103bc5760203660031901126103bc576000610100604051610aaa816127db565b828152826020820152826040820152604051610ac5816127f7565b83815283602082015260608201528260808201528260a08201528260c08201528260e08201520152600435600052600c602052610140604060002060ff600860405192610b11846127db565b80546001600160a01b03908116855260018201548116602086015260028201541660408086019190915251610b45816127f7565b600382015481526004820154602082015260608501528260058201541615156080850152600681015460a0850152600781015460c0850152015460018060a01b03811660e084015260a01c1615156101008201526101006040519160018060a01b03815116835260018060a01b03602082015116602084015260018060a01b0360408201511660408401526020606082015180516060860152015160808401526080810151151560a084015260a081015160c084015260c081015160e084015260018060a01b0360e0820151168284015201511515610120820152f35b346103bc5760003660031901126103bc5760206040517f00000000000000000000000000000000000000000000000000000000000001718152f35b346103bc5760403660031901126103bc57600435610c79612673565b90610c82612868565b6000818152600c6020526040902080546001600160a01b03908116913383148015610d41575b156103605750505080600052600c602052600860406000200160ff815460a01c16908315158092151514610d1d57805460ff60a01b191684151560a01b60ff60a01b161790557ff31750caa046b294dda58b65be18389f4e94ad6ecb4858b6efab8c7cf2ef24e7906020905b604051908152a2005b50506040516358efc88160e01b815260048101919091529015156024820152604490fd5b50816001820154168015159081610d59575b50610ca8565b9050331486610d53565b346103bc5760003660031901126103bc57610d7c6126fc565b610d84612868565b6000805460ff60a01b1916600160a01b1790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1005b346103bc5760403660031901126103bc576001600160a01b0360243581811691600435918390036103bc57610df8612868565b81600052600c602052604060002090815416338103610737575082156106165760010180546001600160a01b0319168317905533907f177e76a486c6b85fe60246345e71d615cb0c8448a2290461819040cafdbfe71a600080a4005b346103bc5760003660031901126103bc576000546040516001600160a01b039091168152602090f35b346103bc57610e8b3661261d565b9060006060604051610e9c816127a5565b8281528260208201528260408201520152600052600e60205260406000209060005260205260806040600020604051610ed4816127a5565b815491828252600181015460208301908152606060036002840154936040860194855201549301928352604051938452516020840152516040830152516060820152f35b346103bc57610f263661261d565b610f2e612b10565b610f36612868565b6000828152600c6020526040902080546001600160a01b039291908316338103610737575081156108c557610f6c828583612f12565b926006820194855495848710610fea57610f8a85610fce9798612b03565b9055610f958161313e565b604051908482527fae1f357660ab777dcfd38c0ab6357834684ec26289ecfa07ec65dbf6c3c6431260203393a360023392015416612b66565b8051610fdb575b60018055005b610fe4906130df565b80610fd5565b60405163c3df48f360e01b8152600481018390526024810188905260448101869052606490fd5b346103bc5761101f3661261d565b611027612868565b6000828152600c60205260409020805490926001600160a01b03918216156110a05782156108c5578360029160066105519601611065868254612af6565b9055604051908582527f6dd055b2e2bf3452b033736068d30d709ffb26f2016b48ba9a612c3701bf33a960203393a3015416309033906128af565b60249060405190631585bdab60e31b82526004820152fd5b346103bc5760003660031901126103bc576003546040516001600160a01b039091168152602090f35b346103bc576110ef3661261d565b906000526007602052604060002090600052602052602060ff604060002054166040519015158152f35b346103bc5760003660031901126103bc576111326126fc565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346103bc5760203660031901126103bc57600435600052600d60205261069761067c610683604060002060405192838092612bda565b346103bc5760003660031901126103bc57602060ff60005460a01c166040519015158152f35b346103bc576111dc36612603565b91600052600b602052604060002090600052602052604060002090600052602052602060ff604060002054166040519015158152f35b346103bc576020806003193601126103bc57611254906001600160a01b03611238612682565b166000526004815261125b604060002060405193848092612bda565b0383612812565b6040519181839283018184528251809152816040850193019160005b82811061128657505050500390f35b835185528695509381019392810192600101611277565b346103bc5760203660031901126103bc576004356112b96126fc565b80156108c5576020817f079e53dc927596d8e1015cfdf0b2e3135c2e06774fa76e2e4bff009fd030d7a292601255604051908152a1005b346103bc5760203660031901126103bc57611309612682565b6113116126fc565b6001600160a01b0316801561061657601080546001600160a01b031916821790557fc76447012850d72eea0bcd2c87f26d6fa622f7708b07d0ed3d1de5cf3f58a6b7600080a2005b346103bc576113673661261d565b90611370612b10565b6002546001600160a01b0390811633819003610737575081600052600c6020526040600020600e602052604060002084600052602052604060002091604051906113b9826127a5565b8354825260036001850154946020840195865260028101546040850152015460608301528254161561146757511561144e57816020917f683f6606eec92f04a68f1797d32d15f840b9b3d410a8ec9b4fdab4c30813796d935161142160068301918254612af6565b9055611434600783519201918254612b03565b90556114408585612fb7565b51604051908152a360018055005b604051639481f8b960e01b815260048101859052602490fd5b604051631585bdab60e31b815260048101859052602490fd5b346103bc5760203660031901126103bc5760043561149c6126fc565b80156108c5576020817f084016fbffe5e2f11ac2b66a265f9d57ae10335d188ff1ca7d9d1efb35b71e0f92601355604051908152a1005b346103bc5760803660031901126103bc576064356001600160a01b0381811691604435916024356004358584036103bc5761150c612b10565b8260025416803303610737575080600052600c602052604060002092600e60205260406000208360005260205260406000209060405161154b816127a5565b825481526003600184015493602083019485526002810154604084015201546060820152818654161561146757511561144e5786156108c557815180881161162b5750610fd597826115f16060937f45625e0810f65b3c601b5c91bdacdf9e8f9ec7098fce927c57a8a65a823fd61795516115cb60078b01918254612b03565b905582518b81811061160a575b50506115e48888612fb7565b60028901541697866131af565b51906040519182528860208301526040820152a3612b66565b61161391612b03565b61162260068b01918254612af6565b90558c8b6115d8565b87604491604051916368d9260360e01b835260048301526024820152fd5b346103bc5760203660031901126103bc57610fce600435611668612b10565b80600052600c6020526040600020612df3565b346103bc5760003660031901126103bc576116946126fc565b60005460ff8160a01c16156116db5760ff60a01b19166000556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b346103bc5760203660031901126103bc57600435611733612b10565b6000818152600c6020526040902080546001600160a01b03908116923384036117c25790816117bb611768610fce9486612df3565b94600681019283549460008160028501541695556005830160ff198154169055825416817fae1f357660ab777dcfd38c0ab6357834684ec26289ecfa07ec65dbf6c3c643126020604051898152a36131af565b3390612b66565b60405163536dd9ef60e01b81523360048201526001600160a01b0385166024820152604490fd5b346103bc576117f73661261d565b906000526008602052604060002090600052602052602060ff604060002054166040519015158152f35b346103bc5760403660031901126103bc5760043561183d612673565b611845612868565b6000828152600c6020526040902080546001600160a01b03908116913383148015611941575b156103605750505081600052600c6020526040600020906005820160ff81541692821515809415151461192057828061190f575b6118de575091610d146020927f184e3738774b2dc98019706750a38aeb01148b3b0c263e9b3374288835adc07d949060ff801983541691151516179055565b600681015460039091015460405163c3df48f360e01b81526004810187905260248101929092526044820152606490fd5b50600681015460038201541161189f565b6040516358efc88160e01b8152600481018690528315156024820152604490fd5b50816001820154168015159081611959575b5061186b565b9050331486611953565b346103bc576119713661261d565b906000526005602052604060002090600052602052602060018060a01b0360406000205416604051908152f35b346103bc5760603660031901126103bc576024356004356044358015158082036103bc576119ca612868565b82600052602091600c8352604060002060018060a01b0380825416913383148015611ad5575b15610360575050508360005260088352604060002085600052835260ff6040600020541615611ab757836000526007835260406000208560005283528160ff60406000205416151514611a965790611a8d7ffc0fae2131c415309f829a0025dc0c5e27bd3c891bfb77cc0d2269a19ac0437993928560005260078452604060002087600052845260406000209060ff801983541691151516179055565b604051908152a3005b6040516358efc88160e01b8152600481018590529015156024820152604490fd5b60448486604051916336626ad160e11b835260048301526024820152fd5b50816001820154168015159081611aed575b506119f0565b9050331489611ae7565b346103bc57611b0536612603565b9160005260096020526040600020906000526020526040600020906000526020526020604060002054604051908152f35b346103bc5760803660031901126103bc57604435602435600435606435611b5b612868565b816000526020600c8152604060002060018060a01b0380825416913383148015611c3a575b156103605750505082600052600b81526040600020846000528152604060002085600052815260ff6040600020541615611c1c578115611c0a577fd12c0bb04d0c36c3143ef1c16a65cddd4ec064708de79e997d96e86f3bbd15979183600052600982526040600020856000528252604060002086600052825280604060002055604051908152a4005b60405163123d7ce760e11b8152600490fd5b6044848660405191636bb6647d60e11b835260048301526024820152fd5b50816001820154168015159081611c52575b50611b80565b9050331489611c4c565b346103bc576003196020368201126103bc576001600160401b03600435116103bc5761014060043560040191600435360301126103bc57611c9b612868565b604460043501351561202557606460043501356044600435013511611ffd57604460043501356024600435013510611fd557600f5490611cda82612754565b600f5533600052600460205260406000208054600160401b811015611fbf57611d0d8185936001611d2494018155612763565b819391549060031b91821b91600019901b19161790565b9055611d3460e460043501612791565b90611d3e81612791565b611d4d61010460043501612791565b9361012460043501359182151583036103bc5760405194611d6d866127db565b3386526001600160a01b03908116602087015216604080860191909152600435360360431901126103bc57611ee1611fae94611fa99361055197604051611db3816127f7565b6044600435013581526064600435013560208201526060840152600160808401526024600435013560a0840152600060c084015260018060a01b031660e08301526101008201901515815283600052600c6020526040600020600860018060a01b03845116916bffffffffffffffffffffffff60a01b92838254161781556001810160018060a01b03602087015116848254161790556002810160018060a01b0360408701511684825416179055602060608601518051600384015501516004820155611e9560808601511515600583019060ff801983541691151516179055565b60a085810151600683015560c0860151600783015560e09095015191018054935160ff60a01b90151590951b949094166001600160a01b039091169190921660ff60a01b191617179055565b611eea83612791565b611ef860e460043501612791565b90611f0861010460043501612791565b60408051600435602481013582526044810135602083015260640135918101919091526001600160a01b0393841660608201529083166080820152911690339083907f1236dbdc184b6c8721974cce53dabb6018679bca9a43784ab2ad71bcdb1d7dd19060a090a4611f7f60846004350184612833565b611f9160a46004949394350186612833565b91611fa160c46004350188612833565b9590946136a6565b612791565b6024600435013590309033906128af565b634e487b7160e01b600052604160045260246000fd5b60446040516338fcec4360e01b81526024600435013560048201528160043501356024820152fd5b6044604051632457cde760e01b81528160043501356004820152606460043501356024820152fd5b6040516314d323eb60e21b8152600490fd5b346103bc5760603660031901126103bc5760043560403660231901126103bc5761205f612868565b6000818152600c6020526040902080546001600160a01b03908116913383148015612113575b15610360578380600052600c602052604060002060243590811561202557604435908183116120f55791816040926004858460037fdf91c8dff53bac50f3157cba47dee1c65eeeafe480d9f529e9db0c5bc4a9ba3998015501556120e88561313e565b82519182526020820152a2005b6044838360405191632457cde760e01b835260048301526024820152fd5b5081600182015416801515908161212b575b50612085565b9050331485612125565b346103bc576121433661261d565b60405191612150836127c0565b600083526060604060209460008682015201526000526005825260406000209060005281526040600020604051612186816127c0565b81546001600160a01b039081168252600183810154858401908152604051600290950180549395939192600092916121bd83612c17565b808752928281169081156122545750600114612216575b505050946121e9836106979596970384612812565b60408501928352604051958695828752511690850152516040840152516060808401526080830190612633565b6000908152888120909893505b828910612241575091968401870191506121e99050836106976121d4565b8054868a01850152978301978101612223565b60ff1916878b0152505050151560051b8301860190506121e9836106976121d4565b346103bc5761228436612603565b9161228d612868565b806000526020600c8152604060002060018060a01b0380825416913383148015612394575b15610360575050508160005260078152604060002083600052815260ff60406000205416156123765781600052600b81526040600020836000528152604060002084600052815260ff6040600020541615612358577fd12c0bb04d0c36c3143ef1c16a65cddd4ec064708de79e997d96e86f3bbd1597908260005260098152604060002084600052815260406000208560005281526000604081205560405160008152a4005b6044838560405191630dca536360e41b835260048301526024820152fd5b506044916040519163016f65ad60e01b835260048301526024820152fd5b508160018201541680151590816123ac575b506122b2565b90503314886123a6565b346103bc576123c436612603565b916123cd612b10565b6002546001600160a01b0393908416338190036107375750816000526020600c8152604060002094855416156125ea5760ff600586015416156125d15760038501548083106125b357506004850154808311610891575082600052600e815260406000208460005281526040600020546125955761244c828487612f12565b9460068101805484811061256d5785600052600d8452604060002054600181018091116108af576012548082116125475750508492604094926124b27fb40d75557428cec6806c7ebb58634796f8a5870a0874bcd0d299328b5518665b97600794612b03565b9055016124c0838254612af6565b905584600052600d81526124d78684600020612bb4565b6124e360135442612af6565b9083516124ef816127a5565b878152600382820185815286830142815260608401918683528a600052600e8652886000208c60005286528860002094518555516001850155516002840155519101558351928352820152a38051610fdb5760018055005b6040516344d2ea2360e01b81526004810189905260248101929092526044820152606490fd5b60405163c3df48f360e01b815260048101879052602481019190915260448101859052606490fd5b6044838560405191631817de9d60e21b835260048301526024820152fd5b82604491604051916338fcec4360e01b835260048301526024820152fd5b6040516333b4460d60e11b815260048101849052602490fd5b604051631585bdab60e31b815260048101849052602490fd5b60609060031901126103bc57600435906024359060443590565b60409060031901126103bc576004359060243590565b919082519283825260005b84811061265f575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161263e565b6024359081151582036103bc57565b600435906001600160a01b03821682036103bc57565b90815180825260208080930193019160005b8281106126b8575050505090565b8351855293810193928101926001016126aa565b9181601f840112156103bc578235916001600160401b0383116103bc576020808501948460051b0101116103bc57565b6000546001600160a01b0316330361271057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60001981146108af5760010190565b805482101561277b5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036103bc5790565b608081019081106001600160401b03821117611fbf57604052565b606081019081106001600160401b03821117611fbf57604052565b61012081019081106001600160401b03821117611fbf57604052565b604081019081106001600160401b03821117611fbf57604052565b90601f801991011681019081106001600160401b03821117611fbf57604052565b903590601e19813603018212156103bc57018035906001600160401b0382116103bc57602001918160051b360383136103bc57565b60ff60005460a01c1661287757565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a08101918183106001600160401b03841117611fbf5761290792604052612921565b565b908160209103126103bc575180151581036103bc5790565b6040516001600160a01b0390911692919061293b816127f7565b6020918282527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564838301526000808285829451910182895af13d15612a51573d956001600160401b038711612a3d576129b5949596604051906129a788601f19601f8401160183612812565b81528093873d92013e612a5d565b805190828215928315612a25575b505050156129ce5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b612a359350820181019101612909565b3882816129c3565b634e487b7160e01b83526041600452602483fd5b6129b593949591506060915b91929015612abf5750815115612a71575090565b3b15612a7a5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612ad25750805190602001fd5b60405162461bcd60e51b815260206004820152908190610396906024830190612633565b919082018092116108af57565b919082039182116108af57565b600260015414612b21576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261290791612b9f826127a5565b612921565b919081101561277b5760061b0190565b805490600160401b821015611fbf5781611d0d916001612bd694018155612763565b9055565b90815480825260208092019260005281600020916000905b828210612c00575050505090565b835485529384019360019384019390910190612bf2565b90600182811c92168015612c47575b6020831014612c3157565b634e487b7160e01b600052602260045260246000fd5b91607f1691612c26565b6001600160401b038111611fbf5760051b60200190565b90612c7282612c51565b612c7f6040519182612812565b8281528092612c90601f1991612c51565b0190602036910137565b805182101561277b5760209160051b010190565b90612cd5600092600093818552602094600d86526040612cdc818320825196878092612bda565b0386612812565b612ce68551612c68565b918094815b8751811015612d8d57818352600e8a52838320612d08828a612c9a565b5184528a528960608585206003875191612d21836127a5565b805483526001810154948301948552600281015489840152015491829101524211612d56575b50612d5190612754565b612ceb565b612d80829897612d8692612d6d612d51958d612c9a565b51612d788c8b612c9a565b525190612af6565b96612754565b9690612d47565b5050949596505091612d9e90612c68565b94835b8551811015612deb5780612db8612dc29286612c9a565b51612dc757612754565b612da1565b612dd18186612c9a565b51612de5612dde88612754565b978a612c9a565b52612754565b509250925050565b91909160608093600683019283549060001982108015612ef9575b612e1a575b5050505050565b909192939550612e476007612e2e85612cae565b939098612e3c858b97612af6565b905501918254612b03565b905560005b8551811015612eea57612ee590836000526020600e8152847f683f6606eec92f04a68f1797d32d15f840b9b3d410a8ec9b4fdab4c30813796d60409283600020612e96868d612c9a565b51600052815283600020938051612eac816127a5565b612ed786548083526003600189015498868501998a5260028101548686015201548d84015286612fb7565b5194519051908152a3612754565b612e4c565b50935050503880808080612e13565b5082600052600d60205260406000205460125414612e0e565b6006810180546060959491938693909282108015612f9e575b612f36575050505050565b909192939550612f4a6007612e2e85612cae565b905560005b8551811015612eea57612f9990836000526020600e8152847f683f6606eec92f04a68f1797d32d15f840b9b3d410a8ec9b4fdab4c30813796d60409283600020612e96868d612c9a565b612f4f565b5082600052600d60205260406000205460125414612f2b565b90600091808352600e602052604083208284526020528260036040822082815582600182015582600282015501558252600d60205261300a60408320916040516130058161067c8187612bda565b613cf8565b90929061304e5760405162461bcd60e51b8152602060048201526015602482015274313cba32b99999103737ba1034b71030b93930bc9760591b6044820152606490fd5b815460001993908481019081116130cb578082036130a4575b5050815490811561309057508201916130808383612763565b909182549160031b1b1916905555565b634e487b7160e01b81526031600452602490fd5b611d0d6130b46130c29286612763565b90549060031b1c9285612763565b90553880613067565b634e487b7160e01b83526011600452602483fd5b6002546001600160a01b0316803b156103bc57604051632cc410dd60e01b815260206004820152916000918391829084908290613120906024830190612698565b03925af161312b5750565b6001600160401b038111611fbf57604052565b80600052600c6020526040600020600581019081549060ff8216908161319c575b5061316957505050565b60ff191690557f184e3738774b2dc98019706750a38aeb01148b3b0c263e9b3374288835adc07d602060405160008152a2565b905060036006820154910154113861315f565b9060068101549160078083015415806135e8575b806135d6575b6131d4575b50505050565b9091929360018060a01b036002850154169460018060a01b03855416958660005260046020526040600020966132178661067c6130058b60405192838092612bda565b6132585760405162461bcd60e51b81526020600482015260156024820152743ab4b73a191a9b103737ba1034b71030b93930bc9760591b6044820152606490fd5b885460001991908281019081116108af57808203613595575b5050885498891561357f57816132be9a019161328d8383612763565b909182549160031b1b19169055559296919590938560005260066020526132c5604060002060405194858092612bda565b0384612812565b6000965b835188101561348a579761338b986132e18986612c9a565b519688600052600580602052604060002089600052602052600260406000206000815560006001820155016133168154612c17565b80613449575b5050508860005283602052604060002088600052602052604060002060ff198154169055886000526008602052604060002088600052602052604060002060ff19815416905588600052600a60205260406000208860005260205261339260406000206040519c8d8092612bda565b038c612812565b60005b8b5181101561340d57806133ac613408928e612c9a565b518b600052600960205260406000208b600052602052604060002081600052602052600060408120558b600052600b60205260406000208b600052602052604060002090600052602052604060002060ff198154169055612754565b613395565b5093989094995061343d9195929688600052600a602052604060002090600052602052610338604060002061360b565b969194909397926132c9565b600092601f80831160011461346557505050555b38808061331c565b8391613483918694958552602085209501901c8401600185016135f4565b555561345d565b9650604092507f8ac07cc6e38c6222dd0309c80353c1962354bacf222b825d7401cc80e93ff3cc93916000600860059389835260066020526134cd87842061360b565b898352600c6020528287812091818355816001840155816002840155816003840155816004840155818784015581600684015582015501550160ff1981541690558151908582526020820152a182613526575b806131ce565b60105461353e9184916001600160a01b031690612b66565b6010546040519283526001600160a01b0316917f3e73fc0f76c9d35dff306ff859166692f079fb15a5686aa4997177493cc5562f90602090a3388080613520565b634e487b7160e01b600052603160045260246000fd5b6135b0916135a66135cd928d612763565b939054918d612763565b91909360031b1c9083549060031b91821b91600019901b19161790565b90553880613271565b5060ff600884015460a01c16156131c9565b506011548411156131c3565b8181106135ff575050565b600081556001016135f4565b8054906000908181558261361e57505050565b815260208120918201915b82811061363557505050565b818155600101613629565b919081101561277b5760051b81013590605e19813603018212156103bc570190565b919081101561277b5760051b81013590601e19813603018212156103bc5701908135916001600160401b0383116103bc576020018260061b360381136103bc579190565b919392959095838503613b5657818503613b38576000945b8086106136cf575050505050505050565b60059891929394959697989587871b8a01351561061657600354604051634839762760e11b815289891b8c013560048083019190915291602491906020908290849082906001600160a01b03165afa908115613b2c57600091613afd575b5015613ae45760206137408b8589613640565b013515613ad45787600052600860205260406000208a8a1b8d013560005260205260ff60406000205416613ab157505061377b888286613640565b6000878152602089815260408083208c8c1b8f0135845290915290206001600160a01b036137a883612791565b82546001600160a01b031916911617815560208201356001820155604082013536839003601e19018112156103bc576001600160401b0381840135116103bc57808301353603602082850101136103bc57868b858f94808d958f92986138126002879b0154612c17565b90601f91828111613a70575b5060009183820135116001146139b357947f70bc150f4694f93722b39f936610105e3af883bc610a906afc7750c9c286e4ec97611fa995602098939560026138fd968b986139079b600091838201356139a4575b508281013560011b9260001991013560031b1c1916179101555b8a600052600686526138a784821b8d01356040600020612bb4565b8a60005260088652604060002084821b8d0135600052865260406000209060ff19916001838254161790558b60005260078752846040600020911b8d013560005286526001604060002091825416179055613640565b013596888c613640565b6040516001600160a01b0390911681528d8d1b9094013593a460005b61392e89878c613662565b905081101561398b5761394c816139468b898e613662565b90612ba4565b906040823603126103bc576103386020613986938e60405161396d816127f7565b83833593848352013593849101528d8d1b01358b613b74565b613923565b509493929198979661399e919650612754565b946136be565b838201018b0135915038613872565b906002840181526020812090805b83850135601f19168110613a4e575097611fa99560209893956002600187896139079c977f70bc150f4694f93722b39f936610105e3af883bc610a906afc7750c9c286e4ec9f8f9c9b6138fd9c0135601f19858501351610613a2d575b50500135811b0191015561388c565b8c60001960f88686013560031b161c19918585010101351690553880613a1e565b6020848601830181013584558d99508e985060019093019291820191016139c1565b613aa29060028601600052602060002084808786013501891c82019260208887013510613aa8575b01881c01906135f4565b3861381e565b92508192613a98565b60405163de5a6b7360e01b815291820188905289891b8c01359082015260449150fd5b50604051635fd1a61d60e11b8152fd5b60405163060f97e560e01b81528a8a1b8d013581840152fd5b613b1f915060203d602011613b25575b613b178183612812565b810190612909565b3861372d565b503d613b0d565b6040513d6000823e3d90fd5b6044858360405191631f4bb7c160e31b835260048301526024820152fd5b6044858560405191631f4bb7c160e31b835260048301526024820152fd5b93929360018060a01b0360035416604095865180926354e7105560e11b825285600483015286602483015281604460209586935afa908115613ced57600091613cd0575b5015613cb3578015613ca25782600052600b8252866000208460005282528660002085600052825260ff876000205416613c855782939495967f4eb2088b4fe1a7bcb1a232b3842804fd8290524696748bc7cc886d137fde15549360005260098352806000208660005283528060002087600052835281816000205584600052600a835280600020866000528352613c538782600020612bb4565b84600052600b8352806000208660005283528060002087600052835280600020600160ff1982541617905551908152a4565b6044848689519163ce83125960e01b835260048301526024820152fd5b865163123d7ce760e11b8152600490fd5b60448486895191636bb6647d60e11b835260048301526024820152fd5b613ce79150833d8511613b2557613b178183612812565b38613bb8565b88513d6000823e3d90fd5b9081519160005b838110613d13575050505060001990600090565b82613d1e8284612c9a565b5114613d3257613d2d90612754565b613cff565b925050509060019056fea26469706673582212201a57c3bb69c0b043a0b513b852560de552b71618f63fa8c6f894b3c0f2181da864736f6c63430008120033