Closed gabririgo closed 6 years ago
in setPrices() require new prices less than 50% higher of existing price maybe also require some minimum time between setting prices (like a few hours)
ok, a similar check is already implemented in the UI (sellPrice < BuyPrice) .Once the contract code is finalized, we'll need to put some notice in the setPrice form so that the user is aware of the rules.
On 11 January 2018 at 11:26, escursionista notifications@github.com wrote:
in setPrices() require new prices less than 50% higher of existing price maybe also require some minimum time between setting prices (like a few hours)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RigoBlock/contracts/issues/9#issuecomment-356891937, or mute the thread https://github.com/notifications/unsubscribe-auth/AL3tpJBqRv8q06xQyqxu_5FHXYAYADaIks5tJeG4gaJpZM4RanvD .
-- David
done, right now the price has to be higher than the sell price and, in order to avoid for typos
function setPrices triggers an event in eventful, hence we can monitor if someone is cheating however we have a typo prevent mechanism which does not allow the sell price to be 90% lower than the previous one and the buy price to be 10 times bigger
this will prevent errors with zeros
only in drago (drago EVO) require buyPRice bigger than sellPrice
implement: modifier bigger_than(a,b) require(b >=a)
function setPrices(uint _newSellPrice, uint _newBuyPrice) only_owner {