keeper

package
v0.0.0-...-abdbe5d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 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 NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the QueryServer 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 {
	Schema         collections.Schema
	Params         collections.Item[types.Params]
	MainnetAccount collections.Map[collections.Pair[uint64, sdk.AccAddress], types.MainnetAccount]
	ProjectSeq     collections.Sequence
	Project        collections.Map[uint64, types.Project]
	ProjectChains  collections.Map[uint64, types.ProjectChains]
	TotalShares    collections.Item[uint64]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	addressCodec address.Codec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
	distributionKeeper types.DistributionKeeper,
	profileKeeper types.ProfileKeeper,
	bankKeeper types.BankKeeper,
	launchKeeper LaunchKeeper,
) Keeper

func (Keeper) AddChainToProject

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

AddChainToProject adds a new chain into an existing project.

func (Keeper) AddressCodec

func (k Keeper) AddressCodec() address.Codec

AddressCodec returns the address codec.

func (Keeper) AppendProject

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

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

func (Keeper) EmitProjectAuctionCreated

func (k Keeper) EmitProjectAuctionCreated(
	ctx context.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 context.Context) ([]types.MainnetAccount, error)

GetAllMainnetAccount returns all MainnetAccount

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetMainnetAccount

func (k Keeper) GetMainnetAccount(ctx context.Context, projectID uint64, address sdk.AccAddress) (types.MainnetAccount, error)

func (Keeper) GetProject

func (k Keeper) GetProject(ctx context.Context, projectID uint64) (types.Project, error)

func (Keeper) GetProjectChains

func (k Keeper) GetProjectChains(ctx context.Context, projectID uint64) (types.ProjectChains, error)

func (Keeper) IsProjectMainnetLaunchTriggered

func (k Keeper) IsProjectMainnetLaunchTriggered(ctx context.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) ListMainnetAccountBalance

func (k Keeper) ListMainnetAccountBalance(ctx context.Context, projectID uint64) ([]types.MainnetAccountBalance, error)

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) MainnetAccountBalance

func (k Keeper) MainnetAccountBalance(ctx context.Context, projectID uint64, address sdk.AccAddress) (types.MainnetAccountBalance, error)

func (Keeper) ProjectAuctionEventHooks

func (k Keeper) ProjectAuctionEventHooks() ProjectAuctionEventHooks

ProjectAuctionEventHooks returns a ProjectAuctionEventHooks associated with the project keeper

func (Keeper) Projects

func (k Keeper) Projects(ctx context.Context) ([]types.Project, error)

Projects returns all Project.

type LaunchKeeper

type LaunchKeeper interface {
	GetChain(ctx context.Context, launchID uint64) (launchtypes.Chain, error)
	CreateNewChain(
		ctx context.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 context.Context,
	auctionID uint64,
	auctioneer string,
	_ sdkmath.LegacyDec,
	_ sdkmath.LegacyDec,
	sellingCoin sdk.Coin,
	_ string,
	_ []fundraisingtypes.VestingSchedule,
	_ uint32,
	_ sdkmath.LegacyDec,
	_ time.Time,
	_ time.Time,
) error

AfterBatchAuctionCreated emits a ProjectAuctionCreated event if created for a project

func (ProjectAuctionEventHooks) AfterFixedPriceAuctionCreated

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

AfterFixedPriceAuctionCreated emits a ProjectAuctionCreated event if created for a project

func (ProjectAuctionEventHooks) BeforeAllowedBidderUpdated

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

BeforeAllowedBidderUpdated implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeAllowedBiddersAdded

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

BeforeAllowedBiddersAdded implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeAuctionCanceled

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

BeforeAuctionCanceled implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeBatchAuctionCreated

BeforeBatchAuctionCreated implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeBidModified

BeforeBidModified implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeBidPlaced

BeforeBidPlaced implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeFixedPriceAuctionCreated

func (h ProjectAuctionEventHooks) BeforeFixedPriceAuctionCreated(
	_ context.Context,
	_ string,
	_ sdkmath.LegacyDec,
	_ sdk.Coin,
	_ string,
	_ []fundraisingtypes.VestingSchedule,
	_ time.Time,
	_ time.Time,
) error

BeforeFixedPriceAuctionCreated implements FundraisingHooks

func (ProjectAuctionEventHooks) BeforeSellingCoinsAllocated

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

BeforeSellingCoinsAllocated implements FundraisingHooks

Jump to

Keyboard shortcuts

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