Git Source

Inherits: RulesEngineClient

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

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

Abstract contract containing modifiers and functions for integrating ERC721A token operations with the Rules Engine. This contract provides policy checks for mint, safeBatchtransferFrom, and safeTransferFrom operations, both before and after execution.

Functions

checksPoliciesERC721ASafeTransferFromBefore

Modifier for checking policies before executing the safeTransferFrom function.

Calls the _checkPoliciesERC721ASafeTransferFrom function to evaluate policies.

modifier checksPoliciesERC721ASafeTransferFromBefore(address from, address to, uint256 tokenId);

Parameters

NameTypeDescription
fromaddressThe sending address.
toaddressThe receiving address.
tokenIduint256The token identifier.

checksPoliciesERC721ASafeTransferFromAfter

Modifier for checking policies after executing the safeTransferFrom function.

Calls the _checkPoliciesERC721SafeTransferFrom function to evaluate policies.

modifier checksPoliciesERC721ASafeTransferFromAfter(address from, address to, uint256 tokenId);

Parameters

NameTypeDescription
fromaddressThe sending address.
toaddressThe receiving address.
tokenIduint256The token identifier.

checksPoliciesERC721ASafeBatchTransferFromBefore

Modifier for checking policies before executing the safeBatchTransferFrom function.

Calls the _checkPoliciesERC721ASafeTransferFrom function to evaluate policies.

modifier checksPoliciesERC721ASafeBatchTransferFromBefore(
    address by,
    address from,
    address to,
    uint256[] memory tokenIds,
    bytes memory data
);

Parameters

NameTypeDescription
byaddressThe approved address.
fromaddressThe sending address.
toaddressThe receiving address.
tokenIdsuint256[]The token identifiers.
databytesGeneric data to pass along with the transfer.

checksPoliciesERC721ASafeBatchTransferFromAfter

Modifier for checking policies after executing the safeBatchTransferFrom function.

Calls the _checkPoliciesERC721SafeBatchTransferFrom function to evaluate policies.

modifier checksPoliciesERC721ASafeBatchTransferFromAfter(
    address by,
    address from,
    address to,
    uint256[] memory tokenIds,
    bytes memory data
);

Parameters

NameTypeDescription
byaddressThe approved address.
fromaddressThe sending address.
toaddressThe receiving address.
tokenIdsuint256[]The token identifiers.
databytesGeneric data to pass along with the transfer.

checksPoliciesERC721AMintBefore

Modifier for checking policies before executing the mint function.

Calls the _checkPoliciesERC721SafeMint function to evaluate policies.

modifier checksPoliciesERC721AMintBefore(address to, uint256 quantity);

Parameters

NameTypeDescription
toaddressThe receiving address.
quantityuint256The amount of tokens minted.

checksPoliciesERC721AMintAfter

Modifier for checking policies after executing the mint function.

Calls the _checkPoliciesERC721AMint function to evaluate policies.

modifier checksPoliciesERC721AMintAfter(address to, uint256 quantity);

Parameters

NameTypeDescription
toaddressThe receiving address.
quantityuint256The amount of tokens minted.

_checkPoliciesERC721ASafeTransferFrom

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

Encodes the parameters and invokes the _invokeRulesEngine function.

function _checkPoliciesERC721ASafeTransferFrom(address _from, address _to, uint256 _tokenId) internal;

Parameters

NameTypeDescription
_fromaddressThe sending address.
_toaddressThe receiving address.
_tokenIduint256The token identifier.

_checkPoliciesERC721ASafeBatchTransferFrom

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

Encodes the parameters and invokes the _invokeRulesEngine function.

function _checkPoliciesERC721ASafeBatchTransferFrom(
    address _by,
    address _from,
    address _to,
    uint256[] memory _tokenIds,
    bytes memory _data
) internal;

Parameters

NameTypeDescription
_byaddress
_fromaddressThe sending address.
_toaddressThe receiving address.
_tokenIdsuint256[]The token identifiers.
_databytesGeneric data to pass along with the transfer.

_checkPoliciesERC721AMint

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

Encodes the parameters and invokes the _invokeRulesEngine function.

function _checkPoliciesERC721AMint(address _to, uint256 _quantity) internal;

Parameters

NameTypeDescription
_toaddressThe receiving address.
_quantityuint256The amount of tokens minted.