memberstore source realm
1
10
func GetTierPower
ActionGetTierPower calculates the effective voting power for a tier given the current members. This is a safe accessor that uses the internal tiers configuration.
func IterateTiers
ActionIterateTiers iterates over all tiers in order. This is a read-only accessor. The callback receives the tier name and tier data. Return true from the callback to stop iteration.
func NewChangeTiersRequest
crossing Actionfunc Render
func RenderCharts
ActionRenderCharts generates two pie charts for member tiers: 1) distribution of member counts per tier 2) distribution of power per tier
func RenderMembers
ActionRenderMembers returns the members list with tier filters and pagination.
func NewMember
Actionfunc Get
ActionGet gets the Members store.
rlm is the cur of an in-scope crossing frame, threaded by the caller. The IsCurrent() check rejects stale or stashed realm values — a malicious realm cannot replay an old cur to claim allowed-DAO identity. After the check, rlm.PkgPath() is the authentic immediate caller's realm.
func NewMembersByTier
Actionfunc GetTier
ActionGetTier returns a tier by name. This is a read-only accessor.
5
type ErrMemberAlreadyExists
structtype Member
structMethods on Member
func RemoveInvitationPoint
method on Membertype MembersByTier
structMembersByTier contains all `Member`s indexed by their Address.
Methods on MembersByTier
func DeleteAll
method on MembersByTierfunc GetMember
method on MembersByTierGetMember iterate over all tiers to try to find a member by its address. The tier ID is also returned if the Member is found.
func GetTierSize
method on MembersByTierGetTierSize tries to get how many members are on the specified tier. If the tier does not exists, it returns 0.
func GetTotalPower
method on MembersByTierGetTotalPower obtains the total voting power from all the specified tiers.
func RemoveMember
method on MembersByTierRemoveMember removes a member from any tier
func SetMember
method on MembersByTierSetMember adds a new member to the specified tier. The tier index is created on the fly if it does not exists.
func SetTier
method on MembersByTiertype Tier
struct 1type Tier struct {
2 // BasePower defines the standard voting power for the members on this tier.
3 BasePower float64
4
5 // InvitationPoints defines how many invitation points users on that tier will receive.
6 InvitationPoints int
7
8 // MaxSize calculates the max amount of members expected to be on this tier.
9 MaxSize func(membersByTier MembersByTier, tiersByName TiersByName) int
10
11 // MinSize calculates the min amount of members expected to be on this tier.
12 MinSize func(membersByTier MembersByTier, tiersByName TiersByName) int
13
14 // PowerHandler calculates what is the final power of this tier after taking into account Members by other tiers.
15 PowerHandler func(membersByTier MembersByTier, tiersByName TiersByName) float64
16}type TiersByName
structTiersByName contains all tier objects indexed by its name.
14
- chain/runtime/unsafe stdlib
- errors stdlib
- gno.land/p/demo/svg package
- gno.land/p/moul/md package
- gno.land/p/nt/bptree/v0 package
- gno.land/p/nt/bptree/v0/pager package
- gno.land/p/nt/mux/v0 package
- gno.land/p/nt/ufmt/v0 package
- gno.land/p/samcrew/piechart package
- gno.land/p/samcrew/tablesort package
- gno.land/p/samcrew/urlfilter package
- gno.land/r/gov/dao realm
- net/url stdlib
- strings stdlib