You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fee amount(902597579.715) is greater than min collection amount(20.0).
Dividing the wanted fee amount by remaining 10^12 results in 0.000902598, which is around the actual ETH fee required (~1 USD)
But convert_from_base_amount function does not calculate fee with parent currency, resulting in this
The text was updated successfully, but these errors were encountered:
# We collect fees depending on the number of spread deposit size
# Example: if deposit spreads on three wallets need to collect eth fee for 3 transactions
fees = options.fetch(:gas_limit).to_d * options.fetch(:gas_price).to_d / 1000000000000000000 # eth decimals
amount = fees * deposit_spread.size
options[:gas_limit] = 21000 # eth gas limit
transaction.amount = amount
transaction.options = options
I realized removing/fixing the "Fee amount is greater than min collection amount" check might also fix this.
810^14 fee is converted to 810^8 by accident, instead of 810^-4
but when sending it will convert 810^8 to 8*10^14 again, by accident, so it should send the correct amount. two wrongs make one right lol
either something like above, or calculation of amount again when checking against min_collection must be done to fix this issue.
sh4dowb
changed the title
[BUG?] ERC20 prepare_deposit_collection calculates fees in token base factor
[BUG] ERC20 prepare_deposit_collection calculates fees in token base factor, token deposits not working
Dec 9, 2022
ETH: 18 subunits
USDT: 6 subunits
Fee amount(902597579.715) is greater than min collection amount(20.0).
Dividing the wanted fee amount by remaining 10^12 results in 0.000902598, which is around the actual ETH fee required (~1 USD)
But convert_from_base_amount function does not calculate fee with parent currency, resulting in this
The text was updated successfully, but these errors were encountered: