contract

package
v0.0.0-...-3c4d084 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

README

Contracts

Furya smart contracts. See https://github.com/furyanrasta/furya-contracts for source code and details.

Arch with Gov Architecture

Developers

Test strategy

Contract interactions (query/ updates) should be covered by integration tests that talk to the real contract(s) We need to ensure that things work as expected but also to provide "consumer driven contracts" in code that couple both worlds to be stable. Though there are use cases that would also be covered by system tests like create-validator or end block callback. In this case we have enough confidence.

Pure Go code should be unit tested only

Download new artifacts

Requires a github access token

Example to download contract for tag v0.1.3

./download_releases.sh v0.1.3
OSX
Preparation
  1. Create access token on github with access to private repos!
Store key in OS keychain
  1. Copy token to clipboard
  2. Add to your OS keychain
security add-generic-password -a "$USER" -s 'github_api_key' -w "$(pbpaste)"

The script will read the token from the OS keychain

Others

Set your api key via environment GITHUB_API_TOKEN variable before running the download script

Documentation

Index

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 ConvertToTendermintPubKey

func ConvertToTendermintPubKey(key ValidatorPubkey) (crypto.PublicKey, error)

func DecimalFromPercentage

func DecimalFromPercentage(percent sdk.Dec) *sdk.Dec

func DecimalFromProMille

func DecimalFromProMille(promille int64) *sdk.Dec

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

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 APProposal

type APProposal struct {
	// An open text proposal with no actual logic executed when it passes
	Text *struct{} `json:"text,omitempty"`
	// Proposes arbiters for existing complaint
	ProposeArbiters *ProposeArbiters `json:"propose_arbiters,omitempty"`
}

type APVotingExecute

type APVotingExecute struct {
	Propose           *Propose           `json:"propose,omitempty"`
	Vote              *VoteProposal      `json:"vote,omitempty"`
	Execute           *ExecuteProposal   `json:"execute,omitempty"`
	Close             *CloseProposal     `json:"close,omitempty"`
	RegisterComplaint *RegisterComplaint `json:"register_complaint,omitempty"`
	AcceptComplaint   *AcceptComplaint   `json:"accept_complaint,omitempty"`
	WithdrawComplaint *WithdrawComplaint `json:"withdraw_complaint,omitempty"`
	RenderDecision    *RenderDecision    `json:"render_decision,omitempty"`
}

APVotingExecute ap-voting contract execute messages See https://github.com/furyanrasta/furya-contracts/blob/v0.9.0/contracts/furya-ap-voting/src/msg.rs

type APVotingInitMsg

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 in seconds for this contract
	WaitingPeriod uint64 `json:"waiting_period"`
	// Cw3-fixed-multisig contract code id.
	// This code id will be used to instantiate a group contract with the proposed arbiters list.
	MultisigCodeID uint64 `json:"multisig_code_id"`
}

APVotingInitMsg instantiation message

type AcceptComplaint

type AcceptComplaint struct {
	ComplaintID uint64 `json:"complaint_id"`
}

type AddRemoveNonVotingMembers

type AddRemoveNonVotingMembers struct {
	Add    []string `json:"add"`
	Remove []string `json:"remove"`
}

type AddVotingMembers

type AddVotingMembers struct {
	Voters []string `json:"voters"`
}

type AlgebraicSigmoid

type AlgebraicSigmoid struct {
	MaxPoints uint64  `json:"max_points,string"`
	A         sdk.Dec `json:"a"`
	P         sdk.Dec `json:"p"`
	S         sdk.Dec `json:"s"`
}

type BaseContractAdapter

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

BaseContractAdapter is the base contract adapter type that contains common methods to interact with the contract

func NewBaseContractAdapter

func NewBaseContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) BaseContractAdapter

NewBaseContractAdapter constructor

func (BaseContractAdapter) Address

func (a BaseContractAdapter) Address() (sdk.AccAddress, error)

Address returns contract address

type Bond

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 ChainUpgrade struct {
	Name   string `json:"name"`
	Height uint64 `json:"height"`
	Info   string `json:"info"`
}

type CloseProposal

