A modern, multi-chain decentralized application (dApp) that allows users to send "Good Morning" messages on multiple blockchain networks. Built with cutting-edge web3 technologies and optimized for both desktop and mobile wallets.
Visit the live application: https://tobiasztworek.github.io/gm.html
Base Sepolia - 0x14a34
0x714Be7D3D4fB4D52c714b00afFd1F297FD0E023fhttps://base-sepolia.rpc.thirdweb.comEthereum Sepolia - 0xaa36a7
0x43ef985e0A520A7331bf93319CE3e676c9FAEbc9https://rpc.sepolia.orgOptimism Sepolia - 0xaa37dc
0x0a56E2E236547575b2db6EF7e872cd49bC91A556https://optimism-sepolia-public.nodies.appBase Mainnet - 0x2105
0x99510A8C66Af928635287CE6E3a480cE788c3960https://mainnet.base.orgCelo Mainnet - 0xa4ec
0xea97aE69A60ec6cc3549ea912ad6617E65d480fBhttps://forno.celo.orgOptimism Mainnet - 0xa
0xF9dE3B895dD0dD0a2DaD27A5Fb268Aa073c46c83https://optimism-mainnet.public.blastapi.iowallet_switchEthereumChain)wallet_addEthereumChain)# Clone the repository
git clone https://github.com/tobiasztworek/tobiasztworek.github.io.git
cd tobiasztworek.github.io
# Install dependencies
npm install
# Build for production
npm run build
# The bundled files will be in dist/
βββ gm.html # Main HTML file
βββ gm.js # Main application logic
βββ gm.css # Styling
βββ dist/
β βββ gm.bundle.js # Production bundle
β βββ gm.bundle.js.map # Source map
βββ gm_test2.html # Legacy redirect to gm.html
βββ img/ # Network logos
Toggle debug mode by changing the DEBUG_MODE constant in gm.js:
const DEBUG_MODE = false; // Set to true for development
When enabled, debug mode provides:
To add a new network, update the NETWORKS array in gm.js:
{
name: 'Network Name',
chainId: '0xHEX_CHAIN_ID',
contractAddress: '0xCONTRACT_ADDRESS',
rpcUrl: 'https://rpc.url',
explorer: 'https://explorer.url/',
buttonColor: '#COLOR',
logoUrl: 'img/logo.jpg',
nativeCurrency: {
name: 'Token Name',
symbol: 'SYMBOL',
decimals: 18
},
feeFunction: 'getGmFeeInEth', // or 'getGmFeeInCelo' for Celo
}
The dApp automatically detects the network and calls the appropriate fee function:
getGmFeeInEth()getGmFeeInCelo()Optimized for MetaMask Mobile with:
Seamless network switching with:
The dApp interacts with GM contracts that implement:
// Standard ETH networks
function getGmFeeInEth() external view returns (uint256);
function sayGM() external payable;
// Celo network
function getGmFeeInCelo() external view returns (uint256);
function sayGM() external payable;
MetaMask Mobile not connecting:
Transaction failing:
Network not switching:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Tobiasz Tworek
Made with β€οΈ for the Web3 community
π Real-World Use Case
Imagine Alice, a crypto enthusiast who wants to interact with your GM smart contracts:
Without GM dApp:
β Manually finds the contract address for her network
β Opens Etherscan, navigates to "Write Contract"
β Connects wallet through Etherscan's interface
β Calculates the fee by calling getGmFeeInEth() separately
β Manually enters the fee value in the sayGM() function
β Repeats this process for every network she wants to use
β On mobile? Forget itβthe experience is terrible
With GM dApp:
β
Opens gm.html on any device
β
Clicks "Connect Wallet" (works on mobile too!)
β
Sees all 6 networks with clear fee information
β
Clicks "Say GM" on her preferred network
β
Transaction completes with one confirmation
β
Wants to switch networks? One click, automatic configuration
β
Seamless experience on desktop, tablet, and mobile
π Why It Matters
Your dApp transforms complex Web3 interactions into consumer-grade simplicity:
Accessibility: Non-technical users can interact with smart contracts
Speed: What took 10+ steps now takes 2
Reliability: Built-in error handling and retry logic
Scalability: Easy to add new networks without code changes
Professional: Production-ready with clean UX and no debug clutter
This is the kind of UX that bridges Web2 and Web3βmaking blockchain technology accessible to everyone, not just developers.
π― Problem Statement
The Challenge
Traditional Web3 interactions face several critical pain points:
Users struggle with connecting different wallet types (browser extensions vs. mobile apps)
WalletConnect setup is often buggy and unreliable
Mobile users face limited options for interacting with dApps
2. π Multi-Chain Fragmentation
Each blockchain network requires separate configuration
Manual network switching is tedious and error-prone
Different networks use different native currencies (ETH, CELO, etc.)
Users must manually add RPC endpoints and chain IDs
3. πΈ Transaction Fee Opacity
Hidden costs surprise users at transaction time
No upfront visibility into network fees
Different contracts use different fee functions depending on the chain
4. π± Mobile Experience Gap
Desktop-focused dApps often break on mobile
QR code workflows are clunky and unreliable
Network switching from mobile wallets is nearly impossible
5. π Development vs. Production Chaos
Debug logs clutter production consoles
Test features confuse end users
No clean way to toggle between dev and prod modes
β
The Solution
GM dApp Multi-Chain addresses these challenges with a unified, intelligent interface:
π Universal Wallet Support
Seamless Integration: Works with MetaMask Extension, MetaMask Mobile, WalletConnect-compatible wallets
Intelligent Detection: Automatically detects injected providers (browser) vs. WalletConnect needs (mobile)
Retry Logic: Built-in circuit breaker and timeout handling for flaky WalletConnect connections
Session Management: Smart localStorage cleanup prevents stale session issues
π True Multi-Chain Experience
6 Networks, One Interface: Supports Base, Celo, Optimism, and Ethereum (both mainnet and testnet)
Automatic Configuration: One-click network switching with automatic RPC setup
Currency-Aware: Dynamically detects whether to use ETH or CELO based on the network
Smart Contract Routing: Calls the correct fee function (getGmFeeInEth vs getGmFeeInCelo) automatically
π Transparent Pricing
Upfront Fee Display: Shows exact transaction cost before user commits
Real-Time Calculation: Fetches current fees directly from smart contracts
Native Currency Display: Shows fees in the network's native token (ETH, CELO)
π² Mobile-First Design
Responsive UI: Bootstrap 5 ensures perfect display on any screen size
Mobile Network Selector: Dedicated button for network switching on mobile devices
WalletConnect Optimization: 30-second timeouts, fallback mechanisms, clear error messages
Touch-Friendly: Large buttons, clear CTAs, no tiny click targets
π§Ή Production-Ready Codebase
DEBUG_MODE Toggle: Single boolean flag controls all debug features
Clean Console: No spam logs in production
Hidden Dev Tools: Test buttons only appear when needed
Professional UX: Minimal, focused interface for end users
Just want it to build it as side gig