> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Abracadabra (abracadabra)

> Lending protocol that lets users borrow MIM stablecoin against yield-bearing collateral via isolated Cauldron markets built on DegenBox.

Lending protocol that lets users borrow MIM stablecoin against yield-bearing collateral via isolated Cauldron markets built on DegenBox.

| Fact | Value |
| - | - |
| Category | CDPs and stablecoins |
| Family | none |
| Namespace | `Abracadabra` on ethereum, arbitrum |
| Chains | ethereum, arbitrum |

## What it offers

* **borrow**: Borrow MIM from a Cauldron
* **repay**: Repay MIM debt
* **addCollateral**: Add collateral to a Cauldron position
* **removeCollateral**: Remove collateral from a Cauldron position

## Notes

* Isolated Cauldron markets - each has specific collateral type and risk parameters
* DegenBox is the underlying vault that holds all assets (BentoBox fork)
* Amounts use "part" (debt accounting) and "share" (DegenBox shares) - not raw token amounts
* skim=false means transfer tokens from caller; skim=true means use tokens already in DegenBox
* Deposit collateral to DegenBox first, then addCollateral to a Cauldron
* Common collateral: sSPELL, yv tokens, LP tokens, yield-bearing assets

## Its names in a program

On Ethereum, `Abracadabra` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Ethereum's degenBox, `0xd96f48665a1410C0cd669A88898ecA36B9Fc2cce`.
  require(Abracadabra.DegenBox != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | degenBox | `0xd96f48665a1410C0cd669A88898ecA36B9Fc2cce` | `Abracadabra.DegenBox` |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | mim | `0x99D8a9C45b2ecA8864373A26D1459e3Dff1e17F3` | `Abracadabra.Mim` |
| [Arbitrum One](https://docs.eco.com/sauce-sdk/reference/chains/arbitrum.md) | degenBox | `0x7C8FeF8eA9b1fE46A7689bfb8149341C90431D38` | `Abracadabra.DegenBox` |
| [Arbitrum One](https://docs.eco.com/sauce-sdk/reference/chains/arbitrum.md) | mim | `0xFEa7a6a0B346362BF88A9e4A88416B77a57D6c2A` | `Abracadabra.Mim` |

## ABI

### `CauldronABI`

`import CauldronABI from "./protocols/abracadabra/CauldronABI.json";`

* `addCollateral(address to, bool skim, uint256 share)`
* `removeCollateral(address to, uint256 share)`
* `borrow(address to, uint256 amount) returns (uint256 part, uint256 share)`
* `repay(address to, bool skim, uint256 part) returns (uint256 amount)`
* `userCollateralShare(address user) view returns (uint256)`
* `userBorrowPart(address user) view returns (uint256)`

### `DegenBoxABI`

`import DegenBoxABI from "./protocols/abracadabra/DegenBoxABI.json";` Speaks for: degenBox.

* `deposit(address token, address from, address to, uint256 amount, uint256 share) payable returns (uint256 amountOut, uint256 shareOut)`
* `withdraw(address token, address from, address to, uint256 amount, uint256 share) returns (uint256 amountOut, uint256 shareOut)`
* `balanceOf(address token, address user) view returns (uint256)`

## Next steps

* [Protocols](https://docs.eco.com/sauce-sdk/reference/protocols.md): the other protocols, by what they do.
* [Protocols and tokens](https://docs.eco.com/sauce/names.md): calling a contract by its namespace, or through its ABI.
* [Glossary](https://docs.eco.com/sauce/glossary.md): the words these pages use, in plain terms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.