Inspiration
We were thinking about the importance of renewable energy currently and how we could apply smart contracts to help allow users more control over their energy purchasing.
What it does
SparkSwap allows users to buy electricity tokens either directly from energy companies in advance or purchase from traders. These tokens are for a certain amount of electricity produced in a certain manner at a particular time. These tokens are then redeemed for actual electricity from the company. The ability of a user to directly choose how much power of each particular type they want is a strength of this system. Additionally, buying a particular amount of electricity from the energy company ahead of time reduces the risk for the energy company and the price for the consumer, thus both have an incentive to use the service.
How we built it
We wrote smart contracts in Solidity, and tested them using a library by Foundry called Forge. We used NextJS as a frontend framework and used a library called wagmi to connect the frontend to the smart contracts and we used TailwindCSS for styling.
Challenges we ran into
We ran into issues setting up the website frontend. One particular sticking point was connecting a wallet to the frontend. Styling the frontend was a real struggle and at one point we completely restarted. Additionally, we kept having weird issues with GitHub. While we were developing a Foundry update was released that caused major conflicts with our GitHub repository.
Accomplishments that we're proud of
We are proud of writing both the smart contracts required for this project and the frontend in 24 hours. Specifically, we are proud of the robustness of the smart contracts. Due to extensive automated tests, we did not need to change them after they were finished, allowing us to fully focus on the frontend. We are also proud of how it looked and we're also proud that it's written using a frontend library instead of raw javascript and html.
What we learned
We learned more about NextJS and writing the frontend, specifically styling. Additionally, we learned about the libraries for connecting the frontend to the smart contracts.
What's next for SparkSwap
The next step would be including historical data on the frontend, and making the front end more user friendly, and also to automate the buying and selling so users can set it up and forget. The final step would be getting an actual power company to use it and honor the tokens, and convince users to use it as well.
Log in or sign up for Devpost to join the conversation.