Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

AP-743: Deployment Script: Logging of TX Hashes #370

Merged
merged 25 commits into from
Sep 7, 2023
Merged

Conversation

0xNeshi
Copy link
Contributor

@0xNeshi 0xNeshi commented Sep 7, 2023

Explanation of the solution

  • created helper functions deploy and deployBehindProxy 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 address
  • moved env.config.ts to config/* folder (+ removed redundant dotenv.config(...) call)
  • moved types into a new root folder types/* and updated tsconfig.json to load this folder together with hardhat.config.ts
    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 these typechain 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

  • run yarn or yarn install to install npm dependencies

@0xNeshi 0xNeshi added enhancement New feature or request WIP labels Sep 7, 2023
@0xNeshi 0xNeshi self-assigned this Sep 7, 2023
@linear
Copy link

linear bot commented Sep 7, 2023

AP-743 Deployment Script: Logging of TX Hashes

Deploy logic lacks the deployment Tx hash logging (makes it harder to debug)

@0xNeshi 0xNeshi changed the title [WIP]: Ap 743 [WIP]: AP-743: Deployment Script: Logging of TX Hashes Sep 7, 2023
@0xNeshi 0xNeshi removed the WIP label Sep 7, 2023
@0xNeshi 0xNeshi changed the title [WIP]: AP-743: Deployment Script: Logging of TX Hashes AP-743: Deployment Script: Logging of TX Hashes Sep 7, 2023
@stevieraykatz
Copy link
Contributor

Good catch on the fact that the types imported from utils which imported from typechain which could case circular/undefined imports!

@stevieraykatz stevieraykatz merged commit b03cf59 into master Sep 7, 2023
@stevieraykatz stevieraykatz deleted the ap-743 branch September 7, 2023 18:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants