Documentation ¶
Index ¶
- func BondDelegation(ctx sdk.Context, contractAddr sdk.AccAddress, operatorAddress sdk.AccAddress, ...) error
- func CallEndBlockWithValidatorUpdate(ctx sdk.Context, contractAddr sdk.AccAddress, k types.Sudoer) ([]abci.ValidatorUpdate, error)
- func DecimalFromPercentage(percent sdk.Dec) *sdk.Dec
- func DecimalFromProMille(promille int64) *sdk.Dec
- func QueryTG4Admin(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress) (sdk.AccAddress, error)
- func QueryTG4Member(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress, ...) (*int, error)
- func QueryTG4TotalPoints(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress) (int, error)
- func RegisterValidator(ctx sdk.Context, contractAddr sdk.AccAddress, pk cryptotypes.PubKey, ...) error
- func SetEngagementPoints(ctx sdk.Context, contractAddr sdk.AccAddress, k types.Sudoer, ...) error
- func UnbondDelegation(ctx sdk.Context, contractAddr sdk.AccAddress, operatorAddress sdk.AccAddress, ...) (*time.Time, error)
- func UpdateValidator(ctx sdk.Context, contractAddr sdk.AccAddress, operatorAddress sdk.AccAddress, ...) error
- type APVotingInitMsg
- type AddRemoveNonVotingMembers
- type AddVotingMembers
- type AlgebraicSigmoid
- type Bond
- type ChainUpgrade
- type CommunityPoolInitMsg
- type ConsensusBlockParamsUpdate
- type ConsensusEvidenceParamsUpdate
- type ContractAdapter
- type DelegatedQuery
- type DelegatedResponse
- type DistributionContract
- type DistributionContractAdapter
- type DistributionQuery
- type EndWithValidatorUpdateResponse
- type EngagementContractAdapter
- type EngagementQuery
- type ExecuteMsg
- type GrantEngagementProposal
- type IsSlasher
- type JailMsg
- type JailingDuration
- type JailingEnd
- type JailingPeriod
- type ListActiveValidatorsResponse
- type ListClaimsQuery
- type ListMembersByPointsQuery
- type ListMembersQuery
- type ListProposalQuery
- type ListValidatorSlashingResponse
- type ListValidatorsQuery
- type ListValidatorsResponse
- type ListVotersQuery
- type ListVotesQuery
- type MemberQuery
- type Migration
- type MixerFunction
- type OCProposalListResponse
- type OCProposalResponse
- type OCProposalsContractAdapter
- type OCProposalsExecuteMsg
- type OCProposalsInitMsg
- type OperatorResponse
- type OversightProposal
- type PageableResult
- type PaginationCursor
- type Paginator
- type ProposalContent
- type ProposalID
- type ProposalMsg
- type ProposalStatus
- type ProposalsQuery
- type ProposeMsg
- type RegisterValidatorKey
- type RewardsResponse
- type Sigmoid
- type SigmoidSqrt
- type SimulateActiveValidatorsResponse
- type SlashProposal
- type SlasherResponse
- type StakeContractAdapter
- func (v StakeContractAdapter) QueryStakedAmount(ctx sdk.Context, opAddr sdk.AccAddress) (*sdk.Int, error)
- func (v StakeContractAdapter) QueryStakingUnbonding(ctx sdk.Context, opAddr sdk.AccAddress) ([]stakingtypes.UnbondingDelegationEntry, error)
- func (v StakeContractAdapter) QueryStakingUnbondingPeriod(ctx sdk.Context) (time.Duration, error)
- type StakedQuery
- type TG4AdminResponse
- type TG4EngagementExecute
- type TG4EngagementInitMsg
- type TG4EngagementSudoMsg
- type TG4Member
- type TG4MemberListResponse
- type TG4MemberResponse
- type TG4MixerInitMsg
- type TG4Query
- type TG4StakeClaim
- type TG4StakeClaimsResponse
- type TG4StakeExecute
- type TG4StakeInitMsg
- type TG4StakeQuery
- type TG4StakedAmountsResponse
- type TG4TotalPointsResponse
- type TG4UpdateAdminMsg
- type TG4ValsetExecute
- type TrustedCircleContractAdapter
- func (a TrustedCircleContractAdapter) AddVotingMembersProposal(ctx sdk.Context, members []string, sender sdk.AccAddress) error
- func (a TrustedCircleContractAdapter) DepositEscrow(ctx sdk.Context, deposit sdk.Coin, sender sdk.AccAddress) error
- func (a TrustedCircleContractAdapter) QueryListVoters(ctx sdk.Context) (*TG4MemberListResponse, error)
- type TrustedCircleExecute
- type TrustedCircleInitMsg
- type Unbond
- type UnbondingPeriodResponse
- type UnjailMsg
- type UpdateConfigMsg
- type UpdateMembersMsg
- type Validator
- type ValidatorInfo
- type ValidatorMetadata
- type ValidatorProposal
- type ValidatorPubkey
- type ValidatorQuery
- type ValidatorResponse
- type ValidatorSlashing
- type ValidatorUpdate
- type ValidatorUpdateSudoMsg
- type ValidatorVotingExecuteMsg
- type ValidatorVotingInitMsg
- type ValidatorVotingPropose
- type ValsetConfigResponse
- type ValsetContractAdapter
- func (v ValsetContractAdapter) JailValidator(ctx sdk.Context, nodeOperator sdk.AccAddress, duration time.Duration, ...) error
- func (v ValsetContractAdapter) ListValidatorSlashing(ctx sdk.Context, opAddr sdk.AccAddress) ([]ValidatorSlashing, error)
- func (v ValsetContractAdapter) ListValidators(ctx sdk.Context, pagination *Paginator) ([]stakingtypes.Validator, PaginationCursor, error)
- func (v ValsetContractAdapter) QueryConfig(ctx sdk.Context) (*ValsetConfigResponse, error)
- func (v ValsetContractAdapter) QueryRawValidator(ctx sdk.Context, opAddr sdk.AccAddress) (ValidatorResponse, error)
- func (v ValsetContractAdapter) QueryValidator(ctx sdk.Context, opAddr sdk.AccAddress) (*stakingtypes.Validator, error)
- func (v ValsetContractAdapter) UnjailValidator(ctx sdk.Context, sender sdk.AccAddress) error
- func (v ValsetContractAdapter) UpdateAdmin(ctx sdk.Context, newAdmin sdk.AccAddress, sender sdk.AccAddress) error
- type ValsetEpochResponse
- type ValsetInitMsg
- type ValsetQuery
- type Vote
- type VoteInfo
- type VoteListResponse
- type VoteMsg
- type VoteQuery
- type VoteResponse
- type VoterDetail
- type VoterListResponse
- type VoterQuery
- type VoterResponse
- type Votes
- type VotingContractAdapter
- func (v VotingContractAdapter) ExecuteProposal(ctx sdk.Context, proposalID uint64, sender sdk.AccAddress) error
- func (v VotingContractAdapter) LatestProposal(ctx sdk.Context) (*OCProposalResponse, error)
- func (v VotingContractAdapter) QueryProposal(ctx sdk.Context, id uint64) (*OCProposalResponse, error)
- func (v VotingContractAdapter) VoteProposal(ctx sdk.Context, proposalID uint64, vote Vote, sender sdk.AccAddress) error
- type VotingRules
- type WithdrawAdjustmentDataQuery
- type WithdrawAdjustmentResponse
- type WithdrawableRewardsQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BondDelegation ¶
func BondDelegation(ctx sdk.Context, contractAddr sdk.AccAddress, operatorAddress sdk.AccAddress, amount sdk.Coins, vestingAmount *sdk.Coin, k types.Executor) error
BondDelegation sends given amounts to the staking contract to increase the bonded amount for the validator operator
func CallEndBlockWithValidatorUpdate ¶
func CallEndBlockWithValidatorUpdate(ctx sdk.Context, contractAddr sdk.AccAddress, k types.Sudoer) ([]abci.ValidatorUpdate, error)
CallEndBlockWithValidatorUpdate calls valset contract for a validator diff
func DecimalFromProMille ¶
func QueryTG4Admin ¶
func QueryTG4Admin(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress) (sdk.AccAddress, error)
QueryTG4Admin returns admin of this contract, if any. Will return nil, err if no admin
func QueryTG4Member ¶
func QueryTG4Member(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress, member sdk.AccAddress) (*int, error)
QueryTG4Member returns the weight of this member. (nil, nil) means not present, (&0, nil) means member with no votes
func QueryTG4TotalPoints ¶ added in v0.6.2
func QueryTG4TotalPoints(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress) (int, error)
QueryTG4TotalPoints returns the points for this member. (nil, nil) means not present
func RegisterValidator ¶
func RegisterValidator(ctx sdk.Context, contractAddr sdk.AccAddress, pk cryptotypes.PubKey, operatorAddress sdk.AccAddress, description stakingtypes.Description, k types.Executor) error
RegisterValidator calls valset contract to register a new validator key and address
func SetEngagementPoints ¶
func SetEngagementPoints(ctx sdk.Context, contractAddr sdk.AccAddress, k types.Sudoer, opAddr sdk.AccAddress, points uint64) error
SetEngagementPoints set engagement points If the member already exists, its weight will be reset to the weight sent here
func UnbondDelegation ¶
func UnbondDelegation(ctx sdk.Context, contractAddr sdk.AccAddress, operatorAddress sdk.AccAddress, amount sdk.Coin, k types.Executor) (*time.Time, error)
UnbondDelegation unbond the given amount from the operators self delegation Amount must be in bonding token denom
func UpdateValidator ¶
func UpdateValidator(ctx sdk.Context, contractAddr sdk.AccAddress, operatorAddress sdk.AccAddress, description stakingtypes.Description, k types.Executor) error
UpdateValidator calls valset contract to change validator's metadata
Types ¶
type APVotingInitMsg ¶ added in v0.8.0
type APVotingInitMsg struct { VotingRules VotingRules `json:"rules"` // GroupContractAddress is the group contract that contains the member list GroupContractAddress string `json:"group_addr"` // Dispute cost on this contract DisputeCost sdk.Coin `json:"dispute_cost"` // Waiting period for this contract WaitingPeriod uint64 `json:"waiting_period"` }
APVotingInitMsg instantiation message
type AddRemoveNonVotingMembers ¶ added in v0.8.0
type AddVotingMembers ¶ added in v0.8.0
type AddVotingMembers struct {
Voters []string `json:"voters"`
}
type AlgebraicSigmoid ¶
type Bond ¶ added in v0.8.0
type Bond struct {
VestingTokens *wasmvmtypes.Coin `json:"vesting_tokens,omitempty"`
}
Bond will bond all staking tokens sent with the message and update membership points. The optional `vesting_tokens` will be staked (delegated) as well, if set.
type ChainUpgrade ¶
type CommunityPoolInitMsg ¶
type CommunityPoolInitMsg struct { VotingRules VotingRules `json:"rules"` GroupAddress string `json:"group_addr"` }
type ConsensusBlockParamsUpdate ¶ added in v0.6.2
type ConsensusBlockParamsUpdate = contract.BlockParams
type ConsensusEvidenceParamsUpdate ¶ added in v0.6.2
type ConsensusEvidenceParamsUpdate = contract.EvidenceParams
type ContractAdapter ¶
type ContractAdapter struct {
// contains filtered or unexported fields
}
ContractAdapter is the base contract adapter type that contains common methods to interact with the contract
func NewContractAdapter ¶
func NewContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) ContractAdapter
NewContractAdapter constructor
type DelegatedQuery ¶ added in v0.6.2
type DelegatedQuery struct {
Owner string `json:"owner"`
}
type DelegatedResponse ¶ added in v0.6.2
type DelegatedResponse struct {
Delegated string `json:"delegated"`
}
type DistributionContract ¶
type DistributionContractAdapter ¶
type DistributionContractAdapter struct {
// contains filtered or unexported fields
}
func NewDistributionContractAdapter ¶
func NewDistributionContractAdapter(contractAddr sdk.AccAddress, contractQuerier types.SmartQuerier, addressLookupErr error) *DistributionContractAdapter
NewDistributionContractAdapter constructor
func (DistributionContractAdapter) ValidatorOutstandingReward ¶
func (d DistributionContractAdapter) ValidatorOutstandingReward(ctx sdk.Context, addr sdk.AccAddress) (sdk.Coin, error)
type DistributionQuery ¶
type DistributionQuery struct {
WithdrawableRewards *WithdrawableRewardsQuery `json:"withdrawable_rewards,omitempty"`
}
type EndWithValidatorUpdateResponse ¶
type EndWithValidatorUpdateResponse struct {
Diffs []ValidatorUpdate `json:"diffs"`
}
EndWithValidatorUpdateResponse is the response to an `EndWithValidatorUpdate` sudo call.
type EngagementContractAdapter ¶
type EngagementContractAdapter struct {
ContractAdapter
}
func NewEngagementContractAdapter ¶
func NewEngagementContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) *EngagementContractAdapter
NewEngagementContractAdapter constructor
func (EngagementContractAdapter) QueryDelegated ¶ added in v0.6.2
func (a EngagementContractAdapter) QueryDelegated(ctx sdk.Context, ownerAddr sdk.AccAddress) (*DelegatedResponse, error)
func (EngagementContractAdapter) UpdateAdmin ¶
func (a EngagementContractAdapter) UpdateAdmin(ctx sdk.Context, newAdmin, sender sdk.AccAddress) error
type EngagementQuery ¶ added in v0.6.2
type EngagementQuery struct { Admin *struct{} `json:"admin,omitempty"` TotalPoints *struct{} `json:"total_points,omitempty"` ListMembers *ListMembersQuery `json:"list_members,omitempty"` ListMembersByPoints *ListMembersByPointsQuery `json:"list_members_by_points,omitempty"` Member *MemberQuery `json:"member,omitempty"` Hooks *struct{} `json:"hooks,omitempty"` Preauths *struct{} `json:"preauths,omitempty"` WithdrawableRewards *WithdrawableRewardsQuery `json:"withdrawable_rewards,omitempty"` DistributedRewards *struct{} `json:"distributed_rewards,omitempty"` UndistributedRewards *struct{} `json:"undistributed_rewards,omitempty"` Delegated *DelegatedQuery `json:"delegated,omitempty"` Halflife *struct{} `json:"halflife,omitempty"` IsSlasher *IsSlasher `json:"is_slasher,omitempty"` ListSlashers *struct{} `json:"list_slashers,omitempty"` DistributionData *struct{} `json:"distribution_data,omitempty"` WithdrawAdjustmentData *WithdrawAdjustmentDataQuery `json:"withdraw_adjustment_data,omitempty"` }
EngagementQuery will create many queries for the engagement contract See https://github.com/confio/poe-contracts/blob/v0.5.3-2/contracts/tg4-engagement/src/msg.rs#L77-L123
type ExecuteMsg ¶ added in v0.8.0
type ExecuteMsg struct {
ProposalID uint64 `json:"proposal_id"`
}
type GrantEngagementProposal ¶
type JailMsg ¶
type JailMsg struct { Operator string `json:"operator"` // Duration for how long validator is jailed (in seconds) Duration JailingDuration `json:"duration"` }
type JailingDuration ¶ added in v0.5.2
type JailingDuration struct { Duration uint64 `json:"duration,omitempty"` Forever *struct{} `json:"forever,omitempty"` }
type JailingEnd ¶ added in v0.8.0
type JailingPeriod ¶ added in v0.5.2
type JailingPeriod struct { Start time.Time `json:"start,omitempty"` End JailingEnd `json:"end,omitempty"` }
func (*JailingPeriod) UnmarshalJSON ¶ added in v0.5.2
func (j *JailingPeriod) UnmarshalJSON(data []byte) error
type ListActiveValidatorsResponse ¶
type ListActiveValidatorsResponse struct {
Validators []ValidatorInfo `json:"validators"`
}
type ListClaimsQuery ¶
type ListMembersByPointsQuery ¶ added in v0.6.2
type ListMembersQuery ¶
type ListProposalQuery ¶
type ListValidatorSlashingResponse ¶
type ListValidatorSlashingResponse struct { Operator string `json:"operator"` StartHeight uint64 `json:"start_height"` Slashing []ValidatorSlashing `json:"slashing"` }
type ListValidatorsQuery ¶
type ListValidatorsResponse ¶
type ListValidatorsResponse struct {
Validators []OperatorResponse `json:"validators"`
}
func (ListValidatorsResponse) PaginationCursor ¶ added in v0.5.3
func (l ListValidatorsResponse) PaginationCursor() PaginationCursor
type ListVotersQuery ¶
type ListVotesQuery ¶
type MemberQuery ¶
type MixerFunction ¶
type MixerFunction struct { GeometricMean *struct{} `json:"geometric_mean,omitempty"` Sigmoid *Sigmoid `json:"sigmoid,omitempty"` SigmoidSqrt *SigmoidSqrt `json:"sigmoid_sqrt,omitempty"` AlgebraicSigmoid *AlgebraicSigmoid `json:"algebaic_sigmoid,omitempty"` }
type OCProposalListResponse ¶
type OCProposalListResponse struct {
Proposals []OCProposalResponse `json:"proposals"`
}
type OCProposalResponse ¶
type OCProposalResponse struct { ID uint64 `json:"id"` Title string `json:"title"` Description string `json:"description"` Proposal OversightProposal `json:"proposal"` Status ProposalStatus `json:"status"` CreatedBy string `json:"created_by"` // TODO: clarify this format // Expires EXP `json:"expires"` Rules VotingRules `json:"rules"` TotalPoints uint64 `json:"total_points"` Votes Votes `json:"votes"` }
type OCProposalsContractAdapter ¶
type OCProposalsContractAdapter struct {
VotingContractAdapter
}
func NewOCProposalsContractAdapter ¶
func NewOCProposalsContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) *OCProposalsContractAdapter
NewOCProposalsContractAdapter constructor
func (OCProposalsContractAdapter) ProposeGrant ¶
func (v OCProposalsContractAdapter) ProposeGrant(ctx sdk.Context, grantee sdk.AccAddress, points uint64, sender sdk.AccAddress) error
ProposeGrant creates a proposal to grant engagement to this account Use LatestProposal after to get the ProposalID
func (OCProposalsContractAdapter) ProposeSlash ¶
func (v OCProposalsContractAdapter) ProposeSlash(ctx sdk.Context, member sdk.AccAddress, portion sdk.Dec, sender sdk.AccAddress) error
ProposeSlash creates a proposal to slash this account Use LatestProposal after to get the ProposalID
type OCProposalsExecuteMsg ¶
type OCProposalsExecuteMsg struct { Propose *ProposalMsg `json:"propose,omitempty"` Vote *VoteMsg `json:"vote,omitempty"` Execute *ProposalID `json:"execute,omitempty"` Close *ProposalID `json:"close,omitempty"` }
type OCProposalsInitMsg ¶
type OCProposalsInitMsg struct { VotingRules VotingRules `json:"rules"` // GroupContractAddress is the group contract that contains the member list GroupContractAddress string `json:"group_addr"` // EngagementContractAddress is the engagement contract that contains list for engagement rewards EngagementContractAddress string `json:"engagement_addr"` // ValsetContractAddress is the valset contract that we execute slashing on ValsetContractAddress string `json:"valset_addr"` }
OCProposalsInitMsg instantiation message
type OperatorResponse ¶
type OperatorResponse struct { Operator string `json:"operator"` Pubkey ValidatorPubkey `json:"pubkey"` Metadata ValidatorMetadata `json:"metadata"` JailedUntil *JailingPeriod `json:"jailed_until,omitempty"` ActiveValidator bool `json:"active_validator"` }
func (OperatorResponse) ToValidator ¶
func (v OperatorResponse) ToValidator() (stakingtypes.Validator, error)
type OversightProposal ¶
type OversightProposal struct { GrantEngagement *GrantEngagementProposal `json:"grant_engagement,omitempty"` Slash *SlashProposal `json:"punish,omitempty"` }
type PageableResult ¶ added in v0.5.3
type PageableResult interface {
PaginationCursor() PaginationCursor
}
PageableResult is a query response where the cursor is a subset of the raw last element.
type PaginationCursor ¶ added in v0.5.3
type PaginationCursor []byte
PaginationCursor is the contracts "last element" as raw data that can be used to navigate through the result set.
type Paginator ¶ added in v0.5.3
type Paginator struct { StartAfter PaginationCursor `json:"start_after,omitempty"` Limit uint64 `json:"limit,omitempty"` }
func NewPaginator ¶ added in v0.5.3
func NewPaginator(pag *query.PageRequest) (*Paginator, error)
NewPaginator constructor
type ProposalContent ¶ added in v0.8.0
type ProposalContent struct { AddVotingMembers *AddVotingMembers `json:"add_voting_members,omitempty"` AddRemoveNonVotingMembers *AddRemoveNonVotingMembers `json:"add_remove_non_voting_members,omitempty"` }
type ProposalID ¶
type ProposalID struct {
ProposalID uint64 `json:"proposal_id"`
}
type ProposalMsg ¶
type ProposalMsg struct { Title string `json:"title"` Description string `json:"description"` Proposal OversightProposal `json:"proposal"` }
type ProposalStatus ¶
type ProposalStatus string
const ( ProposalStatusPending ProposalStatus = "pending" ProposalStatusOpen ProposalStatus = "open" ProposalStatusRejected ProposalStatus = "rejected" ProposalStatusPassed ProposalStatus = "passed" ProposalStatusExecuted ProposalStatus = "executed" )
type ProposalsQuery ¶
type ProposalsQuery struct { // Returns VotingRules Rules *struct{} `json:"rules,omitempty"` // Returns OCProposalResponse Proposal *ProposalID `json:"proposal,omitempty"` // Returns OCProposalListResponse ListProposals *ListProposalQuery `json:"list_proposals,omitempty"` // Returns OCProposalListResponse ReverseProposals *ListProposalQuery `json:"reverse_proposals,omitempty"` // Returns VoteResponse Vote *VoteQuery `json:"vote,omitempty"` // Returns VoteListResponse ListVotes *ListVotesQuery `json:"list_votes,omitempty"` // Returns VoterResponse Voter *VoterQuery `json:"voter,omitempty"` // Returns VoterListResponse ListVoters *ListVotersQuery `json:"list_voters,omitempty"` }
type ProposeMsg ¶ added in v0.8.0
type ProposeMsg struct { Title string `json:"title"` Description string `json:"description"` Proposal ProposalContent `json:"proposal"` }
type RegisterValidatorKey ¶
type RegisterValidatorKey struct { PubKey ValidatorPubkey `json:"pubkey"` Metadata ValidatorMetadata `json:"metadata"` }
type RewardsResponse ¶ added in v0.6.2
type SigmoidSqrt ¶
type SimulateActiveValidatorsResponse ¶
type SimulateActiveValidatorsResponse = ListActiveValidatorsResponse
type SlashProposal ¶
type SlasherResponse ¶ added in v0.6.2
type SlasherResponse struct {
IsSlasher bool `json:"is_slasher"`
}
type StakeContractAdapter ¶
type StakeContractAdapter struct {
// contains filtered or unexported fields
}
func NewStakeContractAdapter ¶
func NewStakeContractAdapter(contractAddr sdk.AccAddress, contractQuerier types.SmartQuerier, addressLookupErr error) *StakeContractAdapter
NewStakeContractAdapter constructor
func (StakeContractAdapter) QueryStakedAmount ¶
func (v StakeContractAdapter) QueryStakedAmount(ctx sdk.Context, opAddr sdk.AccAddress) (*sdk.Int, error)
func (StakeContractAdapter) QueryStakingUnbonding ¶
func (v StakeContractAdapter) QueryStakingUnbonding(ctx sdk.Context, opAddr sdk.AccAddress) ([]stakingtypes.UnbondingDelegationEntry, error)
QueryStakingUnbonding query PoE staking contract for unbonded self delegations TODO: add pagination support here!
func (StakeContractAdapter) QueryStakingUnbondingPeriod ¶
QueryStakingUnbondingPeriod query the unbonding period from PoE staking contract
type StakedQuery ¶
type StakedQuery struct {
Address string `json:"address"`
}
type TG4AdminResponse ¶
type TG4AdminResponse struct {
Admin string `json:"admin,omitempty"`
}
type TG4EngagementExecute ¶
type TG4EngagementExecute struct { UpdateMembers *UpdateMembersMsg `json:"update_members,omitempty"` UpdateAdmin *TG4UpdateAdminMsg `json:"update_admin,omitempty"` }
TG4EngagementExecute execute message See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-engagement/src/msg.rs
type TG4EngagementInitMsg ¶
type TG4EngagementInitMsg struct { Admin string `json:"admin,omitempty"` Members []TG4Member `json:"members"` PreAuthsHooks uint64 `json:"preauths_hooks,omitempty"` PreAuthsSlashing uint64 `json:"preauths_slashing,omitempty"` // Halflife is measured in seconds Halflife uint64 `json:"halflife,omitempty"` // Denom of tokens which may be distributed by this contract. Denom string `json:"denom"` }
TG4EngagementInitMsg contract init message See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-engagement/src/msg.rs
type TG4EngagementSudoMsg ¶
type TG4EngagementSudoMsg struct {
UpdateMember *TG4Member `json:"update_member,omitempty"`
}
TG4EngagementSudoMsg TG4 group sudo message See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-engagement/src/msg.rs
type TG4Member ¶
func QueryTG4Members ¶
func QueryTG4Members(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress, pagination *Paginator) ([]TG4Member, error)
func QueryTG4MembersByWeight ¶
func QueryTG4MembersByWeight(ctx sdk.Context, k types.SmartQuerier, tg4Addr sdk.AccAddress, pagination *Paginator) ([]TG4Member, error)
func SortByWeightDesc ¶
type TG4MemberListResponse ¶
type TG4MemberListResponse struct {
Members []TG4Member `json:"members"`
}
TG4MemberListResponse response to a list members query.
type TG4MemberResponse ¶
type TG4MemberResponse struct { // Points nil means not a member, 0 means member with no voting power... this can be a very important distinction Points *int `json:"points"` }
type TG4MixerInitMsg ¶
type TG4MixerInitMsg struct { LeftGroup string `json:"left_group"` RightGroup string `json:"right_group"` PreAuthsHooks uint64 `json:"preauths_hooks,omitempty"` PreAuthsSlashing uint64 `json:"preauths_slashing,omitempty"` FunctionType MixerFunction `json:"function_type"` }
TG4MixerInitMsg contract init message See https://github.com/confio/tgrade-contracts/blob/main/contracts/tg4-mixer/schema/instantiate_msg.json
type TG4Query ¶
type TG4Query struct { Admin *struct{} `json:"admin,omitempty"` TotalPoints *struct{} `json:"total_points,omitempty"` ListMembers *ListMembersQuery `json:"list_members,omitempty"` ListMembersByPoints *ListMembersByPointsQuery `json:"list_members_by_points,omitempty"` Member *MemberQuery `json:"member,omitempty"` }
TG4Query applies to all tg4 types - stake, group, and mixer
type TG4StakeClaim ¶
type TG4StakeClaim struct { // Addr A human readable address Addr string `json:"addr"` // Amount of tokens in claim Amount sdk.Int `json:"amount"` // CreationHeight Height of a blockchain in a moment of creation of this claim CreationHeight uint64 `json:"creation_height"` // ReleaseAt is the release time of the claim as timestamp in nanoseconds ReleaseAt uint64 `json:"release_at,string,omitempty"` }
type TG4StakeClaimsResponse ¶
type TG4StakeClaimsResponse struct {
Claims []TG4StakeClaim `json:"claims"`
}
type TG4StakeExecute ¶
type TG4StakeExecute struct { Bond *Bond `json:"bond,omitempty"` Unbond *Unbond `json:"unbond,omitempty"` Claim *struct{} `json:"claim,omitempty"` }
TG4StakeExecute staking contract execute messages See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-stake/src/msg.rs
type TG4StakeInitMsg ¶
type TG4StakeInitMsg struct { Admin string `json:"admin,omitempty"` Denom string `json:"denom"` MinBond uint64 `json:"min_bond,string"` TokensPerPoint uint64 `json:"tokens_per_point,string"` // UnbondingPeriod unbonding period in seconds UnbondingPeriod uint64 `json:"unbonding_period"` // AutoReturnLimit limits how much claims would be automatically returned at end of block, 20 by default. Setting this to 0 disables auto returning claims. AutoReturnLimit *uint64 `json:"auto_return_limit,omitempty"` PreAuthsHooks uint64 `json:"preauths_hooks,omitempty"` PreAuthsSlashing uint64 `json:"preauths_slashing,omitempty"` }
TG4StakeInitMsg instantiation message See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-stake/src/msg.rs
type TG4StakeQuery ¶
type TG4StakeQuery struct { UnbondingPeriod *struct{} `json:"unbonding_period,omitempty"` Claims *ListClaimsQuery `json:"claims,omitempty"` Staked *StakedQuery `json:"staked,omitempty"` }
TG4StakeQuery contains some custom queries for the tg4-stake contract. You can also make any generic TG4Query on it. See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-stake/src/msg.rs
type TG4StakedAmountsResponse ¶
type TG4StakedAmountsResponse struct { Liquid wasmvmtypes.Coin `json:"liquid"` Vesting wasmvmtypes.Coin `json:"vesting"` }
func QueryStakedAmount ¶
func QueryStakedAmount(ctx sdk.Context, k types.SmartQuerier, stakeAddr sdk.AccAddress, opAddr sdk.AccAddress) (TG4StakedAmountsResponse, error)
QueryStakedAmount query PoE staking contract for bonded self delegation amount
type TG4TotalPointsResponse ¶ added in v0.6.2
type TG4TotalPointsResponse struct {
Points int `json:"total_points"`
}
type TG4UpdateAdminMsg ¶
type TG4UpdateAdminMsg struct {
NewAdmin *string `json:"admin,omitempty"`
}
TG4UpdateAdminMsg update admin message
type TG4ValsetExecute ¶
type TG4ValsetExecute struct { RegisterValidatorKey *RegisterValidatorKey `json:"register_validator_key,omitempty"` UpdateMetadata *ValidatorMetadata `json:"update_metadata,omitempty"` // Jails validator. Can be executed only by the admin. Jail *JailMsg `json:"jail,omitempty"` // Unjails validator. Admin can unjail anyone anytime, others can unjail only themselves and // only if the jail period passed. Unjail *UnjailMsg `json:"unjail,omitempty"` // UpdateAdmin set a new admin address UpdateAdmin *TG4UpdateAdminMsg `json:"update_admin,omitempty"` UpdateConfig *UpdateConfigMsg `json:"update_config,omitempty"` }
TG4ValsetExecute Valset contract validator key registration See https://github.com/confio/tgrade-contracts/tree/v0.5.0-alpha/contracts/tgrade-valset/src/msg.rs
type TrustedCircleContractAdapter ¶ added in v0.8.0
type TrustedCircleContractAdapter struct {
VotingContractAdapter
}
func NewTrustedCircleContractAdapter ¶ added in v0.8.0
func NewTrustedCircleContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) TrustedCircleContractAdapter
NewTrustedCircleContractAdapter constructor
func (TrustedCircleContractAdapter) AddVotingMembersProposal ¶ added in v0.8.0
func (a TrustedCircleContractAdapter) AddVotingMembersProposal(ctx sdk.Context, members []string, sender sdk.AccAddress) error
AddVotingMembersProposal setup the proposal for adding voting members
func (TrustedCircleContractAdapter) DepositEscrow ¶ added in v0.8.0
func (a TrustedCircleContractAdapter) DepositEscrow(ctx sdk.Context, deposit sdk.Coin, sender sdk.AccAddress) error
DepositEscrow deposits escrow for the given member
func (TrustedCircleContractAdapter) QueryListVoters ¶ added in v0.8.0
func (a TrustedCircleContractAdapter) QueryListVoters(ctx sdk.Context) (*TG4MemberListResponse, error)
QueryListVoters query the list of voters
type TrustedCircleExecute ¶ added in v0.8.0
type TrustedCircleExecute struct { DepositEscrow *struct{} `json:"deposit_escrow,omitempty"` Propose *ProposeMsg `json:"propose,omitempty"` Execute *ExecuteMsg `json:"execute,omitempty"` }
type TrustedCircleInitMsg ¶
type TrustedCircleInitMsg struct { // Name of trusted circle Name string `json:"name"` // EscrowAmount The required escrow amount, in the default denom (utgd) EscrowAmount sdk.Int `json:"escrow_amount"` // VotingPeriod Voting period in days VotingPeriod uint32 `json:"voting_period"` // Quorum voting quorum (0.0-1.0) Quorum sdk.Dec `json:"quorum"` // Threshold voting threshold (0.0-1.0) Threshold sdk.Dec `json:"threshold"` // AllowEndEarly If true, and absolute threshold and quorum are met, we can end before voting period finished. // (Recommended value: true, unless you have special needs) AllowEndEarly bool `json:"allow_end_early"` // InitialMembers is a list of non-voting members to be added to the TRUSTED_CIRCLE upon creation InitialMembers []string `json:"initial_members"` // DenyList is an optional cw4 contract with list of addresses denied to be part of TrustedCircle DenyList string `json:"deny_list,omitempty"` // EditTrustedCircleDisabled If true, no further adjustments may happen. EditTrustedCircleDisabled bool `json:"edit_trusted_circle_disabled"` // RewardDenom is the token denom we can distribute to the trusted circle RewardDenom string `json:"reward_denom"` }
type Unbond ¶
type Unbond struct { // Tokens are the amount to unbond Tokens wasmvmtypes.Coin `json:"tokens"` }
Unbond will start the unbonding process for the given number of tokens. The sender immediately loses points from these tokens, and can claim them back to his wallet after `unbonding_period`. Tokens will be unbonded from the liquid pool first, and then from the vesting pool if available.
type UnbondingPeriodResponse ¶
type UnbondingPeriodResponse struct { // Time is the number of seconds that must pass UnbondingPeriod uint64 `json:"unbonding_period"` }
type UnjailMsg ¶
type UnjailMsg struct { // Address to unjail. Optional, as if not provided it is assumed to be the sender of the // message (for convenience when unjailing self after the jail period). Operator string `json:"operator,omitempty"` }
type UpdateConfigMsg ¶ added in v0.6.2
type UpdateMembersMsg ¶
UpdateMembersMsg contract execute message to update members See https://github.com/confio/tgrade-contracts/blob/v0.5.0-alpha/contracts/tg4-engagement/src/msg.rs
type Validator ¶
type Validator struct { Operator string `json:"operator"` ValidatorPubkey ValidatorPubkey `json:"validator_pubkey"` }
type ValidatorInfo ¶
type ValidatorInfo struct { Operator string `json:"operator"` ValidatorPubkey ValidatorPubkey `json:"validator_pubkey"` Power uint64 `json:"power"` }
func ListActiveValidators ¶
func ListActiveValidators(ctx sdk.Context, k types.SmartQuerier, valset sdk.AccAddress) ([]ValidatorInfo, error)
TODO: add pagination support
func SimulateActiveValidators ¶
func SimulateActiveValidators(ctx sdk.Context, k types.SmartQuerier, valset sdk.AccAddress) ([]ValidatorInfo, error)
type ValidatorMetadata ¶
type ValidatorMetadata struct { // moniker defines a human-readable name for the validator. Moniker string `json:"moniker"` // identity defines an optional identity signature (ex. UPort or Keybase). Identity string `json:"identity,omitempty"` // website defines an optional website link. Website string `json:"website,omitempty"` // security_contact defines an optional email for security contact. SecurityContact string `json:"security_contact,omitempty"` // details define other optional details. Details string `json:"details,omitempty"` }
func MetadataFromDescription ¶
func MetadataFromDescription(description stakingtypes.Description) ValidatorMetadata
func (ValidatorMetadata) ToDescription ¶
func (m ValidatorMetadata) ToDescription() stakingtypes.Description
type ValidatorProposal ¶
type ValidatorProposal struct { RegisterUpgrade *ChainUpgrade `json:"register_upgrade,omitempty"` CancelUpgrade *struct{} `json:"cancel_upgrade,omitempty"` // PinCodes that should be pinned in cache for high performance PinCodes []uint64 `json:"pin_codes,omitempty"` /// UnpinCodes that should be removed from cache to free space UnpinCodes []uint64 `json:"unpin_codes,omitempty"` UpdateConsensusBlockParams *ConsensusBlockParamsUpdate `json:"update_consensus_block_params,omitempty"` UpdateConsensusEvidenceParams *ConsensusEvidenceParamsUpdate `json:"update_consensus_evidence_params,omitempty"` MigrateContract *Migration `json:"migrate_contract,omitempty"` Text *struct{} `json:"text,omitempty"` }
ValidatorProposal proposal options.
type ValidatorPubkey ¶
type ValidatorPubkey struct { Ed25519 []byte `json:"ed25519,omitempty"` Secp256k1 []byte `json:"secp256k1,omitempty"` Sr25519 []byte `json:"sr25519,omitempty"` }
func NewValidatorPubkey ¶
func NewValidatorPubkey(pk cryptotypes.PubKey) (ValidatorPubkey, error)
type ValidatorQuery ¶
type ValidatorQuery struct {
Operator string `json:"operator"`
}
type ValidatorResponse ¶
type ValidatorResponse struct {
Validator *OperatorResponse `json:"validator"`
}
type ValidatorSlashing ¶
type ValidatorUpdate ¶
type ValidatorUpdate struct { // PubKey is the ed25519 pubkey used in Tendermint consensus PubKey ValidatorPubkey `json:"pubkey"` // Power is the new voting power in the consensus rounds Power uint64 `json:"power"` }
ValidatorUpdate is used to update the validator set See https://github.com/tendermint/tendermint/blob/v0.34.8/proto/tendermint/abci/types.proto#L343-L346
type ValidatorUpdateSudoMsg ¶
type ValidatorUpdateSudoMsg struct { /// This will be delivered after everything. /// The data in the Response is (JSON?) encoded diff to the validator set EndWithValidatorUpdate *struct{} `json:"end_with_validator_update,omitempty"` }
ValidatorUpdateSudoMsg callback message sent to a contract. See https://github.com/confio/tgrade-contracts/blob/main/packages/bindings/src/sudo.rs
type ValidatorVotingExecuteMsg ¶
type ValidatorVotingExecuteMsg struct { Propose *ValidatorVotingPropose `json:"propose,omitempty"` Vote *struct{} `json:"vote,omitempty"` Execute *struct{} `json:"execute,omitempty"` }
ValidatorVotingExecuteMsg executable contract message
type ValidatorVotingInitMsg ¶
type ValidatorVotingInitMsg struct { VotingRules VotingRules `json:"rules"` GroupAddress string `json:"group_addr"` }
ValidatorVotingInitMsg setup contract on instantiation
type ValidatorVotingPropose ¶
type ValidatorVotingPropose struct { Title string `json:"title"` Description string `json:"description"` Proposal ValidatorProposal `json:"proposal"` }
ValidatorVotingPropose submit a new gov proposal
type ValsetConfigResponse ¶
type ValsetConfigResponse struct { Membership string `json:"membership"` MinPoints uint64 `json:"min_points"` MaxValidators uint32 `json:"max_validators"` Scaling uint32 `json:"scaling,omitempty"` EpochReward sdk.Coin `json:"epoch_reward"` // Percentage of total accumulated fees which is subtracted from tokens minted as a rewards. A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 FeePercentage sdk.Dec `json:"fee_percentage"` DistributionContracts []DistributionContract `json:"distribution_contracts,omitempty"` ValidatorGroup string `json:"validator_group"` AutoUnjail bool `json:"auto_unjail"` }
ValsetConfigResponse Response to `config` query
type ValsetContractAdapter ¶
type ValsetContractAdapter struct {
ContractAdapter
}
func NewValsetContractAdapter ¶
func NewValsetContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) *ValsetContractAdapter
NewValsetContractAdapter constructor
func (ValsetContractAdapter) JailValidator ¶ added in v0.5.2
func (v ValsetContractAdapter) JailValidator(ctx sdk.Context, nodeOperator sdk.AccAddress, duration time.Duration, forever bool, sender sdk.AccAddress) error
JailValidator is for testing propose only. On a chain the OC does this
func (ValsetContractAdapter) ListValidatorSlashing ¶
func (v ValsetContractAdapter) ListValidatorSlashing(ctx sdk.Context, opAddr sdk.AccAddress) ([]ValidatorSlashing, error)
func (ValsetContractAdapter) ListValidators ¶
func (v ValsetContractAdapter) ListValidators(ctx sdk.Context, pagination *Paginator) ([]stakingtypes.Validator, PaginationCursor, error)
ListValidators query all validators
func (ValsetContractAdapter) QueryConfig ¶
func (v ValsetContractAdapter) QueryConfig(ctx sdk.Context) (*ValsetConfigResponse, error)
QueryConfig query contract configuration
func (ValsetContractAdapter) QueryRawValidator ¶ added in v0.5.2
func (v ValsetContractAdapter) QueryRawValidator(ctx sdk.Context, opAddr sdk.AccAddress) (ValidatorResponse, error)
QueryRawValidator query a single validator as the contract returns it. returns nil when not found
func (ValsetContractAdapter) QueryValidator ¶
func (v ValsetContractAdapter) QueryValidator(ctx sdk.Context, opAddr sdk.AccAddress) (*stakingtypes.Validator, error)
QueryValidator query a single validator and map to the sdk type. returns nil when not found
func (ValsetContractAdapter) UnjailValidator ¶ added in v0.5.2
func (v ValsetContractAdapter) UnjailValidator(ctx sdk.Context, sender sdk.AccAddress) error
func (ValsetContractAdapter) UpdateAdmin ¶
func (v ValsetContractAdapter) UpdateAdmin(ctx sdk.Context, newAdmin sdk.AccAddress, sender sdk.AccAddress) error
UpdateAdmin sets a new admin address
type ValsetEpochResponse ¶
type ValsetEpochResponse struct { // Number of seconds in one epoch. We update the Tendermint validator set only once per epoch. EpochLength uint64 `json:"epoch_length"` // The current epoch # (block.time/epoch_length, rounding down) CurrentEpoch uint64 `json:"current_epoch"` // The last time we updated the validator set - block time (in seconds) LastUpdateTime uint64 `json:"last_update_time"` // The last time we updated the validator set - block height LastUpdateHeight uint64 `json:"last_update_height"` }
ValsetEpochQueryResponse Response to `config` query
func QueryValsetEpoch ¶
func QueryValsetEpoch(ctx sdk.Context, k types.SmartQuerier, valset sdk.AccAddress) (*ValsetEpochResponse, error)
type ValsetInitMsg ¶
type ValsetInitMsg struct { Admin string `json:"admin,omitempty"` Membership string `json:"membership"` MinPoints uint64 `json:"min_points"` MaxValidators uint32 `json:"max_validators"` EpochLength uint64 `json:"epoch_length"` EpochReward sdk.Coin `json:"epoch_reward"` InitialKeys []Validator `json:"initial_keys"` Scaling uint32 `json:"scaling,omitempty"` // Percentage of total accumulated fees which is subtracted from tokens minted as a rewards. A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 FeePercentage *sdk.Dec `json:"fee_percentage,omitempty"` // If set to true, we will auto-unjail any validator after their jailtime is over. AutoUnjail bool `json:"auto_unjail"` // This contract receives the rewards that don't go to the validator (set ot tg4-engagement) DistributionContracts []DistributionContract `json:"distribution_contracts,omitempty"` // This is the code-id of the cw2222-compliant contract used to handle rewards for the validators // Generally should the the tg4-engagement code id ValidatorGroupCodeID uint64 `json:"validator_group_code_id"` }
ValsetInitMsg Valset contract init message See https://github.com/confio/tgrade-contracts/tree/v0.5.0-alpha/contracts/tgrade-valset/src/msg.rs
type ValsetQuery ¶
type ValsetQuery struct { Config *struct{} `json:"configuration,omitempty"` Epoch *struct{} `json:"epoch,omitempty"` Validator *ValidatorQuery `json:"validator,omitempty"` ListValidators *ListValidatorsQuery `json:"list_validators,omitempty"` ListActiveValidators *ListValidatorsQuery `json:"list_active_validators,omitempty"` SimulateActiveValidators *struct{} `json:"simulate_active_validators,omitempty"` ListValidatorSlashing *ValidatorQuery `json:"list_validator_slashing,omitempty"` }
ValsetQuery will create many queries for the valset contract See https://github.com/confio/tgrade-contracts/tree/v0.5.0-alpha/contracts/tgrade-valset/src/msg.rs
type VoteListResponse ¶
type VoteListResponse struct {
Votes []VoteInfo `json:"votes"`
}
type VoteResponse ¶
type VoteResponse struct {
Vote *VoteInfo `json:"vote,omitempty"`
}
type VoterDetail ¶
type VoterListResponse ¶
type VoterListResponse struct {
Voters []VoterDetail `json:"voters"`
}
type VoterQuery ¶
type VoterQuery struct {
Address string `json:"address"`
}
type VoterResponse ¶
type VoterResponse struct {
Weight *uint64 `json:"weight"`
}
type VotingContractAdapter ¶
type VotingContractAdapter struct {
ContractAdapter
}
func NewVotingContractAdapter ¶
func NewVotingContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) VotingContractAdapter
NewVotingContractAdapter constructor
func (VotingContractAdapter) ExecuteProposal ¶
func (v VotingContractAdapter) ExecuteProposal(ctx sdk.Context, proposalID uint64, sender sdk.AccAddress) error
ExecuteProposal executes a previously passed proposal
func (VotingContractAdapter) LatestProposal ¶
func (v VotingContractAdapter) LatestProposal(ctx sdk.Context) (*OCProposalResponse, error)
LatestProposal gets info on the last proposal made, easy way to get the ProposalID
func (VotingContractAdapter) QueryProposal ¶
func (v VotingContractAdapter) QueryProposal(ctx sdk.Context, id uint64) (*OCProposalResponse, error)
QueryProposal query a proposal by id
func (VotingContractAdapter) VoteProposal ¶
func (v VotingContractAdapter) VoteProposal(ctx sdk.Context, proposalID uint64, vote Vote, sender sdk.AccAddress) error
VoteProposal votes on a proposal
type VotingRules ¶
type VotingRules struct { // VotingPeriod Voting period in days VotingPeriod uint32 `json:"voting_period"` // Quorum voting quorum (0.0-1.0) Quorum sdk.Dec `json:"quorum"` // Threshold voting threshold (0.5-1.0) Threshold sdk.Dec `json:"threshold"` // AllowEndEarly If true, and absolute threshold and quorum are met, we can end before voting period finished. // (Recommended value: true, unless you have special needs) AllowEndEarly bool `json:"allow_end_early"` }
VotingRules voting rules
type WithdrawAdjustmentDataQuery ¶ added in v0.6.2
type WithdrawAdjustmentDataQuery struct {
Addr string `json:"addr"`
}
type WithdrawAdjustmentResponse ¶ added in v0.6.2
type WithdrawAdjustmentResponse struct { // PointsCorrection is int128 encoded as a string (use sdk.Int?) PointsCorrection string `json:"points_correction"` // WithdrawnFunds is uint128 encoded as a string (use sdk.Int?) WithdrawnFunds string `json:"withdrawn_funds"` Delegated string `json:"delegated"` }
type WithdrawableRewardsQuery ¶ added in v0.6.2
type WithdrawableRewardsQuery struct {
Owner string `json:"owner"`
}