keeper

package
v0.0.0-...-e311743 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper implements ERC20 token contract using CDT store Each function can be performed in concurrency under specific conditions using the operations provided by CDT.

func NewKeeper

func NewKeeper(store cdtkeeper.Int64Store) Keeper

NewKeeper creates a new keeper instance

func (Keeper) Allowance

func (k Keeper) Allowance(ctx sdk.Context, owner string, spender string) (int64, error)

Allowance Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default.

func (Keeper) Approve

func (k Keeper) Approve(ctx sdk.Context, owner string, spender string, amount int64) (err error)

Approve sets `amount` as the allowance of `spender` over the caller's tokens.

func (Keeper) BalanceOf

func (k Keeper) BalanceOf(ctx sdk.Context, account string) (int64, error)

BalanceOf returns the amount of tokens owned by `account`.

func (Keeper) Burn

func (k Keeper) Burn(ctx sdk.Context, account string, amount int64) error

Burn Destroys `amount` tokens from `account`, reducing the total supply.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis exports bridge module's portID and denom trace info into its genesis state.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)

InitGenesis initializes the bridge module state and binds to PortID.

func (Keeper) Mint

func (k Keeper) Mint(ctx sdk.Context, account string, amount int64) error

Mint creates `amount` tokens and assigns them to `account`, increasing the total supply.

func (Keeper) TotalSupply

func (k Keeper) TotalSupply(ctx sdk.Context) (int64, error)

TotalSupply returns the amount of tokens in existence.

func (Keeper) Transfer

func (k Keeper) Transfer(ctx sdk.Context, spender, recipient string, amount int64) error

Transfer moves `amount` of tokens from `sender` to `recipient`.

func (Keeper) TransferFrom

func (k Keeper) TransferFrom(ctx sdk.Context, owner string, spender string, recipient string, amount int64) error

TransferFrom moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance.

Jump to

Keyboard shortcuts

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