The Shef token Project is a simple implementation of an ERC-20 token using Solidity
- Introduction
- Theory Notes
- Features and Functionality
- Implementation
- Running the Project Locally
- Deployment
- Usage
- License
The project includes a smart contract for the token (ShefToken) and a shop (ShefShop) that allows users to buy and sell tokens. The smart contract is built with security and best practices in mind, including ownership checks and balance validations
ERC-20 is a standard for tokens on the Ethereum blockchain. It defines a set of functions that all compliant tokens must implement, ensuring interoperability between various tokens and platforms
Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. It helps developers manage and automate the recurring tasks that are part of the smart contract development workflow
- Token Creation: The ShefToken smart contract allows for the creation and management of a new ERC-20 token
- Minting and Burning: The contract owner can mint new tokens and burn existing ones
- Transfers and Allowances: Users can transfer tokens to others and set allowances for spending
- Shop Integration: The ShefShop contract allows users to buy tokens with Ether and sell tokens for Ether
The project includes two main contracts:
- ERC-20: Implements the standard ERC-20 functions and additional features like minting and burning.
- ShefShop: Facilitates the buying and selling of ShefTokens.
The project includes a suite of tests to ensure the functionality and security of the contracts. The tests cover scenarios such as:
- Deploying the contracts
- Buying and selling tokens
- Checking balances and allowances
- Minting and burning tokens
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/sssshefer/ERC-20.git cd sheftoken
-
Install dependencies:
npm install
-
Compile the contracts:
npx hardhat compile
-
Run the tests:
npx hardhat test
-
Deploy the contracts locally:
npx hardhat run scripts/deploy.js --network localhost
To deploy the contracts to a live network, follow these steps:
- Configure network settings in
hardhat.config.js
. - Deploy the contracts:
npx hardhat run scripts/deploy.js --network your-network
Once deployed, you can interact with the ShefToken and ShefShop contracts using a web3 interface like Ethers.js or Web3.js. Ensure you have the ABI and contract addresses
This project is licensed under the MIT License.