Giter VIP home page Giter VIP logo

marketplace-contracts's Introduction

Archisinal Contracts

Arschisinal marketplace contracts written in ink!

Structure

.
├── artifacts # Contract ABI and metadata of the contracts
├── contracts # Contracts itself
│ ├── account_manager # Account manager contract, used to manage user accounts
│ ├── arch_nft # Archisinal NFT contract, used to mint and manage NFTs
│ │ └── tests
│ ├── creator # Creator contract, used in account_manager to be able to create new creators
│ ├── marketplace # Marketplace contract, used to buy and sell NFTs, also contains the auction logic
│ ├── mock # Mock contracts used for testing
│ │ ├── my_admin_access
│ │ └── my_psp22
│ └── user # User contract, used to manage user data
├── deploy # Deployment scripts
├── impls # Implementation of the contracts logic
│ ├── account_manager
│ ├── admin_access
│ ├── auction
│ ├── collection
│ ├── creator
│ ├── marketplace
│ ├── shared
│ └── user
├── test # Tests
│ ├── e2e # End to end tests
│ ├── performance # Performance tests
│ ├── security # Security tests
│ └── shared # Shared utils for tests
│     └── test-setups
├── traits # Traits used in the contracts
│ └── events # Events used in the contracts
├── typechain-generated # Files generated by typechain-polkadot
│ ├── build-extrinsic
│ ├── constructors
│ ├── contract-info
│ ├── contracts
│ ├── data
│ ├── event-data
│ ├── event-types
│ ├── events
│ ├── mixed-methods
│ ├── query
│ ├── shared
│ ├── tx-sign-and-send
│ ├── types-arguments
│ └── types-returns
└── utils # Utils used in the contracts
    └── test_helpers # Test helpers used in the ink-e2e tests
        └── src

Testing

Run ink-E2E tests (works with substrate-contracts-node v0.24.0):

cargo test --features e2e-tests

Run E2E, Security and Performance tests:

yarn # install dependencies

yarn test:full # run all tests

You can also run with contracts-node running

yarn test:full-node

Linting

yarn lint
cargo +nightly fmt --all -- --check

Formatting

yarn lint:fix
cargo +nightly fmt --all

Unit & Doc tests

cargo test

General Architecture Overview

Contract Diagram

Account Management

This section governs the user-related data, including both general users and creators who have added capabilities.

Account Manager:

  • Purpose: Centralized contract for overall user management.
  • Features:
    • Register and track user and creator accounts.
    • Interface with both the User and Creator contracts to fetch or modify data.

User:

  • Purpose: Stores individual user metadata.
  • Features:
    • Store personal data like nickname, avatar etc.
    • Potential for future expansion to include more metadata, as indicated by the hint about expansion.

Creator:

  • Purpose: Handles specific functionalities for creators.
  • Features:
    • Management of creators.
    • Store additional metadata for creators (in the future).

Marketplace

This section manages the buying and selling of NFTs.

Auction:

  • Purpose: Oversee the auctioning of NFTs.
  • Features:
    • Create, monitor, and conclude auctions.
    • Handle bids and notify winners.
    • Ensure fund transfers to sellers and, if applicable, distribute royalties to creators.

Marketplace (Sales):

  • Purpose: Direct sale of NFTs.
  • Features:
    • List NFTs for sale with set prices.
    • Handle purchases and transfer ownership of NFTs.
    • Ensure payment processing and royalty distributions if applicable.

ArchNFT

This section is responsible for creating, maintaining, and organizing the actual NFT assets and their collections.

PSP34 (from OpenBrush):

  • Purpose: Mint and manage individual NFTs.
  • Features:
    • Allow creators to mint new NFTs.
    • Store metadata for each NFT.
    • Transfer ownership of NFTs.

Collection:

  • Purpose: Manage collection metadata.
  • Features:
    • Allow creators to define and manage collections.
    • Store metadata for each collection.
    • Handle royalty information at the collection level.

Collection Fabric:

  • Purpose: Manage the creation of new collections.
  • Features:
    • Allow creators to create new collections.
    • Blacklist collections from being created.
    • Whitelist collections to be created.
    • Ban code_hash from being used to create collections.

marketplace-contracts's People

Contributors

sventime avatar

Watchers

 avatar Green Baneling avatar

Forkers

freehere107

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.