Closed vicsn closed 2 years ago
Calling #changePrice
collects tax at the current rate prior to updating the price, which prevents the mentioned scenario.
I'm not following "depending on the frequency of tax collection, this can lead to missing tax paid." – can you expound on this?
Apologies, I overlooked the _collectTax
modifier! That should work just fine.
_taxOwed
is only calculated based on the current price, not on all previous prices. Depending on the frequency of tax collection, this can lead to missing tax paid. Someone could set a high price for a long time period, only to lower it just before_taxOwed
is checked.