Open code423n4 opened 3 years ago
s1m0
The function getSynth(token) in the following functions is called multiple times instead of saving the result.
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
Manual analysis
Save the result.
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.