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
27 stars 26 forks source link

Add ERC-20 Support to NFT Orderbook Smart Contract #469

Open kwiss opened 2 months ago

kwiss commented 2 months ago

Description

We need to extend our NFT orderbook smart contract to support ERC-20 tokens in addition to the currently supported token standards. This addition will allow for fungible token trading within our orderbook system.

Current Status

Tasks

  1. Deploy an ERC-20 token contract on a devnet for testing purposes.
  2. Add support for the ERC-20 standard to the orderbook smart contract:
    • Implement dedicated functions for ERC-20 interactions.
    • Modify existing logic to handle token quantities.
    • Implement logic to handle non-existing token IDs (as ERC-20 tokens don't have individual IDs).

Implementation Details

Acceptance Criteria

Additional Notes

Iwueseiter commented 2 months ago

Hi @kwiss can I work on this?

ShantelPeters commented 2 months ago

Hi @kwiss please can i be assigned to this issue?

Jemiiah commented 2 months ago

@kwiss i'd be up for this

manlikeHB commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I am Cairo developer with lots of experience contributing to Cairo projects, my OD profile is a witness to this. I've had the experience of extending smart contracts to support either erc20 or erc721, so I believe this is within my comfort zone.

How I plan on tackling this issue

JoE11-y commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

With over four years in blockchain and backend development, I’ve worked across different ecosystems, handling everything from smart contract design to on-chain interactions and protocol integration. I focus on building secure, scalable, and reliable blockchain applications, managing both on-chain and off-chain infrastructure.

How I plan on tackling this issue

Would begin by studying the current design of the NFT orderbook, would then proceed to outlining different routes possible to complete the task.

aji70 commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i'm a solidity and cairo smart contract developer with over 2 years experience and belive i have the skill set for the task

ryzen-xp commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a Solidity adn cairo developer specializing in NFT marketplaces and decentralized apps, with experience in multi-token support and integrating blockchain protocols. My work on projects like Worldcoin-Bridge-Linea equips me to handle tasks like adding ERC-20 support efficiently.

How I plan on tackling this issue

Deploy an ERC-20 token on a devnet for testing.Review the current code to find areas needing changes to support ERC-20 Add ERC-20 specific logic: implement functions for ERC-20 transfers, handle token quantities, and remove the need for token IDs. Modify existing logic to manage ERC-20 alongside ERC-721 and ERC-1155. Test the integration by executing trades with the ERC-20 token.

MullerTheScientist commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a full-stack developer with experience in QA testing and languages like Python, Cairo, Solidity, React, and JavaScript.

How I plan on tackling this issue

i will Review Existing Contract Study the current NFT Orderbook Smart Contract implementation. Identify areas requiring modifications for ERC-20 support. Define ERC-20 Token Integration Determine how ERC-20 tokens will interact with the NFT orderbook: Token types (e.g., payment, discount) Token usage (e.g., buying, selling) Implement ERC-20 Token Standards Integrate ERC-20 token standards (ERC-20 interface): totalSupply balanceOf transfer approve allowance

ScottyDavies commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a strong background in blockchain development and smart contract programming

How I plan on tackling this issue

To approach the problem, I would:

Create and deploy an ERC-20 token contract on a development network for testing.

Analyze current functions to understand how ERC-721 and ERC-1155 interactions are handled.

Add dedicated functions for ERC-20 interactions, focusing on quantity handling without token IDs.

Update relevant data structures to accommodate token quantities and ensure compatibility with existing standards.

Create checks for non-existing token IDs, as ERC-20 tokens don’t have them.

Ensure all changes maintain backward compatibility with existing token standards.

Develop and run tests for all new and modified functions to confirm correct functionality and gas optimization.

Update the documentation to include details on the new ERC-20 support

ShantelPeters commented 2 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i am a blockchain developer with vast knowlegde on javascript, typescript, cario etc, i will be happy if i get assigned to work on this issue

How I plan on tackling this issue

To approach this issue i will do the following:

  1. Deploy ERC-20 Token: Set up an ERC-20 token contract on a devnet for testing.

  2. Update Orderbook Contract:

    • Add functions for ERC-20 interactions.
    • Modify existing logic to handle token quantities and remove token IDs for ERC-20.

3 Testing: Ensure all existing functionalities remain intact, implement new tests for ERC-20 operations, and verify that quantity handling and non-existing token ID logic work correctly.

  1. Documentation: Update the documentation to include the new ERC-20 support and ensure backward compatibility.

  2. Optimization: Consider gas efficiency during implementation.

kwiss commented 2 months ago

hey @JoE11-y you are assigned for now on that, if i don't have news next week you'll be removed

JoE11-y commented 1 month ago

Alright @kwiss

JoE11-y commented 1 month ago

Gm @kwiss,

Thanks for the task! I just wanted to clarify a few things to ensure I fully understand the requirements around "allowing fungible token trading within our order book system."

Are we looking to create new order routes, such as "ERC20 -> ERC20," or should I focus on updating the existing routes—"ERC20 -> ERC721" and "ERC721 -> ERC20"—to support additional ERC20 tokens? Cause I noticed that within the code comments of OrderV1, "ERC20" seems to refer to ETH Starkgate.

Lastly, I tried to find references to ERC1155 implementations, but the only mentions I came across were in the Sana and Pontos manager's contract , and mainly related to checking token balances to determine if a token is ERC1155.

I really appreciate any guidance you can provide here, as I’m eager to fully grasp the task and get moving in the right direction! Really excited to get moving.

Thanks in advance.

kwiss commented 1 month ago

just as a reminder you need to use this branch as a base https://github.com/ArkProjectNFTs/ark-project/pull/440 @JoE11-y

JoE11-y commented 1 month ago

Got it @kwiss

JoE11-y commented 1 month ago

@kwiss @ptisserand

I think I may have jumped the gun. I started working on system matching the ERC-20 orders, but does this issue include actually matching them, or is it just about storing and fulfilling the orders like the other order types.

Is this the direction we're going for?

JoE11-y commented 1 month ago

Okay I've reformatted the code. haha

Snehagupta1907 commented 3 weeks ago

is this issue fixed?or can i take up?