-
imagine we are deploying our contract or a testnet or even the main net why do we have to wait for block confirmations if we do this : const someResponse = await deploy() aren't we waiting for the end of the deployment ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When you deploy a smart contract on a blockchain network, you are essentially submitting a transaction that contains the bytecode of your contract to be executed by the network's nodes. Once this transaction is submitted to the network, it needs to be included in a block and added to the blockchain. This is where block confirmations come in. Block confirmations refer to the number of blocks that have been added to the blockchain after the block that includes your contract deployment transaction. Each block that is added to the chain after your transaction increases the level of security and immutability of your contract. The await deploy() line in your code waits for the network to confirm that the transaction has been included in a block, but it does not wait for the necessary number of block confirmations before proceeding with the next steps in your deployment script. This means that there is a possibility that your contract deployment transaction could be reversed or become invalid if it is not included in the blockchain's longest valid chain. |
Beta Was this translation helpful? Give feedback.
When you deploy a smart contract on a blockchain network, you are essentially submitting a transaction that contains the bytecode of your contract to be executed by the network's nodes. Once this transaction is submitted to the network, it needs to be included in a block and added to the blockchain. This is where block confirmations come in.
Block confirmations refer to the number of blocks that have been added to the blockchain after the block that includes your contract deployment transaction. Each block that is added to the chain after your transaction increases the level of security and immutability of your contract.
The await deploy() line in your code waits for the network to confir…