Skip to content

Latest commit

ย 

History

History
88 lines (65 loc) ยท 1.91 KB

File metadata and controls

88 lines (65 loc) ยท 1.91 KB

๐Ÿ’ผ Beat Powell

Onchain game where you can "hit" Jerome Powell to lower the Fed interest rate!

๐ŸŽฎ Game Mechanics

  • Each hit lowers the rate by 0.01%
  • Powell recovers +0.05% every hour (he fights back!)
  • 1 hour cooldown between hits per wallet
  • Current Fed Rate: 3.75%

๐Ÿš€ Setup

1. Install dependencies

npm install

2. Deploy Smart Contract

Go to your Hardhat project folder and deploy:

npx hardhat compile
npx hardhat run scripts/deploy.js --network base

3. Configure App Environment

Create .env.local in the project root:

VITE_CONTRACT_ADDRESS=YOUR_DEPLOYED_CONTRACT_ADDRESS
VITE_PAYMASTER_URL=YOUR_PAYMASTER_URL
VITE_PUBLIC_ONCHAINKIT_API_KEY=YOUR_ONCHAINKIT_API_KEY
VITE_APP_URL=https://rate-slayer.vercel.app
  • If VITE_PAYMASTER_URL is empty, transactions are sent without sponsorship.
  • If it is set and supported by wallet capabilities, gas is sponsored.
  • VITE_PUBLIC_ONCHAINKIT_API_KEY enables MiniKit context and compose-cast sharing.
  • VITE_APP_URL is used in share links and wallet branding metadata.

4. Get Paymaster URL (optional, for gasless transactions)

  1. Go to https://portal.cdp.coinbase.com/
  2. Create a new project
  3. Copy Paymaster URL for Base mainnet
  4. Paste it into .env.local as VITE_PAYMASTER_URL

5. Run locally

npm run dev

6. Build for production

npm run build

๐Ÿ“ Smart Contract

// Current rate: 3.75%
// Decrease per press: 0.01%
// Increase per hour: 0.05%
// Cooldown: 1 hour

๐Ÿ”— Tech Stack

  • React + Vite
  • Wagmi v2 + Viem
  • Base Account (Smart Wallet)
  • Farcaster Mini App support
  • Solidity (Hardhat)

๐ŸŽฏ Features

  • โœ… Base Account integration
  • โœ… Gasless transactions (via Paymaster)
  • โœ… Real-time rate updates
  • โœ… Cooldown timer
  • โœ… Rate recovery mechanic
  • โœ… Works in Base App / Farcaster

The printer goes BRRR ๐Ÿ–จ๏ธ๐Ÿ’ธ