Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/reward metadata #37

Merged
merged 2 commits into from
Feb 27, 2025
Merged

Feat/reward metadata #37

merged 2 commits into from
Feb 27, 2025

Conversation

victorkl400
Copy link
Contributor

Upgrade X2EarnRewardsPool to Version 6

This upgrade introduces the ability for XApps to include metadata in the reward distribution process, enabling richer and more context-specific information to be stored and emitted during events. A new function, distributeRewardWithProofAndMetadata, has been added for this purpose.

Key Updates

  • Backward Compatibility Preserved: The original distributeRewardWithProof function remains unchanged and continues to work as before for apps that do not wish to use metadata.
  • New Metadata Functionality: The distributeRewardWithProofAndMetadata function accepts a string intended to be a JSON representation. A dedicated event, RewardMetadata, is emitted to store this information, following the established internal standards of _emitProof.

Changes 🚀

  • Upgraded Contracts:
    • X2EarnRewardsPool.sol updated to version 6.

Storage Changes 📦

  • None.

New Features 🚀

  • X2EarnRewardsPool:
    • Added distributeRewardWithProofAndMetadata(), which accepts a string intended to be a JSON representation and emits a new event, RewardMetadata, containing this information.
    • Updated internal logic with _emitMetadata, following the _emitProof pattern, to emit the event with the JSON data.

Bug Fixes 🐛

  • None.

@victorkl400 victorkl400 requested a review from a team as a code owner February 27, 2025 15:22
@victorkl400 victorkl400 self-assigned this Feb 27, 2025
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.95%. Comparing base (bc13865) to head (56c4ce6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
+ Coverage   93.91%   93.95%   +0.03%     
==========================================
  Files          55       55              
  Lines        3532     3538       +6     
  Branches      783      783              
==========================================
+ Hits         3317     3324       +7     
+ Misses        215      214       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Agilulfo1820 Agilulfo1820 merged commit 94ac158 into main Feb 27, 2025
9 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.

3 participants