This project was made with:
- Install the dependencies.
npm install
- Compile the contracts.
npx hardhat compile
- Test the contracts.
npx hardhat test
-
Create a second account in metamask if you don't have one and use the second account (metamask is an extension to do blockchain transactions in the browser, if you don't metamask installed click the metamask link to install the extension)
-
Create a
.env
file and add the 12 MNEMONIC phrase generated by metamask look at the.env.example
file to have an example (this step will connect your HD WALLET in this case metamask with the test hardhat accounts while you are in the hardhat network) -
Run the hardhat network (this command will run the hardhat network with 10 test accounts with 1000 fake ETH for each one)
npx hardhat node
- Open a new terminal while the hardhat network is running and run the next script (this script will deploy the contracts to the hardhat network and will create the
abis
folder inside./src
)
npx hardhat run scripts/deploy.js --network localhost
- Change metamask to the hardhat network if you don't have the hardhat network added follow the next steps of the image.
- Add the Mock Dai Token to metamask in custom Tokens.
If you don't know the mock dai contract address check inside the
./src/abis
inside the filedaitoken-address.json
you will find the address. (Note to create the abis folder you need to do step 5) if you don't know the token symbol and decimals check inside the./contracts/DaiToken.sol
contract - Run the react app.
npm start
- Start playing with the token farm stacking and unstacking tokens.
- Issue Retro tokens to your address.
npx hardhat run scripts/issue-tokens.js --network localhost