code-423n4 / 2021-06-tracer-findings

1 stars 0 forks source link

Gas savings in verifyAndSubmitLiquidation() #131

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

0xsanson

Vulnerability details

Impact

In Liquidation.verifyAndSubmitLiquidation(...) we can save the minimumMargin to memory since it's called two times.

Proof of Concept

https://github.com/code-423n4/2021-06-tracer/blob/main/src/contracts/Liquidation.sol#L171

Tools Used

Manual analysis

Recommended Mitigation Steps

Save the result of Balances.minimumMargin(...) to memory.

kumar-ish commented 3 years ago

Also closed by accident