hi friends, have a quick question about smart contract’s storage and how to read it..
i’m doing research for one smart contract, the beginning is:
pragma solidity ^0.1.0;
contract Something {
string Hello;
uint privateNumber;
…..
}
i’m trying to get this privateNumber from smart contract through web3.eth.getStorageAt(contract_address, 1), as i know that even if its private i can read from blockchain.
But i don’t see this number or string in my output… can someone explaing why? usually, i can read variables from storage, but maybe because of 0.1.0 compiler version i can’t.. for string i have value “0x75” (index 0, but i know that it was initialized as ‘Hello World’), and for privateNumber i have value “0x6a9d28” (i assume number is wrong, because i have different output for string). i tried to do for loop throught indexes, but i never can find this string. can someone explain, why? thanks in advance
Feb 21, 2022, 12:29 PM
https://solidity-by-example.org/hacks/accessing-private-data/
Feb 21, 2022, 1:05 PM
thanks, i got it now. anybody know how to call payable function in 0.1.0 ? i am trying: instance.function.value(msg.value)(param)
Feb 21, 2022, 1:13 PM