orbland / contracts

🔮 Orb and related contracts. Auction + Harberger taxed ownership + invocations.
https://orb.land
MIT License
22 stars 5 forks source link

[GAS OPTIMIZATION] setPrice doesn't need to check that newPrice is non-zero #23

Closed odyslam closed 1 year ago

odyslam commented 1 year ago

Description

Currently purchase(uint256 currentPrice, uint256 newPrice) checks that newPrice != 0. This is not required, as the protocol can function as expected if newPrice = 0, since the user can purchase the orb with a non zero new price and then set it to zero via setPrice(uint256 newPrice).

Suggestion

Remove the check

lekevicius commented 1 year ago

Agreed.