Function: _withdraw(address _caller, address _receiver, address _owner, uint256 _assets, uint256 _shares)

This function overrides ERC4626 _withdraw to add donation attack protection.

Inputs

  • _caller

    • Control: Full control.

    • Constraints: None.

    • Impact: People whose shares were taken away.

  • _receiver

    • Control: Full control.

    • Constraints: None.

    • Impact: People who receive assets.

  • _owner

    • Control: Full control.

    • Constraints: Must equal _caller or grant sufficient allowance for the burn.

    • Impact: The account whose shares are burned and whose allowance may be consumed.

  • _assets

    • Control: Full control.

    • Constraints: Cannot exceed vault liquidity and must match the share-to-asset exchange rate.

    • Impact: The amount of the underlying token used for the Vault for accounting, depositing, and withdrawing.

  • _shares

    • Control: Full control.

    • Constraints: None.

    • Impact: The amount of tokens in the vault. Has a ratio of underlying assets exchanged on mint/deposit/withdraw/redeem (as defined by the Vault).

Branches and code coverage

Intended branches

Negative behavior

Zellic © 2025Back to top ↑