Open Avm07 opened 4 years ago
Moving this to the new reference token contract repo. I am not 100% sure we want to have this feature in this particular implementation of a token contract but will review.
I think this type of extra parameter requirement in the standard token contract is not that necessary.
As one can fire an event
via creating a blank action like this:
ACTION void feecharged(asset fee) {
}
Then, from the transaction history, one can add the total amount received as (transferred_qty - fee_qty)
by summing up all the values with this contract & function name.
Looks like the inclusion of the extra parameter means a non-standard argument is required, meaning this would make the token incompatible with most dapps.
I'll modify it for my use case to include this as a constant, or make it settable when setting up the token.
Also, it looks like this sends the fee to the token contract itself, something to consider for every use case, as we may want it to be a different account.
Thanks for your help uploading this, it will make it much easier for me.
Looks like the inclusion of the extra parameter means a non-standard argument is required, meaning this would make the token incompatible with most dapps.
I'll modify it for my use case to include this as a constant, or make it settable when setting up the token.
Also, it looks like this sends the fee to the token contract itself, something to consider for every use case, as we may want it to be a different account.
Thanks for your help uploading this, it will make it much easier for me.
Yes, main problem that dapps and exchanges looks on notification via require_recipient( to ); it means that they need to do calculation of real income amount = quantity - fee. In different solutions the standart notification will be wrong, because real income amount is less then in notification.
Sometimes business model for token smart contract want have fee from token transfer. We need standard interface how to do transfer with fee, count fees, inform receiver/sender from transaction payload, which will be used in blockchain history solution such as Hyperion, Chronicle, dfuse etc.
One of possible signature and realization for fee = 1% * quantity:
So from transaction history we can calculate how much tokens received(quantity - fee). Total fees received by summing all transfer transactions fee field.