ArkProjectNFTs / ark-project

ArkProject is a liquidity layer for digital assets, uniting markets, empowering creators, and bridging the gap to mass adoption. Built on top of Starknet, ArkProject is designed to provide a fully decentralized and trustless orderbook on-chain.
https://arkproject.dev
Apache License 2.0
26 stars 12 forks source link

Whitelist brokers #182

Closed kwiss closed 5 months ago

kwiss commented 10 months ago

Feature Description

We need to introduce a whitelisting mechanism for brokers in our Orderbook. A broker, in our context, is an entity authorized to perform order creation & fulfillment. Our system should include two types of brokers: a) Marketplace brokers that are rewarded when an order is created. creator_broker b) Marketplace brokers that are rewarded when an order is fulfilled. fulfiller_broker

Theses two will be send to Starknet L2 when the order is executed.

Requirements

  1. Whitelisting Functionality: Implement a function to whitelist brokers. This function should manage the list of marketplaces and projects authorized to act as brokers.

  2. Broker Validation in Order Creation and Fulfillment:

    • In the order creation process, validate if the broker is whitelisted. Reject the creation if no broker is detected or if a non-whitelisted broker is involved.
    • Similarly, for order fulfillment, ensure that the fulfilling broker is whitelisted and reject the transaction if it's not.

Implementation Details

  1. Whitelist Broker Function:

  2. Broker Validation in Validate Common Data Function:

    • This validation should be added to the validate common data function.
    • Location for update: order_v1.cairo

Please feel free to ask for any clarifications or additional details needed.

kwiss commented 9 months ago

Any comments @glihm @remiroyc ?