Skip to content

feat(contract): add get_protocol_fee_view read-only view method#27

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
sshdopey:drips-contributions
Mar 26, 2026
Merged

feat(contract): add get_protocol_fee_view read-only view method#27
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
sshdopey:drips-contributions

Conversation

@sshdopey

Copy link
Copy Markdown
Contributor

Summary

Adds a dedicated get_protocol_fee_view method that returns a stable, non-optional ProtocolFeeView struct for indexer-friendly consumption of the current protocol fee configuration.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Checklist

  • Linked issue or backlog item
  • Contract behavior and invariants are described clearly
  • Docs updated if contract interfaces or workflows changed
  • Scope stays limited to one contract concern

Issues Resolved

Closes #19

Changes

#19 - Add read-only protocol fee config view method

Added ProtocolFeeView { creator_bps, protocol_bps, is_configured } struct and get_protocol_fee_view method to CreatorKeysContract. Unlike the existing get_fee_config which returns Option<FeeConfig>, this method always returns a value: is_configured is false and both bps fields are 0 when no config is stored. Added tests/fee_config_view.rs with 4 tests covering the unconfigured state, configured values, read-only idempotency, and reconfiguration.

@drips-wave

drips-wave Bot commented Mar 26, 2026

Copy link
Copy Markdown

@sshdopey Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit f9fd8fd into accesslayerorg:main Mar 26, 2026
1 check 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.

Add read-only protocol fee config view method

2 participants