Inspiration
our motive is to build a completely Decentralized E-commerce website to reduce the middle man fees and tax
What it does
It maintains the database of the buyer and seller in blockchain and is completely decentralized and transaction and payment gateway were done by solidity smart contract (Solidity-which is used to develop a smart contract in Ethereum blockchain network EVM), so there is no chance of any fraudulent activity were happen in commodity
How we built it
we need to clone the Amazon website for our prototype and the back-end was managed by solidity language / the algorithm of our E-commerce website is more secure it only sends the money to the sender when the product is received by the buyer / it verifies some technical condition and validates the digital signature of product details, so that we can reduce the middle man fees.
Challenges we ran into
Maintaining the database of products, buyers and seller is quite complex when it is compared with other centralized E-commerce websites like(Amazon,eBay, and AliExpress)
Accomplishments that we're proud of
we were proud of breaking the cost barriers by cutting of the middle man supports
What's next for Decentralized E-commerce website
Make the E-commerce website more user-friendly and deploy our prototype in real world entity
Solidity code for E-commerce website
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract ecomerce{
struct product{
string productName;
string sellerName;
address payable seller;
uint price;
address buyer;
bool delivred;
uint productid;
}
product[] public data;
address payable manager;
constructor(){
manager=payable(msg.sender);
}
bool destroyed = false;
modifier destroycontract(){
require(!destroyed,"this contract does not exist");
_;
}
uint count=1;
event register(string ProductName,uint ProductId,address selleraddress);
event buyer(address SellerAddress,uint ProductId);
event delivered(uint ProductId,bool status);
function Register(string memory _productname,string memory _sellername, uint _price) public destroycontract{
require(_price>0,"product price must be greater than zero");
product memory p1;
p1.productName=_productname;
p1.sellerName=_sellername;
p1.seller=payable(msg.sender);
p1.price=_price*10**18;
p1.productid=count;
count++;
data.push(p1);
emit register(p1.productName,p1.productid,msg.sender);
}
function buy(uint _productid) payable public destroycontract{
require(data[_productid-1].price==msg.value,"pay the exact amaount");
require(data[_productid-1].seller!=msg.sender,"seller cannot bet the buyer ");
data[_productid-1].buyer==msg.sender;
emit buyer(msg.sender,_productid);
}
function delivery(uint _productid) public destroycontract{
require(data[_productid-1].buyer==msg.sender,"only buyer can confirm");
data[_productid-1].delivred=true;
data[_productid-1].seller.transfer(data[_productid-1].price);
emit delivered(_productid, data[_productid-1].delivred);
}
function Destroycontract() payable public destroycontract{
require(manager==msg.sender);
selfdestruct(manager);
manager.transfer(address(this).balance);
destroyed=true;
}
}


Log in or sign up for Devpost to join the conversation.