URL: https://payperbite.lovable.app/
Lovable Project: https://lovable.dev/projects/14c7262a-adc3-479f-a2cc-913709c4e571
TasteBud Match is a platform that connects restaurants and influencers for advertising campaigns, leveraging smart contracts on the Polkadot Asset Hub blockchain (Paseo Testnet).
This project is built with:
- Frontend: Vite, TypeScript, React, shadcn-ui, Tailwind CSS
- Blockchain: Solidity, Hardhat, Ethers.js
- Network: Polkadot Asset Hub Testnet (Paseo)
-
Start the development server:
npm run dev
-
Navigate to the test page:
http://localhost:8080/test
https://payperbite.lovable.app/test
The /test page allows you to interact directly with the SimpleProposal contract deployed on Polkadot testnet.
- Auto-Connect: When you open the page, a test wallet is automatically connected
- No MetaMask Required: No need to install extensions or configure anything
- Pre-funded: The wallet already has testnet balance to execute transactions
- Address:
0xc48Bd4636bC57b3F06D9d45307b6f0CF42Fb1649
Deployed Contract:
- Address:
0x1932bF2047265051B480136100DB4D524F48BDA5 - Network: Polkadot Asset Hub Testnet (Paseo)
- Chain ID: 420420422
- RPC URL: https://testnet-passet-hub-eth-rpc.polkadot.io
Test Campaign Parameters:
- Restaurant:
0xc48Bd4636bC57b3F06D9d45307b6f0CF42Fb1649 - Influencer:
0x742d35Cc6634C0532925a3b844Bc454e4438f44e - Click Target: 100
- Description: Test Campaign - TasteBud Match Restaurant Promotion
-
View Campaign Data
- On load, the page automatically displays:
- Restaurant and influencer addresses
- Current progress (visual bar)
- Current clicks vs target
- Completion percentage
- On load, the page automatically displays:
-
Register a View
- Click the "Registrar View" button
- A transaction will be sent to the blockchain
- Wait for confirmation (a few seconds)
- Progress will update automatically
-
Manually Refresh Data
- Click the "Atualizar Dados" button
- Data will be reloaded from the contract
- Useful to see changes made by other accounts
-
Track Progress
- The progress bar visually shows advancement
- When reaching 100%, a completion message appears
- The "Registrar View" button is disabled upon completion
If you prefer to use your own wallet:
- Click "Conectar MetaMask" (alternative option)
- Configure Paseo Testnet network in MetaMask:
- Network Name: Paseo Testnet
- RPC URL: https://testnet-passet-hub-eth-rpc.polkadot.io
- Chain ID: 420420422
- Currency Symbol: PAS
- Approve the connection
- Important: You'll need testnet funds to send transactions
In addition to the web interface, you can test the contract using scripts:
cd contracts
npx hardhat run scripts/test-proposal.ts --network passetHubTestnetThis script tests:
- โ Contract connection
- โ
Reading information (
getInfo(),getProgress()) - โ
Registering views (
registerView()) - โ Individual properties
cd contracts
npx hardhat run scripts/simulate-ui-interactions.ts --network passetHubTestnetThis script simulates:
- โ Complete wallet connection flow
- โ Initial data loading
- โ "Registrar View" button clicks
- โ Data refresh
- โ Multiple consecutive registrations
tastebud-match/
โโโ src/
โ โโโ pages/
โ โ โโโ Test.tsx # Contract test page
โ โ โโโ ...
โ โโโ ...
โโโ contracts/
โ โโโ contracts/
โ โ โโโ SimpleProposal.sol # Test contract
โ โ โโโ SBRLToken.sol # SBRL token
โ โ โโโ AdvertisingProposal.sol # Full contract
โ โโโ scripts/
โ โ โโโ deploy-simple-proposal.ts # SimpleProposal deployment
โ โ โโโ test-proposal.ts # Basic tests
โ โ โโโ simulate-ui-interactions.ts # UI simulation
โ โโโ hardhat.config.ts # Hardhat configuration
โโโ README.md
# Clone the repository
git clone <YOUR_GIT_URL>
# Navigate to the directory
cd tastebud-match
# Install dependencies
npm i
# Start the development server
npm run dev# Navigate to contracts directory
cd contracts
# Compile contracts
npm run compile
# Deploy to testnet
npm run deploy:testnet- Test Page: http://localhost:8080/test
- Production URL: https://payperbite.lovable.app/
- Lovable Project: https://lovable.dev/projects/14c7262a-adc3-479f-a2cc-913709c4e571
- Testnet Explorer: https://polkadot.js.org/apps/?rpc=wss://paseo.rpc.amforc.com
registerView()- Registers a view/clickgetProgress()- Returns progress percentage (0-100)getInfo()- Returns all proposal informationrestaurant()- Restaurant addressinfluencer()- Influencer addressclicksRequired()- Click targetcurrentClicks()- Current clicksdescription()- Campaign description
ViewRegistered(uint256 currentClicks, uint256 clicksRequired)- Emitted when registering a viewProposalCompleted(uint256 totalClicks)- Emitted when target is reached
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Integrate SBRL token into proposals
- Add complete escrow system
- Implement restaurant dashboard
- Add campaign analytics
- Mainnet deployment
For questions or issues:
- Open an issue
- Check the Lovable documentation
- Contact the TasteBud Match team