Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AnomalyGatedAccountingAssertion

Git Source

Inherits: AnomalyGatedBaseAssertion

Title: AnomalyGatedAccountingAssertion

Author: Phylax Systems

Reverts only when the transaction is anomalous AND the ERC-4626 share price of vault moves beyond shareToleranceBps across the transaction. Either condition alone passes. Invariant covered:

  • Gated accounting break: an anomalous transaction may not move a vault’s share price beyond tolerance. Covers share-inflation and donation attacks that leave the vault’s own balance untouched while distorting the price at which shares redeem.

Generic across ERC-4626-shaped vaults; the constructor parameters are the only per-deployment difference. An empty vault (zero supply) is skipped by the precompile.

Constants

accountingVault

The ERC-4626-shaped vault whose share price this observes.

address internal immutable accountingVault

shareToleranceBps

Maximum tolerated share-price deviation across the transaction, in bps.

uint256 internal immutable shareToleranceBps

Functions

constructor

constructor(address _vault, uint256 _toleranceBps) ;

_registerAccountingTrigger

Register the anomaly trigger for the gated accounting check. Call this in triggers().

function _registerAccountingTrigger() internal view;

_accountingCorroborates

Whether the accounting heuristic corroborates on this transaction.

function _accountingCorroborates() internal view virtual returns (bool);

assertAnomalousAccounting

Reverts only when the transaction is anomalous and the share price leaves tolerance.

function assertAnomalousAccounting() external view;

Errors

AnomalousAccounting

error AnomalousAccounting();