Inspiration
Experiments in charity, targeted subsidy, and UBI are certainly an interesting subject in web3. What if it was possible to directly give small, regular payments to a broad but specific group of people, without needing to rely on intermediate distributors? What if those payments could adjust automatically in response to need? Stimulus payments, or support to people in crisis zones, or even just perks for membership in an academy, guild, or DAO — we decided to prototype a smart contract platform for custom mass payment distribution.
What it does
CactuStipend allows users to create their own stipends: choosing a payout token, defining the rate and amount of payout, and providing an initial fund. Other users may then search and join stipends for which they qualify, and thereafter receive payments at the defined intervals.
For our demo, by default a stipend's payment amount is modified by Truflation's reported YoY inflation %. Payments are denominated in USD, but thanks to Chainlink Price Feeds, can be disbursed in the form of whichever token has been selected by the stipend creator.
The contract is intended to work in conjunction with an identity verification service, such as PolygonID or DECO. In our CactuStipendZKP contract, we've implemented PolygonID as an option for stipend creators, allowing them to set eligibility criteria that users must meet to qualify.
How we built it
The contracts were written in Solidity using Visual Studio Code and deployed through Remix. We use Chainlink Automation to call the Truflation oracle once a day to update inflation data. Chainlink Price Feeds get the USD-denominated prices of the stipend tokens, and then Chainlink Automation disburses the payments. We deployed on Mumbai to make use of PolygonID. The front end was also built using Visual Studio Code, and was written using React, CSS, HTML, and Ethers.js. The dApp was deployed using Vercel.
Challenges we ran into
We were able to integrate PolygonID into stipend creation and use Hardhat to register PolygonID queries on our contract, but we weren't able to test it ourselves because the PolygonID app would not let us add the claims we created. We've included the credential and proof request QR codes in our CactuStipendZKP demo, which should hopefully grant testers permission to join the ZKP stipend.
Accomplishments that we're proud of
Finishing! CactuStipend became a 24/7 project, with tag-team morning & evening meetings to stay current with each other's progress as we worked together to move data from the blockchain to the front end and back again.
We created a machine with many moving parts, and designed a product that highlights the power of Chainlink and Truflation. Many different elements of blockchain technology were integrated into our contract.
What started as a vague idea for an NFT project transformed first into a prototype for an automated stipend, then a platform for mass stipend creation modified by oracle data, and then, in the last week, when we became aware of PolygonID, we learned about ZKPs and tried to implement PolygonID into our contracts. Meanwhile, we were learning how to render everything properly using React. It was challenging but a lot of fun and a tremendous learning experience!
What we learned
We learned how to use Chainlink's Price Feeds and Automation, how to use the Truflation oracle, and the basics of ZKPs and how they are used by PolygonID. We improved our knowledge of Solidity and React, and how the front and back ends work together.
What's next for CactuStipend
A convenient way for stipend creators to register queries and generate QR code proof requests when opting to use PolygonID. Better mobile support and UI when using the PolygonID app.
More customization options for the Truflation auto-adjust feature. Rather than using just YoY inflation, a stipend creator could toggle a setting that adjusts for food inflation specifically, or housing, or fuel prices, or a custom composite. The creator could also select between different stipend denominations (such as JPY, GBP, TRY, etc).
UI for managing created stipends so the creators can add funds as needed, or remove / add user permissions. More customization for stipend creators in general.
Aave integration, giving stipend creators the option of depositing funds into Aave and generating interest, thereby mitigating some of their costs. Stipend holders would be able to withdraw payments directly from Aave.
Once they become available, the option of DECO attestation for verification and the use of identity oracles for credential distribution.
Built With
- chainlink
- css
- ethers.js
- hardhat
- javascript
- mumbai
- next.js
- polygon-id
- react.js
- remix
- solidity
- truflation
- vercel
- visual-studio-code



Log in or sign up for Devpost to join the conversation.