How ayushpal-abes/soda-vending-machine works
This is a React/Ethers dapp for operating a soda vending machine on Sepolia. A user connects a MetaMask wallet, views price and stock, then submits a purchase; owners can replenish stock, change the price, and withdraw funds. The frontend talks to separate vending-machine and price contracts, while generated TypeChain bindings provide a typed contract interface. Contract implementation details and some frontend calls were not sampled, so those capability links rely on the README rather than inspected call sites.
Main entry points: main.jsx Vending interface · vendingMachine.sol Vending machine · ethers-contracts Typed contract interfaces · factories Contract factories
Components 9
Dapp interface
- Vending interface
frontend/src/main.jsx
Smart contracts
- Vending machine
contracts/vendingMachine.sol - Soda pricing
contracts/sodaVendor.sol - Price oracle interface
contracts/IoraclePrice.sol
Contract bindings
- Typed contract interfaces
types/ethers-contracts - Contract factories
types/ethers-contracts/factories
Other components
- Dapp user
- MetaMask wallet
- Sepolia network
Connections 11
- Dapp user → Vending interface: uses
README.md - Vending interface → MetaMask wallet: connects wallet
frontend/src/main.jsx - Vending interface → Vending machine: reads machine state
frontend/src/main.jsx - Vending interface → Soda pricing: reads price
frontend/src/main.jsx - Vending interface → Vending machine: purchases, stocks, withdraws
- Vending interface → Soda pricing: sets price
frontend/src/main.jsx - MetaMask wallet → Sepolia network: signs transactions
README.md - Vending interface → Sepolia network: targets network
frontend/src/main.jsx - Vending machine → Price oracle interface: uses price interface
- Typed contract interfaces → Contract factories: exports factories
types/ethers-contracts/index.ts - Contract factories → Typed contract interfaces: builds contract interfaces
types/ethers-contracts/factories/VendingMachine__factory.ts