@archisinal/contracts

1.0.7 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @archisinal/contracts

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

11.7 MB

Total Files

1066

Last publish

Collaborators

  • semirazov