The computation of total TST in the getTstTotal()
function involves iterating through two arrays, positions
and pendingStakes
. If these arrays become too large, the looping process could consume a significant amount of gas. In case it exceeds the block gas limit, it might lead to a Denial of Service (DoS) when using this function. Therefore, it would be beneficial to use a state variable to store the total TST state within the contract each time there is a change, such as in the increasePosition()
and decreasePosition()
functions.
Add a variable totalTST
and update it each time there is a change in TST within the contract, for example:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.