01 · 6 min read
Quickstart
Gift links that grow. A Scaffold-HBAR template for sending tokens to someone who has no wallet, no HBAR and no Hedera account. The tokens earn yield in SaucerSwap until they are claimed, and the recipient taps once to receive them.
About five minutes from nothing to a gift claimed into a brand-new account. Everything below was run end to end on Hedera testnet before it was written down.
01Scaffold it#
npm create scaffold-hbar@latest -- --template shane2512/YieldLinks-- is not optional. Without it npm consumes --template and you land in the stock template picker.You get one repository with two Yarn workspaces:
| Workspace | What is in it |
|---|---|
packages/foundry | YieldLinks, the yield sources, 54 tests (unit, fuzz, stateful invariants), deploy and demo scripts |
packages/nextjs | The send page, the wallet-free claim page, your links, the relayer routes and these docs |
Prerequisites: Node.js 20.18.3 or later, Yarn, and Foundry (forge, cast). Fund a testnet account from the Hedera Portal faucet.
cd <your-project>
yarn install02Configure the relayer#
The relayer is a Next.js route that submits claims so recipients need no HBAR. It needs a key, and that key stays on the server.
cp packages/nextjs/.env.example packages/nextjs/.env.local# Server-only. A dedicated, lightly funded testnet account that pays claim fees.
RELAYER_PRIVATE_KEY=0x...NEXT_PUBLIC_. Use a throwaway account: the key has no authority over escrowed funds, but whoever holds it can spend its HBAR.03Run the app#
yarn next:dev # http://localhost:3000The frontend already points at the live testnet deployment, so it works immediately. To deploy your own contracts, see Architecture and run yarn foundry:deploy.
04Get test SAUCE#
The app sends SAUCE, so the sending wallet needs some.
The easiest way is the SaucerSwap testnet app: connect a wallet such as HashPack, make sure it is on Testnet, and swap HBAR for SAUCE. If it asks to associate SAUCE with your account, approve it.
From a terminal instead, with a funded testnet key:
ME=<your 0x address>; KEY=<your private key>; RPC=https://testnet.hashio.io/api
SAUCE=0x0000000000000000000000000000000000120f46
WHBAR=0x0000000000000000000000000000000000003aD2
ROUTER=0x0000000000000000000000000000000000004b40 # SaucerSwap V1 router, 0.0.19264
# associate the token with your account, then swap 20 HBAR for SAUCE
cast send 0x0000000000000000000000000000000000000167 "associateToken(address,address)" $ME $SAUCE \
--private-key $KEY --rpc-url $RPC --legacy --gas-limit 1000000
cast send $ROUTER "swapExactETHForTokens(uint256,address[],address,uint256)" 1 "[$WHBAR,$SAUCE]" $ME \
$(( $(date +%s) + 600 )) --value 20ether --private-key $KEY --rpc-url $RPC --legacy --gas-limit 15000000x…3aD2) in swap paths. The WHBAR helper at 0x…3aD1 reverts in getAmountsOut.05Send a gift#
- Connect a wallet on the home page.
- Enter an amount, pick an expiry (1, 7 or 30 days) and who keeps the yield.
- Click Create gift link. Your wallet signs two transactions: an approval of the source for the amount plus a 0.00001 SAUCE rounding reserve, then
createLinkwith the 1.5 HBAR prepaid network fee attached. - Copy the link or show its QR code.
The SAUCE is now staked in SaucerSwap and the link is worth slightly more every block. Your open links are listed under My links, where you can cancel them.
06Claim it with no wallet#
Open the link in a private window or on a phone. The claim page shows no wallet button and no network chrome, only the gift, growing.
- Choose New wallet, My wallet or Address. A new wallet is a real ED25519 Hedera account, generated in the browser.
- Save the private key it shows, then tick the box.
- Tap Claim gift. The relayer creates the account, submits the claim, and the gift arrives.
The success screen shows the account ID and the key in the 96-character DER form HashPack imports. Choose Testnet on HashPack's import screen and the gift is there.
07Prove it on testnet#
One command runs the whole flow against testnet and prints HashScan links:
yarn foundry:demoIt needs DEPLOYER_PRIVATE_KEY in packages/foundry/.env and at least 4 SAUCE in that account. It creates a link, claims it to an address Hedera has never seen, then creates and cancels a second one. The run behind the README, on 3 October 2026:
| Step | Transaction |
|---|---|
| createLink: 2 SAUCE staked, 1.5 HBAR fee prepaid | 0x11cf2f7c… |
| claim to a never-seen address: 2.000009 SAUCE received | 0xfda1fe45… |
| Account created by that claim | 0.0.10830206 |
| Cancel a second link: SAUCE and fee return | 0xa69f39d6… |
Command reference#
| Command | What it does |
|---|---|
yarn next:dev | Run the frontend on http://localhost:3000 |
yarn next:build | Production build |
yarn next:test | 41 Vitest tests: claim URLs, EIP-712 signing, ED25519 wallets |
yarn next:lint | ESLint with zero warnings allowed |
yarn foundry:test | 54 contract tests, including fuzz and stateful invariants |
yarn foundry:fork | Anvil forking testnet (chain id 296) with the SaucerSwap source |
yarn foundry:chain | Plain Anvil with IdleSource (no yield) |
yarn foundry:deploy --network hedera_testnet | Deploy your own contracts |
yarn foundry:demo | Live testnet proof: create, claim to a new address, cancel |
If forge reports "No tests found" right after a successful build, run forge clean and build again.