Two separate functions (_burnDsc
and _redeemCollateral
) were identified where redundant parameters were used, resulting in potential gas inefficiencies.
In the _burnDsc
function, the parameters onBehalfOf
and dscFrom
represent the same address, leading to unnecessary redundancy. Using two separate variables for the same address increases gas costs slightly.
In the _redeemCollateral
function, the parameters from
and to
also represent the same address, resulting in similar redundancy. Using two separate variables for the same address in this case also increases gas costs slightly.
The impact of these issues is relatively minor, as the redundant variables do not introduce critical vulnerabilities or security risks. However, they can lead to slightly higher gas consumption, potentially impacting the cost-effectiveness of transactions and overall contract performance.
Manual Review
To optimize gas consumption and improve code readability, the following recommendations are suggested:
In the _burnDsc
function, use a single variable to represent the address, and then pass it as an argument to both functions. This eliminates the need for redundant assignments and reduces gas costs slightly.
Similarly, in the _redeemCollateral
function, use a single variable to represent the address and pass it as an argument to both functions to avoid redundancy and save gas.
While the gas savings from these optimizations might not be significant, adhering to best coding practices for efficiency and readability is beneficial in the long run.
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.