validCallerRoles
[]stringMUST 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.
- OID
- 09a187…fbaa: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
- 09a187…fbaa: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
- 09a187…fbaa:7
makeErrorWithDetails details
gReferralKeeper
*referral.keeper- OID
- 09a187…fbaa:26
gReferralKeeper details
EventRegisterFailed
untyped stringValue
"ReferralRegistrationFailed"
init.11
func()- OID
- 09a187…fbaa:10
init.11 details
GetReferral
func(addr string) stringGetReferral returns the referral address for the given address.
- OID
- 09a187…fbaa:12
GetReferral details
HasReferral
func(addr string) boolHasReferral returns true if the given address has a referral.
- OID
- 09a187…fbaa:13
HasReferral details
IsEmpty
func() boolIsEmpty returns true if no referrals exist in the system.
- OID
- 09a187…fbaa:14
IsEmpty details
GetLastOpTimestamp
func(addr string) (int64, .uverse.error)GetLastOpTimestamp returns the last operation timestamp for the given address. Returns ErrNotFound if no operation exists.
- OID
- 09a187…fbaa: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.
- OID
- 09a187…fbaa:16
ContractAddress details
TryRegister
func(addr .uverse.address, referral string) stringTryRegister 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.
- OID
- 09a187…fbaa:17
TryRegister details
MinTimeBetweenUpdates
int64Value
86400
keeper
typekeeper implements ReferralKeeper using BPTree storage. It includes rate limiting to prevent abuse.
Value
referral.keeper
NewKeeper
func() referral.ReferralKeeperNewKeeper creates a new ReferralKeeper instance.
- OID
- 09a187…fbaa:18
NewKeeper details
zeroAddress
.uverse.addressValue
<gnolang.StringValue>
selfAddress
.uverse.addressValue
<gnolang.StringValue>
init.23
func()- OID
- 09a187…fbaa:21
init.23 details
contractAddress
func() .uverse.address- OID
- 09a187…fbaa:23
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
- 09a187…fbaa:24
isRemovalRequest details
ReferralKeeper
typeReferralKeeper defines the interface for managing referral relationships.
Value
referral.ReferralKeeper