NFT based gifting of future yield using Aave and time-locks (but also trojan horse to interest rate swaps for dummies ๐Ÿ‘€)


This project modernises the tradition of gifting something valuable to newborns. Currently this is typically done with cash envelopes or small amounts of gold/silver (in a lot of cultures). With Aavelopes you will be able to gift an NFT that has interest earning DAI locked in it! There is a frontend that allows minting and burning (withdrawing) of the NFT and a Solidity contract that deposits it to AAVE and checks ownership/if time unlock has passed. It also generates an SVG that represents your Aavelope without the need for external art/IPFS etc.

Aavelopes showcase

How it's made

* AAVE: My smart contract code calls Aave's lending pool to deposit users's DAI on their behalf. It then also withdraws this amount on their behalf when they burn the NFT later. This hides the complexity of knowing how to do DeFi from unsophisticated users. * Hardhat: I found it easier to fork mainned for testing rather than use unreliable test network contract instances. Hardhat was great for this. * Smart contract: there were two main challenges that I had to overcome (bear in mind this is my first foray into this world!) 1. How to easily generate SVGs on the fly so that everything is on chain, and 2. How to know what amount of interest a particular user has earned (as all the funds are pooled in the contract) Given I have a newborn this was a solo effort, and I am proud that I hit my main goals of: a. Completing it with little free time to spend! b. Learning solidity and how to interact with AAVE c. Doing something fun :D

Technologies used