ERC20HandlerMainFacet
Inherits: HandlerBase, HandlerUtils, ICommonApplicationHandlerEvents, IHandlerDiamondErrors
Functions
initialize
Initializer params
Parameters
Name | Type | Description |
---|---|---|
_ruleProcessorProxyAddress | address | of the protocol’s Rule Processor contract. |
_appManagerAddress | address | address of the application AppManager. |
_assetAddress | address | address 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.
Parameters
Name | Type | Description |
---|---|---|
_balanceFrom | uint256 | token balance of sender address |
_balanceTo | uint256 | token balance of recipient address |
_from | address | sender address |
_to | address | recipient address |
_sender | address | the address triggering the contract action |
_amount | uint256 | number of tokens transferred |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if all checks pass |
checkAllRules
This function is the one called from the contract that implements this handler. It’s the entry point.
Parameters
Name | Type | Description |
---|---|---|
_balanceFrom | uint256 | token balance of sender address |
_balanceTo | uint256 | token balance of recipient address |
_from | address | sender address |
_to | address | recipient address |
_sender | address | the address triggering the contract action |
_amount | uint256 | number of tokens transferred |
_action | ActionTypes | Action Type |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if all checks pass |
_checkAllRules
This function contains the logic for checking all rules. It performs all the checks for the external functions.
Parameters
Name | Type | Description |
---|---|---|
balanceFrom | uint256 | token balance of sender address |
balanceTo | uint256 | token balance of recipient address |
_from | address | sender address |
_to | address | recipient address |
_sender | address | the address triggering the contract action |
_amount | uint256 | number of tokens transferred |
_action | ActionTypes | Action Type |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if all checks pass |
getAppManagerAddress
standard rules do not apply when either to or from is a treasury account
This function returns the configured application manager’s address.
Returns
Name | Type | Description |
---|---|---|
<none> | address | appManagerAddress address of the connected application manager |
getRuleProcessorAddress
This function returns the configured rule processor address.
Returns
Name | Type | Description |
---|---|---|
<none> | address | ruleProcessorAddress address of the connected Rule Processor |
getAssetAddress
This function returns the configured token address.
Returns
Name | Type | Description |
---|---|---|
<none> | address | assetAddress address of the connected token |