TelegramMessenger / telemint

Telegram Auction Platform smart contracts
GNU General Public License v3.0
345 stars 71 forks source link

Updates (made by contester202210) #63

Closed contester202210 closed 2 years ago

contester202210 commented 2 years ago
  1. Add exception in the case when new_state is null because of any reason

  2. Slightly optimize royalty calculation. Important note: this commit should be fixed:

    • by changing int royalty_value = min(bid, muldiv(bid, royalty_num, royalty_denum)); to int royalty_value = muldiv(bid, royalty_num, royalty_denum); on line 44
    • by adding royalty_value = bid; between line 41 and line 42

Just found this a few minutes after the contest ended, that's why I'm writing about it here and not committing it as a fix. Made the commit in a hurry just before the end of the contest :)

  1. Add another exception instead of condition
arseny30 commented 2 years ago
  1. If new_state is null, we must return the bid to the bidder. In case of an exception, it will be returned to the collection.

  2. Why do you think that this is an optimization?

  3. I don't think it is correct to throw an exception if to_send <= 0.