As an example take the following test contract:
pragma solidity ^0.4.24;
contract DoubleCall {
address public superHero;
uint256 public price = 1 ether;
function becomeSuperHero() public payable{
require(msg.value >= price);
superHero = msg.sender;
price = price * 2;
}
}
What will superHero be if two accounts send a transaction calling the contract's becomeSuperHero()
- both sending 1Eth and the same amount of gas. Both transactions should be included within the same block.
What is the outcome?