orbland / contracts

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

[GAS OPTIMIZATION] Use calldata argument instead of storage variable in purchase() #24

Closed odyslam closed 1 year ago

odyslam commented 1 year ago

Description

When a user calls purchase, they input the currentPrice. It's cheaper to use the calldata input variable than the storage variable _price throughout the function.

Suggestion

Replace_price with currentPrice

lekevicius commented 1 year ago

I assume we would use this after checking that the two are equal? If so, agreed.