Skip to content

Add helper for reading the current protocol fee bps without duplicating storage key logic #582

Description

@Chucks1093

Summary

The protocol fee bps value is read from persistent storage in multiple contract functions, each constructing the storage key inline. A shared read helper should centralise this to eliminate duplication and make fee config reads consistent.

Scope

  • Add read_protocol_fee_bps(env: &Env) -> u32 helper
  • Helper should panic with a descriptive message if the value is absent (contract not initialized)
  • Replace all inline protocol fee bps reads with the helper
  • Add unit tests: initialized contract returns configured bps, uninitialized contract panics with correct message

Acceptance Criteria

  • Helper returns correct bps from storage
  • Helper panics with descriptive message when uninitialized
  • All inline reads replaced with helper
  • Unit tests for initialized and uninitialized states

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions