DeSavings is an automated savings tool designed to help you create a savings plan for your incoming transactions. Make your wallet "react" to receiving tokens and automatically convert them to your desired currencies based on a split set by you.
This project makes use of Solidity smart contracts and a browser-based frontend to interact with Ethereum. The front end consists of a form using which a user can create a custom-designed savings plan. A savings plan basically entails picking a basket of cryptocurrencies and setting percentages between them. The smart contract uses this percentage to split incoming transactions into their respective cryptocurrencies based on the split set by the user during contract creation. The contract also allows the user to define which incoming cryptocurrencies should go through the split. The currencies that have not been whitelisted for the split can be later withdrawn by the owner at any time. The user can also view the transactions that have been made through these contracts in the dApp. This can used as a powerful tool. Imagine a world where large companies have begun to accept cryptocurrencies as payment, or an employee receives their salary through their Web3 wallet. They may want to allow users to pay using any currency but the company may want to store the currencies in their treasury as different tokens than the incoming ones. The company can create a contract on the dApp and assign how they want to receive the tokens. If there are too many transactions (increasing transaction cost), users can also use Chainlinks time-base automation to execute the smart contract once a day.
This project uses Next.js for the front end, it uses WalletConnect's Web3Modal to establish a connection. The simple, minimalistic UX was brought together thanks to ENS Thorin. The smart contracts were built using hardhat and remix for testing. When a user creates a smart contract from the factory contract, it automatically registers an upkeep on behalf of the user. This upkeep is used to execute smart contracts conditionally. The dApp requires the user to have LINK tokens to deposit to their upkeep to pay for their transactions. This can avoided by requesting the user for ETH and the smart contract could convert the ETH to LINK, but due to the low liquidity on Goerli mainnet for the LINK/ETH pool, I avoided this for this demo. After a smart contract is created, the user can create an ENS subname and assign their smart contract address as a record to the subname. This would ensure a smooth payment experience for the payee. The graph protocol is used to query the transactions made through these contracts and displayed to the user in the dApp.