1

where Modifier executed?

in block 1, for example i want send 10 eth to a contract address. in the modifier i will check that contract address should have 0 eth balance. The check is done at the modifier and allows the transaction to be created and sent to the network. now due to network congestion, my transaction will stay pending for 5 blocks. but in block 2, The contract will receive 0.1 eth and the contract balance is no longer zero. now, in block number 5, my transaction will be done and 10 eth will be sent to the contract, or my transaction will get revert ?

1 Answer 1

0

The modifier is executed when the function is called.

In block 1: modifier executed sees that transaction has 0 eth function gets executed: 10 eth is sent to contract address

block 2: contract address receives 0.1 eth

block 5: modifer is executed again but fails transaction is reverted. Eth is not sent to the contract address

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.