Updating a struct stored in storage efficiently in terms of gas costs involves minimizing unnecessary read and write operations.
In function buyLoan, read the state of storage pools[poolId].interestRate and pools[poolId].poolBalance many times.
cost more gas.
uint256 interestRate = pools[poolId].interestRate. then use interestRate instead of pools[poolId].interestRate In function buyLoan.
uint256 poolBalance = pools[poolId].poolBalance .then use poolBalance instead of pools[poolId].poolBalance In function buyLoan.
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.