Skip to main content
A strategy harvest should retain or increase the vault’s recorded balance and price per share. This example rejects a harvest that lowers either value.

Behavior

BeefyHarvestAssertion registers the teaching interface harvest(bool badHarvest). It compares balance slot 0 and price-per-share slot 1 across the matched call. Both post-call values must be greater than or equal to their pre-call values.

Configuration

Replace the selector and storage reads with the deployed vault’s ABI and accounting. The boolean argument is a mock control, not a production Beefy interface. Define whether harvest may realize losses, pay fees, or move assets into a strategy before choosing these inequalities.

Scenarios

Coverage limits

Recorded values can be manipulated together. These checks do not independently value rewards or verify custody. If losses are a supported operation, use a bounded-loss or operation-specific policy instead of treating every decrease as an exploit.

Source

The reviewed source is a teaching template. The example setup guide provides the pinned checkout and test procedure.