type CloseProposal struct {
	ProposalID uint64 `json:"proposal_id"`
}

type CommunityPoolInitMsg

type CommunityPoolInitMsg struct {
	VotingRules  VotingRules `json:"rules"`
	GroupAddress string      `json:"group_addr"`
}

type ConsensusBlockParamsUpdate

type ConsensusBlockParamsUpdate = contract.BlockParams

type ConsensusEvidenceParamsUpdate

type ConsensusEvidenceParamsUpdate = contract.EvidenceParams

type DelegateWithdrawalMsg

type DelegateWithdrawalMsg struct {
	Delegated string `json:"delegated"`
}

DelegateWithdrawalMsg contract sets given address as allowed for senders funds withdrawal

type DelegatedQuery

type DelegatedQuery struct {
	Owner string `json:"owner"`
}

type DelegatedResponse

type DelegatedResponse struct {
	Delegated string `json:"delegated"`
}

type DistributionContract

type DistributionContract struct {
	Address string `json:"contract"`
	// Ratio of total reward tokens for an epoch to be sent to that contract for further distribution.
	// Range 0 - 1
	Ratio sdk.Dec `json:"ratio"`
}

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) Address

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 {
	BaseContractAdapter
}

func NewEngagementContractAdapter

func NewEngagementContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) *EngagementContractAdapter

NewEngagementContractAdapter constructor

func (EngagementContractAdapter) QueryDelegated

func (a EngagementContractAdapter) QueryDelegated(ctx sdk.Context, ownerAddr sdk.AccAddress) (*DelegatedResponse, error)

func (EngagementContractAdapter) QueryWithdrawableRewards

func (a EngagementContractAdapter) QueryWithdrawableRewards(ctx sdk.Context, addr sdk.AccAddress) (sdk.Coin, error)

func (EngagementContractAdapter) UpdateAdmin

func (a EngagementContractAdapter) UpdateAdmin(ctx sdk.Context, newAdmin, sender sdk.AccAddress) error

type EngagementQuery

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

type ExecuteMsg struct {
	ProposalID uint64 `json:"proposal_id"`
}

type ExecuteProposal

type ExecuteProposal struct {
	ProposalID uint64 `json:"proposal_id"`
}

type GrantEngagementProposal

type GrantEngagementProposal struct {
	Member string `json:"member"`
	Points uint64 `json:"points"`
}

type IsSlasher

type IsSlasher struct {
	Addr string `json:"addr"`
}

type JailMsg

type JailMsg struct {
	Operator string `json:"operator"`
	// Duration for how long validator is jailed (in seconds)
	Duration JailingDuration `json:"duration"`
}

type JailingDuration

type JailingDuration struct {
	Duration uint64    `json:"duration,omitempty"`
	Forever  *struct{} `json:"forever,omitempty"`
}

type JailingEnd

type JailingEnd struct {
	Forever bool      `json:"forever,omitempty"`
	Until   time.Time `json:"until,omitempty"`
}

type JailingPeriod

type JailingPeriod struct {
	Start time.Time  `json:"start,omitempty"`
	End   JailingEnd `json:"end,omitempty"`
}

func (*JailingPeriod) UnmarshalJSON

func (j *JailingPeriod) UnmarshalJSON(data []byte) error

type ListActiveValidatorsResponse

type ListActiveValidatorsResponse struct {
	Validators []ValidatorInfo `json:"validators"`
}

func (ListActiveValidatorsResponse) PaginationCursor

func (l ListActiveValidatorsResponse) PaginationCursor(_ []byte) (PaginationCursor, error)

type ListClaimsQuery

type ListClaimsQuery struct {
	Address string `json:"address"`
	// Limit for pagination
	Limit uint32 `json:"limit,omitempty"`
	// StartAfter is used for pagination. Take last `claim.ReleaseAt` from last query
	StartAfter uint64 `json:"start_after,string,omitempty"`
}

type ListMembersByPointsQuery

type ListMembersByPointsQuery struct {
	StartAfter *TG4Member `json:"start_after,omitempty"`
	Limit      int        `json:"limit,omitempty"`
}

type ListMembersQuery

