Documentation
¶
Index ¶
- Constants
- func CreateUpgradeHandler(mm upgrades.ModuleManager, configurator module.Configurator, ...) upgradetypes.UpgradeHandler
- func ExecuteBurnEntries(ctx sdk.Context, bk bankkeeper.BaseKeeper, entries []BurnEntry) (totalBurned sdkmath.Int, success, skipped, errCount int)
- func NewUpgrade() upgrades.Upgrade
- type BurnEntry
Constants ¶
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.
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.