diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 387e540..11045a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 21 - cache: 'npm' + cache: "npm" - name: "Install the Node.js dependencies" run: "npm install" @@ -63,7 +63,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 21 - cache: 'npm' + cache: "npm" - name: "Install the Node.js dependencies" run: "npm install" @@ -96,7 +96,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 21 - cache: 'npm' + cache: "npm" - name: "Install the Node.js dependencies" run: "npm install" diff --git a/.solhint.json b/.solhint.json index 14f780e..92c0821 100644 --- a/.solhint.json +++ b/.solhint.json @@ -4,11 +4,17 @@ "code-complexity": ["error", 8], "compiler-version": ["error", ">=0.8.25"], "func-name-mixedcase": "off", - "func-visibility": ["error", { "ignoreConstructors": true }], + "func-visibility": [ + "error", + { + "ignoreConstructors": true + } + ], "max-line-length": ["error", 120], "named-parameters-mapping": "warn", "no-console": "off", "not-rely-on-time": "off", - "one-contract-per-file": "off" + "one-contract-per-file": "off", + "no-empty-blocks": "off" } } diff --git a/.vscode/settings.json b/.vscode/settings.json index dfaf895..6d10e02 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,4 +7,4 @@ }, "solidity.formatter": "forge", "solidity.compileUsingRemoteVersion": "v0.8.25+commit.b61c2a91" -} \ No newline at end of file +} diff --git a/README.md b/README.md index 74eff1f..38ec9cb 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This project is designed to test your skills in smart contract development using ## Project Overview -You are tasked with implementing a token vendor machine that allows users to buy and sell tokens. The project consists of two main contracts: +You are tasked with implementing a token vendor machine that allows users to buy and sell tokens. The project consists +of two main contracts: 1. `BlockfulToken.sol`: An ERC20 token contract 2. `TokenVendor.sol`: A vendor contract for buying and selling tokens @@ -19,10 +20,12 @@ To get started with this project, follow these steps: ## Your Tasks 1. Implement the `BlockfulToken` contract: + - It should be an ERC20 token with a name, symbol, and 18 decimals. - Initial supply should be 1,000,000 tokens. 2. Implement the `TokenVendor` contract with the following functionality: + - Allow users to buy tokens with ETH (1 ETH = 100 tokens) - Allow users to sell tokens back to the contract - Allow the owner to withdraw ETH from the contract @@ -30,6 +33,7 @@ To get started with this project, follow these steps: - Emit events for token purchases, sales, and ETH withdrawals 3. Complete the test file `test/TokenVendor.t.sol`: + - We've provided some basic "happy path" tests - Implement additional tests for edge cases and potential failure scenarios - Aim for at least 90% test coverage @@ -91,6 +95,7 @@ Please submit your completed project as a Git repository. Make sure to include: ## Note -This project uses [Foundry](https://getfoundry.sh/). If you're new to Foundry, check out the [Foundry Book](https://book.getfoundry.sh/) for detailed instructions and tutorials. +This project uses [Foundry](https://getfoundry.sh/). If you're new to Foundry, check out the +[Foundry Book](https://book.getfoundry.sh/) for detailed instructions and tutorials. Good luck with the challenge! We're excited to see your implementation. diff --git a/package.json b/package.json index 10855aa..5cae5a8 100644 --- a/package.json +++ b/package.json @@ -37,4 +37,4 @@ "test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage", "deploy": "forge script script/Deploy.s.sol:Deploy --rpc-url http://localhost:8545 --broadcast" } -} \ No newline at end of file +}