721labs / partial-common-ownership

This project aims to establish a standard, open source implementation of Partial Common Ownership for non-fungible tokens.
https://721.dev
MIT License
17 stars 5 forks source link

Consider basing _taxOwed on all historic prices #41

Closed vicsn closed 2 years ago

vicsn commented 2 years ago

_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.

will-holley commented 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?

vicsn commented 2 years ago

Apologies, I overlooked the _collectTax modifier! That should work just fine.