packages/hardhat/contractsfolder and check out what contracts we have there.
IAllocationStrategy.solis the interface for the
CompoundAllocationStrategy.solwhere some logic regarding allocation of interest is included. Here we will delegate all this logic to cDai token. And will pay more attention to sharing the interest between different hats. (rToken logic)
accountToImpersonatein App.jsx and for the
burnerWalletAddressput your local address of the wallet from upper right corner.
snatchDai! Congratulations, now you have few thousands of DAI on your dai account :)
ApproveDai. For simplicity and for only educational purpose we approve maximum amount, but the amount is configurable. Again change the value of
accountToImpersonatein App.jsx and set the value of the
rTokenAddressto address of our contract:
Approve Daiand we can go minting :)
hatand then mint to that default one OR we can
mintWithNewHatand do those 2 actions once. Let's do the second one and see what happens.
payInterestin order to transfer hat interest to our account. If you do it and see the balance again you should see that some interest is earned already: