solidity/test/libsolidity/semanticTests/inlineAssembly/keccak_optimization_bug_string.sol
2022-05-19 20:23:28 +02:00

14 lines
479 B
Solidity

contract C {
function f(string memory s) public returns (bool ret) {
assembly {
let a := keccak256(s, 32)
let b := keccak256(s, 8)
ret := eq(a, b)
}
}
}
// ----
// f(string): "" -> false
// f(string): 0x20, 5, "hello" -> false
// f(string): 0x20, 0x2e, 29457663690442756349866640336617293820574110049925353194191585327958485180523, 45859201465615193776739262511799714667061496775486067316261261194408342061056 -> false