Cauldron V1
The first version of the cauldron, not used in production anymore.
Last updated
The first version of the cauldron, not used in production anymore.
Last updated
This is the first version of the Cauldron Contracts. It is deployed directly and then used as a masterContract to deploy each market, as clones, following the minimal proxy pattern.
You can find the full contract here.
This will create the masterContract that will be used by all the clones (markets).
Parameter | Description |
---|---|
Accrues the interest on the borrowed tokens and handles the accumulation of fees.
Gets the exchange rate, ie how much collateral to buy 1e18 asset. Invoked if needed since Oracle queries can be expensive.
Returns
Name | Type | Description |
---|---|---|
Adds share
amount of collateral from msg.sender
to the account to
.
Parameters
Calls _removeCollateral
, which removes the amount share
of collateral and transfers it to the account to
.
Parameters
Calls _borrow
, which allows the sender to borrow amount
and transfer to to
.
Parameters
Returns
Calls _repay
, which repays a loan.
Parameters
Returns
Executes a set of actions and allows composability (contract calls) to other contracts.
The cook function allows to bundle functionality within one contract call while passing return values from one call to the next one. Actions are defined by a numeric identifier and can return two values, value1 and value2 to the next function. The input arrays actions, values and datas define the sequential actions. In the Value array the ether value of a call may be defined.
Whereas calling functions like borrow that have the solvent modifier requires solvency at the end of the function, solvency only needs to be guaranteed at the end of the cook function, thereby allowing more complicated operations such as leveraging within one call.
For certain parameters either an external value can be passed in or the identifier USE_VALUE1 (-1) or USE__VALUE2 (-2) to access either of the local variables. The following variables are marked in bold italic in the table below. If an action returns one value it is saved as value1, if two are returned they are saved as value1 and value2 respectively. Any action can access these values during the whole duration of the cook call.
The call data for the actions is ABI encoded as listed below.
Parameters
Returns
Handles the liquidation of users' balances once the users' amount of collateral is too low.
Parameters
Withdraw the fees accumulated to the feeTo address.
Sets the beneficiary of fees accrued in liquidations. Can only be called by the owner of the contract.
Parameters
Reduces the supply of MIM
Parameters
Return values
Return values
Return values
Return values
Return values
Return values
Return values
Return values
Return values
Return values
When transferring ownership, the future owner is pending until they claims ownership.
Return values
Returns the total amounts borrowed from the cauldron.
Return values
Returns the amount (in shares) of the token collateral
used as collateral in this cauldron.
Return values
Returns the amount of borrowParts held by a user. To convert that amount into a numerical MIM debt amount, you must do totalBorrow.elastic / totalBorrow.base * borrowParts.
Parameters
Return values
Amount (in shares) of the token collateral
used as collateral by the user.
Parameters
Return values
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Action Name | ID | parameter names | ABI encoding | returnValues |
---|---|---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|