Omniscia Kyber Network Audit
HookDataDecoder Code Style Findings
HookDataDecoder Code Style Findings
HDD-01C: Incorrect Documentation
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | HookDataDecoder.sol:L34 |
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 calldata35function decodeExchangeRate(bytes calldata hookData)36 internal37 pure38 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.
