A simple test to supply and redeem ETH using the Compound protocol. It shows that a user gets cEth tokens in exchange for supplying ETH. It also shows that interest is accrued after a user supplies ETH and some time passes. Finally, at the end, a user can redeem the cEth tokens to get back their ETH supplied plus interest.
Go to supply-test.js file to simulate supplying and redeeming ETH on Compound using Hardhat's mainnet forking feature.
Run npx hardhat test