Skip to content

lordbasilaiassistant-sudo/onchain-primitives-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onchain Primitives Lab — 7 immutable primitives on Base

Seven small, focused, single-purpose contracts on Base mainnet. Each one is permissionless, immutable, and routes a small fee to the protocol treasury on every fee-bearing call. 220 tests passing across the suite.

Live on Base mainnet (chainId 8453)

Contract What it is Address
StealthAddressRegistry EIP-5564 stealth meta-address registry 0xD227B45aF37591E6227EB30B757232c1D541c016
SlashablePromiseVault commit ETH, slash to nemesis if you fail 0xe2b5AfF3e1e05f999BbF48EDD27C4c872b953268
ConditionalTokenDrop time-gated permissionless airdrop pull 0x8Fb1224e814fcfE4dcd952a6d3DFF722d86862Ae
TimeCapsule post a sealed-but-readable message at T 0x52E5829b8C71A8F4878B5569Df4255dfeB909a0C
AddressTaggingMarket stake-weighted attestation market on addresses 0x0288DfE67bE8876D92c0EA41c190b506cd99eD63
GroupBountyPool n-of-m signers release a shared bounty 0xaB4C7B22B952f99cC8Bf280D17230E8CaDd6CbD4
AtomicSwapHTLC hash-time-locked atomic swap 0xc3D0CBC815DE1938D4714bf2603b33400f588433

All 7 verified on Basescan. Treasury 0x7a3E312Ec6e20a9F62fE2405938EB9060312E334. Total mainnet deploy spend: 0.000204 ETH. Total tests: 220 passing, 0 failing.

Engineering highlights

  • promise-builder (35 tests): ETH-conservation fuzz, malicious-nemesis test, forbids self-slash escape hatches.
  • tagging-builder (41 tests): tied-stake-attester-wins (incumbent bias prevents grief), support-extends-deadline (stops last-second bombs).
  • capsule-builder: deliberately added peekCiphertext() view so the "bytes are public" warning is concrete.
  • drop-builder: flat ETH setup fee instead of % on token total — avoids fee-on-transfer / rebasing edge cases.
  • swap-builder: claim/refund windows are strictly disjoint — no race conditions.

Per-contract notes

Each contract has its own *.README.md next to its source in src/. Honest builder demand reads are in LAB_REPORT.md.

Build / test

forge install
forge build
forge test -vv

Part of the THRYX onchain surface

Companion deployments:

Project home: https://thryx.fun

Use these contracts

Every address above is clickable straight into Basescan. To call from your own code:

// example: write a stealth meta-address
IStealthAddressRegistry(0xD227B45aF37591E6227EB30B757232c1D541c016).register(meta);

ABIs ship in out/<Contract>.sol/<Contract>.json after forge build. Treasury sink: 0x7a3E312Ec6e20a9F62fE2405938EB9060312E334. Project home with the full THRYX onchain inventory: https://thryx.fun

Built on

  • Base — the Ethereum L2 this is deployed on (open-source, OP Stack).
  • Foundry — Solidity toolchain for build, test, and deploy.
  • Basescan — block explorer used for verification.
  • EIP-5564 — stealth address standard implemented by StealthAddressRegistry.
  • Claude Code by Anthropic — primary engineering assistant for the THRYX surface.

Support this work

If any of these primitives are useful to you, the easiest way to fund continued maintenance is direct on-chain:

The repo's Sponsor button (top of page) wires to the same address via .github/FUNDING.yml.

License

MIT.

About

7 immutable on-chain primitives on Base mainnet: stealth addresses, slashable promises, conditional drops, time capsule, address tagging, group bounties, atomic swaps. 220 tests passing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors