1

I'm looking for some methods to know the content of storage and memory while the contract is running.Mayba some useful tools or abi ?

By the way, the abi of geth, debug_writeMemProfile and debug_memStats, confuse me a lot. Are they helpful?

  • you want to do from inside the contract or outside? – Badr Bellaj Jul 18 '18 at 7:39
  • for reading stroage from outsi you can use web3.eth.getStorageAt(contractAddress, index) for memory i don't think it's possible to read from outsid its content. from inside you've already mload sload. – Badr Bellaj Jul 18 '18 at 7:40
  • yes, web3.eth.getStorageAt() is what I want ! Thanks a lot. – Kevin Jul 19 '18 at 6:51
  • happy to help, i've reformulated the comment in an answer, if you find it helpfull you can accept it – Badr Bellaj Jul 19 '18 at 7:40
0

for reading stroage from outsi you can use web3.eth.getStorageAt(contractAddress, index) for memory i don't think it's possible to read from outsid its content.

in web3js 1.0 documentation :

getStorageAt web3.eth.getStorageAt(address, position [, defaultBlock] [, callback]) Get the storage at a specific position of an address.

for example :

contractAddress = '0x123......'
for (index = 0; index < 10; index++){
 console.log(`[${index}]` + 
   web3.eth.getStorageAt(contractAddress, index))
}

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.