Motivation: Have you ever found yourself in a situation where you paid for concert tickets at a group discount, only to be left waiting for everyone to reimburse you? It can be frustrating and time-consuming, especially when dealing with forgetful friends or missing contributors. However, there is now a solution that eliminates these problems and ensures fair expense sharing. Introducing Spltit, a decentralized expense sharing app that allows each member to pay their share individually.
The Frustration of Group Expenses: Paying for group expenses and waiting for reimbursement can be a daunting task. Traditional financial management apps may offer a way to track expenses, but they don't guarantee that everyone will pay you back. This leaves you hoping and praying that your friends fulfill their financial obligations. Introducing Spltit: A Trustless Expense Split App: Spltit provides a decentralized and trustless solution to the problem of group expense sharing. With Spltit, you no longer have to rely on the trustworthiness of others or chase them for payments. The app ensures that each member pays their own share, eliminating the burden of freeloaders in this increasingly complex economy.
Solving Two Major Problems: Spltit tackles two major problems associated with group expenses. Firstly, it streamlines expense splitting when you already know who the contributors are. Secondly, it facilitates expense sharing among strangers, making it easier to coordinate and ensure fair payments. How Spltit Works: Spltit leverages the power of decentralized smart contracts to achieve its purpose. Using the Solidity smart contract, you can create an expense (a structure), specifying details such as the application deadline, initial deposit per contributor, the total cost, the maximum number of contributors, and the vendor address.
Interested users can deposit Ether into the expense, with the total contributions securely stored within the smart contract. This ensures that no one can misappropriate the funds. Once the deadline passes, the expense creator initiates the payout function, which automatically transfers the funds to the vendor.
Fair Distribution and Refunds: To calculate each member's contribution, Spltit determines the percentage based on the number of contributors. This ensures a fair distribution of expenses. Additionally, if a user deposited more than their required share, Spltit refunds the excess amount after the vendor payout, ensuring fairness for all participants.
Personal Finance Management, Data Analytics and Indexing: Each function has been emits events that can be used to index and used to create user dashboards in the front end, enabling personal financial management and providing valuable insights. Subgraph using respective schema and mappings has been built and deployed, to provide this data. The major entities considered are: the The new Expense, Each Account, Contributor, Payout to contributors and Pay outs to the vendor.
The Benefits and Beyond: Spltit's smart contract deployment, publication, and verification on platforms like Polygon Mumbai testnet ensure transparency and reliability.
Conclusion: Spltit is a revolutionary decentralized expense split app that addresses the frustrations and challenges of group expense sharing. By providing a trustless system where each member pays individually, it eliminates the need to rely on others and simplifies the process for both known and unknown contributors. Say goodbye to financial headaches and welcome fair and hassle-free expense sharing with Spltit.
Spltit has multiple parts to it. The backend is built using Smart Contract. The data from smart contract is being indexed on the Graph, which can be further used to create finance management dashboards.
The smart contract "Splitit" enables fair and transparent expense sharing among group members. It includes various functions and events to manage expenses and contributions. Key features of the contract include creating a new expense, making contributions to an expense, calculating individual contributions, checking the contract balance, paying back contributors, and paying the vendor.
When creating a new expense, users provide details such as the vendor, deadline, initial deposit, maximum capacity, and actual cost. An event is emitted to notify the creation of a new expense. Users can then contribute to the expense by sending Ether, and an event is emitted for each new contribution. The contract ensures that contributors have not already participated and that the deadline has not passed.
The contract allows the calculation of individual contributions based on the total number of confirmed contributors and the actual cost of the expense. Users can check the contract balance to monitor the available funds.
To pay back contributors, the contract verifies that the vendor has been paid and the contributor is eligible. The contributor's deposit is reduced, and the amount to be paid back is calculated. The contract then returns the money to the contributor and updates the paidOutContributor list. An event is emitted for each payment made to a contributor.
The payOut function is used by the expense owner to initiate payments. It verifies that the deadline has passed and the expense has not already been paid out. The actual cost is sent to the vendor, and the paidOut flag is set to true. The contract then iterates through each confirmed contributor, calculates the amount to be paid back, and calls the payBackContributor function. An event is emitted for the payment made to the vendor.
Overall, the Splitit smart contract provides a reliable and decentralized solution for managing group expenses and ensuring fair contribution distribution.
The SC is deployed on the Polygon Mumbai testnet. It is verified and the source code if published. The events emitted by functions have been used to fill the Graph schema using mappings. We are keeping track of entities like new expense created, new contribution created, user Account, pay out to vendors and refund to individual contributors. The graph has been successfully deployed using Hosted services here https://thegraph.com/hosted-service/subgraph/garima5/spltit
Major tech Used: Solidity Smart Contracts, truffle, Ganache, Remix, Hardhat, Polygon Mumbai testnet, The Graph. I had written the initial Sc in solidity using remix. I deployed it on local Blockchain using Ganache. Then I set up local dev environment using npm and HardHat. I then published the SC to Polygon Mumbai Network. For the Graph, I set up the CLI, then based on things that would be required for the front end and the dashboards, I wrote the schema, subgraph and mapping.
Major Sponsor products Used: