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.

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.


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.