Skip to content
Verified contractPartialBUSL-1.1

GridstoneInvariant

Address0x007c6935e2b50591c29a0ef9bce1d601e90cd96d
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.8.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
License
BUSL-1.1
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,328,694
Creation transaction
0xeb409326fb…006f2d2452

src/GridstoneInvariant.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.26;

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

import {IGridstoneInvariant} from "./IGridstoneInvariant.sol";
import {ISUSDWVault} from "./ISUSDWVault.sol";
import {IUSDW} from "./IUSDW.sol";

/**
 * @title  GridstoneInvariant
 * @notice Immutable post-condition checker called by the custom UUPS proxy after every guarded
 *         state-changing call. Enforces three protocol invariants (D-064–D-067):
 *
 *         1. Max supply  — USDW.totalSupply() ≤ MAX_SUPPLY
 *         2. Rate monotonicity — sUSDW.exchangeRate() ≥ sUSDW.lastExchangeRate()
 *            (enforced only on sUSDW-proxy-originated calls; USDW guarded selectors cannot move
 *            the vault rate, so checking it on USDW calls would needlessly couple USDW wrap/unwrap
 *            to the vault's exchange-rate accounting)
 *         3. Collateral floor — M balance of USDW contract ≥ USDW.mBacking()
 *
 * @dev    Immutable — no proxy, no upgrade path, no admin, no state variables.
 *         All addresses and constants are stored as `immutable` and set once in the constructor.
 *
 *         MAX_SUPPLY is hardcoded forever (D-064). Value is supplied at deployment time and
 *         must be confirmed by founders (FD-03) before mainnet deploy. Suggested default:
 *         500_000_000 * 1e6 (500M USDW at 6 decimals).
 *
 *         Threat-model scope: all three checks read live state from the USDW / sUSDW / M
 *         contracts. A compromised UUPS upgrade authority can replace USDW or sUSDW with a
 *         malicious implementation that returns arbitrary values from `totalSupply()`,
 *         `mBacking()`, or `exchangeRate()`, defeating any of the three invariants. This
 *         contract therefore defends against (i) bugs in legitimate implementations and
 *         (ii) compromises of on-chain roles below the upgrade authority (processor,
 *         compliance, etc.) — not against a compromised upgrade authority itself. Mitigation
 *         of the latter is off-chain: upgrade authorization at the highest multisig tier
 *         with a 72h timelock, plus the public on-chain upgrade audit trail. See
 *         docs/design-notes/invariant-security-properties.md for the full analysis.
 */
