-
Notifications
You must be signed in to change notification settings - Fork 53
CIP-82 (DAML): Add support for DevelopmentFundCoupon #3426
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
base: josevelasco/feature-cip-82
Are you sure you want to change the base?
CIP-82 (DAML): Add support for DevelopmentFundCoupon #3426
Conversation
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
…ate a DevelopmentFundCoupon contract in AmuletRules_MiningRound_StartIssuing Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
…n from collection and fund management setup Signed-off-by: Jose Velasco - IEU <[email protected]>
…ntFundPercentage and TransferConfig.optDevelopmentFundBeneficiary Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
…igChange test Signed-off-by: Jose Velasco - IEU <[email protected]>
…figChange test Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
…work with external signing Signed-off-by: Jose Velasco <[email protected]>
… prepare-submission delays larger than 1 minute Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
|
|
meiersi-da
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work! Thank you @jose-velasco-ieu 🙇
Approving with suggestions: https://neilmitchell.blogspot.com/2019/04/code-review-approve-with-suggestions.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is fishy about this file. It's is larger than splice-wallet, which sits farther down in the dependency tree. The size here is also exactly the same 1.18 MB as splice-dso-governance. Can you unzip and compare the contents?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are different.
inspect-dar-splice-dso-governance-0.1.21.json
inspect-dar-splice-amulet-0.1.15.json
Notice that in main we have the same situation:
https://github.com/hyperledger-labs/splice/tree/main/daml/dars
|
|
||
| -- Happy - Development Fund coupon allocated with UnclaimedDevelopmentFundCoupon leftover | ||
| AmuletRules_AllocateDevelopmentFundCouponResult | ||
| { developmentFundCouponCid, optUnclaimedDevelopmentFundCouponCid = Some leftOverUnclaimedDevelopmentFundCouponCid } <- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check amount of left-over funds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| let amuletsToIssueToDevelopmentFund = fromOptional 0.0 params.optAmuletsToIssueToDevelopmentFund | ||
| unclaimedDevelopmentFundCouponCid <- | ||
| if amuletsToIssueToDevelopmentFund > 0.0 | ||
| then | ||
| Some <$> create UnclaimedDevelopmentFundCoupon with | ||
| dso | ||
| amount = amuletsToIssueToDevelopmentFund | ||
| else pure None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| let amuletsToIssueToDevelopmentFund = fromOptional 0.0 params.optAmuletsToIssueToDevelopmentFund | |
| unclaimedDevelopmentFundCouponCid <- | |
| if amuletsToIssueToDevelopmentFund > 0.0 | |
| then | |
| Some <$> create UnclaimedDevelopmentFundCoupon with | |
| dso | |
| amount = amuletsToIssueToDevelopmentFund | |
| else pure None | |
| unclaimedDevelopmentFundCouponCid <- forA params.optAmuletsToIssueToDevelopmentFund $ \amount -> | |
| create UnclaimedDevelopmentFundCoupon with | |
| dso | |
| amount | |
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about if the amount is zero? We would be creating a 0 amount coupon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o.O, I see. I've overlooked that.
I'd still recommend an explicit case distinction then for clarity:
case params.optAmuletsToIssueToDevelopmentFund of
Some amount | amount > 0.0 ->
create UnclaimedDevelopmentFundCoupon with dso; amount
_ -> pure None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| -- Batch merge of unclaimed development fund coupons | ||
| nonconsuming choice AmuletRules_MergeUnclaimedDevelopmentFundCoupons : AmuletRules_MergeUnclaimedDevelopmentFundCouponsResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| -- Batch merge of unclaimed development fund coupons | |
| nonconsuming choice AmuletRules_MergeUnclaimedDevelopmentFundCoupons : AmuletRules_MergeUnclaimedDevelopmentFundCouponsResult | |
| nonconsuming choice AmuletRules_MergeUnclaimedDevelopmentFundCoupons : AmuletRules_MergeUnclaimedDevelopmentFundCouponsResult | |
| -- ^ Batch merge of unclaimed development fund coupons | |
this way they show as docs here: https://docs.dev.sync.global/app_dev/api/splice-amulet/Splice-AmuletRules.html#type-splice-amuletrules-amuletrulescreateexternalpartysetupproposal-53882
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also apply to other choices you've added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Co-authored-by: Simon Meier <[email protected]> Signed-off-by: Jose Velasco - IEU <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Signed-off-by: Jose Velasco <[email protected]>
Summary
This PR introduces the DAML-side support for the Development Fund mechanism defined in CIP-82.
The core design and ledger model were originally developed in the draft PR #3086, and this PR builds on top of that work with additional fixes and updates required to make the implementation fully consistent with the current codebase.
1. New template:
UnclaimedDevelopmentFundCouponA new ledger contract,
UnclaimedDevelopmentFundCoupon, represents the portion of newly minted Amulet allocated to the Development Fund.2. New template:
DevelopmentFundCouponA new ledger contract,
DevelopmentFundCoupon, represents an allocation of Development Fund minting rights to a specific beneficiary.UnclaimedDevelopmentFundCoupon.3. Configuration extensions (
AmuletConfigandIssuanceConfig)The Amulet configuration is extended to support the Development Fund:
IssuanceConfigoptDevelopmentFundPercentage, defining the fraction of each mint emission allocated to the Development Fund.0.0 ≤ percentage ≤ 1.0, preventing invalid or over-allocating configurations.AmuletConfigoptDevelopmentFundManager, identifying the Development Fund Manager, i.e. the party authorized to allocate Development Fund entitlements to final recipients.4.
AmuletRulesenhancementsThe
AmuletRulescontract is extended to support Development Fund issuance and management:AmuletRules_MiningRound_StartIssuingoptDevelopmentFundPercentageand reflected consistently in all issuance parameters.UnclaimedDevelopmentFundCouponis created for the round.AmuletRules_MergeUnclaimedDevelopmentFundCouponsUnclaimedDevelopmentFundCoupon.AmuletRules_AllocateDevelopmentFundCouponoptDevelopmentFundManager).UnclaimedDevelopmentFundCouponcontracts.DevelopmentFundCouponwith beneficiary, amount, and expiry.UnclaimedDevelopmentFundCoupon, ensuring that no entitlement is lost.AmuletRules_TransferDevelopmentFundCouponas a valid input.TransferResultis extended with:totalDevelopmentFundAmount, tracking the total Development Fund amount consumed in the transaction for auditability and reporting.5. Governance integration (
DsoRules)DsoRules_MergeUnclaimedDevelopmentFundCoupons, allowing the DSO to invoke the merge operation at the governance layer.AmuletRules_MergeUnclaimedDevelopmentFundCoupons.6. Additional changes since the original draft
Compared to the original draft PR (#3086), this PR also includes:
IssuingRoundParameterscompliant with SCU, aligning issuance parameters with the updated supply and issuance model.Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines