supplyburn

package
v0.0.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const UpgradeName = "supply-burn"

Variables

This section is empty.

Functions

func CreateUpgradeHandler

func CreateUpgradeHandler(
	mm upgrades.ModuleManager,
	configurator module.Configurator,
	ak *upgrades.AppKeepers,
) upgradetypes.UpgradeHandler

CreateUpgradeHandler burns spendable balances of all addresses in burn_targets.json, keeping keep_pc * 10^18 upc per address. Burn amount is computed from the live spendable balance at upgrade time — not from a snapshot — so it works correctly regardless of accrued rewards.

func ExecuteBurnEntries

func ExecuteBurnEntries(
	ctx sdk.Context,
	bk bankkeeper.BaseKeeper,
	entries []BurnEntry,
) (totalBurned sdkmath.Int, success, skipped, errCount int)

ExecuteBurnEntries burns (spendable_balance - keep_pc * 10^18) upc from each address. Returns total burned and per-outcome counts.

Entries are skipped (not errors) when:

  • spendable balance <= keep amount (nothing to burn)

Entries are counted as errors when:

  • address fails bech32 decoding

Panics if BurnCoins fails after SendCoinsFromAccountToModule succeeds.

func NewUpgrade

func NewUpgrade() upgrades.Upgrade

NewUpgrade constructs the upgrade definition.

Types

type BurnEntry

type BurnEntry struct {
	Address string `json:"address"`
	KeepPC  int64  `json:"keep_pc"` // whole PC to keep liquid (0 = burn all spendable)
}

BurnEntry specifies one address and how much PC to keep (in whole PC tokens). The handler burns: spendable_balance - keep_pc * 10^18 upc. Set keep_pc = 0 to burn the entire spendable balance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL