0xWeb
  • 0xWeb
  • πŸ’»Installation
  • πŸ—ƒοΈBlockchains
  • πŸ“¦Package Manager
    • πŸ“‚Folder structure
    • πŸš€Dequanto dependency
    • πŸŽ†Installing contracts
    • πŸ”’Versioning
  • πŸ”Wallet
    • πŸ”‘Keys notice
    • πŸ™‚Accounts
  • πŸ’»CLI
    • Commands Overview
  • πŸ—„οΈGnosis Safe
    • πŸ™†β€β™‚οΈZero Trust Wallet
  • πŸš€Dequanto
    • ℹ️Info
    • πŸ•ΈοΈRPC Client Pool
    • πŸ—οΈTx Builder
    • πŸ“€Tx Writer
    • ⛓️Blockchain Explorers
    • πŸͺ™Token Services
    • πŸ—ƒοΈIndexer
    • ✨Utilities
  • ⛑️Hardhat
    • ℹ️Info
    • ⬇️Installation
    • 🧩Compile
    • πŸ’«Deploy
  • 0️Openzeppelin
    • Openzeppelin contracts
Powered by GitBook
On this page
  • --sources
  • --artifacts
  • --watch true
  • --package
  1. Hardhat

Compile

You would use the Hardhat as usual. Client classes will be generated for the compiled contracts automatically

npx hardhat compile

Additional CLI parameters

--sources

Override the default sources folder (/contracts)

npx hardhat compile --sources /other/folder/in/projects/root

--artifacts

Override the default output folder

npx hardhat compile --artifacts /foo/bar

--watch true

Compile the contracts, watch *.sol files for changes and automatically recompile

npx hardhat compile --watch true

--package

Enables the mono-repo structure for the project. The contracts can now be organized into separate package folders within the repository


project/
β”œβ”€ packages/
β”‚  β”œβ”€ Foo/
β”‚  β”‚  β”œβ”€ contracts/
β”‚  β”‚  β”‚  β”œβ”€ Foo.sol
β”‚  β”œβ”€ Bar/
β”‚  β”‚  β”œβ”€ contracts/
β”‚  β”‚  β”‚  β”œβ”€ Bar.sol

Every package can be implemented separately, but still reference the contracts and interfaces of each other. To compile the package:

npx hardhat compile --package packages/Bar

PreviousInstallationNextDeploy

Last updated 1 year ago

⛑️
🧩