Inspiration
Cryptos’ super power is how they enable borderless payments for goods and services! This is why I started work on dCommerce, a custom erc1155 contract to accept crypto payments for physical/digital goods & services. (for the Unbanked & Degen)
What it does
The contract logic is built with the concept of a Shopify or Stripe product dashboard where you can set up basic product information and prices then send out a payment link. This allows for decentralized stock management and sales!
How we built it
After the contract is deployed it’s ready for setup and retrieves ETH/USD price data using ChainLink AggregatorV3Interface.
The dProduct manager can use the following to setup products:
- The ownerInitProduct function allows the owner to initialize a new product with a given URI and price.
- The setPrice function allows the owner to set the price for a particular product in USD or other stables.
- The updateProductURI function allows the owner to update the URI of an existing product.
- The setShipping function allows the owner of the contract to set a new shipping fee for products.
Now that there are products on chain, buyers can now browse any decentralized app (like etherscan) or the official website:
- The getLatestPrice function retrieves the latest ETH/USD price from the Chainlink oracle and calculates the ETH price for a given product based on its id.
- The buy function allows a user to purchase a specified amount of a product for the calculated price in ETH, plus a shipping fee.
- The buyBulk function allows a user to purchase multiple products at once, with each product priced and calculated individually
NB: getLatestPrice is used in both buy & buyBulk so buyers can pay the eth equivalents of the usd/stables price
Product delivery is up to the merchant on the terms agreed on in the product description. This lightweight & decentralized model for running a business allows for more flexibility in making sales, receiving payment and delivering products especially across borders. Shipping/Delivery and other product info can be collected off-chain through an Official website or even token gated discord.
Shipping Claims were letter integrated with the contract to track orders that have been shipped against orders that have not!
Challenges we ran into
I used TS for the first time on the frontend and it was a challenge to figure out the types and interfaces in the early stages. Testing was complicated due to gas on goerli being so high and many services not fully supporting sepolia yet
Accomplishments that we're proud of
- Place just 3 positions shy of winning a NounsDao grant for dCommerce during their Hack Week! Got massive support from nouns12. This is massive for an anon dev with zero exposure to nouns prior to submission
- Applied to Unemployable grant programs found a user interesting in using dCommerce for the farm produce sales
What we learned
- The NFT/Crypto Space & regulation might not be completely ready to fully embrace consumer projects like this!
- Decentralized consumer phased projects have the potential to destabilize many legacy web2 monopolies with open-source leading the way
What's next for dCommerce
- Website builder + dCommerce deployer & product/sales management dashboard (decentralized Shopify)
- Find Suppliers & retailers willing to conduct their business the decentralized way using dCommerce
- Create some personal side businesses using the protocol (already working on being Ledger Reseller in the west African region)
Built With
- ethers
- react
- solidity
- typescript
- wagmi


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