Denom
untyped stringDenom is the only coin this drop pays in.
Value
"ugnot"
leafPrefix
untyped stringleafPrefix is part of every leaf preimage, so a proof for one drop cannot be replayed against another realm that happens to use the same encoding.
Value
"gno.land/r/moul/x/daily/merkledrop/v1"
Owner
.uverse.addressOwner may set the drop and sweep it. Hardcoded rather than derived from the deployer at init: inside a plain \`func Test(t \*testing.T)\` the gno test runner reports OriginCaller() as the EMPTY address, so an owner taken from it is the empty address in every test and whatever deployed on chain. That divergence is exactly where an authorization bug hides, so the address is written down instead.
Value
<gnolang.StringValue>
Ownable
*v0.Ownable- OID
- 078042…0b8c:73
Ownable details
root
[]uint8// the committed allocation root; nil means no drop
- OID
- 078042…0b8c:75
root details
total
int// leaf count the root commits to
Value
4
closesAt
int64// chain height after which claims are refused; 0 = never
Value
0
claimed
v0.Tree// padded index -> claimer address string
- OID
- 078042…0b8c:76
claimed details
paid
int64// running total of ugnot sent
Value
0
demo
[]v1.Allocation- OID
- 078042…0b8c:59
demo details
Allocation
typeAllocation is one entry of a drop: who may claim, and how much.
Value
v1.Allocation
ErrNoDrop
*errors.errorString- OID
- 078042…0b8c:12
ErrNoDrop details
ErrClosed
*errors.errorString- OID
- 078042…0b8c:15
ErrClosed details
ErrClaimed
*errors.errorString- OID
- 078042…0b8c:18
ErrClaimed details
ErrBadProof
*errors.errorString- OID
- 078042…0b8c:21
ErrBadProof details
ErrUnfunded
*errors.errorString- OID
- 078042…0b8c:24
ErrUnfunded details
ErrStillOpen
*errors.errorString- OID
- 078042…0b8c:27
ErrStillOpen details
ErrBadRoot
*errors.errorString- OID
- 078042…0b8c:30
ErrBadRoot details
ErrBadTotal
*errors.errorString- OID
- 078042…0b8c:33
ErrBadTotal details
ErrBadAmount
*errors.errorString- OID
- 078042…0b8c:36
ErrBadAmount details
init.20
func()- OID
- 078042…0b8c:38
init.20 details
Leaf
func(index int, addr .uverse.address, amount int64) stringLeaf returns the exact preimage committed for one allocation. Reproduce it off chain to rebuild the tree; it is the whole interface between the drop and its generator. leaf = "<pkgpath>|<index>|<address>|<amount>"
- OID
- 078042…0b8c:40
Leaf details
SetDrop
func(rootHex string, totalLeaves int, closesAtHeight int64)SetDrop commits a new allocation root. Owner only. totalLeaves is the number of allocations the root commits to; the verifier needs it to rebuild the tree shape, so a wrong value invalidates every proof rather than weakening any. closesAtHeight is the last height at which a claim is accepted, or 0 for a drop that never closes. Setting a new root abandons the previous claim ledger: a drop is a commitment, and replacing it starts a new one.
- OID
- 078042…0b8c:41
SetDrop details
Claim
func(index int, amount int64, proof string)Claim proves the caller is allocated amount at index and pays it out. proof is the comma-separated hex sibling list from the tree generator, leaf first. It panics on a closed drop, a double claim, a bad proof, or a drop that cannot cover the amount; nothing is marked claimed in any of those cases.
- OID
- 078042…0b8c:42
Claim details
Sweep
func()Sweep returns whatever is left to the owner, once the drop has closed. Owner only. A drop with no closing height can never be swept, which is the point of setting one.
- OID
- 078042…0b8c:43
Sweep details
Address
func() .uverse.address- OID
- 078042…0b8c:44
Address details
Balance
func() int64Balance returns the ugnot the drop still holds.
- OID
- 078042…0b8c:45
Balance details
Root
func() stringRoot returns the committed root, hex-encoded, or "" when no drop is set.
- OID
- 078042…0b8c:46
Root details
Total
func() intTotal returns the number of allocations the root commits to.
- OID
- 078042…0b8c:47
Total details
ClosesAt
func() int64ClosesAt returns the last height a claim is accepted, or 0 for never.
- OID
- 078042…0b8c:48
ClosesAt details
IsClosed
func() boolIsClosed reports whether the drop is past its closing height.
- OID
- 078042…0b8c:49
IsClosed details
Paid
func() int64Paid returns the ugnot claimed so far.
- OID
- 078042…0b8c:50
Paid details
Claims
func() intClaims returns the number of allocations claimed.
- OID
- 078042…0b8c:51
Claims details
HasClaimed
func(index int) boolHasClaimed reports whether the allocation at index was claimed.
- OID
- 078042…0b8c:52
HasClaimed details
ClaimedBy
func(index int) .uverse.address- OID
- 078042…0b8c:53
ClaimedBy details
Verify
func(index int, addr .uverse.address, amount int64, proof string) boolVerify checks an allocation against the committed root without claiming it, so a recipient can confirm a proof before spending gas on Claim.
- OID
- 078042…0b8c:54
Verify details
parseRoot
func(s string) ([]uint8, .uverse.error)- OID
- 078042…0b8c:55
parseRoot details
hexOf
func(b []uint8) string- OID
- 078042…0b8c:56
hexOf details
indexKey
func(i int) stringindexKey pads the index so avl iteration is numeric, not lexicographic. ufmt has no width flags, so the padding is by hand: unpadded keys sort "0","1","10","11","2" and Render would lose the order past nine entries.
- OID
- 078042…0b8c:57
indexKey details
demoAllocations
[]v1.AllocationdemoAllocations is the example drop seeded at deploy, so the realm renders working proofs instead of an empty page. A real drop calls SetDrop with a root computed off chain and stores no allocations at all.
- OID
- 078042…0b8c:59
demoAllocations details
seed
func()seed installs the example drop. Also called by the example tests: realm globals persist for a whole test binary and examples run after every Test, so a pinned Render must start from a known state.
- OID
- 078042…0b8c:64
seed details
demoTree
func() *v0.Tree- OID
- 078042…0b8c:66
demoTree details
DemoProof
func(index int) stringDemoProof returns the proof for one seeded allocation, so the drop can be exercised end to end without an off-chain generator. It is empty once a real drop replaces the seeded one.
- OID
- 078042…0b8c:67
DemoProof details
Render
func(path string) stringRender serves the drop overview at "" and one allocation at "proof/\<index>".
- OID
- 078042…0b8c:68
Render details
renderIndex
func() string- OID
- 078042…0b8c:69
renderIndex details
renderProof
func(raw string) string- OID
- 078042…0b8c:70
renderProof details
closesLabel
func() string- OID
- 078042…0b8c:71
closesLabel details
yesNo
func(b bool) string- OID
- 078042…0b8c:72