Deprecated

This Splice documentation site is deprecated. Use the current Canton Network docs.

Open current docs

Splice.Amulet.RewardAccountingV2

Templates and support code for reward accounting based on off-ledger calculations, as initially described in CIP-104 for traffic-based app rewards.

It is a Version 2 compared to the previous reward accounting mechanism that is based on tracking all state on-ledger using App|Validator|SvRewardCoupon and IssuingMiningRound contracts.

The design is flexible to allow for extending it to other kinds of rewards that are based on off-ledger calculations, but the initial implementation is specialized to traffic-based app rewards.

Templates

template CalculateRewardsV2

State contract tracking the need to calculate and confirm the app reward amounts for the given round.

Signatory: dso

Field

Type

Description

dso

Party

round

Round

roundClosedAt

Time

The time at which the round was closed. This should be equal to the creation time of this contract. We store this for ease of doing debugging and gathering metrics.

rewardCouponTimeToLive

RelTime

Time to live for reward coupons that are created. We store this as part of requesting the calculation of rewards to avoid reading the AmuletConfig later again, which could lead to inconsistencies in case of config changes.

dryRun

Bool

Whether to only simulate the confirmation without creating any RewardCouponV2 contracts.

  • Choice Archive

    Controller: dso

    Returns: ()

    (no fields)

template ProcessRewardsV2

State contract tracking outstanding processing of rewards for a given round and batch hash.

Signatory: dso

Field

Type

Description

dso

Party

round

Round

roundClosedAt

Time

The time at which the round was closed. Copied from the originating CalculateRewardsV2 contract. We store this for ease of doing debugging and gathering metrics.

dryRun

Bool

Whether to only simulate the processing without creating any RewardCouponV2 contracts.

rewardCouponTimeToLive

RelTime

batchHash

Hash

Data Types

data Batch

data MintingAllowance

A minting allowance for a service provider to mint Amulet.

MintingAllowance

Field

Type

Description

provider

Party

amount

Decimal

instance Hashable MintingAllowance

instance Eq MintingAllowance

instance Show MintingAllowance

instance GetField "amount" MintingAllowance Decimal

instance GetField "provider" MintingAllowance Party

instance SetField "amount" MintingAllowance Decimal

instance SetField "provider" MintingAllowance Party

type MintingAllowances

= [MintingAllowance]

data ProcessRewardsV2_ProcessBatchResult

Functions

batchProviders

: Set Party -> Batch -> [Party]

Comments