Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

validCallerRoles

[]string (len=6)

MUST BE IMMUTABLE, DO NOT MODIFY. validCallerRoles is a list of roles that are authorized to modify referral data. This includes governance, governance staker, router, position, staker, and launchpad contracts.

Open
OID
055201…080e:4
validCallerRoles details (len=6)

+6 more Inspect slice

assertValidCaller

func(caller .uverse.address)

assertValidCaller checks if the caller address has permission to modify referral data. Only addresses with specific roles defined in validCallerRoles are authorized. Errors: - ErrUnauthorized: the caller is not authorized to modify referral data

Open
OID
055201…080e:5
assertValidCaller details

Inspect func

ErrInvalidAddress

untyped string

Value

"invalid address format"

ErrSelfReferral

untyped string

Value

"self referral is not allowed"

ErrUnauthorized

untyped string

Value

"unauthorized caller"

ErrTooManyRequests

untyped string

Value

"too many requests: operations allowed once per 24 hours for each address"

ErrNotFound

untyped string

Value

"referral not found"

ErrInvalidTime

untyped string

Value

"invalid time format"

makeErrorWithDetails

func(message string, detail string) .uverse.error
Open
OID
055201…080e:7
makeErrorWithDetails details

Inspect func

EventRegisterFailed

untyped string

EventRegisterFailed is emitted when an authorized non-empty write fails. Successful non-empty writes emit the RegisterReferral event.

Value

"ReferralRegistrationFailed"

GetReferral

func(addr string) string

GetReferral returns the referral address string stored for the given address. Parameters: - addr: address string whose referral relationship is queried. Returns: - referral: stored referrer address string, or an empty string when no valid referral is found.

Open
OID
055201…080e:12
GetReferral details

Inspect func

HasReferral

func(addr string) bool

HasReferral reports whether the given address has a stored referral. Parameters: - addr: address string whose referral relationship is checked. Returns: - hasReferral: true when a referral record exists; false when it is absent or invalid.

Open
OID
055201…080e:13
HasReferral details

Inspect func

IsEmpty

func() bool

IsEmpty reports whether the referral keeper contains no referral records. Returns: - empty: true when the keeper store has zero referral records.

Open
OID
055201…080e:14
IsEmpty details

Inspect func

GetLastOpTimestamp

func(addr string) (int64, .uverse.error)

GetLastOpTimestamp returns the last non-removal registration or update timestamp for an address. Parameters: - addr: address string whose last non-removal operation is queried. Returns: - timestamp: Unix timestamp of the last successful registration or update. - error: nil when a timestamp exists; otherwise an invalid-address or ErrNotFound error.

Open
OID
055201…080e:15
GetLastOpTimestamp details

Inspect func

ContractAddress

func() string

ContractAddress returns the address of the referral contract. Use this address as the referral parameter in TryRegister to remove an existing referral. Returns: - address: referral contract address string, used as the removal sentinel.

Open
OID
055201…080e:16
ContractAddress details

Inspect func

TryRegister

func(addr .uverse.address, referral string) string

TryRegister attempts to register, update, or remove a referral. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - addr: address whose referral relationship is read or changed. - referral: empty string for a read, ContractAddress() to remove, or a candidate referrer address string. Returns: - effectiveReferral: stored referrer after the operation or fallback; empty when none is stored. Empty input is treated as a read and returns the stored referrer without authorization, rate-limit checks, or event emission. Non-empty input requires an authorized caller.

Open
OID
055201…080e:17
TryRegister details

Inspect func

MinTimeBetweenUpdates

int64

Value

86400

keeper

type

keeper implements ReferralKeeper using BPTree storage. Non-removal registrations and updates use a 24-hour cooldown; removal via the contract-address sentinel bypasses that check and preserves the timestamp.

Value

v1.keeper

NewKeeper

func() v1.ReferralKeeper

NewKeeper creates an empty ReferralKeeper backed by independent referral and last-operation BPTrees. Returns: - keeper: new referral store with no relationships or operation timestamps

Open
OID
055201…080e:18
NewKeeper details

Inspect func

Render

func(path string) string

Render describes referral registration or shows the referral for an address.

Open
OID
055201…080e:20
Render details

Inspect func

zeroAddress

.uverse.address

Value

<gnolang.StringValue>

selfAddress

.uverse.address

Value

<gnolang.StringValue>

contractAddress

func() .uverse.address
Open
OID
055201…080e:25
contractAddress details

Inspect func

isRemovalRequest

func(refAddr .uverse.address) bool

isRemovalRequest checks if the given address indicates a removal request. Removal is indicated by passing the contract's own address as the referral.

Open
OID
055201…080e:26
isRemovalRequest details

Inspect func

ReferralKeeper

type

ReferralKeeper defines the interface for managing referral relationships.

Value

v1.ReferralKeeper
validCallerRoles : []string (len=6) Inspect
assertValidCaller : func(caller .uverse.address) Inspect
ErrInvalidAddress : untyped string ="invalid address format"
ErrSelfReferral : untyped string ="self referral is not allowed"
ErrUnauthorized : untyped string ="unauthorized caller"
ErrTooManyRequests : untyped string ="too many requests: operations allowed once per 24 hours for each address"
ErrNotFound : untyped string ="referral not found"
ErrInvalidTime : untyped string ="invalid time format"
makeErrorWithDetails : func(message string, detail string) .uverse.error Inspect
gReferralKeeper : *v1.keeper Inspect
EventRegisterFailed : untyped string ="ReferralRegistrationFailed"
init.11 : func() Inspect
GetReferral : func(addr string) string Inspect
HasReferral : func(addr string) bool Inspect
IsEmpty : func() bool Inspect
GetLastOpTimestamp : func(addr string) (int64, .uverse.error) Inspect
ContractAddress : func() string Inspect
TryRegister : func(addr .uverse.address, referral string) string Inspect
MinTimeBetweenUpdates : int64 =86400
keeper : type =v1.keeper
NewKeeper : func() v1.ReferralKeeper Inspect
Render : func(path string) string Inspect
zeroAddress : .uverse.address =<gnolang.StringValue>
selfAddress : .uverse.address =<gnolang.StringValue>
init.24 : func() Inspect
contractAddress : func() .uverse.address Inspect
isRemovalRequest : func(refAddr .uverse.address) bool Inspect
ReferralKeeper : type =v1.ReferralKeeper