Open code423n4 opened 2 years ago
Details: In L129-137 of wfCashLogic.sol consider changing the code
require( ac.hasDebt == 0x00 && assets.length == 1 && EncodeDecode.encodeERC1155Id( assets[0].currencyId, assets[0].maturity, assets[0].assetType ) == fCashID );
to the following version without the && operator:
require(ac.hasDebt == 0x00); require(assets.length == 1); require(EncodeDecode.encodeERC1155Id( assets[0].currencyId, assets[0].maturity, assets[0].assetType == fCashID));
Note: This optimization can became invalid if an error message is added to require. Furthermore, consider using custom errors to save gas.
Split require to avoid using && opcode
Details: In L129-137 of wfCashLogic.sol consider changing the code
to the following version without the && operator:
Note: This optimization can became invalid if an error message is added to require. Furthermore, consider using custom errors to save gas.