type ListMembersQuery struct {
	StartAfter string `json:"start_after,omitempty"`
	Limit      int    `json:"limit,omitempty"`
}

type ListProposalQuery

type ListProposalQuery struct {
	StartAfter uint64 `json:"start_after,omitempty"`
	Limit      uint32 `json:"limit,omitempty"`
}

type ListValidatorSlashingResponse

type ListValidatorSlashingResponse struct {
	Operator    string              `json:"operator"`
	StartHeight uint64              `json:"start_height"`
	Slashing    []ValidatorSlashing `json:"slashing"`
}

type ListValidatorsQuery

type ListValidatorsQuery struct {
	StartAfter string `json:"start_after,omitempty"`
	Limit      int    `json:"limit,omitempty"`
}

type ListValidatorsResponse

type ListValidatorsResponse struct {
	Validators []OperatorResponse `json:"validators"`
}

func (ListValidatorsResponse) PaginationCursor

func (l ListValidatorsResponse) PaginationCursor(_ []byte) (PaginationCursor, error)

PaginationCursor implements PageableResult.PaginationCursor with a custom key which is implemented in the contract.

type ListVotersQuery

type ListVotersQuery struct {
	StartAfter string `json:"start_after,omitempty"`
	Limit      uint32 `json:"limit,omitempty"`
}

type ListVotesQuery

type ListVotesQuery struct {
	ProposalID uint64 `json:"proposal_id"`
	StartAfter string `json:"start_after,omitempty"`
	Limit      uint32 `json:"limit,omitempty"`
}

type MemberQuery

type MemberQuery struct {
	Addr     string `json:"addr"`
	AtHeight int    `json:"at_height,omitempty"`
}

type Migration

type Migration struct {
	/// the contract address to be migrated
	Contract string `json:"contract"`
	/// a reference to the new WASM code that it should be migrated to
	CodeID uint64 `json:"code_id"`
	/// encoded message to be passed to perform the migration
	MigrateMsg []byte `json:"migrate_msg"`
}

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:"algebraic_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"`
	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

type PageableResult interface {
	// PaginationCursor pagination cursor
	PaginationCursor(raw []byte) (PaginationCursor, error)
}

PageableResult is a query response where the cursor is a subset of the raw last element.

type PaginationCursor

type PaginationCursor []byte

PaginationCursor is the contracts "last element" as raw data that can be used to navigate through the result set.

func (PaginationCursor) Empty

func (p PaginationCursor) Empty() bool

Empty is nil or zero size

func (PaginationCursor) Equal

func (PaginationCursor) String

func (p PaginationCursor) String() string

String convert to string representation

type Paginator

type Paginator struct {
	StartAfter PaginationCursor `json:"start_after,omitempty"`
	Limit      uint64           `json:"limit,omitempty"`
}

func NewPaginator

func NewPaginator(pag *query.PageRequest) (*Paginator, error)

NewPaginator constructor

func (*Paginator) ToQuery

func (p *Paginator) ToQuery() (string, int)

ToQuery converts to poe contract query format

type ProposalContent

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 Propose

type Propose struct {
	Title       string     `json:"title"`
	Description string     `json:"description"`
	APProposal  APProposal `json:"arbiter_pool_proposal"`
}

Propose arbiters for a given dispute

type ProposeArbiters

type ProposeArbiters struct {
	CaseID   uint64           `json:"case_id"`
	Arbiters []sdk.AccAddress `json:"arbiters"`
}

type ProposeMsg

type ProposeMsg struct {
	Title       string          `json:"title"`
	Description string          `json:"description"`
	Proposal    ProposalContent `json:"proposal"`
}

type RegisterComplaint

type RegisterComplaint struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Defendant   string `json:"defendant"`
}

type RegisterValidatorKey

type RegisterValidatorKey struct {
	PubKey   ValidatorPubkey   `json:"pubkey"`
	Metadata ValidatorMetadata `json:"metadata"`
}

type RenderDecision

type RenderDecision struct {
	ComplaintID uint64 `json:"complaint_id"`
	Summary     string `json:"summary"`
	IpfsLink    string `json:"ipfs_link"`
}

type RewardsResponse

type RewardsResponse struct {
	Rewards sdk.Coin
}

type Sigmoid

type Sigmoid struct {
	MaxPoints uint64  `json:"max_points,string"`
	P         sdk.Dec `json:"p"`
	S         sdk.Dec `json:"s"`
}

type SigmoidSqrt

type SigmoidSqrt struct {
	MaxPoints uint64  `json:"max_points,string"`
	S         sdk.Dec `json:"s"`
}

type SimulateActiveValidatorsResponse

type SimulateActiveValidatorsResponse = ListActiveValidatorsResponse

type SlashProposal

type SlashProposal struct {
	Member  string  `json:"member"`
	Portion sdk.Dec `json:"portion"`
}

type SlasherResponse

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) Address

func (v StakeContractAdapter) Address() (sdk.AccAddress, error)

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

func (StakeContractAdapter) QueryStakingUnbondingPeriod

func (v StakeContractAdapter) QueryStakingUnbondingPeriod(ctx sdk.Context) (time.Duration, error)

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"`
	WithdrawRewards    *WithdrawRewardsMsg    `json:"withdraw_rewards,omitempty"`
	DelegateWithdrawal *DelegateWithdrawalMsg `json:"delegate_withdrawal,omitempty"`
}

