keeper

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountWithoutProjectInvariant

func AccountWithoutProjectInvariant(k Keeper) sdk.Invariant

AccountWithoutProjectInvariant invariant that checks if the `MainnetAccount` project exist.

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func GetProjectIDBytes

func GetProjectIDBytes(id uint64) []byte

GetProjectIDBytes returns the byte representation of the ID

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func ProjectSharesInvariant

func ProjectSharesInvariant(k Keeper) sdk.Invariant

ProjectSharesInvariant invariant that checks, for all projects, if the amount of allocated shares is equal to the sum of `MainnetVestingAccount` and `MainnetAccount` shares plus the amount of vouchers in circulation plus the total shares of special allocations

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all module invariants

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	paramSpace paramtypes.Subspace,
	launchKeeper LaunchKeeper,
	bankKeeper types.BankKeeper,
	distrKeeper types.DistributionKeeper,
	profileKeeper types.ProfileKeeper,
) *Keeper

func (Keeper) AddChainToProject

func (k Keeper) AddChainToProject(ctx sdk.Context, projectID, launchID uint64) error

AddChainToProject adds a new chain into an existing project

func (Keeper) AppendProject

func (k Keeper) AppendProject(ctx sdk.Context, project types.Project) uint64

AppendProject appends a project in the store with a new id and update the count

func (Keeper) EmitProjectAuctionCreated

func (k Keeper) EmitProjectAuctionCreated(
	ctx sdk.Context,
	auctionID uint64,
	auctioneer string,
	sellingCoin sdk.Coin,
) (bool, error)

EmitProjectAuctionCreated emits EventProjectAuctionCreated event if an auction is created for a project from a coordinator

func (Keeper) GetAllMainnetAccount

func (k Keeper) GetAllMainnetAccount(ctx sdk.Context) (list []types.MainnetAccount)

GetAllMainnetAccount returns all mainnetAccount

func (Keeper) GetAllProject

func (k Keeper) GetAllProject(ctx sdk.Context) (list []types.Project)

GetAllProject returns all project

func (Keeper) GetAllProjectChains

func (k Keeper) GetAllProjectChains(ctx sdk.Context) (list []types.ProjectChains)

GetAllProjectChains returns all projectChains

func (Keeper) GetMainnetAccount

func (k Keeper) GetMainnetAccount(
	ctx sdk.Context,
	projectID uint64,
	address string,
) (val types.MainnetAccount, found bool)

GetMainnetAccount returns a mainnetAccount from its index

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetProject

func (k Keeper) GetProject(ctx sdk.Context, id uint64) (val types.Project, found bool)

GetProject returns a project from its id

func (Keeper) GetProjectChains

func (k Keeper) GetProjectChains(ctx sdk.Context, projectID uint64) (val types.ProjectChains, found bool)

GetProjectChains returns a projectChains from its index

func (Keeper) GetProjectCounter

func (k Keeper) GetProjectCounter(ctx sdk.Context) uint64

GetProjectCounter get the counter for project

func (Keeper) GetTotalShares

func (k Keeper) GetTotalShares(ctx sdk.Context) uint64

GetTotalShares gets the total shares value

func (Keeper) IsProjectMainnetLaunchTriggered

func (k Keeper) IsProjectMainnetLaunchTriggered(ctx sdk.Context, projectID uint64) (bool, error)

IsProjectMainnetLaunchTriggered returns true if the provided project has an associated mainnet chain whose launch has been already triggered

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) MaxMetadataLength

func (k Keeper) MaxMetadataLength(ctx sdk.Context) (maxMetadataLength uint64)

MaxMetadataLength returns the param that defines the max metadata length

func (Keeper) Params

func (Keeper) ProjectAuctionEventHooks

func (k Keeper) ProjectAuctionEventHooks() ProjectAuctionEventHooks

ProjectAuctionEventHooks returns a ProjectAuctionEventHooks associated with the project keeper

func (Keeper) ProjectCreationFee

func (k Keeper) ProjectCreationFee(ctx sdk.Context) (projectCreationFee sdk.Coins)

ProjectCreationFee returns the project creation fee param

func (Keeper) RemoveMainnetAccount

func (k Keeper) RemoveMainnetAccount(
	ctx sdk.Context,
	projectID uint64,
	address string,
)

RemoveMainnetAccount removes a mainnetAccount from the store

func (Keeper) RemoveProject

func (k Keeper) RemoveProject(ctx sdk.Context, id uint64)

RemoveProject removes a project from the store

func (Keeper) SetMainnetAccount

func (k Keeper) SetMainnetAccount(ctx sdk.Context, mainnetAccount types.MainnetAccount)

SetMainnetAccount set a specific mainnetAccount in the store from its index

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the project parameters to the param space.

func (Keeper) SetProject

func (k Keeper) SetProject(ctx sdk.Context, project types.Project)

SetProject set a specific project in the store

func (Keeper) SetProjectChains

func (k Keeper) SetProjectChains(ctx sdk.Context, projectChains types.ProjectChains)

