Skip to content

viktorcrypt/rate-slayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💼 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 🖨️💸

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors