Use Case & Applications
Prevents unauthorized fee manipulation in AMMs and DeFi protocols by using a whitelist approach to control fee changes. Critical for AMMs (Velodrome, Aerodrome, Curve), DEX aggregators, lending protocols with origination fees, yield aggregators with performance fees, and cross-chain bridges with transfer fees. Unexpected fee changes can lead to unauthorized manipulation, protocol revenue loss, user losses, or market manipulation through fee bypasses.Explanation
Uses a whitelist approach to control fee changes:registerStorageChangeTrigger(): Detect changes to fee storage slotph.load(): Retrieve new fee value after changegetStateChangesUint(): Verify all state changes for fee storage slot- Maintains hardcoded allowed fee values for stable pools (0.1%, 0.15%) and non-stable pools (0.25%, 0.30%)
Code Example
Full examples with tests available in the Phylax Assertion Examples Repository.

