my purpose is to generate a random key when the smart contract is created and save that key in a private variable. I don't what to know its value either.
Let's take for example the code below:
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store value in a variable
*/
contract Storage {
uint256 private number;
constructor () public {
number = uint(keccak256(abi.encodePacked(now, msg.sender))) % 100;
}
}
Can someone know what the number
is? Could some miner repeat the calculation and get the same number?
I deployed this smart contract on rinkeby and I don't see any getters to read the value of number
.