Closed juliangruber closed 1 year ago
Was able to remove one more state variable, bringing down gas overall
Sorry I haven't addressed all of the review. Following up
While reviewing places accessing balanceHeld, I found that transferScheduled is updating that variable once for reach participant receiving the payment. Should we rework this part to be consistent with how we handle scoring?
I'm currently not concerned with that part, as it's not inside the setScores()
path and therefore not (yet) burning a concerning amount of gas. Once we take a look at that, I agree this is a good thing to try
Instead of updating the storage variables (expensive) for every participant, update once after processing all. Also cache a compution.
While making the whole contract slightly more expensive, this reduces
setScores()
cost for many participants by over 30%.