Closed cppfuns closed 5 years ago
Not quite.
fee.amount = ( tokens.amount + 9 ) / 10;
To complete the transaction the fee and the amount the fee is being calculated on need to be maintained separately.
Bear in mind that code performs integer coercion to the next largest integer, which for small amounts can yield a final result considerably larger than the nominal 10%.
Calculate .5% fee https://github.com/EOSIO/eos/blob/905e7c85714aee4286fa180ce946f15ceb4ce73c/contracts/eosio.system/delegate_bandwidth.cpp#L111
How to calculate the 10% fee? Is it like this?
fee.amount = ( fee.amount + 9 ) / 10;