TG4EngagementExecute execute message See https://github.com/furyanrasta/furya-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/furyanrasta/furya-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/furyanrasta/furya-contracts/blob/v0.5.0-alpha/contracts/tg4-engagement/src/msg.rs

type TG4Member

type TG4Member struct {
	Addr        string `json:"addr"`
	Points      uint64 `json:"points"`
	StartHeight uint64 `json:"start_height,omitempty"`
}

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

func SortByWeightDesc(s []TG4Member) []TG4Member

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"`
	// Optional field indicating the start height the member gained membership
	StartHeight uint64 `json:"start_height,omitempty"`
}

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/furyanrasta/furya-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/furyanrasta/furya-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/furyanrasta/furya-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/furyanrasta/furya-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

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/furyanrasta/furya-contracts/tree/v0.5.0-alpha/contracts/furya-valset/src/msg.rs

type TrustedCircleContractAdapter

type TrustedCircleContractAdapter struct {
	VotingContractAdapter
}

func NewTrustedCircleContractAdapter

func NewTrustedCircleContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) TrustedCircleContractAdapter

NewTrustedCircleContractAdapter constructor

func (TrustedCircleContractAdapter) AddVotingMembersProposal

func (a TrustedCircleContractAdapter) AddVotingMembersProposal(ctx sdk.Context, members []string, sender sdk.AccAddress) error

AddVotingMembersProposal set up the proposal for adding voting members

func (TrustedCircleContractAdapter) DepositEscrow

func (a TrustedCircleContractAdapter) DepositEscrow(ctx sdk.Context, deposit sdk.Coin, sender sdk.AccAddress) error

DepositEscrow deposits escrow for the given member

func (TrustedCircleContractAdapter) QueryListVoters

QueryListVoters query the list of voters

type TrustedCircleExecute

type TrustedCircleExecute struct {
	DepositEscrow   *struct{}   `json:"deposit_escrow,omitempty"`
	Propose         *ProposeMsg `json:"propose,omitempty"`
	Execute         *ExecuteMsg `json:"execute,omitempty"`
	WithdrawRewards *struct{}   `json:"withdraw_rewards,omitempty"`
}

type TrustedCircleInitMsg

