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

referral 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 contracts, router, position manager, and staker contracts.

Open
OID
09a187…fbaa: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
09a187…fbaa: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
09a187…fbaa:7
makeErrorWithDetails details

Inspect func

EventRegisterFailed

untyped string

Value

"ReferralRegistrationFailed"

GetReferral

func(addr string) string

GetReferral returns the referral address for the given address.

Open
OID
09a187…fbaa:12
GetReferral details

Inspect func

HasReferral

func(addr string) bool

HasReferral returns true if the given address has a referral.

Open
OID
09a187…fbaa:13
HasReferral details

Inspect func

IsEmpty

func() bool

IsEmpty returns true if no referrals exist in the system.

Open
OID
09a187…fbaa:14
IsEmpty details

Inspect func

GetLastOpTimestamp

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

GetLastOpTimestamp returns the last operation timestamp for the given address. Returns ErrNotFound if no operation exists.

Open
OID
09a187…fbaa: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.

Open
OID
09a187…fbaa:16
ContractAddress details

Inspect func

TryRegister

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

TryRegister attempts to register a new referral. Parameters: - addr: address to register - referral: referral address string Returns the effective referrer after applying registration or fallback. Empty input is treated as "no new referrer provided" and returns the stored referrer without attempting registration. Panics if the caller is not authorized for non-empty registration attempts.

Open
OID
09a187…fbaa:17
TryRegister details

Inspect func

MinTimeBetweenUpdates

int64

Value

86400

keeper

type

keeper implements ReferralKeeper using BPTree storage. It includes rate limiting to prevent abuse.

Value

referral.keeper

NewKeeper

func() referral.ReferralKeeper

NewKeeper creates a new ReferralKeeper instance.

Open
OID
09a187…fbaa:18
NewKeeper details

Inspect func

zeroAddress

.uverse.address

Value

<gnolang.StringValue>

selfAddress

.uverse.address

Value

<gnolang.StringValue>

contractAddress

func() .uverse.address
Open
OID
09a187…fbaa:23
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
09a187…fbaa:24
isRemovalRequest details

Inspect func

ReferralKeeper

type

ReferralKeeper defines the interface for managing referral relationships.

Value

referral.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 : *referral.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 =referral.keeper
NewKeeper : func() referral.ReferralKeeper Inspect
zeroAddress : .uverse.address =<gnolang.StringValue>
selfAddress : .uverse.address =<gnolang.StringValue>
init.23 : func() Inspect
contractAddress : func() .uverse.address Inspect
isRemovalRequest : func(refAddr .uverse.address) bool Inspect
ReferralKeeper : type =referral.ReferralKeeper