Summary
The NatSpec for checkBalanceOf describes the implemented return value
incorrectly β the description is semantically inverted relative to the actual
code behavior.
Current NatSpec (line 458)
/// `implemented` denotes whether the `token` does not implement `balanceOf`.
Actual behavior
implemented := and(
gt(returndatasize(), 0x1f),
staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
)
staticcall returns 1 on success. implemented is therefore true when the
call succeeds β i.e., when the token does implement balanceOf.
The word "not" in the NatSpec inverts the meaning. A developer reading the docs
would expect implemented == true to mean "token lacks balanceOf", but the
opposite is true.
Suggested fix
/// `implemented` is `true` if the `token` implements `balanceOf`, `false` otherwise.
/// `amount` is zero if the `token` does not implement `balanceOf`.
Summary
The NatSpec for
checkBalanceOfdescribes theimplementedreturn valueincorrectly β the description is semantically inverted relative to the actual
code behavior.
Current NatSpec (line 458)
/// `implemented` denotes whether the `token` does not implement `balanceOf`.Actual behavior
staticcallreturns1on success.implementedis thereforetruewhen thecall succeeds β i.e., when the token does implement
balanceOf.The word "not" in the NatSpec inverts the meaning. A developer reading the docs
would expect
implemented == trueto mean "token lacks balanceOf", but theopposite is true.
Suggested fix