type TrustedCircleInitMsg struct {
	// Name Trusted circle name
	Name string `json:"name"`
	// Denom Trusted circle denom
	Denom string `json:"denom"`
	// EscrowAmount The required escrow amount, in the Denom
	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 being part of the trusted circle
	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

type UpdateConfigMsg struct {
	MinPoints     uint64 `json:"min_points,omitempty"`
	MaxValidators uint32 `json:"max_validators,omitempty"`
}

type UpdateMembersMsg

type UpdateMembersMsg struct {
	Add    []TG4Member `json:"add"`
	Remove []string    `json:"remove"`
}

UpdateMembersMsg contract execute message to update members See https://github.com/furyanrasta/furya-contracts/blob/v0.5.0-alpha/contracts/tg4-engagement/src/msg.rs

func (*UpdateMembersMsg) ToJSON

func (m *UpdateMembersMsg) ToJSON(t *testing.T) string

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 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 ValidatorSlashing struct {
	Height  uint64  `json:"slash_height"`
	Portion sdk.Dec `json:"portion"`
}

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/furyanrasta/furya-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 {
	BaseContractAdapter
}

func NewValsetContractAdapter

func NewValsetContractAdapter(contractAddr sdk.AccAddress, twasmKeeper types.TWasmKeeper, addressLookupErr error) *ValsetContractAdapter

NewValsetContractAdapter constructor

func (ValsetContractAdapter) IterateActiveValidators

func (v ValsetContractAdapter) IterateActiveValidators(ctx sdk.Context, callback func(ValidatorInfo) bool, pagination *Paginator) error

IterateActiveValidators iterate through the active validator set.

func (ValsetContractAdapter) JailValidator

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

QueryConfig query contract configuration

func (ValsetContractAdapter) QueryRawValidator

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

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, it should the tg4-engagement code id.
	ValidatorGroupCodeID uint64 `json:"validator_group_code_id"`
	// When a validator joins the valset, verify they sign the first block, or jail them for a period otherwise.
	// The verification happens every time the validator becomes an active validator, including when they are unjailed
	// or when they just gain enough power to participate.
	VerifyValidators bool `json:"verify_validators"`
	// The duration in seconds to jail a validator for in case they don't sign their first epoch boundary block.
	// After the period, they have to pass verification again, ad infinitum.
	OfflineJailDuration uint64 `json:"offline_jail_duration"`
}

ValsetInitMsg Valset contract init message See https://github.com/furyanrasta/furya-contracts/tree/v0.5.0-alpha/contracts/furya-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/furyanrasta/furya-contracts/tree/v0.5.0-alpha/contracts/furya-valset/src/msg.rs

type Vote

type Vote string
const (
	YesVote     Vote = "yes"
	NoVote      Vote = "no"
	AbstainVote Vote = "abstain"
	VetoVote    Vote = "veto"
)

type VoteInfo

type VoteInfo struct {
	Voter  string `json:"voter"`
	Vote   Vote   `json:"vote"`
	Weight uint64 `json:"weight"`
}

type VoteListResponse

type VoteListResponse struct {
	Votes []VoteInfo `json:"votes"`
}

type VoteMsg

type VoteMsg struct {
	Vote       Vote   `json:"vote"`
	ProposalID uint64 `json:"proposal_id"`
}

type VoteProposal

type VoteProposal struct {
	ProposalID uint64 `json:"proposal_id"`
	Vote       Vote   `json:"vote"`
}

type VoteQuery

type VoteQuery struct {
	ProposalID uint64 `json:"proposal_id"`
	Voter      string `json:"voter"`
}

type VoteResponse

type VoteResponse struct {
	Vote *VoteInfo `json:"vote,omitempty"`
}

type VoterDetail

type VoterDetail struct {
	Addr   string `json:"addr"`
	Weight uint64 `json:"weight"`
}

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 Votes

type Votes struct {
	Yes     uint64 `json:"yes"`
	No      uint64 `json:"no"`
	Abstain uint64 `json:"abstain"`
	Veto    uint64 `json:"veto"`
}

type VotingContractAdapter

type VotingContractAdapter struct {
	BaseContractAdapter
}

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

type WithdrawAdjustmentDataQuery struct {
	Addr string `json:"addr"`
}

type WithdrawAdjustmentResponse

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 WithdrawComplaint

type WithdrawComplaint struct {
	ComplaintID uint64 `json:"complaint_id"`
	Reason      string `json:"reason"`
}

type WithdrawRewardsMsg

type WithdrawRewardsMsg struct {
	Owner    *string `json:"owner,omitempty"`
	Receiver *string `json:"receiver,omitempty"`
}

WithdrawRewardsMsg contract execute message to claim rewards

type WithdrawableRewardsQuery

type WithdrawableRewardsQuery struct {
	Owner string `json:"owner"`
}

Jump to

Keyboard shortcuts

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