Conversation
72a3e45 to
a3dd046
Compare
28368ff to
aaff4c9
Compare
AOranov
previously approved these changes
Jun 24, 2025
AOranov
reviewed
Jul 16, 2025
plutarch-validators/WhalePoolsDex/PContracts/PDoubleRoyaltyPool.hs
Outdated
Show resolved
Hide resolved
AOranov
previously approved these changes
Jul 22, 2025
4d0e82c to
ea4e445
Compare
df2cc5b to
ef2e529
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new type of pool called Double Royalty Pool. Generally, the Double Royalty Pool is an extension of the existing Royalty Pool, with a few key additions:
New royalty pool fields (line 76)
Field for a second royalty public key (line 81)
All existing royalty pool math now takes these new fields into account, for example:
Royalty calculation logic updated (line 227)
The following contracts were also updated to support the new royalty model:
PDoubleRoyaltyDeposit.hs
PDoubleRoyaltyRedeem.hs
These contracts take the new fields into account in their calculations.
The PDoubleRoyaltyWithdrawPool.hs contract (which validates royalty withdrawals) now works with two royalty keys and determines the correct withdrawer based on a value provided in the redeemer.
Additionally, the Royalty Pool DAO v1 contract was extended to support the new format. It now validates and prevents unauthorized changes to the new fields during DAO actions.
New scripts:
PDoubleRoyaltyDAOV1.hs
PDoubleRoyaltyDeposit.hs
PDoubleRoyaltyPool.hs
PDoubleRoyaltyRedeem.hs
PDoubleRoyaltyWithdrawPool.hs
This PR also includes a small fix for the following contracts related to the DAO v1 orders approach:
PBalancePool.hs
PPool.hs
A Nonce field was added to the pool datum in both cases to support new DAO-related flows.