Open code423n4 opened 2 years ago
0x0x0x
The function is implemented as follows:
function addMarket( LPoolInterface pool0, LPoolInterface pool1, uint16 marginLimit, bytes memory dexData ) external override returns (uint16) { uint16 marketId = numPairs; OpenLevV1Lib.addMarket(pool0, pool1, marginLimit, dexData, marketId, markets, calculateConfig, addressConfig, supportDexs, taxes); numPairs ++; return marketId; }
It can be replaced with following codeblock to save gas.
function addMarket( LPoolInterface pool0, LPoolInterface pool1, uint16 marginLimit, bytes memory dexData ) external override returns (uint16) { OpenLevV1Lib.addMarket(pool0, pool1, marginLimit, dexData, numPairs++, markets, calculateConfig, addressConfig, supportDexs, taxes); return marketId; }
Handle
0x0x0x
Vulnerability details
The function is implemented as follows:
It can be replaced with following codeblock to save gas.