PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/moul/x/daily/merkledrop/v1

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v1
Namespace
moul / x / daily / merkledrop
Files
6 (README)(gnomod.toml)
Exported functions
17
Module
gno.land/r/moul/x/daily/merkledrop/v1
gno
0.9

Files (6)

  • README.mdmarkdown
  • gnomod.tomltoml
  • merkledrop.gnogno
  • render.gnogno
  • merkledrop_test.gnogno
  • render_example_test.gnogno

Select a file to view its exact on-chain source. Sorted README → gnomod → sources → tests.

Functions

  • Address() string

  • Balance() int64

  • Claim(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}, index int, amount int64, proof string)

  • ClaimedBy(index int) string

  • Claims() int

  • ClosesAt() int64

  • DemoProof(index int) string

  • HasClaimed(index int) bool

  • IsClosed() bool

  • Leaf(index int, addr string, amount int64) string

  • Paid() int64

  • Render(path string) string

  • Root() string

  • SetDrop(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}, rootHex string, totalLeaves int, closesAtHeight int64)

  • Sweep(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})

  • Total() int

  • Verify(index int, addr string, amount int64, proof string) bool

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗
# MerkleDrop v1

A Merkle root gates an airdrop that pays real ugnot. Successor to
[v0](/r/moul/x/daily/merkledrop/v0), which moved no coins and whose proof scheme was
safe only by accident of encoding lengths.

## Drop

| Field | Value |
|---|---|
| Root | `6964baa99da23b9d8c76774c6f1122b250040e29c1d75823dda15c043dc65755` |
| Allocations | 4 |
| Closes at height | never |
| Claimed | 0 |
| Paid out | 0 ugnot |
| Funding address | `g1jvh5ukk07dvd57fxefcp5aa29xaydxmxs7myyp` |

## How it differs from v0

1. **Domain separated leaves.** v0 hashed leaves bare and combined nodes
   commutatively, so an inner-node hash was also a valid leaf hash. It was not
   exploitable, but only because a v0 leaf preimage tops out at 61 bytes while an
   inner preimage is always 64. v1 tags leaves `0x00` and inner nodes `0x01`.
2. **Proofs bound to a position.** v0 folded a sibling list of any length. v1
   carries index and total, rebuilds the tree shape, and caps the depth.
3. **A settable root and a closing height.** v0's root was a `const`.
4. **Real coins.** v0 kept a `uint64` ledger and moved nothing.

## Leaf encoding

Reproduce this off chain to rebuild the tree:

```
leaf = "gno.land/r/moul/x/daily/merkledrop/v1|<index>|<address>|<amount>"
tree = Tendermint simple tree, leaf 0x00, inner 0x01
```

## Example allocations

Seeded at deploy so the drop can be exercised without a generator. A live drop
commits only a root and stores none of this.

| # | Address | Amount | Claimed |
|---|---|---|---|
| [0](/r/moul/x/daily/merkledrop/v1:proof/0) | `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` | 100 | no |
| [1](/r/moul/x/daily/merkledrop/v1:proof/1) | `g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj` | 250 | no |
| [2](/r/moul/x/daily/merkledrop/v1:proof/2) | `g1manfred47kzduec920z88wfr64ylksmdcedlf5` | 500 | no |
| [3](/r/moul/x/daily/merkledrop/v1:proof/3) | `g1sss9uxef4l6lwc0mxq8n5v0e4vqpml7c39cxq2` | 750 | no |

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.