Compile a Contract with the CLI

After you extract a packaged contract, you can compile the project from the command line.

Run the following commands to compile and verify a contract.

  1. Navigate to the directory that contains the extracted package.
    cd <path/to/directory>
  2. Compile the project.
    npx hardhat clean && npx hardhat 
  3. Navigate to the contracts folder.
    cd  <path/to/directory>/artifacts/contracts

Verify that the ABI, bytecode, and other compilation related information is available under the contracts folder. For example, in case of the TokenizedDeposit package, the information will be found in the ./artifacts/contracts/TokenizedDeposit/TokenizedDepositUpgradeable.sol/TokenizedDepositUpgradeable.json file.