A web3 dashboard that displays high scores from multiple smart contracts on the Polygon Amoy testnet. The dashboard fetches minting events from configured contracts and displays them as scores in an elegant horizontal bar chart format.
This project monitors multiple smart contracts for minting events and treats each minting event as a score value. It aggregates these scores across all configured contracts and displays the highest scores in a real-time leaderboard format.
- Multi-Contract Monitoring: Track scores from multiple smart contracts simultaneously
- Real-Time Updates: Automatic refresh of scores from the blockchain
- Horizontal Bar Visualization: Clean, responsive bar chart display
- Polygon Amoy Integration: Built specifically for Polygon's testnet
- Error Handling: Robust error handling for network issues
- Mobile Responsive: Works seamlessly on desktop and mobile devices
- A modern web browser with JavaScript enabled
- Internet connection to access Polygon Amoy testnet
-
Fork or Clone the Repository
git clone <your-repo-url> cd MultiContract-Highscore
-
Configure Contract Addresses
Edit the
config.jsonfile to include your contract addresses:{ "contracts": [ "0x1234567890123456789012345678901234567890", "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd", "0x9876543210987654321098765432109876543210" ] } -
Serve the Files
Since this is a client-side application that makes blockchain calls, you need to serve it through a web server:
Option A: Using Python (if installed)
# Python 3 python -m http.server 8000 # Python 2 python -m SimpleHTTPServer 8000
Option B: Using Node.js (if installed)
npx serve .Option C: Using any local web server
- Use VS Code Live Server extension
- Use any other local development server
-
Open in Browser
Navigate to
http://localhost:8000(or your server's URL) in your web browser.
The config.json file contains an array of contract addresses to monitor:
{
"contracts": [
"0x1234567890123456789012345678901234567890",
"0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
]
}To add new contracts:
- Open
config.json - Add the contract address to the
contractsarray - Save the file
- Refresh the dashboard
The dashboard automatically detects standard minting events from your contracts. It looks for:
- Transfer events from zero address (0x0000...)
- Standard ERC-721/ERC-1155 minting patterns
- Event values are interpreted as scores
- Frontend: Pure HTML5, CSS3, and JavaScript (ES6+)
- Web3 Library: Web3.js for blockchain interaction
- Network: Polygon Amoy Testnet (Chain ID: 80002)
- RPC Endpoint:
https://rpc-amoy.polygon.technology/
- Configuration Loading: Reads contract addresses from
config.json - Web3 Connection: Connects to Polygon Amoy testnet
- Event Fetching: Queries minting events from each contract
- Score Processing: Extracts score values from event data
- Visualization: Displays scores in horizontal bar format
- Auto-Refresh: Periodically updates scores
The dashboard processes minting events by:
- Filtering for Transfer events from zero address
- Extracting token IDs or values as scores
- Aggregating scores across all contracts
- Sorting by highest values
Modify style.css to customize:
- Color schemes
- Bar chart appearance
- Layout and typography
- Responsive breakpoints
Edit script.js to change the auto-refresh interval:
const REFRESH_INTERVAL = 30000; // 30 secondsCustomize the number of top scores displayed:
const MAX_SCORES_DISPLAY = 10; // Show top 10 scores"Connection Failed" Error
- Check your internet connection
- Verify the RPC endpoint is accessible
- Try refreshing the page
"No Scores Found"
- Verify contract addresses are correct
- Ensure contracts have minting events
- Check if contracts are deployed on Polygon Amoy
Scores Not Updating
- Check browser console for errors
- Verify contract addresses in
config.json - Ensure contracts are active and have recent transactions
Open browser developer tools (F12) and check the console for detailed error messages.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style
- Test with multiple contract addresses
- Ensure mobile responsiveness
- Add error handling for new features
This project is open source and available under the MIT License.
If you encounter issues or have questions:
- Check the troubleshooting section above
- Review browser console errors
- Open an issue on GitHub
- Provide contract addresses and error details
Happy tracking! 🚀