I am working on a custom coin Move module for the Aptos blockchain and need to ensure that all transfers of a custom coin type use a specific transfer function that I will define. This function could include custom logic for fees, restrictions(e.g. kyc), etc.
The challenge I’m facing is how to enforce the use of this custom transfer
function and prevent users from bypassing it by calling standard functions such as aptos_framework::coin::transfer
or aptos_framework::aptos_account::transfer_coins
. I want to ensure that the custom logic cannot be sidestepped.
Could anyone provide insights or examples of how to architect this module to enforce the use of a custom transfer function for a coin in Move?