Skip to content

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

@kwiss

Description

@kwiss

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

  • The smart contract currently supports ERC-721 tokens and is being updated to support ERC-1155.
  • We need to adapt the structure to accommodate ERC-20 tokens, which have different characteristics from NFTs.

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

  • The primary changes for ERC-20 support will be:
    1. Handling token quantities (similar to ERC-1155 support).
    2. Removing the concept of token IDs for ERC-20 transactions.
  • Existing functions and data structures should be reviewed and updated to accommodate these changes.
  • New functions specific to ERC-20 operations will need to be added.

Acceptance Criteria

  • ERC-20 token contract successfully deployed on devnet
  • Orderbook smart contract updated to support ERC-20 tokens
  • All existing functionality for other token standards remains intact
  • New ERC-20 specific functions are implemented and tested
  • Quantity handling is correctly implemented for ERC-20 tokens
  • Logic for handling non-existing token IDs is implemented and tested
  • All tests pass, including new tests for ERC-20 functionality

Additional Notes

  • Ensure backwards compatibility with existing supported token standards
  • Update documentation to reflect new ERC-20 support
  • Consider gas optimization when implementing quantity handling
  • Implement appropriate checks to distinguish between different token standards in the contract

Metadata

Metadata

Assignees

Labels

ODHack8Only dust 8difficulty: mediumTo resolve the issue, it is necessary to gain an understanding of some aspects of the codebasegood first issueGood for newcomerslang:cairoWork on the Starknet part of the application; you need to know Cairo lang.priority: medium

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions