Skip to content

feat(harvester): full implementation with cooldown enforcement and fuzz tests [GF-05]#60

Merged
wumibals merged 1 commit into
LadderMine:mainfrom
yusuftomilola:feat/gf-05-harvester-implementation
Jun 23, 2026
Merged

feat(harvester): full implementation with cooldown enforcement and fuzz tests [GF-05]#60
wumibals merged 1 commit into
LadderMine:mainfrom
yusuftomilola:feat/gf-05-harvester-implementation

Conversation

@yusuftomilola

Copy link
Copy Markdown
Contributor

Summary

Implements the permissionless Harvester contract as specified in issue #38.

  • Cooldown enforcement uses env.ledger().sequence() (ledger sequence, not timestamp) to fix audit finding L-02
  • 10 bps bounty to the caller calculated with checked multiplication, forwarded in USDC
  • Remainder forwarded to StrategyVault via deposit_capital
  • Zero-yield harvest updates LAST_HARVEST_LEDGER without panicking or transferring
  • Property-based tests verify bounty + remainder == harvested for all valid inputs, including boundary amounts and the u32::MAX cooldown overflow case

Changes

  • contracts/harvester/src/lib.rs — full implementation replacing the empty stub

Closes #38

…tests

Implements GF-05 as specified in issue LadderMine#38:
- Cooldown enforced via env.ledger().sequence() (audit fix L-02)
- 10 bps bounty to caller via checked multiplication
- Remainder forwarded to StrategyVault
- Zero-yield harvest handled gracefully
- Property tests verify bounty + remainder == harvested for all inputs
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@yusuftomilola is attempting to deploy a commit to the wumibals' projects Team on Vercel.

A member of the Team first needs to authorize it.

@wumibals wumibals left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the way you think.

@wumibals wumibals merged commit a300bed into LadderMine:main Jun 23, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GF-05] [CONTRACT] Harvester: Full Implementation + Fuzz Tests

2 participants