Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions assignments/token/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Sample Hardhat 3 Beta Project (`mocha` and `ethers`)

This project showcases a Hardhat 3 Beta project using `mocha` for tests and the `ethers` library for Ethereum interactions.

To learn more about the Hardhat 3 Beta, please visit the [Getting Started guide](https://hardhat.org/docs/getting-started#getting-started-with-hardhat-3). To share your feedback, join our [Hardhat 3 Beta](https://hardhat.org/hardhat3-beta-telegram-group) Telegram group or [open an issue](https://github.com/NomicFoundation/hardhat/issues/new) in our GitHub issue tracker.

## Project Overview

This example project includes:

- A simple Hardhat configuration file.
- Foundry-compatible Solidity unit tests.
- TypeScript integration tests using `mocha` and ethers.js
- Examples demonstrating how to connect to different types of networks, including locally simulating OP mainnet.

## Usage

### Running Tests

To run all the tests in the project, execute the following command:

```shell
npx hardhat test
```

You can also selectively run the Solidity or `mocha` tests:

```shell
npx hardhat test solidity
npx hardhat test mocha
```

### Make a deployment to Sepolia

This project includes an example Ignition module to deploy the contract. You can deploy this module to a locally simulated chain or to Sepolia.

To run the deployment to a local chain:

```shell
npx hardhat ignition deploy ignition/modules/Counter.ts
```

To run the deployment to Sepolia, you need an account with funds to send the transaction. The provided Hardhat configuration includes a Configuration Variable called `SEPOLIA_PRIVATE_KEY`, which you can use to set the private key of the account you want to use.

You can set the `SEPOLIA_PRIVATE_KEY` variable using the `hardhat-keystore` plugin or by setting it as an environment variable.

To set the `SEPOLIA_PRIVATE_KEY` config variable using `hardhat-keystore`:

```shell
npx hardhat keystore set SEPOLIA_PRIVATE_KEY
```

After setting the variable, you can run the deployment with the Sepolia network:

```shell
npx hardhat ignition deploy --network sepolia ignition/modules/Counter.ts
```
1 change: 1 addition & 0 deletions assignments/token/cache/compile-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"/home/dgp/Documents/Token/contracts/Counter.sol":{"jobHash":"solc-0_8_28-3cf78ffd563e71214aa1c6f0535657fdd3def742","isolated":false,"artifactPaths":["/home/dgp/Documents/Token/artifacts/contracts/Counter.sol/Counter.json"],"buildInfoPath":"/home/dgp/Documents/Token/artifacts/build-info/solc-0_8_28-3d8f8a931f4e87d5253566b1bec96e960d034861.json","buildInfoOutputPath":"/home/dgp/Documents/Token/artifacts/build-info/solc-0_8_28-3d8f8a931f4e87d5253566b1bec96e960d034861.output.json","typeFilePath":"/home/dgp/Documents/Token/artifacts/contracts/Counter.sol/artifacts.d.ts","wasm":false},"/home/dgp/Documents/Token/contracts/Counter.t.sol":{"jobHash":"solc-0_8_28-0093c652ae45a119a272b9e4d188227124584146","isolated":false,"artifactPaths":["/home/dgp/Documents/Token/cache/test-artifacts/contracts/Counter.t.sol/CounterTest.json"],"buildInfoPath":"/home/dgp/Documents/Token/cache/test-artifacts/build-info/solc-0_8_28-0093c652ae45a119a272b9e4d188227124584146.json","buildInfoOutputPath":"/home/dgp/Documents/Token/cache/test-artifacts/build-info/solc-0_8_28-0093c652ae45a119a272b9e4d188227124584146.output.json","wasm":false},"/home/dgp/Documents/Token/contracts/ERC20.sol":{"jobHash":"solc-0_8_28-0c348592b6355c4c11341c4cabe08907df6898e2","isolated":false,"artifactPaths":["/home/dgp/Documents/Token/artifacts/contracts/ERC20.sol/ERC20.json"],"buildInfoPath":"/home/dgp/Documents/Token/artifacts/build-info/solc-0_8_28-3d8f8a931f4e87d5253566b1bec96e960d034861.json","buildInfoOutputPath":"/home/dgp/Documents/Token/artifacts/build-info/solc-0_8_28-3d8f8a931f4e87d5253566b1bec96e960d034861.output.json","typeFilePath":"/home/dgp/Documents/Token/artifacts/contracts/ERC20.sol/artifacts.d.ts","wasm":false},"/home/dgp/Documents/Token/contracts/ERC721.sol":{"jobHash":"solc-0_8_28-9127224d232e6fed7c7cdd8605bc0f18c595ef3f","isolated":false,"artifactPaths":["/home/dgp/Documents/Token/artifacts/contracts/ERC721.sol/ERC721.json","/home/dgp/Documents/Token/artifacts/contracts/ERC721.sol/IERC165.json","/home/dgp/Documents/Token/artifacts/contracts/ERC721.sol/IERC721.json","/home/dgp/Documents/Token/artifacts/contracts/ERC721.sol/IERC721Metadata.json","/home/dgp/Documents/Token/artifacts/contracts/ERC721.sol/IERC721Receiver.json"],"buildInfoPath":"/home/dgp/Documents/Token/artifacts/build-info/solc-0_8_28-3d8f8a931f4e87d5253566b1bec96e960d034861.json","buildInfoOutputPath":"/home/dgp/Documents/Token/artifacts/build-info/solc-0_8_28-3d8f8a931f4e87d5253566b1bec96e960d034861.output.json","typeFilePath":"/home/dgp/Documents/Token/artifacts/contracts/ERC721.sol/artifacts.d.ts","wasm":false}}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading