The IProtocolToken interface contains the minimal set of functions that must be implemented in order for an ERC20 token to be compatible with the protocol.
The token must also override the _beforeTokenTransfer function and add a call to the checkAllRules hook defined in the IProtocolTokenHandler interface (using the handler address set in the above functions).
Example:
Copy
Ask AI
function _beforeTokenTransfer(address from, address to, uint256 amount) internal override { /// Rule Processor Module Check require(IProtocolTokenHandler(address(handler)).checkAllRules(balanceOf(from), balanceOf(to), from, to, _msgSender(), amount)); super._beforeTokenTransfer(from, to, amount); }