FLASH is a decentralised lending and borrowing platform. Deposit some ETH and earn NDL stablecoins. Repay stablecoins and get your ETH back. FLASH is secure, fast and reliable.
FLASH uses a set of well tested smart contracts deployed on rinkeby testnet to mint NDL tokens equivalent to the price of eth in dollars deposited by the users. These NDL tokens are pegged to US dollars. FLASH makes it easier to lend some ETH and earn stablecoins.
NDL tokens are stablecoins deployed to rinkeby testnet and each token is worth around one US dollars.
FLASH makes it more decentralised to borrow stablecoins by using a chainlink oracle to fetch the current price ETH to USD conversion rate. Based on this rate conversion the amount of stablecoins that a user will get after depositing ETH is calculated
Since FLASH uses a decentralized oracle network like Chainlink, it is permissionless and trustless.
During the development of FLASH the biggest challenge was to figure out the algorithm to calculate the amount of stablecoins a user will receive after depositing eth.
The first challenge was to figure out what is a stablecoin and how a stablecoin actually work. So I begin researching, during the research I read about a lot of stablecoins in the market like USDT, DAI etc.
After that another challenge was to figure out how to code a stablecoin, but then I found out stablecoins also follow the same ERC20 token standard.
After doing some research on different stable coins, I reached to a conclusion of using Chainlink oracle to get the latest price feed of ETH to US dollars. After that the same worth of stablecoins will be sent to the user.
I use AggregatorV3Interface to get the price feed.
Another challenge was to keep the mint function of token contract abstract to maintain the scarcity of tokens and the stability of price. For that I put the mint function inside a function and added onlyOwner modifier to it and gave the owner rights to the main vault contract.
So now not everyone can mint the token directly but they have to deposit ETH into the vault contract and after that only the vault contract can mint the appropriate amount of stablecoins to the user address during the deposit call to the vault contract.
Discussion