I'm new to programming and currently following a brownie tutorial. While interacting with smart contracts, my tutor puts a tx.wait(1) after every transaction that requires a state change of the contract. I'm guessing tx.wait(1) means that we tell brownie to wait for at least one confirmation of the transaction before proceeding further. But
It is clear that I don't fully understand what tx.wait(1) actually does. Can someone please explain it to me? Or atleast point me towards some documentation about it? I'd really appreciate the help. TIA.
number of confirmations are required to finalize a transaction with high probability. Confirmations serve as an additional mechanism to ensure that there is probabilistically a very low chance for a transaction to be reverted, but otherwise, once a mined block is finalized and announced, the transactions within that block are final at that point. Bitcoin has 6 block confirmations. The key idea behind waiting for six confirmations is that the probability of double spending is virtually eliminated after six confirmations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With