Created comprehensive guides for deploying smart contracts: DEPLOY_CONTRACTS.md: - Two deployment options: Hardhat (Node.js) or Remix IDE - Step-by-step instructions for BSC Testnet deployment - Verification procedures - Troubleshooting section - Gas estimates TEST_CONTRACTS.md: - How to test StakingUI locally without deployed contracts - Example addresses for UI testing - Current project status checklist - What's working vs what needs deployment Note: Actual deployment requires user's wallet with testnet BNB - Hardhat 3.x requires ES modules (conflicts with Bun setup) - Recommended: Use Remix IDE for deployment (easiest) - Deployment takes ~30-60 minutes first time - Estimated cost: ~0.035 tBNB (~free from faucet) StakingUI is fully integrated and ready to use once contracts are deployed.
3.7 KiB
3.7 KiB
๐งช Testing Staking UI Without Deployed Contracts
How to test the StakingUI locally before deploying to testnet
๐ฏ Quick Test Setup
You can test the StakingUI interface using example addresses. The UI will load and show the interface, but transactions won't work until you deploy real contracts.
Step 1: Add Test Contract Addresses
Edit apps/frontend/.env.local:
# Example testnet addresses (for UI testing only - not real deployed contracts!)
NEXT_PUBLIC_IMMBOT_TOKEN_TESTNET=0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82
NEXT_PUBLIC_STAKING_TESTNET=0x10ED43C718714eb63d5aA57B6Da2929C30bC095c
# BSC Testnet example (CAKE token address)
# These are real contracts on testnet, but not YOUR contracts
Step 2: Start Frontend
cd apps/frontend
npm run dev
Step 3: Test UI
- Open http://localhost:3000
- Go to Staking tab
- Connect wallet (switch to BSC Testnet - Chain ID 97)
- You should see:
- โ No "Contracts Not Deployed" warning
- โ Staking tiers displayed
- โ Your balance (if you have the test token)
- โ Staking won't work (these aren't your contracts)
๐ To Actually Deploy and Use Staking:
Follow DEPLOY_CONTRACTS.md guide:
Quick Version:
-
Get testnet BNB:
- https://testnet.bnbchain.org/faucet-smart
- Request 0.1 tBNB
-
Deploy with Remix (easiest):
- Go to https://remix.ethereum.org
- Copy
contracts/IMMBotToken.sol - Compile with Solidity 0.8.20
- Deploy to BSC Testnet (MetaMask)
- Copy deployed address
-
Deploy Staking:
- Copy
contracts/Staking.solto Remix - Deploy with token address
- Copy staking address
- Copy
-
Update .env.local:
NEXT_PUBLIC_IMMBOT_TOKEN_TESTNET=0xYOUR_TOKEN_ADDRESS NEXT_PUBLIC_STAKING_TESTNET=0xYOUR_STAKING_ADDRESS -
Restart frontend and test!
๐ Current Status
โ Staking UI is fully coded and integrated:
- Approve workflow
- Stake transaction
- Active stakes display
- Unstake functionality
- Reward calculations
โ Contracts need to be deployed by you:
- Requires your wallet with testnet BNB
- Takes ~30 minutes first time
- Follow DEPLOY_CONTRACTS.md
๐ What's Working Now?
Frontend Features (Ready to Use):
- Wallet Connection: โ Wagmi + RainbowKit
- Dashboard: โ Bot control, status display
- Trading Stats: โ Live data from backend API
- Memories: โ Greenfield storage integration
- Token Discovery: โ DexScreener trending tokens
- Staking UI: โ Fully coded, needs deployed contracts
Backend Features (Fully Functional):
- API Server: โ All 8 endpoints working
- AI Trading: โ OpenRouter integration
- Trade Execution: โ PancakeSwap integration
- Memory Storage: โ BNB Greenfield
- Telegram Alerts: โ Ready to configure
Smart Contracts (Ready to Deploy):
- IMMBotToken: โ Written, tested, ready
- Staking: โ Written, tested, ready
- Deployment Scripts: โ Complete
- ABIs: โ Generated and exported
๐ง Testing Checklist
Without Deployed Contracts (UI only):
- See staking interface
- View staking tiers
- See "Contract Not Deployed" warning (if no addresses)
- Connect wallet
- Switch networks
With Deployed Contracts (Full functionality):
- Deploy token contract
- Deploy staking contract
- Update .env.local with addresses
- Restart frontend
- Approve token spending (MetaMask popup)
- Stake tokens (MetaMask popup)
- See active stakes
- Calculate rewards
- Unstake and claim rewards
Next Step: Follow DEPLOY_CONTRACTS.md to deploy your own contracts!
Time Required: 30-60 minutes (one-time setup)