Show HN: ETHShot – 以太坊测试网“一发入魂”大奖游戏

2作者: cranberryturkey5 个月前
Hi 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)。 我正在寻求关于以下方面的反馈: * 可用性和入门(流程是否明显?)。 * 合约设计、gas 节省以及您发现的任何攻击面。 * 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&#x2F;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:&#x2F;&#x2F;github.com&#x2F;profullstack&#x2F;ethshot-web">https:&#x2F;&#x2F;github.com&#x2F;profullstack&#x2F;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:&#x2F;&#x2F;ethshot.io" rel="nofollow">https:&#x2F;&#x2F;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)