> ## 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.

# LayerBank (layerbank)

> Lending protocol on Scroll. Compound-style markets (lTokens), but every user action goes through the Core contract, which names the market.

Lending protocol on Scroll. Compound-style markets (lTokens), but every user action goes through the Core contract, which names the market.

| Fact | Value |
| - | - |
| Category | Lending |
| Family | none |
| Namespace | `Layerbank` on scroll |
| Chains | scroll |

## Notes

* Unlike Compound V2, the lToken's own supply/borrow/redeem functions are callable only by Core
* Must call `enterMarkets` on Core before borrowing against any market
* Scroll-only deployment

## Its names in a program

On Scroll, `Layerbank` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Scroll's core, `0xEC53c830f4444a8A56455c6836b5D2aA794289Aa`.
  require(Layerbank.Core != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Scroll](https://docs.eco.com/sauce-sdk/reference/chains/scroll.md) | core | `0xEC53c830f4444a8A56455c6836b5D2aA794289Aa` | `Layerbank.Core` |

## ABI

Where a line says what an address it returns is, a program that calls the function through
its namespace calls that contract's methods on the result directly:
`<Namespace>.<Contract>.<function>(...).<method>(...)`. A token's methods are the ERC-20
functions, and its writes are SafeERC20.

### `LTokenABI`

`import LTokenABI from "./protocols/layerbank/LTokenABI.json";`

* `balanceOf(address account) view returns (uint256)`
* `underlyingBalanceOf(address account) view returns (uint256)`
* `borrowBalanceOf(address account) view returns (uint256)`
* `exchangeRate() view returns (uint256)`
* `underlying() view returns (address)`: the address is a token

### `LayerBankCoreABI`

`import LayerBankCoreABI from "./protocols/layerbank/LayerBankCoreABI.json";` Speaks for: core.

* `enterMarkets(address[] lTokens)`
* `exitMarket(address lToken)`
* `supply(address lToken, uint256 uAmount) payable returns (uint256)`
* `redeemToken(address lToken, uint256 lAmount) returns (uint256)`
* `redeemUnderlying(address lToken, uint256 uAmount) returns (uint256)`
* `borrow(address lToken, uint256 amount)`
* `repayBorrow(address lToken, uint256 amount) payable`

## 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.