Skip to content

Instantly share code, notes, and snippets.

@alkavan
Created December 12, 2020 10:37
Show Gist options
  • Save alkavan/017242ddea26d37564dd6bf9509e1314 to your computer and use it in GitHub Desktop.
Save alkavan/017242ddea26d37564dd6bf9509e1314 to your computer and use it in GitHub Desktop.

Revisions

  1. alkavan created this gist Dec 12, 2020.
    48 changes: 48 additions & 0 deletions hardhat-openzeppelin-project.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    ## Install Instructions

    Install Hardhat
    ```
    npm install --save-dev hardhat
    ```

    Initiate a new Hardhat project (in empty directory)
    ```
    npx hardhat
    ```

    Install OpenZeppelin upgrades plugin
    ```
    npm install --save-dev @openzeppelin/hardhat-upgrades
    ```

    Install OpenZeppelin contracts
    ```
    npm install @openzeppelin/contracts
    ```

    ## Run Instructions

    Compile contracts
    ```
    npx hardhat compile
    ```

    Test contracts
    ```
    npx hardhat test
    ```

    Run network node
    ```
    npx hardhat node
    ```

    Deploy contract to the local running node
    ```
    npx hardhat run scripts/sample-script.js --network localhost
    ```

    ## References
    [Hardhat Getting Started](https://hardhat.org/getting-started/)
    [Hardhat Upgrades Plugin](https://docs.openzeppelin.com/upgrades-plugins/1.x/hardhat-upgrades)
    [OpenZeppelin and Hardhat Upgrades Tutorial](https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-hardhat/3580)