Skip to content

Instantly share code, notes, and snippets.

@NaoyaTabakomori
Last active December 28, 2018 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NaoyaTabakomori/fe7e45609f657e79f85dce554c1c2301 to your computer and use it in GitHub Desktop.
Save NaoyaTabakomori/fe7e45609f657e79f85dce554c1c2301 to your computer and use it in GitHub Desktop.
_powersのmapping, _decorationsのmapping, その先にあるarrayの要素の位置を特定する
const Web3 = require('web3');
const provider = new Web3.providers.HttpProvider(
"https://ropsten.infura.io/ws"
);
const web3 = new Web3(provider);
getKeys()
function getKeys() {
let key = '0000000000000000000000[your_address_from_0x]'
let powerIndex = '0000000000000000000000000000000000000000000000000000000000000000'
let powerKey = web3.sha3(key + powerIndex, {"encoding":"hex"})
console.log("powerKey: "+powerKey);
let decorationArrIndex = '0000000000000000000000000000000000000000000000000000000000000001'
let decorationArrKey = web3.sha3(key + decorationArrIndex, {"encoding":"hex"})
console.log("arrKey: "+decorationArrKey);
let decorationArr0Key = web3.sha3(decorationArrKey, {"encoding":"hex"})
console.log("decorationArr0Key: "+decorationArr0Key);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment