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

# RulesEngineClientERC1155

[Git Source](https://github.com/forte-service-company-ltd/forte-rules-engine/blob/1f7450a94147e76e3930c235a18534779130abee/src/client/RulesEngineClientERC1155.sol)

**Inherits:**
[RulesEngineClient](/v2/reference/client/RulesEngineClient.sol/abstract.RulesEngineClient)

**Author:**
@mpetersoCode55, @ShaneDuncan602, @TJ-Everett, @VoR0220, @Palmerg4

This contract is intended to be inherited and implemented by ERC1155 token contracts requiring Rules Engine integration.

*Abstract contract containing modifiers and functions for integrating ERC1155 token operations with the Rules Engine.
This contract provides policy checks for `safeMint`, `transferFrom`, and `safeTransferFrom` operations, both before and after execution.*

## Functions

### checksPoliciesERC1155MintBefore

Modifier for checking policies before executing the `safeMint` function.

*Calls the `_checkPoliciesERC1155SafeMint` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155MintBefore(address to, uint256 tokenId, uint256 value, bytes memory data);
```

**Parameters**

| Name      | Type      | Description                                   |
| --------- | --------- | --------------------------------------------- |
| `to`      | `address` | The receiving address.                        |
| `tokenId` | `uint256` | The token identifier.                         |
| `value`   | `uint256` | The value of tokenId being transfered.        |
| `data`    | `bytes`   | Generic data to pass along with the transfer. |

### checksPoliciesERC1155MintAfter

Modifier for checking policies after executing the `safeMint` function.

*Calls the `_checkPoliciesERC1155SafeMint` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155MintAfter(address to, uint256 tokenId, uint256 value, bytes memory data);
```

**Parameters**

| Name      | Type      | Description                                   |
| --------- | --------- | --------------------------------------------- |
| `to`      | `address` | The receiving address.                        |
| `tokenId` | `uint256` | The token identifier.                         |
| `value`   | `uint256` | The value of tokenId being transfered.        |
| `data`    | `bytes`   | Generic data to pass along with the transfer. |

### checksPoliciesERC1155BatchMintBefore

Modifier for checking policies before executing the `safeMint` function.

*Calls the `_checkPoliciesERC1155SafeMint` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155BatchMintBefore(
    address to,
    uint256[] memory tokenIds,
    uint256[] memory values,
    bytes memory data
);
```

**Parameters**

| Name       | Type        | Description                                   |
| ---------- | ----------- | --------------------------------------------- |
| `to`       | `address`   | The receiving address.                        |
| `tokenIds` | `uint256[]` | The token identifiers.                        |
| `values`   | `uint256[]` | The values of tokenIds being transfered.      |
| `data`     | `bytes`     | Generic data to pass along with the transfer. |

### checksPoliciesERC1155BatchMintAfter

Modifier for checking policies after executing the `safeMint` function.

*Calls the `_checkPoliciesERC1155SafeMint` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155BatchMintAfter(
    address to,
    uint256[] memory tokenIds,
    uint256[] memory values,
    bytes memory data
);
```

**Parameters**

| Name       | Type        | Description                                   |
| ---------- | ----------- | --------------------------------------------- |
| `to`       | `address`   | The receiving address.                        |
| `tokenIds` | `uint256[]` | The token identifiers.                        |
| `values`   | `uint256[]` | The values of tokenIds being transfered.      |
| `data`     | `bytes`     | Generic data to pass along with the transfer. |

### checksPoliciesERC1155SafeTransferFromBefore

Modifier for checking policies before executing the `safeTransferFrom` function.

*Calls the `_checkPoliciesERC1155SafeTransferFrom` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155SafeTransferFromBefore(
    address from,
    address to,
    uint256 tokenId,
    uint256 value,
    bytes memory data
);
```

**Parameters**

| Name      | Type      | Description                                   |
| --------- | --------- | --------------------------------------------- |
| `from`    | `address` | The sending address.                          |
| `to`      | `address` | The receiving address.                        |
| `tokenId` | `uint256` | The token identifier.                         |
| `value`   | `uint256` | The value of tokenId being transfered.        |
| `data`    | `bytes`   | Generic data to pass along with the transfer. |

### checksPoliciesERC1155SafeTransferFromAfter

Modifier for checking policies after executing the `safeTransferFrom` function.

*Calls the `_checkPoliciesERC1155SafeTransferFrom` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155SafeTransferFromAfter(
    address from,
    address to,
    uint256 tokenId,
    uint256 value,
    bytes memory data
);
```

**Parameters**

| Name      | Type      | Description                                   |
| --------- | --------- | --------------------------------------------- |
| `from`    | `address` | The sending address.                          |
| `to`      | `address` | The receiving address.                        |
| `tokenId` | `uint256` | The token identifier.                         |
| `value`   | `uint256` | The value of tokenId being transfered.        |
| `data`    | `bytes`   | Generic data to pass along with the transfer. |

### checksPoliciesERC1155SafeBatchTransferFromBefore

Modifier for checking policies before executing the `transferFrom` function.

*Calls the `_checkPoliciesERC1155TransferFrom` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155SafeBatchTransferFromBefore(
    address from,
    address to,
    uint256[] memory tokenIds,
    uint256[] memory values,
    bytes memory data
);
```

**Parameters**

| Name       | Type        | Description                              |
| ---------- | ----------- | ---------------------------------------- |
| `from`     | `address`   | The sending address.                     |
| `to`       | `address`   | The receiving address.                   |
| `tokenIds` | `uint256[]` | The token identifiers.                   |
| `values`   | `uint256[]` | The values of tokenIds being transfered. |
| `data`     | `bytes`     |                                          |

### checksPoliciesERC1155SafeBatchTransferFromAfter

Modifier for checking policies before executing the `transferFrom` function.

*Calls the `_checkPoliciesERC1155TransferFrom` function to evaluate policies.*

```solidity
modifier checksPoliciesERC1155SafeBatchTransferFromAfter(
    address from,
    address to,
    uint256[] memory tokenIds,
    uint256[] memory values,
    bytes memory data
);
```

**Parameters**

| Name       | Type        | Description                              |
| ---------- | ----------- | ---------------------------------------- |
| `from`     | `address`   | The sending address.                     |
| `to`       | `address`   | The receiving address.                   |
| `tokenIds` | `uint256[]` | The token identifiers.                   |
| `values`   | `uint256[]` | The values of tokenIds being transfered. |
| `data`     | `bytes`     |                                          |

### \_checkPoliciesERC1155Mint

Calls the Rules Engine to evaluate policies for an ERC1155 `Mint` operation.

*Encodes the parameters and invokes the `_invokeRulesEngine` function.*

```solidity
function _checkPoliciesERC1155Mint(address _to, uint256 _tokenId, uint256 _value, bytes memory _data) internal;
```

**Parameters**

| Name       | Type      | Description                                   |
| ---------- | --------- | --------------------------------------------- |
| `_to`      | `address` | The receiving address.                        |
| `_tokenId` | `uint256` | The token identifier.                         |
| `_value`   | `uint256` | The value of tokenId being transfered.        |
| `_data`    | `bytes`   | Generic data to pass along with the transfer. |

### \_checkPoliciesERC1155MintBatch

Calls the Rules Engine to evaluate policies for an ERC1155 `MintBatch` operation.

*Encodes the parameters and invokes the `_invokeRulesEngine` function.*

```solidity
function _checkPoliciesERC1155MintBatch(
    address _to,
    uint256[] memory _tokenIds,
    uint256[] memory _values,
    bytes memory _data
) internal;
```

**Parameters**

| Name        | Type        | Description                                   |
| ----------- | ----------- | --------------------------------------------- |
| `_to`       | `address`   | The receiving address.                        |
| `_tokenIds` | `uint256[]` | The token identifiers.                        |
| `_values`   | `uint256[]` | The values of tokenIds being transfered.      |
| `_data`     | `bytes`     | Generic data to pass along with the transfer. |

### \_checkPoliciesERC1155SafeTransferFrom

Calls the Rules Engine to evaluate policies for an ERC1155 `safeTransferFrom` operation.

*Encodes the parameters and invokes the `_invokeRulesEngine` function.*

```solidity
function _checkPoliciesERC1155SafeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId,
    uint256 _value,
    bytes memory _data
) internal;
```

**Parameters**

| Name       | Type      | Description                                   |
| ---------- | --------- | --------------------------------------------- |
| `_from`    | `address` | The sending address.                          |
| `_to`      | `address` | The receiving address.                        |
| `_tokenId` | `uint256` | The token identifier.                         |
| `_value`   | `uint256` | The value of tokenId being transfered.        |
| `_data`    | `bytes`   | Generic data to pass along with the transfer. |

### \_checkPoliciesERC1155SafeBatchTransferFrom

Calls the Rules Engine to evaluate policies for an ERC1155 `safeTransferFrom` operation.

*Encodes the parameters and invokes the `_invokeRulesEngine` function.*

```solidity
function _checkPoliciesERC1155SafeBatchTransferFrom(
    address _from,
    address _to,
    uint256[] memory _tokenIds,
    uint256[] memory _values,
    bytes memory _data
) internal;
```

**Parameters**

| Name        | Type        | Description                                   |
| ----------- | ----------- | --------------------------------------------- |
| `_from`     | `address`   | The sending address.                          |
| `_to`       | `address`   | The receiving address.                        |
| `_tokenIds` | `uint256[]` | The token identifiers.                        |
| `_values`   | `uint256[]` | The values of tokenIds being transfered.      |
| `_data`     | `bytes`     | Generic data to pass along with the transfer. |

### \_checkPoliciesERC1155TransferFrom

Calls the Rules Engine to evaluate policies for an ERC1155 `transferFrom` operation.

*Encodes the parameters and invokes the `_invokeRulesEngine` function.*

```solidity
function _checkPoliciesERC1155TransferFrom(address _from, address _to, uint256 _tokenId) internal;
```

**Parameters**

| Name       | Type      | Description            |
| ---------- | --------- | ---------------------- |
| `_from`    | `address` | The sending address.   |
| `_to`      | `address` | The receiving address. |
| `_tokenId` | `uint256` | The token identifier.  |
