Scenerio 1
Say I have a function f()
.
Whoever calls the function first gets a reward.
Persons A
, B
, and C
all call the function at roughly the same time.
Who will receive the reward?
Scenerio 2
Say I have a function f()
Whoever calls the function first gets a reward and function f()
is no longer callable.
Persons A
, B
, and C
all call the function at roughly the same time.
In actuality Person A
calls function f()
first.
Will persons B
and C
still be able to call the function?
For Clarity
I'm building a smart contract where if someone calls a certain function
f()
, that person and ONLY that person will receive a unique reward. And because that person called the function first, the contract will be paused (function f()
will be uncallable) until that block has been mined.
So basically are the two scenarios mentioned possible?
Or am I misunderstanding anything when it comes to the mechanics of the Ethereum blockchain?
I've tested my contract within a private network and the contract is paused immediately once I call the function, and then is unpaused once the block has been mined.