relevant tag icon
CEther - Compound CToken Interface
copy icon
compound
• version 1.0.0
Compound
Token
ERC20
Interface
Audited

CEther - Compound CToken Interface

Audited

A public interface for CToken -the Compound CTokens, which are self-contained borrowing and lending contracts.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

compound

Recent Use

🍞 0x775F downloaded

Last Publish

10/26/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
mint() :
This function is used to mint new tokens on the blockchain. It works by taking in a value (in Ether) as an argument and then calling the mintInternal() function with that value. The mintInternal() function then creates new tokens and assigns them to the caller of the mint() function. (autogenerated documentation)
redeem() :
This function allows a user to redeem a certain amount of tokens from the contract. It works by calling the internal function redeemInternal() which will subtract the amount of tokens specified from the user's balance. The function returns a status code of NO_ERROR to indicate that the redemption was successful. (autogenerated documentation)
redeemUnderlying() :
This function allows a user to redeem a certain amount of underlying tokens from the contract. It works by calling the internal function redeemUnderlyingInternal, which handles the actual redemption process. The function returns a status code of NO_ERROR to indicate that the redemption was successful. (autogenerated documentation)
borrow() :
This function allows a user to borrow a certain amount of funds from the contract. It works by calling the internal function borrowInternal(), which updates the user's balance and the total amount of debt owed to the contract. The function returns a status code of NO_ERROR to indicate that the transaction was successful. (autogenerated documentation)
repayBorrow() :
This function allows a borrower to repay a loan that they have taken out from the contract. It works by taking in a payment of the specified amount in Ether and then subtracting that amount from the total amount of debt that the borrower owes. The function also updates the total amount of available funds in the contract. (autogenerated documentation)
repayBorrowBehalf(address) :
This function allows a borrower to repay a loan that they have taken out on behalf of someone else. It takes in an address of the borrower as an argument and sends the amount of the repayment to the lender. The function works by calling the internal function repayBorrowBehalfInternal, which takes in the borrower's address and the amount of the repayment as arguments. The internal function then processes the repayment and sends the funds to the lender. (autogenerated documentation)
liquidateBorrow(address) :
This function liquidates a borrower's position in a cToken collateralized loan. It works by taking the address of the borrower, the cToken collateral, and the amount of the loan as parameters. The function then calls the internal liquidateBorrowInternal function, which uses the provided parameters to liquidate the borrower's position and return the collateral to the lender. (autogenerated documentation)
_addReserves() :
This function allows users to add reserves to the contract. It does this by calling the _addReservesInternal() function, passing in the value of the transaction (msg.value) as an argument. This function will then add the reserves to the contract and return the amount of reserves added. (autogenerated documentation)
getCashPrior() :
This function is an override internal view function that returns the amount of cash that was held by the contract prior to the current transaction. It does this by subtracting the amount of the current transaction (msg.value) from the current balance of the contract (address(this).balance). (autogenerated documentation)
doTransferIn(address) :
This function is an override of the transferIn() function in the ERC20 interface. It is used to transfer tokens from an external address to the contract. It requires that the sender of the transaction is the same as the address specified in the function parameters, and that the value of the transaction is equal to the amount specified in the parameters. If these conditions are met, the function returns the amount of tokens transferred. (autogenerated documentation)
doTransferOut(address) :
This function is used to transfer a specified amount of funds from the contract to an external address. It takes two parameters, an address payable to which the funds should be transferred and an amount of funds to be transferred. The function then calls the transfer() function on the address payable, sending the specified amount of funds to the external address. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i cether
copy icon

Recent Use

🍞 0x775F downloaded

Last Publish

10/26/2022

Version

1.0.0

Creator

compound

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.