Skip to content

Conversation

@jose-velasco-ieu
Copy link
Contributor

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: UnclaimedDevelopmentFundCoupon

A new ledger contract, UnclaimedDevelopmentFundCoupon, represents the portion of newly minted Amulet allocated to the Development Fund.

  • Each coupon is created and owned by the DSO.
  • It records the total amount of Amulet allocated to the Development Fund for a given issuance round.
  • Coupons do not expire:
    • ACS size control is achieved through explicit merging rather than expiry.
    • These contracts are purely accounting instruments and do not require availability incentives.

2. New template: DevelopmentFundCoupon

A new ledger contract, DevelopmentFundCoupon, represents an allocation of Development Fund minting rights to a specific beneficiary.

  • Created when the Development Fund Manager allocates part of the unclaimed fund entitlement.
  • Records the total amount of Amulet the beneficiary is entitled to mint directly to themselves.
  • Lifecycle operations:
    • Withdrawal by the Development Fund Manager, restoring the amount back into an UnclaimedDevelopmentFundCoupon.
    • Expiry by the DSO, similarly consuming the allocated coupon and restoring the amount into an unclaimed coupon.

3. Configuration extensions (AmuletConfig and IssuanceConfig)

The Amulet configuration is extended to support the Development Fund:

  • IssuanceConfig

    • Adds optDevelopmentFundPercentage, defining the fraction of each mint emission allocated to the Development Fund.
    • Validation ensures 0.0 ≤ percentage ≤ 1.0, preventing invalid or over-allocating configurations.
  • AmuletConfig

    • Adds optDevelopmentFundManager, identifying the Development Fund Manager, i.e. the party authorized to allocate Development Fund entitlements to final recipients.

4. AmuletRules enhancements

The AmuletRules contract is extended to support Development Fund issuance and management:

AmuletRules_MiningRound_StartIssuing

  • Deducts the Development Fund’s share before distributing rewards to Validators, Super Validators, and Apps.
  • The deduction is proportional to optDevelopmentFundPercentage and reflected consistently in all issuance parameters.
  • When the allocation is non-zero, a new UnclaimedDevelopmentFundCoupon is created for the round.

AmuletRules_MergeUnclaimedDevelopmentFundCoupons

  • Introduces a batch merge operation, exercisable by the DSO.
  • Requires at least two active unclaimed coupons.
  • Aggregates their amounts into a single new UnclaimedDevelopmentFundCoupon.

AmuletRules_AllocateDevelopmentFundCoupon

  • Allows the Development Fund Manager to allocate Development Fund entitlement to a beneficiary.
  • Key properties:
    • Controller: Development Fund Manager (optDevelopmentFundManager).
    • Consumes one or more UnclaimedDevelopmentFundCoupon contracts.
    • Deducts the specified allocation amount.
    • Creates a new DevelopmentFundCoupon with beneficiary, amount, and expiry.
    • Any remaining unclaimed balance is returned as a new UnclaimedDevelopmentFundCoupon, ensuring that no entitlement is lost.

AmuletRules_Transfer

  • Transfer logic is extended to accept DevelopmentFundCoupon as a valid input.
  • Consumption is permitted only if the sender matches the coupon beneficiary.
  • TransferResult is extended with:
    • totalDevelopmentFundAmount, tracking the total Development Fund amount consumed in the transaction for auditability and reporting.

5. Governance integration (DsoRules)

  • Adds DsoRules_MergeUnclaimedDevelopmentFundCoupons, allowing the DSO to invoke the merge operation at the governance layer.
  • This choice delegates to the same underlying logic as AmuletRules_MergeUnclaimedDevelopmentFundCoupons.

6. Additional changes since the original draft

Compared to the original draft PR (#3086), this PR also includes:

  • Bumping DAML package versions to reflect the new templates and rules.
  • Fixes to Scala and TypeScript compilation, required to align the application code with the updated DAML configuration and contract model.
  • Making IssuingRoundParameters compliant with SCU, aligning issuance parameters with the updated supply and issuance model.

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

jose-velasco-ieu and others added 30 commits December 17, 2025 11:39
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]>
…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]>
jose-velasco-ieu and others added 19 commits December 17, 2025 11:39
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]>
…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]>
@mergify
Copy link

mergify bot commented Dec 18, 2025

⚠️ The sha of the head commit of this PR conflicts with #3086. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor

@meiersi-da meiersi-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


-- Happy - Development Fund coupon allocated with UnclaimedDevelopmentFundCoupon leftover
AmuletRules_AllocateDevelopmentFundCouponResult
{ developmentFundCouponCid, optUnclaimedDevelopmentFundCouponCid = Some leftOverUnclaimedDevelopmentFundCouponCid } <-
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 463 to 470
let amuletsToIssueToDevelopmentFund = fromOptional 0.0 params.optAmuletsToIssueToDevelopmentFund
unclaimedDevelopmentFundCouponCid <-
if amuletsToIssueToDevelopmentFund > 0.0
then
Some <$> create UnclaimedDevelopmentFundCoupon with
dso
amount = amuletsToIssueToDevelopmentFund
else pure None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
```

Copy link
Contributor Author

@jose-velasco-ieu jose-velasco-ieu Dec 18, 2025

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.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 601 to 602
-- Batch merge of unclaimed development fund coupons
nonconsuming choice AmuletRules_MergeUnclaimedDevelopmentFundCoupons : AmuletRules_MergeUnclaimedDevelopmentFundCouponsResult
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- 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

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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.

5 participants