Skip to content
wwaterfall2027Public

About

$MELT: a NEP-141 memecoin on NEAR whose idle balances melt into a shared Freezer that pays whoever spreads MELT to new holders. Built at NEAR HACKATHON.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$MELT: the memecoin that melts

A NEP-141 token on NEAR whose idle balances melt into a shared Freezer, and the Freezer pays whoever spreads MELT to new holders. Hoarding feeds the pot; spreading the meme drains it.

Built at NEAR HACKATHON, track Memecoins With Mechanics (memecoins).

Play: https://wwaterfall2027.github.io/melt/ · Tests (16, run in your browser): https://wwaterfall2027.github.io/melt/tests/ · Contract on testnet: meltcoin.testnet

The mechanic

Rule What the contract does
Melt An idle balance keeps 99.99% per whole minute (0.01%/min, about 13.4% a day). Sending or receiving restarts the account's clock. Melt is computed lazily, so no keeper is needed.
Freezer Nothing is burned. Every melted unit moves to the Freezer, a pot held by the contract. Supply is conserved: reserve + balances + Freezer = 1,000,000,000 MELT.
Spread bonus Send at least 1 MELT to an account that holds none, and you receive 1% of the Freezer. Once per sender every 10 minutes.
Scoop Every registered account can claim 1,000 MELT once from the reserve.
Poke Anyone can call poke(account_id) to settle another account's melt into the Freezer, so idle whales cannot hide from it.

Why it is a meme with a mechanic and not a chart: the token rewards circulation and punishes sitting still. The best strategy is to keep MELT moving and to bring it to people who don't have it yet. The Freezer is a public, growing prize that anyone can see and anyone can trigger.

Try it

  1. Open the playground. The Live section shows the Freezer, the next spread bonus, total melted and registered holders, read from meltcoin.testnet.
  2. Click Create burner account. A testnet account is created through the public NEAR testnet faucet. Its key stays in your browser; testnet NEAR has no value.
  3. Click Register (0.0025 NEAR), then Scoop 1,000 MELT. Your balance appears and starts melting: the counter drops 0.01% every minute and shows the time to the next drip.
  4. Send ≥ 1 MELT to an account that holds none. Open a second browser profile to make one, or use any registered testnet account. The log shows a spread_bonus event with 1% of the Freezer.
  5. Type any registered account into Poke. Its melt moves into the Freezer and the Live numbers update.
  6. Open the tests. You see 16/16 passing. The contract is compiled in your browser and the real wasm runs in a NEAR host simulator.

The Recorded run table on the playground links every transaction of a full session on testnet: deploy, init, registrations, scoops, idle melting, a stranger's poke, a spread bonus, and an ft_transfer_call that a receiver contract half-refunds.

How it is built

contract/melt.ts       the token: NEP-141, NEP-145, NEP-148 and the MELT rules, written against
                       NEAR host functions directly (no SDK), in AssemblyScript
contract/receiver.ts   tiny ft_transfer_call receiver used by the demo (keeps half, refunds half)
src/build.js           compiles contract/melt.ts in the browser (AssemblyScript 0.27.31, pinned options)
src/sim.js             NEAR host simulator: storage, registers, deposits, promises, time, panics with
                       full state rollback; runs the real compiled bytes
src/app.js             the playground (near-api-js 4.0.4, testnet burner accounts)
tests/                 16 tests against the compiled wasm
  • No toolchain to install, and verifiable. The contract compiles inside any modern browser. The tests page prints the wasm SHA-256 (11b6150a…1b5a92, 15,496 bytes). Its base58 form, 2C8xzCGun2jdkgEqSDaqq6NioVpDdqSKqmCrshMzKmC5, is exactly the code_hash that NEAR reports for meltcoin.testnet, so anyone can check that the deployed bytes are this source.
  • Standards. NEP-141 (ft_transfer with 1 yoctoNEAR, ft_transfer_call with ft_on_transfer and ft_resolve_transfer, ft_total_supply, ft_balance_of), NEP-145 storage management (storage_deposit, storage_balance_of, storage_balance_bounds), NEP-148 metadata, and NEP-297 events (ft_mint, ft_transfer, plus melt and spread_bonus).
  • Melt math. The contract computes 0.9999^minutes in 1e9 fixed point by exponentiation by squaring and multiplies without overflow, so it never needs u128. The tests check every settlement against an independent BigInt implementation of the same math, and check a one-day melt against Math.pow to 1e-6.
  • Safety. Every failed call reverts all of its state, including partial melt settlement (tested). Arguments go through a strict JSON reader: escapes, unicode, nested values and hostile inputs are tested. Account IDs are validated. Amounts reject overflow and non-digits. Excess storage deposits are refunded exactly, including deposits above 2^64 yoctoNEAR (tested).

Tests

tests/index.html covers:

  • init (once, contract only);
  • the NEP-141, NEP-145 and NEP-148 views;
  • storage deposits and refunds;
  • the u128 refund edge;
  • scoops;
  • transfers and their events;
  • rollback on panic;
  • exact minute-by-minute melt;
  • poke settlement and whole-minute remainders;
  • spread bonus amount, dust, non-empty receivers and the cooldown;
  • ft_transfer_call promise wiring;
  • ft_resolve_transfer partial and failed refunds;
  • JSON robustness;
  • a 300-step randomized session that ends with exact supply conservation.

Limits (honest list)

  • Testnet only. The contract has not been audited.
  • Sybil resistance of the spread bonus is economic, not absolute. Each new holder must pay 0.0025 NEAR of storage, the bonus is 1% of the Freezer, and there is a 10-minute cooldown per sender. Farming with fresh accounts is possible but costs storage and time.
  • Amounts are u64 raw units (6 decimals), which covers the fixed 1,000,000,000 MELT supply. storage_withdraw and storage_unregister are not implemented, so registration is permanent.
  • The Freezer only counts settled melt. An idle account's pending melt joins it when that account is touched or poked.

Other project by the same author

As the hackathon rules require for a second submission: NEAR Thesis Lab (track Investment Thesis) is an independent project.

Built with AI assistance (Claude Code). MIT licensed.

About

$MELT: a NEP-141 memecoin on NEAR whose idle balances melt into a shared Freezer that pays whoever spreads MELT to new holders. Built at NEAR HACKATHON.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages