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

merkledrop state

Back to all declarations

merkleRoot

untyped string

merkleRoot commits to the airdrop allocation set. Generated off-chain with the exact scheme above over the four example recipients in README.md.

Value

"0d00b73577019dc92924f0ae001d3e1839d51fb358adda2ad1510c39eb82b13f"

claimed

v0.Tree

claimed maps claimer address string -> claimed amount (uint64).

Open
OID
0f7653…197c:4
claimed details

Inspect ref

totalClaimed

uint64

totalClaimed is the running sum of all claimed allocations.

Value

0

leaf

func(claimer .uverse.address, amount uint64) []uint8

leaf computes the tree leaf for an (address, amount) allocation.

Open
OID
0f7653…197c:6
leaf details

Inspect func

hashPair

func(a []uint8, b []uint8) []uint8

hashPair hashes two nodes in sorted order (commutative), so the proof does not need to encode child positions.

Open
OID
0f7653…197c:8
hashPair details

Inspect func

parseProof

func(proof string) [][]uint8

parseProof splits a comma-separated list of hex hashes into raw 32-byte nodes, panicking on any malformed element.

Open
OID
0f7653…197c:9
parseProof details

Inspect func

computeRoot

func(leafHash []uint8, proof [][]uint8) string

computeRoot walks the proof from the given leaf up to a candidate root and returns its hex encoding.

Open
OID
0f7653…197c:10
computeRoot details

Inspect func

Verify

func(claimer .uverse.address, amount uint64, proof string) bool

Verify reports whether (claimer, amount, proof) resolves to merkleRoot. Pure and read-only — safe to call from tests and Render.

Open
OID
0f7653…197c:11
Verify details

Inspect func

AmountClaimed

func(claimer .uverse.address) uint64

AmountClaimed returns how much the address has already claimed (0 if none).

Open
OID
0f7653…197c:12
AmountClaimed details

Inspect func

HasClaimed

func(claimer .uverse.address) bool

HasClaimed reports whether the address already claimed.

Open
OID
0f7653…197c:13
HasClaimed details

Inspect func

Claim

func(amount uint64, proof string)

Claim proves the caller is entitled to \`amount\` via \`proof\` (comma-separated hex sibling hashes) and marks the allocation claimed. Panics on a bad proof or a double claim. Mirrors MerkleDistributor.claim (msg.sender is the caller).

Open
OID
0f7653…197c:14
Claim details

Inspect func

Render

func(path string) string

Render shows the committed root, aggregate stats, and the list of claimers.

Open
OID
0f7653…197c:15
Render details

Inspect func
merkleRoot : untyped string ="0d00b73577019dc92924f0ae001d3e1839d51fb358adda2ad1510c39eb82b13f"
claimed : v0.Tree Inspect
totalClaimed : uint64 =0
leaf : func(claimer .uverse.address, amount uint64) []uint8 Inspect
hashPair : func(a []uint8, b []uint8) []uint8 Inspect
parseProof : func(proof string) [][]uint8 Inspect
computeRoot : func(leafHash []uint8, proof [][]uint8) string Inspect
Verify : func(claimer .uverse.address, amount uint64, proof string) bool Inspect
AmountClaimed : func(claimer .uverse.address) uint64 Inspect
HasClaimed : func(claimer .uverse.address) bool Inspect
Claim : func(amount uint64, proof string) Inspect
Render : func(path string) string Inspect