This repository was archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
AP-743: Deployment Script: Logging of TX Hashes #370
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AP-743 Deployment Script: Logging of TX Hashes
Deploy logic lacks the deployment Tx hash logging (makes it harder to debug) |
stevieraykatz
approved these changes
Sep 7, 2023
Good catch on the fact that the types imported from utils which imported from typechain which could case circular/undefined imports! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation of the solution
deploy
anddeployBehindProxy
that wrap common deployment logic (see utils/deploy.ts) which includes logging of Tx hashes only on failed transactions (to avoid cluttering the logs); successful Tx hashes, if necessary, can be found by searching etherscan-like explorers with the deployed contract's addressdotenv.config(...)
call)Explanation: if types are part of the utils/* folder, then in order for hardhat.config.ts to load config/* (to use
CONFIG
constant) which imports an enum type from this utils/types/* folder, it (hardhat.config.ts) needs to also load the utils/* folder. This becomes a problem if we have any file inside utils/* use the auto-generated typechain-types folder, since at the time of hardhat.config.ts being loaded thesetypechain
types do not exist (they are loaded afterwards); we cannot guarantee typechain-types won't be used inside utils/* (and it is used with the newly created helper funcs), so updated the code to avoid this issue altogether.NOTE: even if these helpers weren't created and the "typechain-types loading problem" didn't occur up 'till now, it would've probably occurred at some later point, so better to tackle it now than later
Instructions on making this work
yarn
oryarn install
to install npm dependencies