Lesson 6: understanding wait and deployed #2771
-
I'm trying to understand the purpose of the
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@NotNotRama : Simply put :
|
Beta Was this translation helpful? Give feedback.
-
@NotNotRama
For example, |
Beta Was this translation helpful? Give feedback.
@NotNotRama
SimpleStorageFactory.deploy()
deploys the actual contract which the ContractFactory instance represents.contract.deployTransaction.wait(1)
Here,.wait(<insert number>)
the number represents the number of blocks you want to "wait" (for them to be mined).1
means we are waiting for one block (to be mined).simpleStorage.deployed()
Here,.deployed()
serves as a "progress-checker", one which will pass oncesimpleStorage
is deployed.For example,
xyzContract.deployed
will wait untilxyzContract
is deployed and will return true once deployed. So, it serves for a confirmation for the contract to be deployed.