From 346c7fc268669de9f17fd8527183666da7121b7d Mon Sep 17 00:00:00 2001 From: leggio Date: Wed, 9 Nov 2022 13:24:30 -0500 Subject: [PATCH] readme info --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7be82e5..4abcba8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ -# Sample Hardhat Project +# Magna Take-Home Assessment -This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract. +## Smart Contracts: +- `MagnaToken.sol` -> an example ERC20 token that is deployed for the Airdrop +- `Airdrop.sol` -> a simple airdrop contract that sends ERC20 tokens to an array of addresses -Try running some of the following tasks: +## Contract Setup: +1. Run `yarn` in this directory to install all required dependencies. +2. Split your terminal into 2 windows. +3. In one, run `yarn hardhat node` to run the hardhat chain locally on your machine. +4. In the other, run `yarn hardhat run scripts/deploy.ts`. Make sure to take note of the contract addresses that are printed to the console when this command is ran, as you will use these to call the contracts from your dapp. This deploy script does the following: + 1. Deploy the ERC20 token contract and mint tokens to Hardhat Account #0 (listed in the terminal output of the `yarn hardhat node` command). + 2. Deploy the Airdrop contract while passing our ERC20 token's address to the constructor of the Airdrop contract. -```shell -npx hardhat help -npx hardhat test -REPORT_GAS=true npx hardhat test -npx hardhat node -npx hardhat run scripts/deploy.ts -``` +## Contract Tests: +We have included a suite of tests for the Airdrop contract that you can refer to for basic contract functionality. These can be ran by running `yarn hardhat test`. Feel free to edit the test cases to better understand the functionality/limitations of the Airdrop contract. \ No newline at end of file