👋 Welcome to the public repository of ICE-DEX workshop!
This branch contains the boilerplate code for the project: ICE-DEX.
In this workshop, you'll learn how to create and deploy your custom ERC20 Token and a dedicated Exchange for it in the ICE-testnet.
Please go through the given tasks and complete them in a sequential order in order to do so...
npm install
Add the two contracts to the contracts directory
NOTE Make sure to delete the .gitignore file inside the contracts directory. It was only used as a placeholder so that the contracts directory could be commited to git
Create a new file called .env in the root directory and perform one of the following tasks as per your preference:
-
Use the provided accounts pre-funded with ICZ (testnet currency of ICE: Frost Network) to deploy and interact with the contracts in Frost:
- Copy the contents of .env.example file
- Paste it in your newly created .env file and save it
-
Use your personal metamask wallet pre-funded with ICZ to deploy and interact with the contracts in Frost:
- Copy the contents of .env.example file
- Paste it in your newly created .env file
- Replace the
DEPLOYER_PRIVATE_KEY
with the private key of the account you want to use - Replace the
DEPLOYER_ADDRESS
with the address of the related account
There are 6 scripts provided inside the scripts directory, run them consecutively in your terminal using the command:
npx hardhat run scripts/<file_name> --network frost
- 1_deploy_token.js
- 2_query_token.js
- 3_deploy_exchange.js
- 4_exchange_addLiquidity.js
- 5_exchange_swapIczForToken.js
- 6_exchange_swapTokenForIcz.js
Additional Hardhat Commands
`npx hardhat accounts`
`npx hardhat compile`
`npx hardhat clean`
`npx hardhat test`
`npx hardhat node`
`npx hardhat help`
NOTE
Please refer to the branch: complete_project for the complete project.