0

I would like to recreate compound.finance as a project but I don't really understand the architecture. Their white paper of website wasn't really helpful in this matter.

When I want to borrow I first have to add tokens that can be used as a collateral.

Then I can borrow but which contract stores the collateral? Is it the Comptroller or cToken contract?

Thanks

1 Answer 1

2

cToken is the address that is holding the underlying asset, u can check that by checking lets say DAI, DaiContractAddr.balanceOf(cToken)

Here is where user transfer their collateral to cToken address

https://github.com/compound-finance/compound-protocol/blob/master/contracts/CErc20.sol#L156

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.