Skip to content

What does .deployed() do? #1577

Answered by ricmoo
fvictorio asked this question in Q&A
May 20, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

The .deployTransaction only exists on transactions which we deployed by a ContractFactory during this execution.

The .deployed() method will use the .deployTransaction if it is present (i.e. was deployed by a ContractFactrory during this execution), otherwise it will use provider.getCode to ensure there is a contract deployed at this address, which means it can be used in another process or otherwise orthogonally to a ContractFactory. 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 at contract.address.

Does that make sense?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fvictorio
Comment options

@AlexTheLion123
Comment options

Answer selected by fvictorio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants