Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement strategy_any_item_from_collection_for_fixed_price contract #83

Closed
0xandee opened this issue Aug 21, 2024 · 13 comments
Closed
Assignees
Labels
ODHack7 OnlyDust Hackathon #7.0 Techno: cairo cairo Type: feature a new feature to implement

Comments

@0xandee
Copy link
Collaborator

0xandee commented Aug 21, 2024

This strategy will allow buyer can set a fixed price, then any NFT holder can insant sell at that price.

Read more on README, marketplace/deployment.ts and strategy_standard_sale_for_fixed_price.cairo for references and to understand more how strategy works with marketplace contract.

Example feature image:

image
@0xandee 0xandee added Type: feature a new feature to implement Techno: cairo cairo ODHack7 OnlyDust Hackathon #7.0 labels Aug 21, 2024
@Mystic-Nayy
Copy link

Mystic-Nayy commented Aug 21, 2024

Hi @0xandee i can work of this.

Copy link

onlydustapp bot commented Aug 21, 2024

Hi @Gift-Naomi!
Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

@ShantelPeters
Copy link

ShantelPeters commented Aug 21, 2024

Hi @0xandee I can work on this

@mubarak23
Copy link
Contributor

mubarak23 commented Aug 21, 2024

am available to work on this

this issue is aim at creating contract that allow the sell of any item at fix price.

so we will have the following function

  • set price for item by the buyer
  • NFT Holder accept price (can_execute_taker_bid)
  • NFT holder sell at that price (can_execute_taker_ask)

@0xandee

Copy link

onlydustapp bot commented Aug 21, 2024

Hi @mubarak23!
Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

2 similar comments
Copy link

onlydustapp bot commented Aug 21, 2024

Hi @mubarak23!
Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

Copy link

onlydustapp bot commented Aug 21, 2024

Hi @mubarak23!
Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

Copy link

onlydustapp bot commented Aug 21, 2024

Hi @ShantelPeters!
Maintainers during the ODHack # 7.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

@mubarak23
Copy link
Contributor

mubarak23 commented Aug 22, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

am a Cairo smart contract developer with experience working on projects such as Just Art Peace, Dojo, Kart, TBA, and Shinigami. Before transitioning to Cairo development, I was a backend developer specializing in Rust.

My recent work with cairo starknet

How I plan on tackling this issue

I intent to handle via the following flow

  • Setting the Protocol Fee
    The contract will initially set the protocol fee via the constructor, and it will be managed by the contract owner. I will also add a function that allows the contract owner to update the protocol fee as needed.

  • Returning the Protocol Fee:
    There will be a function to return the protocol fee. When an item is sold, the protocol fee will be added to the total price.

  • Setting Items for Sale:
    The contract will allow NFT holders to put items up for sale at any price. I will store the data in a mapping of tokenId to the owner's address.

  • Setting the Price for Items:
    A function will allow buyers to set a price for an item. The function will return a tuple containing the tokenId, price, and buyer’s address. It will check if the item was put up for sale by the owner at any price and emit an event.

  • can_execute_taker_bid:
    This function will return a tuple containing the price, tokenId, and a boolean indicating whether the bid can be executed. It will check if the item is allowed to be sold at the set price and emit an event.

  • Upgrade Function:
    This function will handle upgrading the contract.

Storage:

  • Mapping: <tokenId, ownerAddress>
  • Mapping: <buyerAddress, <TokenId, price>>

Unit Tests:
I will write all necessary unit tests, including edge cases for each function.

Duration:
4 days

@ScottyDavies
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am front end developer with 6 years experience.
i have worked with microsoft on several projects,
this will be my first time contributing to the ecosystem and i am ready to work

How I plan on tackling this issue

