• We lend at the floor price of an NFT collection. By doing this, we can extend loans more widely and create a unified liquidity pool for lending. • There are 4 key events in our contract.
- Deposit - lend ether to the vault
- Withdraw - withdraw ether plus gains / losses
- Take Loan - deposit an NFT and get a loan in return
- Repay Loan - repay a loan, with interest.
• Currently a vault manager will need to call whitelistCollection to change a parameter like the lending price for an NFT collection. Is the current setup gas inefficient? • What vectors for abuse am I not thinking about? • Can large whale deposits be used to take gains and subsequantly remove liquidity and abuse the system? • Can re-entrancy attacks be used in takeLoan or withdrawFunds?
• Keep 10% of the vault liquid at all times for withdraws • Clarify when vaultBalance and vaultBalanceAvailable should be adjusted.
everything you need to build on Ethereum! 🚀
🧪 Quickly experiment with Solidity using a frontend that adapts to your smart contract:
Prerequisites: Node plus Yarn and Git
clone/fork 🏗 scaffold-eth:
git clone https://github.com/austintgriffith/scaffold-eth.git
install and start your 👷 Hardhat chain:
cd scaffold-eth
yarn install
yarn chain
in a second terminal window, start your 📱 frontend:
cd scaffold-eth
yarn start
in a third terminal window, 🛰 deploy your contract:
cd scaffold-eth
yarn deploy
🔏 Edit the smart contract Tangelo.sol
in packages/hardhat/contracts
📝 Edit your frontend App.jsx
in packages/react-app/src
💼 Edit your deployment scripts in packages/hardhat/deploy
📱 Open http://localhost:3000 to see the app
Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io