I believe this is a very simple question, but i couldn't find a direct answer in documentation or google. I'm new to solidity/ethereum and maybe i don't fully understand some core concepts yet.
So, let's use a simple code like this
contract StrangeToken {
uint256 private repurchasePrice;
mapping(address => uint256) balances;
function setPrice(uint256 price) {
repurchasePrice = price;
}
}
Anyone can call setPrice()
function to set a repurchasePrice
variable. Let's assume that there are thousands of users and setPrice()
is called every minute or even more often and the value is set to some random number.
The questions is: how difficult is it to predict and/or influence the value of repurchasePrice for the nearest future/coming blocks.
As far as i understand ethereum does not necessarily keep a sequence of calls so there is no practical possibility to time the call, so attacker has to be at least a miner, not a ordinary user. But the possibilities of miners in this area are not completely clear to me.
Thanks!