ethersphere / bee-dashboard

An app which helps users to setup their Bee node and do actions like cash out cheques
https://dashboard.ethswarm.org/
BSD 3-Clause "New" or "Revised" License
142 stars 53 forks source link

Postage stamp - Price calculation seems wrong #303

Closed Cafe137 closed 2 years ago

agazso commented 2 years ago

When trying to buy a postage stamp with depth=20 and amount=1_000_000_000 the indicative price is 0.000006400 BZZ. I have 0.08951 BZZ and 0.00153 XDAI, so this should not be a problem but Bee reports that I have insufficient token balance. I managed to buy a postage stamp with the same depth with amount=100_000_000.

Blockscout link: https://blockscout.com/xdai/mainnet/address/0xaDB5f7402Dc0Aa7c94764edC527F1BEdc54430E3/transactions

Bee log:

DEBU[2022-03-03T11:43:02+01:00] create batch: out of funds: insufficient token balance 
ERRO[2022-03-03T11:43:02+01:00] create batch: out of funds                   
Screenshot 2022-03-03 at 11 45 49
agazso commented 2 years ago

It seems that the problem is indeed in the price calculation of the dashboard, because the BZZ price of the successful transaction with depth=20, amount=100_000_000 in blockscout is 0.01048576 and not 0.0000006400.

https://blockscout.com/xdai/mainnet/tx/0xa7de2fe503d8076cb87a19269920068566d90afa7c68c93487aae1498bddf294

vojtechsimetka commented 2 years ago

Fixed by #305