-
Users tend to do this: const contract = Contract.deploy()
await contract.deployed() but that doesn't seem to quite work on testnets (it does on local networks). My answer usually is to tell them to use So, what is the difference? What does |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The The So, the Does that make sense? |
Beta Was this translation helpful? Give feedback.
The
.deployTransaction
only exists on transactions which we deployed by aContractFactory
during this execution.The
.deployed()
method will use the.deployTransaction
if it is present (i.e. was deployed by aContractFactrory
during this execution), otherwise it will useprovider.getCode
to ensure there is a contract deployed at this address, which means it can be used in another process or otherwise orthogonally to aContractFactory
. This does not verify the bytecode is the correct contract (as it doesn't even know what the correct bytecode is).So, the
.deployed()
will make sure there is a contract deployed atcontract.address
.Does that make sense?