Inspiration
In the densely populated regions of Nigeria, environmental degradation has become a pervasive issue, with a lack of awareness and concern about the consequences of individual actions on the environment. Despite numerous discussions and meetings addressing climate change and environmental challenges, there has been a noticeable absence of impactful solutions.
Simultaneously, the country grapples with increasing poverty rates and a challenging job market for graduates. Economic instability, coupled with a rising dollar-to-naira exchange rate, raises concerns about the escalating costs of goods and services.
To address these pressing issues, I propose ECO4Reward, a decentralized solution designed to tackle both environmental degradation and unemployment. ECO4Reward incentivizes users to engage in eco-friendly actions, offering rewards for positive contributions to the environment. This innovative approach not only addresses immediate environmental concerns but also provides a means of livelihood for those affected by unemployment.
ECO4Reward aims to create a symbiotic relationship between environmental well-being and economic empowerment, striving to achieve a harmonious balance between prosperity and the preservation of our planet.
What it does
Eco4Reward is a decentralized application designed to empower users to contribute to environmental preservation actively. Users can submit evidence of their environmental actions, and once these submissions are confirmed, users are rewarded with points. These accumulated points can then be converted into AVAX tokens.
The application recognizes three categories of environmental actions: general environmental actions, waste recycling, and tree planting. General environmental actions encompass a range of activities such as reducing water usage, conserving energy, and adopting sustainable transportation practices. Waste recycling focuses on the responsible disposal and recycling of various types of waste. Tree planting involves the planting of trees to enhance green cover.
There are two distinct user roles within the application: normal users and admins. Normal users initiate environmental actions, while admins review and approve or reject submitted actions based on their authenticity. Admins have the authority to assign points upon approval, ensuring a transparent and effective reward system for positive environmental contributions.
How we built it
Smart Contracts:
Eco4Reward utilizes two smart contracts - the Eco4Reward contract and the Lottery contract. The Eco4Reward contract manages the creation and approval of environmental actions. It also incorporates functionality for funding the contract and converting points to AVAX tokens. On the other hand, the Lottery contract is responsible for gamifying the system. It employs Chainlink Automation and Chainlink VRF to select a daily winner among active users, with the winner receiving 10 points.
Both smart contracts have been successfully deployed on the Avalanche Fuji testnet.
The Graph:
The graph was used to index the events on the smart contract to be able easily query the information on the frontend.
Frontend:
The frontend, developed with Next.js, Ethers.js, The Graph, and other tools, features several key pages:
Landing Page: This page provides essential information, including calls to action for creating environmental actions and accessing user profiles. It offers guidance on using the application, statistics on application usage, a call to action for funding, and an overview of application features.
Actions Page: Users can create environmental actions on this page.
Profile Page: This page allows users to view actions, view their current points and overall points, and convert their point to avax coin.
Leaderboard Page: Users can see where they rank in terms of points among other users of the app, they can also see the winner of the daily lottery of the app, only users can perform at least one environmental actions can qualify for the lottery.
Admin Page: This page is dedicated to admins to approve or reject environment actions and assign points to the approved environmental actions.
I leveraged thegraph to streamline and optimize data querying from the blockchain. Integrating thegraph into the project significantly improved the efficiency of retrieving and aggregating on-chain data, enhancing the overall user experience. By creating custom subgraphs tailored to the project's specific data needs, I ensured a more targeted and precise data extraction process. thegraph's decentralized indexing protocol allowed for real-time updates and seamless data synchronization, providing users with the most accurate and up-to-date information. The flexibility and scalability of thegraph played a pivotal role in building a robust and dynamic data layer for the project, ultimately contributing to its success.
The frontend is designed to be user-friendly, providing easy navigation between different sections of the application and facilitating user engagement.
Gamification of ECO4REWARD
In order to encourage users to continuously use the app, i introduced a leaderboard system where users can see how they rank with other users. i also introduced a lottery system in which requires a user to perform at least one environmental action for the user to qualify for the lottery. This lottery runs every 24 hours and it is powered by chainlink automation and chainlink vrf. The winner of the lottery everyday is displayed on the leaderboard page.
Challenges we ran into
I had some issues trying to figure out how to integrate lottery into the existing system, i was trying to do something that will help users on the application and not another additional feature. I came to the realization that users will ultimatley need a sort of motivation to continuously use the app, so i used the chainlink vrf and chainlink automation to create a automated lottery system that selects a winner every 24 hours and sends 10 point to the user as a reward.
Accomplishments that we're proud of
I am proud of the project as a whole
I am also proud to be able to build something that has the potential to help the environment and the people in the environment.
The integration of the smart contract to the frontend and thegraph was also an accomplishment i am proud off.
What we learned
I learned a lot about the Chainlink products. I learnt more about chainlink vrf and chainlink automation, i did a deep dive into the different chainlink automation methods, i tried the time and custom made automation.
I learned more about front-end development and how to integrate thgraph into the application.
SDGs Impact
The solution outlined above aligns with several United Nations Sustainable Development Goals (SDGs). Specifically, it contributes to the following SDGs:
SDG 6: Clean Water and Sanitation - By encouraging reduced water usage and responsible waste disposal.
SDG 7: Affordable and Clean Energy - Through efforts to minimize energy consumption.
SDG 11: Sustainable Cities and Communities - By promoting sustainable practices within communities.
SDG 12: Responsible Consumption and Production - By advocating for reduced energy and water consumption, as well as waste recycling.
SDG 13: Climate Action - Particularly through initiatives like tree planting, which helps mitigate the impact of climate change.
These goals collectively address environmental sustainability, responsible resource management, and climate resilience, contributing to a holistic approach to development.
Funding for ECO4Reward
Eco4Reward is a social good project, we will rely on getting funding from donors, government and willing individuals, that is why we have a call to action on the page for those who are willing to help fund the project. We will also sell sorted waste to companies who can use them to make new products, also through our tree planting actions, we can sell carbon credits on the global marketplace.
What's next for ECO4Reward
Deploy on other chains
Add more tokens for reward
Testing and Security Audits
Partnership with Government and Environmental Organizations.
Built With
- chainlink-automation
- chainlink-vrf
- ethers.js
- javascript
- nextjs
- solidity
- thegraph
Log in or sign up for Devpost to join the conversation.