Summary
In this chapter, we have deep-dived into the implementation of the AssetPool
smart contract. This is the core and most complex smart contract in the crypto loan system. You have learned how we manage asset pools and the user ledger with Solidity code and also implemented the functions for the user to deposit, withdraw, borrow, repay, and liquidate the assets of the crypto loan system. In the last section of this chapter, we went through the topic of deployment and testing for crypto loan smart contracts.
As a simple set of smart contracts for a decentralized crypto loan system running on blockchain, we have already covered all the basic features in Chapter 11, An Introduction to Crypto Loans and Chapter 12, Implementing an Asset Pool Smart Contract for a Crypto Loan (this chapter). However, smart contracts still need to be strengthened as a real-world product. In the next chapter, we will discuss the risk of using a price oracle based on a pair reserve. We will propose a...