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

1 stars 0 forks source link

Unnecessary function calls in `addLiquidity` #320

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

In Pools.sol, the addLiquidity function includes unnecessary function calls, which are isAnchor and isAsset. Since the two functions are defined as public view, and are compiled into calls at the bytecode level.

Proof of Concept

Referenced code: Pools.sol#L58 Pools.sol#L63 Pools.sol#L218-L222

Tools Used

None

Recommended Mitigation Steps

Consider changing to _isAnchor[token] and _isAsset[token] to save gas on calling funtions.