Inspiration

The inspiration for the ShopDAO generator stemmed from observing a thriving trend – the integration of e-commerce with DAOs and autonomous workflows.

For instance, the ShopDAO generator enables a brand to establish a retail-specific DAO. When a product selling proposal is approved by the DAO governance, the product is automatically listed on Shopify, through the use of Chainlink Oracle hosted by Chainlink Functions. The sales profits are then autonomously and fairly distributed to NFT holders.

What it does

The ShopDAO generator is a groundbreaking tool that allows brand to create a retail-specific DAO for their Shopify-based e-commerce platform. It empowers brand fans to actively participate in the decision-making process and involves them in daily business operations. It also allows both brand and fans to benefit from generated profits.

User usecase:

  • [Brand Manager] Create a retail-specific DAO.
  • [Brand Fan] Enable fans to actively participate in the decision-making process.
  • [Brand Fan] Facilitate their involvement in the day-to-day brand business operations.
  • [Brand Fan] Allow fans to benefit from the generated profits.
  • [Brand Manager] stock up on merchandise by nft sales.

shopdao generator workflow

How we built it

Chainlink

Chanlink Functions: First thing that we had to build is integration with Shopify Admin API for registoration selling item.

We also considered implementing the system with ExternalAdapter as well as Functions, but we think it was the right decision to use Functions in consideration of implementation and operation.

Extended Access Control to limit execution for requirement by restricting executeRequest() to Timelock Contracts, which can be decentlized.

Chainlink Automations: Chainlink automation is used for DAOs workflow.The process of a DAO requires someone to call the "queue" and "execute" functions; otherwise, the passed proposal will never be applied properly. This task is managed by the Chainlink automation.

To implement this automation in the DAO, I have created two sorted lists ordered by time. These lists essentially indicate the order in which the Chainlink automation will call functions.

The logic is as follows: when a proposal is created, it will be added to the first sorted list. If the voting period for the proposal passes and it receives enough votes, the automation will call the "queue" function, remove the proposal from the first list, and add it to the second list. Then, when the timelock delay has passed, the Chainlink automation will call the "execute" function and remove the proposal from the list.

SmartContract

You can view the architecture of the contracts implemented in this project here. Please note that there are several additional changes and additions currently in progress.

The main components of this project include decentralized autonomous organizations (DAOs), Chainlink automation, and Chainlink functions. In the provided image, it is visible that the BrandManager has the ability to create a DAO and make a proposal regarding which items should be listed on Shopify. Once the proposal receives enough votes from the DAO members, the Chainlink automation will initiate the "queue" and "execute" functions to list the item on Shopify. Essentially, the Chainlink function is utilized to facilitate the process of listing items on Shopify.

Frontend dApp

We are implementing these features based on React, TypeScript, Next.js, and Vercel serverless functions.

After the first version of the smart contract and backend was built we started on for the simple UX for the frontend.

1. Integration with Shopify - Webhook Configuration url

1.Integration with Shopify

2.Creation of Retail-Specific Brand DAO url

2.Creation of Retail-Specific Brand DAO

3.Product proposal and Purchase of ProfitRightNFT url

3.Product proposal and Purchase of ProfitRightNFT

4.Profit Distribution upon Sale from Shopify EC url

4.Profit Distribution upon Sale from Shopify EC

Challenges we ran into

I have come across several challenges. However, one of the most difficult parts was the implementation of the minimal proxy pattern and the governorContract offered by OpenZeppelin. The governorContract itself is inherited by many smart contracts, and there are many variables set up in the constructor functions of those smart contracts. This means that the values of the variables in the constructor functions will be empty when they are cloned. To solve this problem, I had to copy all the contracts and add init functions to set up those variables.

Accomplishments that we're proud of

We appreciate Chainlink for offering a great tutorial on how the state-of-the-art Chainlink function master works. We are very proud to have implemented this new feature in our project. The Chainlink function master is the core of our project, as it provides the connection between Web3, our smart contracts, and Web2, our target Shopify platform.

What we learned

I was truly impressed by the capabilities of Chainlink Functions. Compared to Chainlink External Adaptrer,It has been a game-changer for me, especially as I didn’t encountered challenges with configuring and operating nodes, as well as creating jobs. This experience has left me even more amazed and appreciative of its remarkable functionality.

What's next for ShopDAO generator

With the Brand Manager and fans being the target users, we are developing a protocol with a focus on general use cases and a user-friendly UX. Additionally, we are considering a toB marketing approach like Saas, keeping in mind the development of a protocol that offers enhanced marketing capabilities.

For example by leveraging ERC6551, we can create a model that not only provides a clear understanding for users but also works effectively as a tokenomics mechanism. This model involves centralized management of multiple ProfitRightNFTs and Governance Tokens, enabling a user-friendly approach and enhanced tokenomics functionality.

Built With

Share this project:

Updates