PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

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/v0

Realm
Open in gnoweb ↗

Overview

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

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • merkledrop.gnogno
README.mdPreviewRaw
# merkledrop

> ⚠️ **Experimental — generated with no human supervision** by the daily MCP pipeline (Solidity→Gno port). Not audited. See [r/moul/x/daily](https://github.com/moul/gno-contracts/blob/main/r/moul/x/daily/README.md).

---


A gno.land port of the classic Solidity **MerkleDistributor** airdrop (Uniswap /
OpenZeppelin `MerkleProof`). A fixed `merkleRoot` commits to a set of
`(address, amount)` allocations; a recipient claims by supplying the sibling
hashes on the path from their leaf to the root. Each address may claim exactly
once (tracked in an `avl.Tree`, so `Render` can list claimers deterministically).

Hashing uses `crypto/sha256` from the gno stdlib (confirmed importable on
gno 0.9 / sapphire), so the tree is trivially reproducible off-chain. Internal
nodes hash their two children in sorted order (OpenZeppelin's commutative
scheme), meaning proofs need no left/right flags:

```
leaf = sha256(addr.String() + "|" + amount)
node = sha256(min(a,b) || max(a,b))
```

Amounts are pure `uint64` accounting — gno has no `msg.value`, so this models
the allocation ledger only, not a real coin transfer.

## Allocation set (committed by the root)

| Address | Amount |
|---|---|
| g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 | 100 |
| g1sss9uxef4l6lwc0mxq8n5v0e4vqpml7c39cxq2 | 250 |
| g1manfred47kzduec920z88wfr64ylksmdcedar8 | 500 |
| g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj | 750 |

Root: `0d00b73577019dc92924f0ae001d3e1839d51fb358adda2ad1510c39eb82b13f`

## Example calls

Claim from `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` (its proof is the sibling
leaf then the right subtree root):

```
Claim(100, "dd57b89301cc6f1aa5593eb0881cefefcf2ef85ce7629dab61ad0528c301bce9,7c1352bec23bc53d2b573373623cff31174a738de9a257906866c9b598d01253")
```

Read-only checks:

```
Verify("g1manfred47kzduec920z88wfr64ylksmdcedar8", 500, "<proof>")  // -> true
HasClaimed("g1manfred47kzduec920z88wfr64ylksmdcedar8")              // -> false until claimed
```

A wrong amount, wrong caller, or bad proof panics `invalid proof`; a second
claim from the same address panics `already claimed`.

<!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) -->

---

Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

**Dependency graph:**

![gno.land/r/moul/x/daily/merkledrop/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/merkledrop/v0/deps.png)

> 🧪 **Highly experimental — potentially vibe-coded.** Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).

<!-- END GNOCONTRACTS FOOTER -->

Functions

  • AmountClaimed(claimer string) uint64

  • 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}, amount uint64, proof string)

  • HasClaimed(claimer string) bool

  • Render(path string) string

  • Verify(claimer string, amount uint64, proof string) bool

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

Rendered

RenderedRawgnoweb ↗

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.