Clément suggested the idea, and it seemed like a very practical solution, with real world use-cases that aren't just speculative.
There are many wise ways to use money. You can use it to feed yourself. Clothe yourself. Pay a monthly rent for a little shelter. But the best use is to forgo all living necessities and settle for purchasing cryptocurrencies. With VendETH, this dream becomes a little more practical.
What it does
VendETH is pretty simple; just go up to the machine, select your product, pay for it with a mobile wallet, trustwallet, torus, or squarelink, the machine dispenses it, and boom, you have your food.
VendETH is pretty simple; just go up to the machine, select your product, pay for it with a mobile wallet, the machine dispenses it, and boom, you have your food!
How we built it
The project is divided into four parts:
The smart contracts are written in Solidity, written in a Golang environment for testing and deployment.
React is used to power the UI for sending transactions and purchasing products. Using this, users can select products, scan their mobile wallets, and enjoy an overall smooth experience.
The vending machine's coils are powered by servo engines, connected to a servo drive (more specifically, the Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685). The board itself is connected to an Arduino Mega board, which is in turn controlled by a Raspberry Pi 4 running a Node script.
Coinbase Commerce Server
In order to integrate Coinbase Commerce, we have the front-end generating "Charge" API calls to actually charge the user, and allow them to pay via all of the cryptocurrency payment methods the service provides. Since the service communicates events by sending data to a public endpoint (e.g. a server owned by us), we set up an Express server on a VPS. SSL is required for this endpoint, so we purchased a domain (cryptovendingmachine.xyz) and added an SSL certificate via Let's Encrypt and their helpful tool, certbot. On a successful charge event, the server communicates with the Vending Machine smart contract and confirms the purchase.
Challenges we ran into
It turns out that soldering inside a building is actually not such a good idea, due to smoke alarms. It also turns out that soldering outside in a shady corner in windy weather conditions and light drizzling is also not such a good idea. Weighing the options, we thought that the best way to legally challenge our sense of adventure was through the second one. We ended up needing to use tall cardboard as a windshield, a loosely put-together cardboard box to serve as a table for soldering the servo drive's pins, and smart phone lighting to prevent our brave soldier from burning himself and all of us in the process.
Another huge challenge - headless install of a Raspberry Pi 4! Since the Harvard University Wi-Fi requires you to use the browser to log in, this is a big issue with trying to ssh into a Pi that can only really do basic Wi-Fi authentication. In the hacker space we had no data connection on our mobile phones, so we had to constantly go upstairs, and find a location with service, and then wait upwards of 30 minutes for the installation process. We had to create a DHCP server on the laptop to enable an ssh connection to the raspberry pi, while also connecting to our mobile hotspot via the wi-fi chip. This caused default routing issues, which the only way to solve was a while loop that deleted the bad default route.
Accomplishments that we're proud of
Soldering the pins onto the board, constructing the vending machine, getting the servos to turn, getting the servos to stop turning, getting a server running on a VPS, hooking it up to a domain, an SSL, and finally getting Coinbase Commerce to interact with the endpoint, the React front-end.
What we learned
Don't solder in the wind
What's next for VendETH
Adding DAO functionality for agreement on adding vendors/products, and rebrand to VendDAO.