Skip to content

lesson-9 00-mocks vs 01-deploy #2331

Answered by krakxn
TimeKeyRoll asked this question in Q&A
Discussion options

You must be logged in to vote

See, first of all there is an order precedence : 00 and 01

Consequently, our "00 deploy mocks" script is used first by Hardhat--which essentially deploys our Mock contract.

Only then is our "01 deploy" is used.

Why is the Mock being used in the actual deployment (i.e. "01 deploy")? Because for local networks we need the Mock. We do not use it for testnet deployments. This is precisely the need for it in your "01 deploy" script.

This is also why if you straight up run the second script on a local network w/o deploying your Mock, it will lead to an error resembling "cannot get mock xyz"

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@TimeKeyRoll
Comment options

@alymurtazamemon
Comment options

@TimeKeyRoll
Comment options

@alymurtazamemon
Comment options

@TimeKeyRoll
Comment options

Comment options

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

@krakxn
Comment options

Answer selected by TimeKeyRoll
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