Skip to content

Instantly share code, notes, and snippets.

@bas-vk
Created June 30, 2016 16:09
Show Gist options
  • Save bas-vk/4d754e46fab06012c076d25fd8cea427 to your computer and use it in GitHub Desktop.
Save bas-vk/4d754e46fab06012c076d25fd8cea427 to your computer and use it in GitHub Desktop.
eth_getStorageAt
var Web3 = require('web3');
var web3 = new Web3();
var key = Buffer.from("000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298", "hex");
var pos = Buffer.from("0000000000000000000000000000000000000000000000000000000000000001", "hex");
var key = Buffer.concat([key, pos], key.length + pos.length).toString("hex");
var options = {encoding: "hex"};
var position = web3.sha3(key, options);
console.log("position", position);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment