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

# RulesEngineClientERC721

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

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

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

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

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

## Functions

### checksPoliciesERC721SafeMintBefore

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

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

```solidity
modifier checksPoliciesERC721SafeMintBefore(address to);
```

**Parameters**

| Name | Type      | Description            |
| ---- | --------- | ---------------------- |
| `to` | `address` | The receiving address. |

### checksPoliciesERC721SafeMintAfter

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

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

```solidity
modifier checksPoliciesERC721SafeMintAfter(address to);
```

**Parameters**

| Name | Type      | Description            |
| ---- | --------- | ---------------------- |
| `to` | `address` | The receiving address. |

### checksPoliciesERC721SafeTransferFromBefore

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

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

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

**Parameters**

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

### checksPoliciesERC721SafeTransferFromAfter

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

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

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

**Parameters**

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

### checksPoliciesERC721TransferFromBefore

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

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

```solidity
modifier checksPoliciesERC721TransferFromBefore(address from, address to, uint256 tokenId);
```

**Parameters**

| Name      | Type      | Description            |
| --------- | --------- | ---------------------- |
| `from`    | `address` | The sending address.   |
| `to`      | `address` | The receiving address. |
| `tokenId` | `uint256` | The token identifier.  |

### checksPoliciesERC721TransferFromAfter

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

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

```solidity
modifier checksPoliciesERC721TransferFromAfter(address from, address to, uint256 tokenId);
```

**Parameters**

| Name      | Type      | Description            |
| --------- | --------- | ---------------------- |
| `from`    | `address` | The sending address.   |
| `to`      | `address` | The receiving address. |
| `tokenId` | `uint256` | The token identifier.  |

### \_checkPoliciesERC721SafeMint

Calls the Rules Engine to evaluate policies for an ERC721 `safeMint` operation.

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

```solidity
function _checkPoliciesERC721SafeMint(address _to) internal;
```

**Parameters**

| Name  | Type      | Description            |
| ----- | --------- | ---------------------- |
| `_to` | `address` | The receiving address. |

### \_checkPoliciesERC721SafeTransferFrom

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

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

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

**Parameters**

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

### \_checkPoliciesERC721TransferFrom

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

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

```solidity
function _checkPoliciesERC721TransferFrom(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.  |
