code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Gas improvement #253

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

s1m0

Vulnerability details

Impact

The function getSynth(token) in the following functions is called multiple times instead of saving the result.

Proof of Concept

https://github.com/code-423n4/2021-04-vader/blob/main/vader-protocol/contracts/Pools.sol#L143 https://github.com/code-423n4/2021-04-vader/blob/main/vader-protocol/contracts/Pools.sol#L155 https://github.com/code-423n4/2021-04-vader/blob/main/vader-protocol/contracts/Pools.sol#L167

Tools Used

Manual analysis

Recommended Mitigation Steps

Save the result.