Git Source

Inherits: HandlerBase, HandlerUtils, ICommonApplicationHandlerEvents, NFTValuationLimit, IHandlerDiamondErrors

Functions

initialize

Initializer params

function initialize(address _ruleProcessorProxyAddress, address _appManagerAddress, address _assetAddress)
    external
    onlyOwner;

Parameters

NameTypeDescription
_ruleProcessorProxyAddressaddressof the protocol’s Rule Processor contract.
_appManagerAddressaddressaddress of the application AppManager.
_assetAddressaddressaddress of the controlling asset.

checkAllRules

This function is called without passing in an action type.

This function is the one called from the contract that implements this handler. It’s the entry point.

function checkAllRules(
    uint256 balanceFrom,
    uint256 balanceTo,
    address _from,
    address _to,
    address _sender,
    uint256 _tokenId
) external onlyOwner returns (bool);

Parameters

NameTypeDescription
balanceFromuint256token balance of sender address
balanceTouint256token balance of recipient address
_fromaddresssender address
_toaddressrecipient address
_senderaddressthe address triggering the contract action
_tokenIduint256id of the NFT being transferred

Returns

NameTypeDescription
<none>booltrue if all checks pass

checkAllRules

This function is the one called from the contract that implements this handler. It’s the legacy entry point. This function only serves as a pass-through to the active function.

function checkAllRules(
    uint256 _balanceFrom,
    uint256 _balanceTo,
    address _from,
    address _to,
    uint256 _amount,
    uint256 _tokenId,
    ActionTypes _action
) external onlyOwner returns (bool);

Parameters

NameTypeDescription
_balanceFromuint256token balance of sender address
_balanceTouint256token balance of recipient address
_fromaddresssender address
_toaddressrecipient address
_amountuint256number of tokens transferred
_tokenIduint256the token’s specific ID
_actionActionTypesAction Type defined by ApplicationHandlerLib — (Purchase, Sell, Trade, Inquire) are the legacy options

Returns

NameTypeDescription
<none>boolSuccess equals true if all checks pass

_checkAllRules

This function contains the logic for checking all rules. It performs all the checks for the external functions.

function _checkAllRules(
    uint256 balanceFrom,
    uint256 balanceTo,
    address _from,
    address _to,
    address _sender,
    uint256 _tokenId,
    ActionTypes _action
) internal returns (bool);

Parameters

NameTypeDescription
balanceFromuint256token balance of sender address
balanceTouint256token balance of recipient address
_fromaddresssender address
_toaddressrecipient address
_senderaddressthe address triggering the contract action
_tokenIduint256id of the NFT being transferred
_actionActionTypesthe client determined action, if NONE then the action is dynamically determined

Returns

NameTypeDescription
<none>booltrue if all checks pass

getAppManagerAddress

currently not supporting batch NFT transactions. Only single NFT transfers. standard tagged and non-tagged rules do not apply when either to or from is a Treasury account

This function returns the configured application manager’s address.

function getAppManagerAddress() external view returns (address);

Returns

NameTypeDescription
<none>addressappManagerAddress address of the connected application manager

getRuleProcessorAddress

This function returns the configured rule processor address.

function getRuleProcessorAddress() external view returns (address);

Returns

NameTypeDescription
<none>addressruleProcessorAddress address of the connected Rule Processor

getAssetAddress

This function returns the configured token address.

function getAssetAddress() external view returns (address);

Returns

NameTypeDescription
<none>addressassetAddress address of the connected token