validCallerRoles
[]stringMUST 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.
- OID
- 055201…080e:4
validCallerRoles details
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
- OID
- 055201…080e:5
assertValidCaller details
ErrInvalidAddress
untyped stringValue
"invalid address format"
ErrSelfReferral
untyped stringValue
"self referral is not allowed"
ErrUnauthorized
untyped stringValue
"unauthorized caller"
ErrTooManyRequests
untyped stringValue
"too many requests: operations allowed once per 24 hours for each address"
ErrNotFound
untyped stringValue
"referral not found"
ErrInvalidTime
untyped stringValue
"invalid time format"
makeErrorWithDetails
func(message string, detail string) .uverse.error- OID
- 055201…080e:7
makeErrorWithDetails details
gReferralKeeper
*v1.keeper- OID
- 055201…080e:28
gReferralKeeper details
EventRegisterFailed
untyped stringEventRegisterFailed is emitted when an authorized non-empty write fails. Successful non-empty writes emit the RegisterReferral event.
Value
"ReferralRegistrationFailed"
init.11
func()- OID
- 055201…080e:10
init.11 details
GetReferral
func(addr string) stringGetReferral 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.
- OID
- 055201…080e:12
GetReferral details
HasReferral
func(addr string) boolHasReferral 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.
- OID
- 055201…080e:13
HasReferral details
IsEmpty
func() boolIsEmpty reports whether the referral keeper contains no referral records. Returns: - empty: true when the keeper store has zero referral records.
- OID
- 055201…080e:14
IsEmpty details
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.
- OID
- 055201…080e:15
GetLastOpTimestamp details
ContractAddress
func() stringContractAddress 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.
- OID
- 055201…080e:16
ContractAddress details
TryRegister
func(addr .uverse.address, referral string) stringTryRegister 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.
- OID
- 055201…080e:17
TryRegister details
MinTimeBetweenUpdates
int64Value
86400
keeper
typekeeper 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.ReferralKeeperNewKeeper creates an empty ReferralKeeper backed by independent referral and last-operation BPTrees. Returns: - keeper: new referral store with no relationships or operation timestamps
- OID
- 055201…080e:18
NewKeeper details
Render
func(path string) stringRender describes referral registration or shows the referral for an address.
- OID
- 055201…080e:20
Render details
zeroAddress
.uverse.addressValue
<gnolang.StringValue>
selfAddress
.uverse.addressValue
<gnolang.StringValue>
init.24
func()- OID
- 055201…080e:23
init.24 details
contractAddress
func() .uverse.address- OID
- 055201…080e:25
contractAddress details
isRemovalRequest
func(refAddr .uverse.address) boolisRemovalRequest checks if the given address indicates a removal request. Removal is indicated by passing the contract's own address as the referral.
- OID
- 055201…080e:26
isRemovalRequest details
ReferralKeeper
typeReferralKeeper defines the interface for managing referral relationships.
Value
v1.ReferralKeeper