Create a test based on Hardhat for testing contract deployment and interaction.
🧯 01. Intro to Blockchain for FE developers
🧯 03. Hardhat general overview
🧥 (Optional) 04. Solidity - all you need to know about it
Create a Hardhat project:
- Add the Store Contract in the repo. The contract abides to the following specification:
- The administrator (owner) of the store should be able to add new products and the quantity of them.
- The administrator should not be able to add the same product twice, just quantity.
- Buyers (clients) should be able to see the available products and buy them by their id.
- Buyers should be able to return products if they are not satisfied (within a certain period in blocktime: 100 blocks).
- A client cannot buy the same product more than one time.
- The clients should not be able to buy a product more times than the quantity in the store unless a product is returned or added by the administrator (owner)
- Create a test suite in hardhat. The suite should provide extensive coverage for the Store Contract.
- [Optional] Setup a GitHub repo with CI. The CI should be able to: Compile the contract Deploy the contract on a local hardhat node Execute the suite against a local node and verify that it gets full code coverage