I would approach this issue with following steps
Understand the Existing Marketplace and Strategy:
Review the README file to gain a high-level understanding of how the marketplace contract and the various sales strategies work.
Examine the marketplace/deployment.ts file to see how the marketplace contract is currently being deployed and configured.
Analyze the strategy_standard_sale_for_fixed_price.cairo file to understand the implementation of the existing fixed-price sale strategy.
Design the Buyer-Set Fixed Price Strategy:
Determine the key components and requirements of the buyer-set fixed price strategy, such as:
Allowing buyers to set a fixed price for a specific NFT item
Enabling any NFT holder to instantly sell their NFT at the buyer-set price
Handling the transfer of the NFT and funds during the sale
Maintaining the buyer-set price and associated data
Sketch out the high-level logic and data structures needed to implement the buyer-set fixed price strategy.
Implement the Buyer-Set Fixed Price Strategy:
Create a new Cairo file, e.g., strategy_buyer_set_fixed_price.cairo, to implement the buyer-set fixed price strategy.
Define the necessary data structures and storage variables to keep track of the buyer-set prices, such as a mapping of NFT IDs to the fixed prices.
Implement the core logic of the buyer-set fixed price strategy, including:
Allowing buyers to set a fixed price for a specific NFT item
Enabling NFT holders to instantly sell their NFT at the buyer-set price
Handling the transfer of the NFT and funds during the sale
Updating the buyer-set price data when a sale occurs
Integrate the Buyer-Set Fixed Price Strategy with the Marketplace:
Modify the marketplace/deployment.ts file to include the new buyer-set fixed price strategy alongside the existing fixed-price sale strategy.
Ensure that the marketplace contract can properly interact with the buyer-set fixed price strategy, including:
Passing the necessary parameters to the buyer-set fixed price strategy
Handling the execution of the buyer-set fixed price sale
Integrating the buyer-set fixed price sale outcome with the overall marketplace functionality
Update the Documentation:
Enhance the README file to include detailed documentation on the new buyer-set fixed price strategy, covering the following aspects:
Overview of the buyer-set fixed price strategy and its key features
Integration with the marketplace contract
Step-by-step instructions on how to use the buyer-set fixed price strategy
Examples of buyer-set price setup and sale execution
Considerations and potential edge cases
Test and Validate the Buyer-Set Fixed Price Strategy:
Thoroughly test the buyer-set fixed price strategy, including various scenarios such as:
Buyers setting fixed prices for different NFT items
NFT holders attempting to sell at the buyer-set prices
Edge cases, such as handling errors or exceptions during the buyer-set fixed price sale
Ensure that the buyer-set fixed price strategy integrates seamlessly with the marketplace contract and that the overall system behaves as expected.
Deploy and Communicate the Changes:
Once the buyer-set fixed price strategy is tested and validated, deploy the updated marketplace contract to the production environment.
Communicate the new buyer-set fixed price functionality to the marketplace users, providing clear instructions and examples on how to set fixed prices and participate in the instant sale process.
Gather feedback from the users and be prepared to address any issues or concerns that arise during the initial deployment.

@kfastov
Copy link
Contributor

kfastov commented Aug 22, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I've wrote several Cairo contracts before, both from scratch and porting code from Solidity. I am aware of the latest Cairo updates, so I can write the up-to-date code.

How I plan on tackling this issue

I will check the README on how the strategies work, than take an existing strategy as a reference, create a new file for the new strategy, and implement the code.
Then I'll look how I can integrate this strategy into existing flow and do it.

@ooochoche
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a smart contract developer

How I plan on tackling this issue

I would start:

  • first by designing the new strategy. It should allow a buyer to set a fixed price for NFTs, and NFT holders can instantly sell at that price. Use the references to guide your implementation.

  • then, write the code in Cairo. Make sure it works well with the existing marketplace contract.

  • test the strategy carefully to check for any issues.

  • review work and update the documentation if needed

Copy link

onlydustapp bot commented Aug 23, 2024

The maintainer 0xandee has assigned mubarak23 to this issue via OnlyDust Platform.
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ODHack7 OnlyDust Hackathon #7.0 Techno: cairo cairo Type: feature a new feature to implement
Projects
None yet
Development

No branches or pull requests

7 participants