1package referral23const zeroAddress = address("")45// selfAddress is cached at package initialization to ensure consistent comparison.6var selfAddress address78func init(cur realm) {9 selfAddress = cur.Address()10}1112// contractAddress returns the address of the referral contract.13// This is used as a sentinel value for removing referrals.14func contractAddress() address {15 return selfAddress16}1718// isRemovalRequest checks if the given address indicates a removal request.19// Removal is indicated by passing the contract's own address as the referral.20func isRemovalRequest(refAddr address) bool {21 return refAddr == selfAddress22}2324// ReferralKeeper defines the interface for managing referral relationships.25type ReferralKeeper interface {26 // register creates or updates a referral relationship between addresses.27 // Setting refAddr to the contract's own address removes the referral.28 register(addr, refAddr address) (address, error)2930 // has returns true if a referral exists for the given address.31 has(addr address) bool3233 // get retrieves the referral address for a given address.34 get(addr address) (address, error)3536 // isEmpty returns true if no referrals exist in the system.37 isEmpty() bool3839 // getLastOpTimestamp returns the last operation timestamp for an address.40 getLastOpTimestamp(addr address) (int64, error)41}42ContractAddress() string
GetLastOpTimestamp(addr string) (int64, interface {Error func() string})
GetReferral(addr string) string
HasReferral(addr string) bool
IsEmpty() bool
NewKeeper() interface {get func(.uverse.address) (.uverse.address, .uverse.error); getLastOpTimestamp func(.uverse.address) (int64, .uverse.error); has func(.uverse.address) bool; isEmpty func() bool; register func(.uverse.address, .uverse.address) (.uverse.address, .uverse.error)}
Render(path string) string
TryRegister(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, addr string, referral string) string
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.