State
State Objects
The x/incentives
module keeps the following objects in state:
Incentive
Incentive bytecode
[]byte{1} + []byte(contract)
[]byte{incentive}
KV
GasMeter
Incentive id bytecode by erc20 contract bytes
[]byte{2} + []byte(contract) + []byte(participant)
[]byte{gasMeter}
KV
AllocationMeter
Total allocation bytes by denom bytes
[]byte{3} + []byte(denom)
[]byte{sdk.Dec}
KV
Incentive
An instance that organizes distribution conditions for a given smart contract.
As long as an incentive has remaining epochs, it distributes rewards according to its allocations. The allocations are stored as sdk.DecCoins
where each containing sdk.DecCoin
describes the percentage of rewards (Amount
) that are allocated to the contract for a given coin denomination (Denom
). An incentive can contain several allocations, resulting in users to receive rewards in form of several different denominations.
GasMeter
Tracks the cumulative gas spent in a contract per participant during one epoch.
AllocationMeter
An allocation meter stores the sum of all registered incentives’ allocations for a given denomination and is used to limit the amount of registered incentives.
Say, there are several incentives that have registered an allocation for the $BCX coin and the allocation meter for $BCX is at 97%. Then a new incentive proposal can only include an $BCX allocation at up to 3%, claiming the last remaining allocation capacity from the $BCX rewards in the inflation pool.
Genesis State
The x/incentives
module's GenesisState
defines the state necessary for initializing the chain from a previously exported height. It contains the module parameters and the list of active incentives and their corresponding gas meters:
Last updated