contract GridstoneInvariant is IGridstoneInvariant {
    // ── Immutables ───────────────────────────────────────────────────────────────

    /// @notice USDW proxy address. Used for totalSupply(), mBacking(), and as `account` for M balance.
    address public immutable usdw;

    /// @notice sUSDW proxy address. Used for exchangeRate() and lastExchangeRate().
    address public immutable sUSDW;

    /// @notice M token address. Used to read the M balance held by the USDW contract.
    address public immutable mToken;

    /// @notice Hardcoded maximum USDW supply. Permanent — cannot be changed after deployment (D-064).
    uint256 public immutable MAX_SUPPLY;

    // ── Errors ───────────────────────────────────────────────────────────────────

    /// @notice Thrown when a required constructor address is the zero address.
    error ZeroAddress();

    /// @notice Thrown when the constructor is given a zero `maxSupply_` (the cap must be positive).
    error ZeroMaxSupply();

    // ── Constructor ──────────────────────────────────────────────────────────────

    /// @param usdw_       USDW proxy address.
    /// @param sUSDW_      sUSDW proxy address.
    /// @param mToken_     M token address.
    /// @param maxSupply_  Maximum allowed USDW supply. Permanent. Confirm FD-03 before mainnet.
    constructor(address usdw_, address sUSDW_, address mToken_, uint256 maxSupply_) {
        if (usdw_ == address(0) || sUSDW_ == address(0) || mToken_ == address(0)) revert ZeroAddress();
        if (maxSupply_ == 0) revert ZeroMaxSupply();
        usdw = usdw_;
        sUSDW = sUSDW_;
        mToken = mToken_;
        MAX_SUPPLY = maxSupply_;
    }

    // ── IGridstoneInvariant ──────────────────────────────────────────────────────

    /// @inheritdoc IGridstoneInvariant
    function checkInvariants() external view {
        _checkMaxSupply();
        // Exchange-rate monotonicity is a sUSDW-vault invariant: only the sUSDW proxy can move
        // totalAssets()/totalSupply(). USDW guarded selectors (wrap/unwrap/forceTransfer/upgrade)
        // cannot change the vault rate, so running this check on USDW-originated calls would only
        // couple unrelated USDW wrap/unwrap to the vault's exchange-rate accounting for no benefit.
        // The proxy issues checkInvariants() via staticcall from its own context, so
        // msg.sender is the calling proxy — scope the check to the sUSDW proxy.
        if (msg.sender == sUSDW) _checkExchangeRateMonotonicity();
        _checkCollateralFloor();
    }

    // ── Internal checks ──────────────────────────────────────────────────────────

    /// @dev Invariant 1: USDW total supply must never exceed the permanent `MAX_SUPPLY`.
    function _checkMaxSupply() internal view {
        uint256 supply = IERC20(usdw).totalSupply();
        if (supply > MAX_SUPPLY) revert MaxSupplyExceeded(supply, MAX_SUPPLY);
    }

    /// @dev Invariant 2: the sUSDW exchange rate may only ratchet up. A drop below the stored
    ///      high-water mark means a non-impairment path lowered the rate — reverts.
    function _checkExchangeRateMonotonicity() internal view {
        uint256 current = ISUSDWVault(sUSDW).exchangeRate();
        uint256 last = ISUSDWVault(sUSDW).lastExchangeRate();
        if (current < last) revert ExchangeRateDecreased(current, last);
    }

    /// @dev Invariant 3: the M held by USDW must cover its reported backing (1-wei dust allowed).
    function _checkCollateralFloor() internal view {
        uint256 mBalance = IERC20(mToken).balanceOf(usdw);
        uint256 mBacking_ = IUSDW(usdw).mBacking();
        // Allow 1-wei dust: M token earning index uses integer division which rounds down by at
        // most 1 wei per earning position. USDW is a single earner so the deficit is bounded.
        if (mBacking_ > mBalance + 1) revert CollateralDeficit(mBalance, mBacking_);
    }
}

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC4626.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/IERC4626.sol)

pragma solidity >=0.6.2;

import {IERC20} from "../token/ERC20/IERC20.sol";
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";

/**
 * @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in
 * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
 */
