Documentation
¶
Index ¶
- Constants
- func FormatConsensusPubkey(consensusPubkey *codectypes.Any) string
- func LoadABI() (abi.ABI, error)
- func NewDelegationRequest(args []interface{}) (*multistakingtypes.QueryMultiStakingLockRequest, error)
- func NewUnbondingDelegationRequest(args []interface{}) (*multistakingtypes.QueryMultiStakingUnlockRequest, error)
- func NewValidatorRequest(args []interface{}) (*multistakingtypes.QueryValidatorRequest, error)
- type DelegationOutput
- type Description
- type Precompile
- func (p Precompile) BeginRedelegateEVM(ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) CancelUnbondingEVMDelegation(ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) CreateEVMValidator(ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) DelegateEVM(ctx sdk.Context, sender common.Address, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) Delegation(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) Execute(ctx sdk.Context, contract *vm.Contract, readOnly bool) ([]byte, error)
- func (Precompile) IsTransaction(method *abi.Method) bool
- func (p Precompile) RequiredGas(input []byte) uint64
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)
- func (p Precompile) UnbondingDelegation(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) UndelegateEVM(ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) Validator(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- type SelfDelegation
- type UnbondingDelegationEntry
- type UnbondingDelegationOutput
- type UnbondingDelegationResponse
- type ValidatorInfo
- type ValidatorOutput
Constants ¶
const ( // DelegationMethod defines the ABI method name for the staking Delegation // query. DelegationMethod = "delegation" // UnbondingDelegationMethod defines the ABI method name for the staking // UnbondingDelegationMethod query. UnbondingDelegationMethod = "unbondingDelegation" // ValidatorMethod defines the ABI method name for the staking // Validator query. ValidatorMethod = "validator" )
const ( MultistakingPrecompileAddress = "0x0000000000000000000000000000000000000900" // Transactions DelegateMethod = "delegate" UndelegateMethod = "undelegate" RedelegateMethod = "redelegate" CancelUnbondingDelegationMethod = "cancelUnbondingDelegation" CreateValidatorMethod = "createValidator" )
Variables ¶
This section is empty.
Functions ¶
func FormatConsensusPubkey ¶
func FormatConsensusPubkey(consensusPubkey *codectypes.Any) string
FormatConsensusPubkey format ConsensusPubkey into a base64 string
func NewDelegationRequest ¶
func NewDelegationRequest(args []interface{}) (*multistakingtypes.QueryMultiStakingLockRequest, error)
func NewUnbondingDelegationRequest ¶
func NewUnbondingDelegationRequest(args []interface{}) (*multistakingtypes.QueryMultiStakingUnlockRequest, error)
func NewValidatorRequest ¶
func NewValidatorRequest(args []interface{}) (*multistakingtypes.QueryValidatorRequest, error)
Types ¶
type DelegationOutput ¶
DelegationOutput is a struct to represent the key information from a delegation response.
func (*DelegationOutput) FromResponse ¶
func (do *DelegationOutput) FromResponse(res *multistakingtypes.QueryMultiStakingLockResponse) *DelegationOutput
FromResponse populates the DelegationOutput from a QueryDelegationResponse.
type Description ¶
type Description = struct {
Moniker string "json:\"moniker\""
Identity string "json:\"identity\""
Website string "json:\"website\""
SecurityContact string "json:\"securityContact\""
Details string "json:\"details\""
}
Description use golang type alias defines a validator description.
type Precompile ¶
type Precompile struct {
cmn.Precompile
abi.ABI
codec.Codec
// contains filtered or unexported fields
}
Precompile defines the multistaking precompile
func NewPrecompile ¶
func NewPrecompile( cdc codec.Codec, stakingKeeper stakingkeeper.Keeper, multiStakingKeeper multistakingkeeper.Keeper, erc20Keeper erc20keeper.Keeper, addrCodec address.Codec, valAddrCodec address.Codec, ) (*Precompile, error)
NewPrecompile creates a new multistaking Precompile instance implementing the PrecompiledContract interface.
func (Precompile) BeginRedelegateEVM ¶
func (p Precompile) BeginRedelegateEVM( ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}, ) ([]byte, error)
BeginRedelegateEVM handles the redelegation of tokens from one validator to another.
func (Precompile) CancelUnbondingEVMDelegation ¶
func (p Precompile) CancelUnbondingEVMDelegation( ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}, ) ([]byte, error)
CancelUnbondingEVMDelegation handles the cancellation of an unbonding delegation using erc20 token.
func (Precompile) CreateEVMValidator ¶
func (p Precompile) CreateEVMValidator( ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}, ) ([]byte, error)
CreateValidator creates a new erc20 validator using the multistaking module.
func (Precompile) DelegateEVM ¶
func (p Precompile) DelegateEVM( ctx sdk.Context, sender common.Address, method *abi.Method, args []interface{}, ) ([]byte, error)
Delegate handles the delegation of ERC20 tokens to a validator. This method converts ERC20 tokens to SDK coins and delegates them.
func (Precompile) Delegation ¶
func (p Precompile) Delegation( ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}, ) ([]byte, error)
Delegation returns the delegation that a delegator has with a specific validator.
func (Precompile) Execute ¶ added in v1.5.0
Execute executes the precompiled contract bank query methods defined in the ABI.
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method *abi.Method) bool
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(input []byte) uint64
RequiredGas calculates the precompiled contract's base gas rate.
func (Precompile) Run ¶
Run executes the precompiled contract multistaking methods defined in the ABI.
func (Precompile) UnbondingDelegation ¶
func (p Precompile) UnbondingDelegation( ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}, ) ([]byte, error)
UnbondingDelegation returns the delegation currently being unbonded for a delegator from a specific validator.
func (Precompile) UndelegateEVM ¶
func (p Precompile) UndelegateEVM( ctx sdk.Context, origin common.Address, method *abi.Method, args []interface{}, ) ([]byte, error)
Undelegate handles the undelegation of tokens from a validator. This method undelegates SDK coins and converts them back to ERC20 tokens.
type SelfDelegation ¶
Helper struct for self delegation
type UnbondingDelegationEntry ¶
UnbondingDelegationEntry is a struct that contains the information about an unbonding delegation entry.
type UnbondingDelegationOutput ¶
type UnbondingDelegationOutput struct {
UnbondingDelegation UnbondingDelegationResponse
}
UnbondingDelegationOutput is the output response returned by the query method.
func (*UnbondingDelegationOutput) FromResponse ¶
func (do *UnbondingDelegationOutput) FromResponse(res *multistakingtypes.QueryMultiStakingUnlockResponse) *UnbondingDelegationOutput
FromResponse populates the DelegationOutput from a QueryDelegationResponse.
type UnbondingDelegationResponse ¶
type UnbondingDelegationResponse struct {
DelegatorAddress string
ValidatorAddress string
Entries []UnbondingDelegationEntry
}
UnbondingDelegationResponse is a struct that contains the information about an unbonding delegation.
type ValidatorInfo ¶
type ValidatorInfo struct {
OperatorAddress string `abi:"operatorAddress"`
ConsensusPubkey string `abi:"consensusPubkey"`
Jailed bool `abi:"jailed"`
Status uint8 `abi:"status"`
Tokens *big.Int `abi:"tokens"`
Description stakingtypes.Description `abi:"description"`
UnbondingHeight int64 `abi:"unbondingHeight"`
UnbondingTime int64 `abi:"unbondingTime"`
Commission *big.Int `abi:"commission"`
MinSelfDelegation *big.Int `abi:"minSelfDelegation"`
BondDenom string `abi:"bondDenom"`
}
ValidatorInfo is a struct to represent the key information from a validator response.
type ValidatorOutput ¶
type ValidatorOutput struct {
Validator ValidatorInfo
}
func DefaultValidatorOutput ¶
func DefaultValidatorOutput() ValidatorOutput
DefaultValidatorOutput returns a ValidatorOutput with default values.
func (*ValidatorOutput) FromResponse ¶
func (vo *ValidatorOutput) FromResponse(res *multistakingtypes.QueryValidatorResponse) ValidatorOutput
FromResponse populates the ValidatorOutput from a QueryValidatorResponse.