Open code423n4 opened 3 years ago
shw
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.
Pools.sol
addLiquidity
isAnchor
isAsset
public view
Referenced code: Pools.sol#L58 Pools.sol#L63 Pools.sol#L218-L222
None
Consider changing to _isAnchor[token] and _isAsset[token] to save gas on calling funtions.
_isAnchor[token]
_isAsset[token]
Handle
shw
Vulnerability details
Impact
In
Pools.sol
, theaddLiquidity
function includes unnecessary function calls, which areisAnchor
andisAsset
. Since the two functions are defined aspublic 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.