Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created March 14, 2019 18:31
Show Gist options
  • Select an option

  • Save miguelmota/c7e057eafaea27a07917afcfa6d7e853 to your computer and use it in GitHub Desktop.

Select an option

Save miguelmota/c7e057eafaea27a07917afcfa6d7e853 to your computer and use it in GitHub Desktop.
Web3.js Solidity SHA3 (keccak256) Solidity equivalent
// in web3
web3.utils.keccak256(web3.eth.abi.encodeParameters(['string', 'address'], ['foo', '0x4ccA5F2f01746B1c13ca7a3Dab0462d225795D3A']))
// in solidity
keccak256(abi.encode("foo", 0x4ccA5F2f01746B1c13ca7a3Dab0462d225795D3A));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment