0

Why does keccak256() in assembly require 2 arguments? What is the second argument?

assembly {
let foo := keccak256(4)
}

returns error

Function expects 2 arguments but got 1.
2

If I'm not mistaken, that is a pointer (start) and a length. The syntax differs from Solidity because the latter gets the location as well as the length from the bytes argument.

Hope it helps.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.