interface IERC4626 is IERC20, IERC20Metadata {
    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);

    event Withdraw(
        address indexed sender,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /**
     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
     *
     * - MUST be an ERC-20 token contract.
     * - MUST NOT revert.
     */
    function asset() external view returns (address assetTokenAddress);

    /**
     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.
     *
     * - SHOULD include any compounding that occurs from yield.
     * - MUST be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT revert.
     */
    function totalAssets() external view returns (uint256 totalManagedAssets);

    /**
     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToShares(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToAssets(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
     * through a deposit call.
     *
     * - MUST return a limited value if receiver is subject to some deposit limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
     * - MUST NOT revert.
     */
    function maxDeposit(address receiver) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
     *   in the same transaction.
     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewDeposit(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Deposit `assets` underlying tokens and send the corresponding number of vault shares (`shares`) to `receiver`.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   deposit execution, and are accounted for during deposit.
     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
     * - MUST return a limited value if receiver is subject to some mint limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
     * - MUST NOT revert.
     */
    function maxMint(address receiver) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
     *   same transaction.
     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
     *   would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by minting.
     */
    function previewMint(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Mints exactly `shares` vault shares to `receiver` in exchange for `assets` underlying tokens.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
     *   execution, and are accounted for during mint.
     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function mint(uint256 shares, address receiver) external returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
     * Vault, through a withdraw call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxWithdraw(address owner) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
     *   called
     *   in the same transaction.
     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewWithdraw(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   withdraw execution, and are accounted for during withdraw.
     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
     * through a redeem call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxRedeem(address owner) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their redemption at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
     *   same transaction.
     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
     *   redemption would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.
     */
    function previewRedeem(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   redeem execution, and are accounted for during redeem.
     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
}

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol

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

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity >=0.6.2;

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

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

src/IGridstoneInvariant.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.26;

/**
 * @title  IGridstoneInvariant
 * @notice Interface for the immutable invariant-checking contract called by the custom UUPS proxy
 *         after every guarded state-changing call (D-064, D-067).
 */
interface IGridstoneInvariant {
    /* ============ Errors ============ */

    /// @notice Thrown when USDW totalSupply exceeds the hardcoded MAX_SUPPLY cap.
    error MaxSupplyExceeded(uint256 supply, uint256 maxSupply);

    /// @notice Thrown when sUSDW exchangeRate() is below lastExchangeRate() (rate decreased).
    error ExchangeRateDecreased(uint256 current, uint256 last);

    /// @notice Thrown when the M token balance held by USDW is less than mBacking().
    error CollateralDeficit(uint256 mBalance, uint256 mBacking);

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

    /// @notice Runs all three invariant checks. Reverts if any invariant is violated, rolling back
    ///         the calling transaction entirely (including the preceding delegatecall in the proxy).
    /// @dev    Called by CustomUUPSProxy after every guarded selector. Open access — any caller is
    ///         fine since the checks are view-only with no state side-effects (OQ-5.3).
    function checkInvariants() external view;
}

src/ISUSDWVault.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.26;

import {IERC4626} from "@openzeppelin/contracts/interfaces/IERC4626.sol";

/**
 * @title  ISUSDWVault
 * @notice Interface for the staked USDW yield vault (sUSDW).
 * @dev    Extends IERC4626 with Gridstone-specific surfaces:
 *         - dual-balance accounting (on-chain `usdwBalance`, off-chain `loanBalance`)
 *         - processor-driven reward distribution with linear vesting (D-040)
 *         - capital deployment / return between the two balances (D-003, D-040e)
 *         - ARES-driven redemption settlement (D-050)
 *         - governance escape hatch `impairLoanBalance` (Q-NEW-02)
 *
 *         Sync redeem/withdraw are DISABLED — `withdraw`, `redeem`, `previewWithdraw`,
 *         `previewRedeem` revert with {OperationNotAllowed} (D-040b). `maxWithdraw` and
 *         `maxRedeem` return the ARES-queue-bounded amount (5%/7d per-address cap) — they
 *         do NOT imply a callable sync `withdraw`. All exits flow through ARES.
 */
interface ISUSDWVault is IERC4626 {
    /* ============ Events ============ */

    /// @notice Emitted on every `transferInRewards`. `currentExchangeRate` is mandatory (whitepaper §10.3).
    event RewardsDistributed(
        uint256 indexed epoch,
        uint256 loanRewardAmount,
        uint256 mYieldAmount,
        uint256 currentExchangeRate,
        bytes32 attestationHash,
        uint256 timestamp
    );

    /// @notice Emitted when processor moves USDW from the on-chain balance into off-chain loan balance.
    event CapitalDeployed(uint256 usdwAmount);

    /// @notice Emitted when processor returns USDW from loan balance back to the on-chain balance.
    event CapitalReturned(uint256 usdwAmount);

    /// @notice Emitted when an address is added to the blacklist.
    event AddedToBlacklist(address indexed account);

    /// @notice Emitted when an address is removed from the blacklist.
    event RemovedFromBlacklist(address indexed account);

    /// @notice Emitted when a blacklisted user's shares are seized and transferred to a compliance address.
    event LockedSharesSeized(address indexed from, address indexed to, uint256 sharesAmount);

    /// @notice Emitted when the ARES queue reference is changed via {setARESQueue}.
    event ARESQueueUpdated(address oldQueue, address newQueue);

    /// @notice Emitted when governance writes down the loan balance via the impairment escape hatch.
    event LoanImpaired(uint256 writeDownAmount, uint256 newExchangeRate);

    /* ============ Errors ============ */

    /// @notice Thrown by sync-redeem paths that are intentionally disabled (D-040b).
    error OperationNotAllowed();

    /// @notice Thrown by `transferInRewards` while the previous distribution is still vesting (D-040g).
    error VestingActive(uint256 unvestedAmount);

    /// @notice Thrown by `transferInRewards` when `loanRewardAmount + mYieldAmount` exceeds the
    ///         per-distribution rate-limit cap `totalAssets() * maxRewardsBps / 10_000` (D-043).
    error RewardExceedsCap(uint256 requested, uint256 cap);

    /// @notice Thrown by `transferInRewards` when `mYieldAmount` exceeds the on-chain USDW
    ///         surplus that arrived via `USDW.claimYield()` (i.e. actual balance - tracked usdwBalance).
    error InsufficientMYieldSurplus(uint256 requested, uint256 surplus);

    /// @notice Thrown when an ARES-only function is called by anyone other than the registered
    ///         ARES queue.
    error NotARESQueue();

    /// @notice Thrown by `settleRedemption` when the vault's liquid USDW (`usdwBalance`) is
    ///         insufficient to cover the net settlement amount.
    error InsufficientLiquidity(uint256 available, uint256 required);

    /// @notice Thrown by `convertFromUsdw` when the requested deployment would consume USDW
    ///         earmarked for pending ARES redemptions.
    error InsufficientDeployableBalance(uint256 requested, uint256 deployable);

    /// @notice Thrown by `initiateRedemption` when `owner`'s min-staking-duration cooldown
    ///         has not yet elapsed (D-042).
    error StakingCooldownActive(uint256 readyAt);

    /// @notice Thrown when an operation involves a blacklisted account.
    error AccountBlacklisted(address account);

    /// @notice Thrown by `seizeLockedShares` when the account is not blacklisted.
    error AccountNotBlacklisted(address account);

    /// @notice Thrown when attempting to blacklist a DEFAULT_ADMIN_ROLE holder.
    error CannotBlacklistAdmin();

    /// @notice Thrown by `seizeLockedShares` when the `to` address is blacklisted.
    error RecipientBlacklisted(address account);

    /// @notice Thrown by `settleRedemption` when recipient is the vault itself — a self-transfer
    ///         would create an accounting gap between `usdwBalance` and actual token balance.
    error InvalidRecipient(address recipient);

    /// @notice Thrown by `_deposit` when the computed share amount is zero — either because
    ///         assets is zero or because floor rounding reduces a tiny deposit to zero shares.
    ///         Prevents cooldown-reset griefing and stuck-fund scenarios.
    error ZeroShares();

    /// @notice Thrown by `initiateRedemption` when the floor-rounded share→asset conversion
    ///         yields zero USDW. Dust share amounts (below the 12-decimal virtual-share offset)
    ///         would otherwise burn shares yet record a zero obligation, letting an attacker
    ///         enqueue zero-value ARES positions that the FIFO settler must clear one tx at a
    ///         time and that bypass the per-address rolling cap.
    ///         Rejecting at the source removes the spam vector.
    error ZeroRedemptionAssets();

    /// @notice Thrown by `impairLoanBalance` when `writeDownAmount` is zero. A zero write-down
    ///         has no effect on `loanBalance` but would still reset `lastExchangeRate`, allowing
    ///         IMPAIRMENT_ROLE to silently clear a GridstoneInvariant monotonicity alarm without
    ///         booking an actual loss.
    error ZeroWriteDown();

    /// @notice Thrown by `convertFromUsdw` / `convertFromLoan` when `usdwAmount` is zero.
    ///         A zero conversion is a no-op that would still emit a misleading event.
    error ZeroConversionAmount();

    /// @notice Thrown when a required address parameter is the zero address.
    error ZeroAddress();

    /// @notice Thrown by `convertFromLoan` when `usdwAmount` exceeds `loanBalance`.
    error InsufficientLoanBalance(uint256 requested, uint256 available);

    /// @notice Thrown by `settleRedemption` / `cancelRedemption` when `feeAmount > usdwAmount`.
    error FeeExceedsAmount(uint256 feeAmount, uint256 usdwAmount);

    /// @notice Thrown by `settleRedemption` / `cancelRedemption` when `usdwAmount > pendingRedemptions`.
    error InsufficientPendingRedemptions(uint256 requested, uint256 available);

    /// @notice Thrown by `transferInRewards` when actual USDW balance is below the tracked ledger.
    error VaultBalanceBelowLedger(uint256 balance, uint256 ledger);

    /// @notice Thrown when an attestation hash is required but `bytes32(0)` was provided.
    error MissingAttestation();

    /// @notice Thrown by `setARESQueue` when `pendingRedemptions > 0` — all in-flight
    ///         positions must be settled or cancelled before the queue can be replaced.
    error PendingRedemptionsNotZero(uint256 pendingRedemptions);

    /// @notice Thrown by `setARESQueue` when the supplied address does not advertise the
    ///         {IARESQueue} interface via ERC-165. Also covers EOAs and non-ERC-165 contracts,
    ///         which `ERC165Checker.supportsInterface` reports as unsupported.
    error UnsupportedARESQueueInterface(address queue);

    /// @notice Thrown by the governance parameter setters when `value` falls outside the
    ///         permitted `[min, max]` range. The bounds are enforced here, at the point of
    ///         use, so they hold even if `GOVERNANCE_ROLE` is granted to an address other
    ///         than {ParameterGovernance}.
    error OutOfBounds(uint256 value, uint256 min, uint256 max);

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

    /// @notice Single entry in the per-address FIFO lock queue (D-042). Each deposit or
    ///         transfer-in pushes one entry; expiries are quantized to a fixed window so inflows
    ///         in the same window merge into one entry, bounding the queue length.
    struct LockEntry {
        /// Shares locked by this entry.
        uint128 shares;
        /// Unix time at which these shares unlock (quantized to the lock window).
        uint64 expiry;
    }

    /* ============ Gridstone-specific views ============ */

    /// @notice Current exchange rate: `totalAssets() * 1e18 / totalSupply()`, or `1e18` if supply is zero.
    function exchangeRate() external view returns (uint256);

    /// @notice Monotonic snapshot of {exchangeRate} used by GridstoneInvariant to enforce non-decrease.
    function lastExchangeRate() external view returns (uint256);

    /// @notice USDW currently held on-chain by the vault.
    function usdwBalance() external view returns (uint256);

    /// @notice Face value of USDW deployed off-chain as loans (carried at face / amortized cost).
    function loanBalance() external view returns (uint256);

    /// @notice USDW-equivalent of reward amount still subject to linear vesting.
    function getUnvestedAmount() external view returns (uint256);

    /// @notice Convenience view: `totalAssets()`. Exposed by D-025 for transparency.
    function totalStakedUSDW() external view returns (uint256);

    /// @notice Total USDW value of submitted but unsettled/uncancelled ARES redemptions.
    function pendingRedemptions() external view returns (uint256);

    /// @notice Total sUSDW shares currently within the `minStakingDuration` cooldown for `account`.
    function lockedSharesOf(address account) external view returns (uint256);

    /// @notice Returns whether `account` is on the sUSDW blacklist.
    function isBlacklisted(address account) external view returns (bool);

    /* ============ Processor ============ */

    /// @notice Distribute a new reward tranche. Only callable by PROCESSOR_ROLE.
    /// @param loanRewardAmount Off-chain loan interest credited to `loanBalance` (may be 0 in Phase 2).
    /// @param mYieldAmount     On-chain $M yield already in the vault via `USDW.claimYield()`,
    ///                         credited to `usdwBalance`. Must be 0 unless the caller first calls
    ///                         `USDW.claimYield()` so the tokens are physically present.
    /// @param attestationHash  IPFS/reference hash of the off-chain attestation covering both streams.
    function transferInRewards(uint256 loanRewardAmount, uint256 mYieldAmount, bytes32 attestationHash) external;

    /// @notice Move `usdwAmount` of USDW from `usdwBalance` into `loanBalance` (1:1). PROCESSOR_ROLE only.
    function convertFromUsdw(uint256 usdwAmount) external;

    /// @notice Move `usdwAmount` of USDW back from `loanBalance` into `usdwBalance` (1:1). PROCESSOR_ROLE only.
    function convertFromLoan(uint256 usdwAmount) external;

    /* ============ ARES interface ============ */

    /// @notice Burn `shares` from `owner` and record the USDW obligation in `pendingRedemptions`.
    ///         No USDW is transferred at this point — tokens move at settle time.
    /// @dev    Only callable by the ARES queue. Enforces the min-staking-duration cooldown.
    function initiateRedemption(address owner, uint256 shares) external returns (uint256 usdwAmount);

    /// @notice Transfer net USDW to `recipient` and retain `feeAmount` in the vault at settle
    ///         time. The fee lifts the exchange rate for remaining stakers.
    /// @dev    Only callable by the ARES queue.
    function settleRedemption(address recipient, uint256 usdwAmount, uint256 feeAmount) external;

    /// @notice Remove a pending redemption obligation on cancellation. Mints fresh sUSDW shares
    ///         for the net amount (after cancellation fee) at the current exchange rate.
    /// @dev    Only callable by the ARES queue.
    function cancelRedemption(address submitter, uint256 usdwAmount, uint256 feeAmount)
        external
        returns (uint256 newShares);

    /* ============ Governance escape hatch (Q-NEW-02) ============ */

    /// @notice Writes down `loanBalance` by `writeDownAmount` and resets `lastExchangeRate`
    ///         to the new (lower) `exchangeRate`. The ONLY path that may decrease
    ///         `lastExchangeRate`. Gated by a high-impact multisig + 72h timelock role.
    function impairLoanBalance(uint256 writeDownAmount) external;

    /* ============ Blacklist ============ */

    /// @notice Adds `account` to the blacklist. Blacklisted addresses cannot deposit, transfer, or redeem.
    /// @dev    Only callable by COMPLIANCE_ROLE. Cannot blacklist admin addresses.
    ///         Reverts if already blacklisted.
    function addToBlacklist(address account) external;

    /// @notice Removes `account` from the blacklist.
    /// @dev    Only callable by COMPLIANCE_ROLE. Reverts if not blacklisted.
    function removeFromBlacklist(address account) external;

    /// @notice Seizes all shares held by a blacklisted address and transfers them to a
    ///         compliance-controlled address. OFAC blocking requires holding seized property,
    ///         not destroying it — so shares are burned from `from` and minted to `to`.
    /// @dev    Only callable by COMPLIANCE_ROLE. Requires `from` to be blacklisted,
    ///         `to` to be non-zero and non-blacklisted, and `from` to hold shares.
    function seizeLockedShares(address from, address to) external;

    /* ============ Admin ============ */

    /// @notice Wire the ARES queue address post-init.
    function setARESQueue(address newAresQueue) external;

    /* ============ Governance parameters (called by ParameterGovernance) ============ */

    /// @notice Set the per-distribution reward cap (bps of `totalAssets()`); GOVERNANCE_ROLE only.
    function setMaxRewardsBps(uint256 newValue) external;
    /// @notice Set the linear reward vesting window (seconds); GOVERNANCE_ROLE only.
    function setVestingPeriod(uint256 newValue) external;
    /// @notice Set the minimum staking duration before ARES exit (seconds); GOVERNANCE_ROLE only.
    function setMinStakingDuration(uint256 newValue) external;

    /// @notice Per-distribution reward cap as a fraction of `totalAssets()`, in bps.
    function maxRewardsBps() external view returns (uint256);
    /// @notice Linear vesting window applied to each reward distribution, in seconds.
    function vestingPeriod() external view returns (uint256);
    /// @notice Minimum time shares must be held before they can be submitted to ARES, in seconds.
    function minStakingDuration() external view returns (uint256);
}

src/IUSDW.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.26;

/**
 * @title  IUSDW
 * @notice Interface for the USDW stablecoin contract.
 * @dev    Deposit and withdrawal happen through the M0 SwapFacility.
 *         Force transfers (compliance clawback) are defined in IForcedTransferable.
 */
interface IUSDW {
    /* ============ Errors ============ */

    /// @notice Thrown when a required address parameter is the zero address.
    error ZeroAddress();

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

    /// @notice Returns the amount of M backing USDW supply (for GridstoneInvariant).
    function mBacking() external view returns (uint256);
}
Compiler settingsShow
{
  "viaIR": false,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "cancun",
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/solidity-stringutils/:ds-test/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/solidity-stringutils/lib/ds-test/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/solidity-stringutils/:ds-test/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/solidity-stringutils/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/lib/forge-std/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/lib/forge-std/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/forge-std/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/forge-std/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:forge-std/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:forge-std/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/:forge-std/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/:forge-std/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/:solidity-stringutils/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/solidity-stringutils/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/:solidity-stringutils/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/lib/solidity-stringutils/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/:ds-test/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/lib/ds-test/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/:ds-test/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-std/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-std/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/:erc4626-tests/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/:erc4626-tests/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/solmate/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/solmate/lib/ds-test/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/solmate/:ds-test/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/solmate/lib/ds-test/src/",
    "lib/m-extensions/lib/wrapped-m-token/lib/common/lib/forge-std/:ds-test/=lib/m-extensions/lib/wrapped-m-token/lib/common/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/wrapped-m-token/lib/common/lib/forge-std/:ds-test/=lib/m-extensions/lib/wrapped-m-token/lib/common/lib/forge-std/lib/ds-test/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:forge-std/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:forge-std/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:openzeppelin-contracts/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/:openzeppelin-contracts/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts/:erc4626-tests/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts/:erc4626-tests/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts/:forge-std/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts/:forge-std/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/lib/common/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/:safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/contracts/",
    "lib/m-extensions/lib/common/lib/safe-utils/:safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/contracts/",
    "lib/m-extensions/lib/common/lib/safe-utils/:solidity-stringutils/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/:solidity-stringutils/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/:forge-std/=lib/m-extensions/lib/common/lib/safe-utils/lib/forge-std/src/",
    "lib/m-extensions/lib/common/lib/safe-utils/:forge-std/=lib/m-extensions/lib/common/lib/safe-utils/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/:solmate/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/:solmate/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/:openzeppelin-contracts/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/:openzeppelin-contracts/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/:solmate/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/solmate/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/:solmate/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/solmate/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/:forge-std/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/forge-std/src/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/:openzeppelin-contracts/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/:openzeppelin-contracts/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/wrapped-m-token/lib/common/:forge-std/=lib/m-extensions/lib/wrapped-m-token/lib/common/lib/forge-std/src/",
    "lib/m-extensions/lib/wrapped-m-token/lib/common/:forge-std/=lib/m-extensions/lib/wrapped-m-token/lib/common/lib/forge-std/src/",
    "lib/m-extensions/lib/common/:safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/contracts/",
    "lib/m-extensions/lib/common/:safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/contracts/",
    "lib/m-extensions/lib/common/:forge-std/=lib/m-extensions/lib/common/lib/forge-std/src/",
    "lib/m-extensions/lib/common/:forge-std/=lib/m-extensions/lib/common/lib/forge-std/src/",
    "lib/m-extensions/lib/common/:openzeppelin-contracts-upgradeable/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/",
    "lib/m-extensions/lib/common/:openzeppelin-contracts-upgradeable/=lib/m-extensions/lib/common/lib/openzeppelin-contracts-upgradeable/",
    "lib/m-extensions/lib/common/:openzeppelin-contracts/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/common/:openzeppelin-contracts/=lib/m-extensions/lib/common/lib/openzeppelin-contracts/",
    "lib/m-extensions/lib/openzeppelin-foundry-upgrades/:forge-std/=lib/m-extensions/lib/openzeppelin-foundry-upgrades/lib/forge-std/src/",
    "lib/m-extensions/lib/openzeppelin-foundry-upgrades/:forge-std/=lib/m-extensions/lib/openzeppelin-foundry-upgrades/lib/forge-std/src/",
    "lib/m-extensions/lib/wrapped-m-token/:common/=lib/m-extensions/lib/wrapped-m-token/lib/common/src/",
    "lib/m-extensions/lib/wrapped-m-token/:common/=lib/m-extensions/lib/wrapped-m-token/lib/common/src/",
    "lib/m-extensions/lib/wrapped-m-token/:forge-std/=lib/m-extensions/lib/wrapped-m-token/lib/forge-std/src/",
    "lib/m-extensions/lib/wrapped-m-token/:forge-std/=lib/m-extensions/lib/wrapped-m-token/lib/forge-std/src/",
    "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:forge-std/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:forge-std/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/src/",
    "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "lib/m-extensions/:safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/contracts/",
    "lib/m-extensions/:safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/contracts/",
    "lib/m-extensions/:common/=lib/m-extensions/lib/common/",
    "lib/m-extensions/:common/=lib/m-extensions/lib/common/",
    "lib/m-extensions/:forge-std/=lib/m-extensions/lib/forge-std/src/",
    "lib/m-extensions/:forge-std/=lib/m-extensions/lib/forge-std/src/",
    "lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "lib/openzeppelin-contracts-upgradeable/:forge-std/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/src/",
    "lib/openzeppelin-contracts-upgradeable/:forge-std/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/src/",
    "lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "lib/openzeppelin-contracts-upgradeable/:openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "lib/openzeppelin-contracts-upgradeable/:openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "@ensdomains/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/node_modules/@ensdomains/",
    "@openzeppelin/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/lib/openzeppelin-contracts/",
    "@uniswap/v4-core/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/",
    "common/=lib/m-extensions/lib/wrapped-m-token/lib/common/src/",
    "ds-test/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/node_modules/hardhat/",
    "m-extensions/=lib/m-extensions/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "openzeppelin-foundry-upgrades/=lib/m-extensions/lib/openzeppelin-foundry-upgrades/src/",
    "permit2/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/",
    "safe-smart-account/=lib/m-extensions/lib/common/lib/safe-utils/lib/safe-smart-account/",
    "safe-utils/=lib/m-extensions/lib/common/lib/safe-utils/src/",
    "solidity-http/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-http/src/",
    "solidity-stringutils/=lib/m-extensions/lib/common/lib/safe-utils/lib/solidity-stringutils/",
    "solmate/=lib/m-extensions/lib/uniswap-v4-periphery/lib/permit2/lib/solmate/",
    "uniswap-v4-periphery/=lib/m-extensions/lib/uniswap-v4-periphery/",
    "v4-core/=lib/m-extensions/lib/uniswap-v4-periphery/lib/v4-core/src/",
    "wrapped-m-token/=lib/m-extensions/lib/wrapped-m-token/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.