SetProjectChains set a specific projectChains in the store from its index

func (Keeper) SetProjectCounter

func (k Keeper) SetProjectCounter(ctx sdk.Context, counter uint64)

SetProjectCounter set the counter for project

func (Keeper) SetTotalShares

func (k Keeper) SetTotalShares(ctx sdk.Context, numShares uint64)

SetTotalShares sets the total shares value

func (Keeper) TotalSupplyRange

func (k Keeper) TotalSupplyRange(ctx sdk.Context) (totalSupplyRange types.TotalSupplyRange)

TotalSupplyRange returns the param that defines the allowed range for total supply

type LaunchKeeper

type LaunchKeeper interface {
	GetChain(ctx sdk.Context, launchID uint64) (val launchtypes.Chain, found bool)
	CreateNewChain(
		ctx sdk.Context,
		coordinatorID uint64,
		genesisChainID,
		sourceURL,
		sourceHash string,
		initialGenesis launchtypes.InitialGenesis,
		hasProject bool,
		projectID uint64,
		isMainnet bool,
		accountBalance sdk.Coins,
		metadata []byte,
	) (uint64, error)
}

type ProjectAuctionEventHooks

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

ProjectAuctionEventHooks implements fundraising hooks and emit events on auction creation

func (ProjectAuctionEventHooks) AfterBatchAuctionCreated

func (h ProjectAuctionEventHooks) AfterBatchAuctionCreated(
	ctx sdk.Context,
	auctionID uint64,
	auctioneer string,
	_ sdk.Dec,
	_ sdk.Dec,
	sellingCoin sdk.Coin,
	_ string,
	_ []fundraisingtypes.VestingSchedule,
	_ uint32,
	_ sdk.Dec,
	_ time.Time,
	_ time.Time,
)

AfterBatchAuctionCreated emits a ProjectAuctionCreated event if created for a project

func (ProjectAuctionEventHooks) AfterFixedPriceAuctionCreated

func (h ProjectAuctionEventHooks) AfterFixedPriceAuctionCreated(
	ctx sdk.Context,
	auctionID uint64,
	auctioneer string,
	_ sdk.Dec,
	sellingCoin sdk.Coin,
	_ string,
	_ []fundraisingtypes.VestingSchedule,
	_ time.Time,
	_ time.Time,
)

AfterFixedPriceAuctionCreated emits a ProjectAuctionCreated event if created for a project

func (ProjectAuctionEventHooks) BeforeAllowedBidderUpdated

func (h ProjectAuctionEventHooks) BeforeAllowedBidderUpdated(
	_ sdk.Context,
	_ uint64,
	_ sdk.AccAddress,
	_ sdkmath.Int,
)

BeforeAllowedBidderUpdated implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeAllowedBiddersAdded

func (h ProjectAuctionEventHooks) BeforeAllowedBiddersAdded(
	_ sdk.Context,
	_ []fundraisingtypes.AllowedBidder,
)

BeforeAllowedBiddersAdded implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeAuctionCanceled

func (h ProjectAuctionEventHooks) BeforeAuctionCanceled(
	_ sdk.Context,
	_ uint64,
	_ string,
)

BeforeAuctionCanceled implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeBatchAuctionCreated

func (h ProjectAuctionEventHooks) BeforeBatchAuctionCreated(
	_ sdk.Context,
	_ string,
	_ sdk.Dec,
	_ sdk.Dec,
	_ sdk.Coin,
	_ string,
	_ []fundraisingtypes.VestingSchedule,
	_ uint32,
	_ sdk.Dec,
	_ time.Time,
	_ time.Time,
)

BeforeBatchAuctionCreated implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeBidModified

func (h ProjectAuctionEventHooks) BeforeBidModified(
	_ sdk.Context,
	_ uint64,
	_ uint64,
	_ string,
	_ fundraisingtypes.BidType,
	_ sdk.Dec,
	_ sdk.Coin,
)

BeforeBidModified implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeBidPlaced

func (h ProjectAuctionEventHooks) BeforeBidPlaced(
	_ sdk.Context,
	_ uint64,
	_ uint64,
	_ string,
	_ fundraisingtypes.BidType,
	_ sdk.Dec,
	_ sdk.Coin,
)

BeforeBidPlaced implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeFixedPriceAuctionCreated

func (h ProjectAuctionEventHooks) BeforeFixedPriceAuctionCreated(
	_ sdk.Context,
	_ string,
	_ sdk.Dec,
	_ sdk.Coin,
	_ string,
	_ []fundraisingtypes.VestingSchedule,
	_ time.Time,
	_ time.Time,
)

BeforeFixedPriceAuctionCreated implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeSellingCoinsAllocated

func (h ProjectAuctionEventHooks) BeforeSellingCoinsAllocated(
	_ sdk.Context,
	_ uint64,
	_ map[string]sdkmath.Int,
	_ map[string]sdkmath.Int,
)

BeforeSellingCoinsAllocated implements FundraisingHooks

Jump to

Keyboard shortcuts

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