Skip to content

Implement fee recipient view and overflow-safe quote math #59 #51 #58…#67

Merged
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
devchant:contract-enhancements
Mar 27, 2026
Merged

Implement fee recipient view and overflow-safe quote math #59 #51 #58…#67
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
devchant:contract-enhancements

Conversation

@devchant

Copy link
Copy Markdown
Contributor

Summary

This PR introduces enhancements to the contract’s read-only quote functionality, safety mechanisms, and test coverage. It focuses on improving reliability, correctness, and developer usability without introducing any state mutations.

Changes Made

Read-Only Sell Quote Method

  • Added a new read-only method to return the current sell quote for a creator key
  • Ensures no contract state is mutated
  • Returns expected payout for valid holder and creator paths
  • Naming and output structure aligned with existing read methods

Quote Overflow Safety Helper

  • Introduced a reusable helper for overflow-safe math checks in quote calculations
  • Integrated helper into buy and sell quote paths where necessary
  • Designed to be minimal, focused, and reusable across quote logic

Buy Quote Missing Creator Tests

  • Added unit tests covering behavior when a buy quote is requested for a non-existent creator
  • Explicitly asserts failure/error path
  • Ensures no unintended behavior changes in quote logic

Creator Fee Recipient Read Method

  • Added a read-only method to fetch the creator fee recipient address
  • Reuses existing creator storage access patterns
  • Maintains naming consistency with other creator-related read methods

Testing

  • Added tests for:

    • Sell quote read path (valid scenarios)
    • Overflow-sensitive quote calculations
    • Missing creator behavior in buy quote
    • Creator fee recipient lookup
  • Verified all new and existing tests pass successfully

  • Ensured read-only methods do not mutate contract state

Notes

All additions follow existing contract design patterns and maintain consistency across read methods. The introduction of shared safety helpers improves maintainability and reduces duplication in quote-related logic.

Closes: #54
Closes: #51
Closes: #58
Closes: #59

@drips-wave

drips-wave Bot commented Mar 27, 2026

Copy link
Copy Markdown

@devchant 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 fb2e0fc into accesslayerorg:main Mar 27, 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

2 participants