# Receivable

[Git Source](https://github.com/isle-labs/isle-contract/blob/main/contracts/Receivable.sol)

**Inherits:** [ReceivableStorage](/contract-documentation/receivablestorage.md), Initializable, ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721BurnableUpgradeable, UUPSUpgradeable, [IReceivable](/contract-documentation/interfaces/ireceivable.md)

## Functions

### \_authorizeUpgrade

```solidity
function _authorizeUpgrade(address newImplementation) internal override onlyGovernor;
```

### initialize

*Initializes the Receivable.*

```solidity
function initialize(address isleGlobal_) external override initializer;
```

**Parameters**

| Name          | Type      | Description                    |
| ------------- | --------- | ------------------------------ |
| `isleGlobal_` | `address` | The address of the isleGlobal. |

### createReceivable

Mint a new receivable.

*The event faceAmount is converted to decimal with 6 decimals.*

```solidity
function createReceivable(RCV.Create calldata params_) external override returns (uint256 tokenId_);
```

**Parameters**

| Name      | Type         | Description                                                            |
| --------- | ------------ | ---------------------------------------------------------------------- |
| `params_` | `RCV.Create` | The struct containing the information of the receivable to be created. |

**Returns**

| Name       | Type      | Description                             |
| ---------- | --------- | --------------------------------------- |
| `tokenId_` | `uint256` | The id of the newly created receivable. |

### getReceivableInfoById

*Get the information of a receivable.*

```solidity
function getReceivableInfoById(uint256 tokenId_) external view override returns (RCV.Info memory info_);
```

**Parameters**

| Name       | Type      | Description               |
| ---------- | --------- | ------------------------- |
| `tokenId_` | `uint256` | The id of the receivable. |

**Returns**

| Name    | Type       | Description                                              |
| ------- | ---------- | -------------------------------------------------------- |
| `info_` | `RCV.Info` | The struct containing the information of the receivable. |

### burnReceivable

*Burn a receivable.*

```solidity
function burnReceivable(uint256 tokenId_) external;
```

**Parameters**

| Name       | Type      | Description               |
| ---------- | --------- | ------------------------- |
| `tokenId_` | `uint256` | The id of the receivable. |

### governor

*Get governor from IsleGlobals.*

```solidity
function governor() public view returns (address governor_);
```

**Returns**

| Name        | Type      | Description                  |
| ----------- | --------- | ---------------------------- |
| `governor_` | `address` | The address of the governor. |

### \_beforeTokenTransfer

not support batch transfer

*Hook that is called before any token transfer.*

```solidity
function _beforeTokenTransfer(
    address from_,
    address to_,
    uint256 tokenId_,
    uint256 batchSize_
)
    internal
    override(ERC721Upgradeable, ERC721EnumerableUpgradeable);
```

### supportsInterface

*See {IERC165-supportsInterface}.*

```solidity
function supportsInterface(
    bytes4 interfaceId_
)
    public
    view
    override(ERC721Upgradeable, ERC721EnumerableUpgradeable)
    returns (bool);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.isle.finance/contract-documentation/receivable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
