Documentation ¶
Index ¶
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterProposalActive(ctx sdk.Context, proposalID uint64)
- func (h Hooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress)
- func (h Hooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64)
- func (h Hooks) AfterProposalInactive(ctx sdk.Context, proposalID uint64)
- func (h Hooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64)
- func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress)
- func (h Hooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64)
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- func (h Hooks) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
- type Keeper
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress)
- func (k Keeper) ClaimCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, claimsRecord types.ClaimsRecord, ...) (math.Int, error)
- func (k Keeper) ClaimableAmountForAction(ctx sdk.Context, claimsRecord types.ClaimsRecord, action types.Action, ...) (claimableCoins, remainder math.Int)
- func (k Keeper) ClaimsInvariant() sdk.Invariant
- func (k Keeper) ClaimsRecord(c context.Context, req *types.QueryClaimsRecordRequest) (*types.QueryClaimsRecordResponse, error)
- func (k Keeper) ClaimsRecords(c context.Context, req *types.QueryClaimsRecordsRequest) (*types.QueryClaimsRecordsResponse, error)
- func (k Keeper) ClawbackEmptyAccounts(ctx sdk.Context, claimsDenom string)
- func (k Keeper) ClawbackEscrowedTokens(ctx sdk.Context) error
- func (k Keeper) DeleteClaimsRecord(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) EndAirdrop(ctx sdk.Context, params types.Params) error
- func (k Keeper) EndBlocker(ctx sdk.Context)
- func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, claimsRecord types.ClaimsRecord, action types.Action, ...) (claimableCoins, remainder math.Int)
- func (k Keeper) GetClaimsRecord(ctx sdk.Context, addr sdk.AccAddress) (types.ClaimsRecord, bool)
- func (k Keeper) GetClaimsRecords(ctx sdk.Context) []types.ClaimsRecordAddress
- func (k Keeper) GetModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetModuleAccountAddress() sdk.AccAddress
- func (k Keeper) GetModuleAccountBalances(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) HasClaimsRecord(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IterateClaimsRecords(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MergeClaimsRecords(ctx sdk.Context, recipient sdk.AccAddress, ...) (mergedRecord types.ClaimsRecord, err error)
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error
- func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement) exported.Acknowledgement
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
- func (k Keeper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, ...) (sequence uint64, err error)
- func (k Keeper) SetClaimsRecord(ctx sdk.Context, addr sdk.AccAddress, claimsRecord types.ClaimsRecord)
- func (k *Keeper) SetICS4Wrapper(ics4Wrapper porttypes.ICS4Wrapper)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) TotalUnclaimed(c context.Context, _ *types.QueryTotalUnclaimedRequest) (*types.QueryTotalUnclaimedResponse, error)
- func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
- func (k Keeper) WriteAcknowledgement(ctx sdk.Context, channelCap *capabilitytypes.Capability, ...) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the claims module invariants
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for the claim keeper
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
AfterDelegationModified is a wrapper for calling the Staking AfterDelegationModified hook on the module keeper
func (Hooks) AfterProposalActive ¶
func (Hooks) AfterProposalDeposit ¶
func (Hooks) AfterProposalFailedMinDeposit ¶
governance hooks
func (Hooks) AfterProposalInactive ¶
func (Hooks) AfterProposalSubmission ¶
func (Hooks) AfterProposalVote ¶
AfterProposalVote is a wrapper for calling the Gov AfterProposalVote hook on the module keeper
func (Hooks) AfterProposalVotingPeriodEnded ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
staking hooks
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper struct
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey storetypes.StoreKey, authority sdk.AccAddress, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, dk types.DistrKeeper, ck types.ChannelKeeper, ) *Keeper
NewKeeper returns keeper
func (Keeper) AfterDelegationModified ¶
func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
AfterDelegationModified is called after a delegation is modified. Once a user delegates their HEKAS tokens to a validator, the claimable amount for the user's claims record delegation action is claimed and transferred to the user address.
func (Keeper) AfterProposalVote ¶
AfterProposalVote is called after a vote on a proposal is cast. Once the vote is successfully included, the claimable amount for the user's claims record vote action is claimed and the transferred to the user address.
func (Keeper) ClaimCoinsForAction ¶
func (k Keeper) ClaimCoinsForAction( ctx sdk.Context, addr sdk.AccAddress, claimsRecord types.ClaimsRecord, action types.Action, params types.Params, ) (math.Int, error)
ClaimCoinsForAction removes the claimable amount entry from a claims record and transfers it to the user's account
func (Keeper) ClaimableAmountForAction ¶
func (k Keeper) ClaimableAmountForAction( ctx sdk.Context, claimsRecord types.ClaimsRecord, action types.Action, params types.Params, ) (claimableCoins, remainder math.Int)
ClaimableAmountForAction returns claimable amount for a specific action done by an address
func (Keeper) ClaimsInvariant ¶
ClaimsInvariant checks that the total amount of all unclaimed coins held in claims records is equal to the escrowed balance held in the claims module account
func (Keeper) ClaimsRecord ¶
func (k Keeper) ClaimsRecord( c context.Context, req *types.QueryClaimsRecordRequest, ) (*types.QueryClaimsRecordResponse, error)
ClaimsRecord returns the initial claimable amount per user and the claims per action. Claimable amount per action will be 0 if claiming is disabled, before the start time, or after end time.
func (Keeper) ClaimsRecords ¶
func (k Keeper) ClaimsRecords( c context.Context, req *types.QueryClaimsRecordsRequest, ) (*types.QueryClaimsRecordsResponse, error)
ClaimsRecords returns all claims records
func (Keeper) ClawbackEmptyAccounts ¶
ClawbackEmptyAccounts performs the clawback of all allocated tokens from airdrop recipient accounts with a sequence number of 0 (i.e the account hasn't performed a single tx during the claim window). Once the account is clawbacked, the claims record is deleted from state.
func (Keeper) ClawbackEscrowedTokens ¶
ClawbackEscrowedTokens transfers all the escrowed airdrop tokens on the ModuleAccount to the community pool
func (Keeper) DeleteClaimsRecord ¶
func (k Keeper) DeleteClaimsRecord(ctx sdk.Context, addr sdk.AccAddress)
DeleteClaimsRecord deletes a claims record from the store
func (Keeper) EndAirdrop ¶
EndAirdrop transfers the unclaimed tokens from the airdrop to the community pool, removes all claims records from state and disables the claims.
func (Keeper) EndBlocker ¶
EndBlocker checks if the airdrop claiming period has ended in order to process the clawback of unclaimed tokens
func (Keeper) GetAppVersion ¶
GetAppVersion returns the underlying application version.
func (Keeper) GetClaimableAmountForAction ¶
func (k Keeper) GetClaimableAmountForAction( ctx sdk.Context, claimsRecord types.ClaimsRecord, action types.Action, params types.Params, ) (claimableCoins, remainder math.Int)
GetClaimableAmountForAction returns claimable amount for a specific action done by an address returns zero if airdrop didn't start, isn't enabled or has finished
func (Keeper) GetClaimsRecord ¶
func (k Keeper) GetClaimsRecord(ctx sdk.Context, addr sdk.AccAddress) (types.ClaimsRecord, bool)
GetClaimsRecord returns the claims record for a specific address
func (Keeper) GetClaimsRecords ¶
func (k Keeper) GetClaimsRecords(ctx sdk.Context) []types.ClaimsRecordAddress
GetClaimsRecords get claims record instances for genesis export
func (Keeper) GetModuleAccount ¶
func (k Keeper) GetModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
GetModuleAccount returns the module account for the claim module
func (Keeper) GetModuleAccountAddress ¶
func (k Keeper) GetModuleAccountAddress() sdk.AccAddress
GetModuleAccountAddress gets the airdrop coin balance of module account
func (Keeper) GetModuleAccountBalances ¶
GetModuleAccountBalances gets the balances of module account that escrows the airdrop tokens
func (Keeper) HasClaimsRecord ¶
HasClaimsRecord returns if the claims record is found in the store a given address
func (Keeper) IterateClaimsRecords ¶
func (k Keeper) IterateClaimsRecords(ctx sdk.Context, handlerFn func(addr sdk.AccAddress, cr types.ClaimsRecord) (stop bool))
IterateClaimsRecords iterates over all claims records and performs a callback.
func (Keeper) MergeClaimsRecords ¶
func (k Keeper) MergeClaimsRecords( ctx sdk.Context, recipient sdk.AccAddress, senderClaimsRecord, recipientClaimsRecord types.ClaimsRecord, params types.Params, ) (mergedRecord types.ClaimsRecord, err error)
This method additionally:
- Always claims the IBC action, assuming both record haven't claimed it.
- Marks an action as claimed for the new instance by performing an XOR operation between the 2 provided records: `merged completed action = sender completed action XOR recipient completed action`
func (Keeper) OnAcknowledgementPacket ¶
func (k Keeper) OnAcknowledgementPacket( ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, ) error
OnAcknowledgementPacket performs an IBC send callback. Once a user submits an IBC transfer to a recipient in the destination chain and the transfer acknowledgement package is received, the claimable amount for the senders's claims record `ActionIBCTransfer` is claimed and transferred to the sender address. The function performs a no-op if claims are disabled globally, acknowledgment failed, or if the sender has no claims record.
func (Keeper) OnRecvPacket ¶
func (k Keeper) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement, ) exported.Acknowledgement
OnRecvPacket performs an IBC receive callback. Once a user receives an IBC transfer from a counterparty chain and the transfer is successful, the claimable amount for the receiver's claims record `ActionIBCTransfer` is claimed and transferred to the receivers address. Additionally, if the sender address is a Cosmos Hub or Osmosis address with an airdrop allocation, the claims record is merged with the recipient's claims record. The function performs a no-op if claims are disabled globally or if the sender has no claims record.
func (Keeper) Params ¶
func (k Keeper) Params( c context.Context, _ *types.QueryParamsRequest, ) (*types.QueryParamsResponse, error)
Params returns the params of the claim module
func (Keeper) PostTxProcessing ¶
func (k Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
PostTxProcessing implements the ethermint evm PostTxProcessing hook. After a EVM state transition is successfully processed, the claimable amount for the users's claims record evm action is claimed and transferred to the user address.
func (Keeper) SendPacket ¶
func (k Keeper) SendPacket( ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte, ) (sequence uint64, err error)
SendPacket implements the ICS4Wrapper interface from the transfer module. It calls the underlying SendPacket function directly to move down the middleware stack. Without SendPacket, this module would be skipped, when sending packages from the transferKeeper to core IBC.
func (Keeper) SetClaimsRecord ¶
func (k Keeper) SetClaimsRecord(ctx sdk.Context, addr sdk.AccAddress, claimsRecord types.ClaimsRecord)
SetClaimsRecord sets a claims record for an address in store
func (*Keeper) SetICS4Wrapper ¶
func (k *Keeper) SetICS4Wrapper(ics4Wrapper porttypes.ICS4Wrapper)
SetICS4Wrapper sets the ICS4 wrapper to the keeper. It panics if already set
func (Keeper) TotalUnclaimed ¶
func (k Keeper) TotalUnclaimed( c context.Context, _ *types.QueryTotalUnclaimedRequest, ) (*types.QueryTotalUnclaimedResponse, error)
TotalUnclaimed returns the total amount unclaimed from the airdrop
func (*Keeper) UpdateParams ¶
func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
UpdateParams implements the gRPC MsgServer interface. When an UpdateParams proposal passes, it updates the module parameters. The update can only be performed if the requested authority is the Cosmos SDK governance module account.
func (Keeper) WriteAcknowledgement ¶
func (k Keeper) WriteAcknowledgement(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error
WriteAcknowledgement implements the ICS4Wrapper interface from the transfer module. It calls the underlying WriteAcknowledgement function directly to move down the middleware stack.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶
NewMigrator returns a new Migrator.