- Customer can buy an item by paying the amount in ether(or wei)
- Admin can upload a new item by pasing the details (category, seller address, quantity ..etc)
- Admin can view how much to pay to the seller of a pariculater item ID.
- Admin can pay to the seller of a pariculater item ID.
- Arguments to
upload a new item
(by Admin) are -
uint category -> 0 for Men, 1 for Women, 2 for Children
uint quantity -> Number of items
address seller -> Ethereum address of the seller
uint weiPerItem -> price (wei) per item
string memory name -> Name of the item
string memory description -> Description about the item
string memory image -> URL of the item image
- Clone this repository
npm install
touch .env
- Put your accounts private key (this account will be the admin) and your infura ribkeby url in the .env file (format given in env.copy file)
cd ./frontend
npm install
cd ..
- Run the hardhat script that will deploy the contract using the command
npx hardhat run --network rinkeby ./scripts/deploy.js
- The script will return the address of the deployed contract, copy that!
- Paste the contract address in the files
frontend/src/App.js
andfrontend/src/Components/Admin.js
in the variablecontractAddress
cd ./frontend
npm start