Omniscia Kyber Network Audit

HookDataDecoder Code Style Findings

HookDataDecoder Code Style Findings

HDD-01C: Incorrect Documentation

Description:

The referenced documentation does not match the decoding approach utilized by the HookDataDecoder::decodeExchangeRate function.

Example:

src/libraries/HookDataDecoder.sol
34/// @dev equivalent to: abi.decode(params, (int256, int256, int256, uint256, bytes)) in calldata
35function decodeExchangeRate(bytes calldata hookData)
36 internal
37 pure
38 returns (int256 maxExchangeRate, int256 exchangeRateDenom)
39{
40 assembly ("memory-safe") {
41 maxExchangeRate := calldataload(add(hookData.offset, 0x20))
42 exchangeRateDenom := calldataload(add(hookData.offset, 0x40))
43 }
44}

Recommendation:

We advise it to be corrected, increasing the code's legibility.

Alleviation:

The documentation has been corrected as advised, addressing this exhibit.