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

vault state

Back to all declarations

Denom

untyped string

Denom is the only asset this vault accepts.

Value

"ugnot"

MaxFeeBps

int64

MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%. Nobody can configure a higher fee; changing this requires deploying a new realm.

Value

1000

admin

.uverse.address

// may set fee, fee recipient, and successor admin

Value

<gnolang.StringValue>

feeRecipient

.uverse.address

// may withdraw the fee pot and sweep surplus

Value

<gnolang.StringValue>

feeBps

int64

// current protocol fee in basis points

Value

250

self

.uverse.address

// this realm's own address, captured at deploy

Value

<gnolang.StringValue>

Deposit

func()

Deposit credits the caller with the attached GNOT minus the current protocol fee. Only direct EOA calls (maketx call with -send) are accepted: that is the only shape where the chain guarantees the send envelope landed at this realm's address before the body runs. The envelope must be exactly one coin of denom ugnot with positive amount.

Open
OID
0cd3fb…634e:14
Deposit details

Inspect func

Claim

func(amount int64)

Claim sends amount ugnot of the caller's balance back to the caller. Fails if amount is not positive or exceeds the caller's balance.

Open
OID
0cd3fb…634e:15
Claim details

Inspect func

ClaimAll

func()

ClaimAll sends the caller's entire balance back to the caller. Fails if the caller has no balance.

Open
OID
0cd3fb…634e:16
ClaimAll details

Inspect func

WithdrawFees

func()

WithdrawFees sends the entire accrued fee pot to the fee recipient. Only the fee recipient may call it. Fails if the pot is empty.

Open
OID
0cd3fb…634e:17
WithdrawFees details

Inspect func

SweepSurplus

func()

SweepSurplus sends coins that sit at the realm address ABOVE the ledger's liabilities (ugnot force-sent outside Deposit, or any other denomination) to the fee recipient. Only the fee recipient may call it. User balances and the fee pot are untouchable by construction: only the excess over Liabilities() moves. Fails if there is no surplus.

Open
OID
0cd3fb…634e:18
SweepSurplus details

Inspect func

SweepDenom

func(denom string)

SweepDenom sends the surplus of a single denomination to the fee recipient. This is the bounded escape hatch for when SweepSurplus would exceed gas because a third party force-sent many junk denominations to the realm address: each call touches exactly one denomination, so ugnot surplus can always be recovered regardless of how many foreign denoms accumulate. For ugnot only the excess over Liabilities() moves; any other denom moves wholly. Only the fee recipient may call it.

Open
OID
0cd3fb…634e:19
SweepDenom details

Inspect func

SetFeeBps

func(bps int64)

SetFeeBps sets the protocol fee for FUTURE deposits. Admin only; bounded by \[0, MaxFeeBps].

Open
OID
0cd3fb…634e:20
SetFeeBps details

Inspect func

SetFeeRecipient

func(next .uverse.address)

SetFeeRecipient re-points who may withdraw the fee pot (including fees accrued before the change) and sweep surplus. Admin only; the zero address is rejected.

Open
OID
0cd3fb…634e:21
SetFeeRecipient details

Inspect func

TransferAdmin

func(next .uverse.address)

TransferAdmin hands the admin role to next. Admin only; the zero address is rejected. One-step: a transfer to a wrong-but-valid address permanently loses fee administration (deposits and claims keep working).

Open
OID
0cd3fb…634e:22
TransferAdmin details

Inspect func

FeeRecipient

func() .uverse.address
Open
OID
0cd3fb…634e:24
FeeRecipient details

Inspect func

FeeBps

func() int64

FeeBps returns the protocol fee applied to future deposits, in basis points of the deposit amount.

Open
OID
0cd3fb…634e:25
FeeBps details

Inspect func

FeeOn

func(amount int64) (fee int64, credited int64)

FeeOn previews the fee and credited amount for a deposit of amount at the CURRENT FeeBps.

Open
OID
0cd3fb…634e:26
FeeOn details

Inspect func

BalanceOf

func(addr .uverse.address) int64

BalanceOf returns addr's claimable balance.

Open
OID
0cd3fb…634e:27
BalanceOf details

Inspect func

UsersTotal

func() int64

UsersTotal returns the sum of all user balances.

Open
OID
0cd3fb…634e:28
UsersTotal details

Inspect func

FeesAccrued

func() int64

FeesAccrued returns the fee pot awaiting withdrawal.

Open
OID
0cd3fb…634e:29
FeesAccrued details

Inspect func

Liabilities

func() int64

Liabilities returns UsersTotal() + FeesAccrued().

Open
OID
0cd3fb…634e:30
Liabilities details

Inspect func

Held

func() int64

Held returns the ugnot actually held at the realm address.

Open
OID
0cd3fb…634e:31
Held details

Inspect func

Surplus

func() int64

Surplus returns Held() - Liabilities(): ugnot at the realm address that the ledger does not owe to anyone. Negative would indicate a conservation bug (see the invariant in the package doc).

Open
OID
0cd3fb…634e:32
Surplus details

Inspect func

Render

func(string) string

Render shows configuration, totals, and the live conservation check.

Open
OID
0cd3fb…634e:34
Render details

Inspect func

assertAdmin

func(caller .uverse.address)

assertAdmin gates admin-only entrypoints; callers resolve identity at the crossing boundary and pass the address down.

Open
OID
0cd3fb…634e:35
assertAdmin details

Inspect func

send

func(to .uverse.address, amount int64)

send moves amount ugnot from the realm to \`to\`. Callers must have debited the ledger first (checks-effects-interactions); a panic here aborts the transaction, reverting the debit with it.

Open
OID
0cd3fb…634e:36
send details

Inspect func
Denom : untyped string ="ugnot"
MaxFeeBps : int64 =1000
admin : .uverse.address =<gnolang.StringValue>
feeRecipient : .uverse.address =<gnolang.StringValue>
feeBps : int64 =250
self : .uverse.address =<gnolang.StringValue>
ledger : *feeledger.Ledger Inspect
init.7 : func() Inspect
Deposit : func() Inspect
Claim : func(amount int64) Inspect
ClaimAll : func() Inspect
WithdrawFees : func() Inspect
SweepSurplus : func() Inspect
SweepDenom : func(denom string) Inspect
SetFeeBps : func(bps int64) Inspect
SetFeeRecipient : func(next .uverse.address) Inspect
TransferAdmin : func(next .uverse.address) Inspect
Admin : func() .uverse.address Inspect
FeeRecipient : func() .uverse.address Inspect
FeeBps : func() int64 Inspect
FeeOn : func(amount int64) (fee int64, credited int64) Inspect
BalanceOf : func(addr .uverse.address) int64 Inspect
UsersTotal : func() int64 Inspect
FeesAccrued : func() int64 Inspect
Liabilities : func() int64 Inspect
Held : func() int64 Inspect
Surplus : func() int64 Inspect
Address : func() .uverse.address Inspect
Render : func(string) string Inspect
assertAdmin : func(caller .uverse.address) Inspect
send : func(to .uverse.address, amount int64) Inspect
itoa : func(n int64) string Inspect