Documentation ¶
Index ¶
- func AllInvariants(k Keeper, bk bankkeeper.Keeper) sdk.Invariant
- func HandleAddMarkerProposal(ctx sdk.Context, k Keeper, c *types.AddMarkerProposal) error
- func HandleChangeStatusProposal(ctx sdk.Context, k Keeper, c *types.ChangeStatusProposal) error
- func HandleRemoveAdministratorProposal(ctx sdk.Context, k Keeper, c *types.RemoveAdministratorProposal) error
- func HandleSetAdministratorProposal(ctx sdk.Context, k Keeper, c *types.SetAdministratorProposal) error
- func HandleSetDenomMetadataProposal(ctx sdk.Context, k Keeper, c *types.SetDenomMetadataProposal) error
- func HandleSupplyDecreaseProposal(ctx sdk.Context, k Keeper, c *types.SupplyDecreaseProposal) error
- func HandleSupplyIncreaseProposal(ctx sdk.Context, k Keeper, c *types.SupplyIncreaseProposal) error
- func HandleWithdrawEscrowProposal(ctx sdk.Context, k Keeper, c *types.WithdrawEscrowProposal) error
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, mk Keeper, bk bankkeeper.Keeper)
- type Handler
- type Keeper
- func (k Keeper) Access(c context.Context, req *types.QueryAccessRequest) (*types.QueryAccessResponse, error)
- func (k Keeper) ActivateMarker(ctx sdk.Context, caller sdk.Address, denom string) error
- func (k Keeper) AddAccess(ctx sdk.Context, caller sdk.AccAddress, denom string, grant types.AccessGrantI) error
- func (k Keeper) AddFinalizeAndActivateMarker(ctx sdk.Context, marker types.MarkerAccountI) error
- func (k Keeper) AddMarkerAccount(ctx sdk.Context, marker types.MarkerAccountI) error
- func (k Keeper) AdjustCirculation(ctx sdk.Context, marker types.MarkerAccountI, desiredSupply sdk.Coin) error
- func (k Keeper) AllMarkers(c context.Context, req *types.QueryAllMarkersRequest) (*types.QueryAllMarkersResponse, error)
- func (k Keeper) BurnCoin(ctx sdk.Context, caller sdk.AccAddress, coin sdk.Coin) error
- func (k Keeper) CancelMarker(ctx sdk.Context, caller sdk.AccAddress, denom string) error
- func (k Keeper) CurrentCirculation(ctx sdk.Context, marker types.MarkerAccountI) sdkmath.Int
- func (k Keeper) CurrentEscrow(ctx sdk.Context, marker types.MarkerAccountI) sdk.Coins
- func (k Keeper) DecreaseSupply(ctx sdk.Context, marker types.MarkerAccountI, coin sdk.Coin) error
- func (k Keeper) DeleteMarker(ctx sdk.Context, caller sdk.AccAddress, denom string) error
- func (k Keeper) DenomMetadata(c context.Context, req *types.QueryDenomMetadataRequest) (*types.QueryDenomMetadataResponse, error)
- func (k Keeper) Escrow(c context.Context, req *types.QueryEscrowRequest) (*types.QueryEscrowResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)
- func (k Keeper) FinalizeMarker(ctx sdk.Context, caller sdk.Address, denom string) error
- func (k Keeper) GetAllMarkerHolders(ctx sdk.Context, denom string) []types.Balance
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetEnableGovernance(ctx sdk.Context) (enabled bool)
- func (k Keeper) GetEscrow(ctx sdk.Context, marker types.MarkerAccountI) sdk.Coins
- func (k Keeper) GetMarker(ctx sdk.Context, address sdk.AccAddress) (types.MarkerAccountI, error)
- func (k Keeper) GetMarkerByDenom(ctx sdk.Context, denom string) (types.MarkerAccountI, error)
- func (k Keeper) GetMaxTotalSupply(ctx sdk.Context) (max uint64)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetUnrestrictedDenomRegex(ctx sdk.Context) (regex string)
- func (k Keeper) Holding(c context.Context, req *types.QueryHoldingRequest) (*types.QueryHoldingResponse, error)
- func (k Keeper) IbcTransferCoin(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.Coin, ...) error
- func (k Keeper) IncreaseSupply(ctx sdk.Context, marker types.MarkerAccountI, coin sdk.Coin) error
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) IterateMarkers(ctx sdk.Context, cb func(marker types.MarkerAccountI) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Marker(c context.Context, req *types.QueryMarkerRequest) (*types.QueryMarkerResponse, error)
- func (k Keeper) MintCoin(ctx sdk.Context, caller sdk.AccAddress, coin sdk.Coin) error
- func (k Keeper) NewMarker(ctx sdk.Context, marker types.MarkerAccountI) types.MarkerAccountI
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveAccess(ctx sdk.Context, caller sdk.AccAddress, denom string, remove sdk.AccAddress) error
- func (k Keeper) RemoveMarker(ctx sdk.Context, marker types.MarkerAccountI)
- func (k Keeper) SetMarker(ctx sdk.Context, marker types.MarkerAccountI)
- func (k Keeper) SetMarkerDenomMetadata(ctx sdk.Context, metadata banktypes.Metadata, caller sdk.AccAddress) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) Supply(c context.Context, req *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
- func (k Keeper) TransferCoin(ctx sdk.Context, from, to, admin sdk.AccAddress, amount sdk.Coin) error
- func (k Keeper) ValidateDenomMetadata(ctx sdk.Context, proposed banktypes.Metadata, existing *banktypes.Metadata, ...) error
- func (k Keeper) ValidateUnrestictedDenom(ctx sdk.Context, denom string) error
- func (k Keeper) WithdrawCoins(ctx sdk.Context, caller sdk.AccAddress, recipient sdk.AccAddress, denom string, ...) error
- type MarkerKeeperI
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func AllInvariants(k Keeper, bk bankkeeper.Keeper) sdk.Invariant
AllInvariants runs all invariants of the marker module.
func HandleAddMarkerProposal ¶ added in v0.3.0
HandleAddMarkerProposal handles an Add Marker governance proposal request
func HandleChangeStatusProposal ¶ added in v0.3.0
HandleChangeStatusProposal handles a ChangeStatus governance proposal request
func HandleRemoveAdministratorProposal ¶ added in v0.3.0
func HandleRemoveAdministratorProposal(ctx sdk.Context, k Keeper, c *types.RemoveAdministratorProposal) error
HandleRemoveAdministratorProposal handles a RemoveAdministrator governance proposal request
func HandleSetAdministratorProposal ¶ added in v0.3.0
func HandleSetAdministratorProposal(ctx sdk.Context, k Keeper, c *types.SetAdministratorProposal) error
HandleSetAdministratorProposal handles a SetAdministrator governance proposal request
func HandleSetDenomMetadataProposal ¶ added in v1.7.0
func HandleSetDenomMetadataProposal(ctx sdk.Context, k Keeper, c *types.SetDenomMetadataProposal) error
HandleSetDenomMetadataProposal handles a Set Denom Metadata governance proposal request
func HandleSupplyDecreaseProposal ¶ added in v0.3.0
HandleSupplyDecreaseProposal handles a SupplyDecrease governance proposal request
func HandleSupplyIncreaseProposal ¶ added in v0.3.0
HandleSupplyIncreaseProposal handles a SupplyIncrease governance proposal request
func HandleWithdrawEscrowProposal ¶ added in v0.3.0
HandleWithdrawEscrowProposal handles a Withdraw escrowed coins governance proposal request
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the marker MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries (using the Legacy Amino Codec)
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, mk Keeper, bk bankkeeper.Keeper)
RegisterInvariants registers module invariants
Types ¶
type Handler ¶
type Handler func(record types.MarkerAccountI) error
Handler is a handler function for use with IterateRecords.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the name module Keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, authKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, authzKeeper authzkeeper.Keeper, feegrantKeeper feegrantkeeper.Keeper, ibcKeeper ibckeeper.Keeper, bankKey storetypes.StoreKey, ) Keeper
NewKeeper returns a marker keeper. It handles: - managing MarkerAccounts - enforcing permissions for marker creation/deletion/management
CONTRACT: the parameter Subspace must have the param key table already initialized
func (Keeper) Access ¶
func (k Keeper) Access(c context.Context, req *types.QueryAccessRequest) (*types.QueryAccessResponse, error)
Access query for access records on an account
func (Keeper) ActivateMarker ¶
ActivateMarker transitions a marker into the active status, enforcing permissions, supply constraints, and minting any supply as required.
func (Keeper) AddAccess ¶
func (k Keeper) AddAccess( ctx sdk.Context, caller sdk.AccAddress, denom string, grant types.AccessGrantI, ) error
AddAccess adds the provided AccessGrant to the marker of the caller is allowed to make changes
func (Keeper) AddFinalizeAndActivateMarker ¶ added in v1.14.0
AddFinalizeAndActivateMarker adds marker, finalizes, and then activates it
func (Keeper) AddMarkerAccount ¶
AddMarkerAccount persists marker to the account keeper store.
func (Keeper) AdjustCirculation ¶
func (k Keeper) AdjustCirculation(ctx sdk.Context, marker types.MarkerAccountI, desiredSupply sdk.Coin) error
AdjustCirculation will mint/burn coin if required to ensure desired supply matches amount in circulation
func (Keeper) AllMarkers ¶
func (k Keeper) AllMarkers(c context.Context, req *types.QueryAllMarkersRequest) (*types.QueryAllMarkersResponse, error)
AllMarkers returns a list of all markers on the blockchain
func (Keeper) BurnCoin ¶
BurnCoin removes supply from the marker by burning coins held within the marker acccount.
func (Keeper) CancelMarker ¶
CancelMarker prepares transition to deleted state.
func (Keeper) CurrentCirculation ¶ added in v1.7.0
Returns the current supply in network according to the bank module for the given marker
func (Keeper) CurrentEscrow ¶ added in v1.7.0
Retures the current escrow balance for the marker base account
func (Keeper) DecreaseSupply ¶
DecreaseSupply will move a given amount of coin from the marker to the markermodule coin pool account then burn it.
func (Keeper) DeleteMarker ¶
DeleteMarker burns the entire coin supply, ensure no assets are pooled, and marks the current instance of the marker as destroyed.
func (Keeper) DenomMetadata ¶
func (k Keeper) DenomMetadata(c context.Context, req *types.QueryDenomMetadataRequest) (*types.QueryDenomMetadataResponse, error)
DenomMetadata query for metadata on denom
func (Keeper) Escrow ¶
func (k Keeper) Escrow(c context.Context, req *types.QueryEscrowRequest) (*types.QueryEscrowResponse, error)
Escrow query for coins on a marker account
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)
ExportGenesis exports the current keeper state of the marker module.ExportGenesis We do not export anything because our marker accounts will be exported/imported by the Account Module.
func (Keeper) FinalizeMarker ¶
FinalizeMarker sets the state of the marker to finalized, mints the associated supply, assigns the minted coin to the marker accounts, and if successful emits an EventMarkerFinalize event to transition the state to active
func (Keeper) GetAllMarkerHolders ¶
GetAllMarkerHolders returns an array of all account addresses holding the given denom (and the amount)
func (Keeper) GetAuthority ¶ added in v1.14.0
GetAuthority is signer of the proposal
func (Keeper) GetEnableGovernance ¶ added in v1.0.0
GetEnableGovernance returns the current parameter value for enabling governance control (or default if unset)
func (Keeper) GetMarker ¶
func (k Keeper) GetMarker(ctx sdk.Context, address sdk.AccAddress) (types.MarkerAccountI, error)
GetMarker looks up a marker by a given address
func (Keeper) GetMarkerByDenom ¶
GetMarkerByDenom looks up marker with the given denom
func (Keeper) GetMaxTotalSupply ¶ added in v1.0.0
GetMaxTotalSupply return the current parameter value for the max allowed total supply (or default if unset)
func (Keeper) GetUnrestrictedDenomRegex ¶ added in v1.0.0
GetUnrestrictedDenomRegex returns the current parameter value for enabling governance control (or default if unset)
func (Keeper) Holding ¶
func (k Keeper) Holding(c context.Context, req *types.QueryHoldingRequest) (*types.QueryHoldingResponse, error)
Holding query for all accounts holding the given marker coins
func (Keeper) IbcTransferCoin ¶ added in v1.13.0
func (k Keeper) IbcTransferCoin( ctx sdk.Context, sourcePort, sourceChannel string, token sdk.Coin, sender, admin sdk.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, memo string, checkRestrictionsHandler ibckeeper.CheckRestrictionsHandler) error
IbcTransferCoin transfers restricted coins between to chains when the administrator account holds the transfer access right and the marker type is restricted_coin
func (Keeper) IncreaseSupply ¶
IncreaseSupply will mint coins to the marker module coin pool account, then send these to the marker account
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
InitGenesis creates the initial genesis state for the marker module. Typically these accounts would be listed with the rest of the accounts and not created here.
func (Keeper) IterateMarkers ¶
IterateMarkers iterates all markers with the given handler function.
func (Keeper) Marker ¶
func (k Keeper) Marker(c context.Context, req *types.QueryMarkerRequest) (*types.QueryMarkerResponse, error)
Marker query for a single marker by denom or address
func (Keeper) MintCoin ¶
MintCoin increases the Supply of a coin by interacting with the supply keeper for the adjustment, updating the marker's record of expected total supply, and transferring the created coin to the MarkerAccount for holding pending further action.
func (Keeper) NewMarker ¶
func (k Keeper) NewMarker(ctx sdk.Context, marker types.MarkerAccountI) types.MarkerAccountI
NewMarker returns a new marker instance with the address and baseaccount assigned. Does not save to auth store
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries params of distribution module
func (Keeper) RemoveAccess ¶
func (k Keeper) RemoveAccess(ctx sdk.Context, caller sdk.AccAddress, denom string, remove sdk.AccAddress) error
RemoveAccess delete the AccessGrant for the specified user from the marker if the caller is allowed to make changes
func (Keeper) RemoveMarker ¶
func (k Keeper) RemoveMarker(ctx sdk.Context, marker types.MarkerAccountI)
RemoveMarker removes a marker from the auth account store. Note: if the account holds coins this will likely cause an invariant constraint violation for the coin supply
func (Keeper) SetMarker ¶
func (k Keeper) SetMarker(ctx sdk.Context, marker types.MarkerAccountI)
SetMarker sets a marker in the auth account store will panic if the marker account is not valid or if the auth module account keeper fails to marshall the account.
func (Keeper) SetMarkerDenomMetadata ¶ added in v1.0.0
func (k Keeper) SetMarkerDenomMetadata(ctx sdk.Context, metadata banktypes.Metadata, caller sdk.AccAddress) error
SetMarkerDenomMetadata updates the denom metadata records for the current marker.
func (Keeper) Supply ¶
func (k Keeper) Supply(c context.Context, req *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error)
Supply query for supply of coin on a marker account
func (Keeper) TransferCoin ¶
func (k Keeper) TransferCoin(ctx sdk.Context, from, to, admin sdk.AccAddress, amount sdk.Coin) error
TransferCoin transfers restricted coins between to accounts when the administrator account holds the transfer access right and the marker type is restricted_coin
func (Keeper) ValidateDenomMetadata ¶ added in v1.2.0
func (k Keeper) ValidateDenomMetadata(ctx sdk.Context, proposed banktypes.Metadata, existing *banktypes.Metadata, markerStatus types.MarkerStatus) error
ValidateDenomMetadata performs extended validation of the denom metadata fields. It checks that:
- The proposed metadata passes ValidateDenomMetadataBasic.
- The marker status is one that allows the denom metadata to be manipulated.
- All DenomUnit Denom and Aliases strings pass the unrestricted denom regex. If there is an existing record:
- The Base doesn't change. If marker status is active or finalized:
- No DenomUnit entries are removed.
- DenomUnit Denom fields aren't changed.
- No aliases are removed from a DenomUnit.
func (Keeper) ValidateUnrestictedDenom ¶ added in v1.2.0
ValidateUnrestictedDenom checks if the supplied denom is valid based on the module params
func (Keeper) WithdrawCoins ¶
func (k Keeper) WithdrawCoins( ctx sdk.Context, caller sdk.AccAddress, recipient sdk.AccAddress, denom string, coins sdk.Coins, ) error
WithdrawCoins removes the specified coins from the MarkerAccount (both marker denominated coins and coins as assets are supported here)
type MarkerKeeperI ¶
type MarkerKeeperI interface { // Returns a new marker instance with the address and baseaccount assigned. Does not save to auth store NewMarker(sdk.Context, types.MarkerAccountI) types.MarkerAccountI // GetMarker looks up a marker by a given address GetMarker(sdk.Context, sdk.AccAddress) (types.MarkerAccountI, error) // Set a marker in the auth account store SetMarker(sdk.Context, types.MarkerAccountI) // Remove a marker from the auth account store RemoveMarker(sdk.Context, types.MarkerAccountI) GetEscrow(sdk.Context, types.MarkerAccountI) sdk.Coins // IterateMarker processes all markers with the given handler function. IterateMarkers(sdk.Context, func(types.MarkerAccountI) bool) // GetAuthority returns signer of the proposal GetAuthority() string }
MarkerKeeperI provides a read/write iterate interface to marker acccounts in the auth account keeper store