This code is snippet from a smart contract, In the code below:
who is approving whom and whose funds are cDai allowed to transfer within the given _amount?
what is dai.approve doing?
If contract is depositing funds to compound, why I should use approve cDai?
function _depositToCompound(uint256 _amount) internal returns (uint256) { require(dai.approve(address(cDai), _amount)); uint256 result = cDai.mint(_amount); return result; }