展示HN:ETHShot – 一个以太坊测试网的“来一发”大奖游戏
嗨,HN,
我一直在尝试制作超简单的区块链游戏,并创建了 ETHShot.io,这是一个小型去中心化应用(dApp),在这里每次“射击”彩金的费用为 0.0005 测试 ETH,赢得整个奖池的概率为 1%。该应用仅在 Sepolia/Goerli 测试网络上运行,因此没有涉及真实的 ETH。
**工作原理**
- 连接一个测试网钱包(如 MetaMask、Rabby 等)。
- 每次交易(“射击”)会向合约发送 0.0005 测试 ETH。
- 每次射击都有 1% 的概率合约会将整个奖池支付给发送者。
- 未中奖的射击会将金额加入奖池,但会扣除少量维护费用。
合约代码不到 80 行 Solidity,前端使用简单的 Svelte。源代码:[https://github.com/profullstack/ethshot-web](https://github.com/profullstack/ethshot-web)。
我希望能得到以下方面的反馈:
- 可用性和引导流程(流程是否清晰?)。
- 合约设计、燃气费用节省以及你发现的任何攻击面。
- 1% 的中奖概率是否合适,或者是否应该是动态的。
**快速开始**
- 从任何 Sepolia 水龙头获取一些测试 ETH。
- 访问 [https://ethshot.io](https://ethshot.io) 并进行射击。
- 如果你赢了,会立即看到交易;如果没有,你会看到奖池增加。
- 欢迎在这里或作为 GitHub 问题提交错误报告和想法。
感谢你的关注。
— Anthony (cranberryturkey)
查看原文
Hi HN,<p>I’ve been tinkering with ultra‑simple blockchain games and built ETHShot.io, a tiny dApp where each “shot” at a jackpot costs 0.0005 test‑ETH and has a 1 % chance to win the whole pot. It’s live only on the Sepolia/Goerli testnets, so no real ETH is involved.<p>How it works<p>- Connect a testnet wallet (MetaMask, Rabby, etc.).<p>- Each transaction (“shot”) sends 0.0005 test‑ETH to the contract.<p>- On every shot there’s exactly a 1 % chance the contract pays the entire pot to the sender.<p>- Non‑winning shots add to the pot minus a small maintenance fee.
0 Contract is under 80 lines of Solidity; front‑end is plain Svelte. Source code: <a href="https://github.com/profullstack/ethshot-web">https://github.com/profullstack/ethshot-web</a>.<p>I’m looking for feedback on<p>- Usability and onboarding (is the flow obvious?).<p>- Contract design, gas savings, and any attack surface you spot.<p>- Whether the 1 % odds feel right or should be dynamic.<p>Quick start<p>- Grab a little test‑ETH from any Sepolia faucet.<p>- Visit <a href="https://ethshot.io" rel="nofollow">https://ethshot.io</a> and take a shot.<p>- If you win, you’ll see the transaction immediately; if not, you’ll see the pot grow.<p>- Bug reports and ideas welcome here or as GitHub issues.<p>Thanks for taking a look.<p>— Anthony (cranberryturkey)