pcaversaccio / createx

Factory smart contract to make easier and safer usage of the `CREATE` and `CREATE2` EVM opcodes as well as of `CREATE3`-based (i.e. without an initcode factor) contract creations.
https://createx.rocks
GNU Affero General Public License v3.0
304 stars 18 forks source link

♻️ Remove `dotenv` and Use Hardhat Configuration Variables #27

Closed pcaversaccio closed 11 months ago

pcaversaccio commented 11 months ago

🕓 Changelog

Hardhat v2.19.0 introduced configuration variables for user-specific values or for data that shouldn't be included in the code repository (i.e. a private key). Since we want to set an industry precedent, I completely remove any dotenv variables (I keep it in the .gitignore though for footgun protection) and use the new syntax vars.has and vars.get. I deliberately don't use a default value for vars.get but instead use vars.has("OPTIONAL_VARIABLE") ? [vars.get("OPTIONAL_VARIABLE")] : []; in order to be explicit about it already in the code.

🐶 Cute Animal Picture

image

github-actions[bot] commented 11 months ago

Coverage after merging hh-vars into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   CreateX.sol100%100%100%100%