BlockRocket
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Digitalax Stage 2 - Parent, Child NFTs with Auctions ## Other links * [Stage 1 Docx](https://hackmd.io/RzmT0y91ReyRmrh084ShNA) * [SubGraph Data Requirements](https://hackmd.io/czRBe2GjR_m7i48adTsx-Q) ## General Design ### Contracts #### Rinkeby Deployments ``` https://thegraph.com/explorer/subgraph/digitalax/digitalaxropsten ``` ``` DigitalaxAccessControls - 0x386c30961E47c38f3aa899464FF4bBc9dF9949f5 DigitalaxGenesisNFT - 0x064A6151F99ba2610f2D6600Dcb2b2Ed3a276356 DigitalaxMaterials - 0x5988db41A39F4AB0d6DeB9cf99C74F691bbD236a DigitalaxGarment - 0xBf379898e6C392Fe2A131046B8f3daE9A8748454 DigitalaxGarmentFactory - 0x4B613A9b2a9122bDa2240011da48f9C6a6964b20 DigitalaxAuction - 0x18ff4ECCf9397C4CEF2A8611a33CbD5052f3679E ``` One click dapp for auction:https://oneclickdapp.com/garden-clark/?privateKey=0xfa6a469cb56013cfe7557e7d6c62d093c5ef21a388f713f5cde532fa1190ff85 #### Mainnet ``` https://thegraph.com/explorer/subgraph/digitalax/digitalax ``` ``` TODO ``` ## NFTs * `ERC721` can own a bunch of `ERC1155` tokens, composed together losely based on `ERC998` standard * To get access to the 1155 child tokens, the owner must burn the NFT. ``` Parent (ERC-721) a.k.a masters | ▼ Child (ERC-1155) a.k.a. strands ``` ### Auction * Auctions are for primary sales only, once sold cannot be listed again * Auctions are for the `721` tokens, any child `1155` tokens held by this token do not move as the owner of the `master` token also has ownership of the 1155 tokens composed within. #### ABI ##### Bidder functions * Open to `all`, auction rules are enforced ```solidity function placeBid(uint256 _garmentTokenId) function withdrawBid(uint256 _garmentTokenId) ``` ```json { "inputs": [ { "internalType": "uint256", "name": "_garmentTokenId", "type": "uint256" } ], "name": "placeBid", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_garmentTokenId", "type": "uint256" } ], "name": "withdrawBid", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ``` ##### Resulting functions * Requires `admin` or `smart contract` role ```solidity function resultAuction(uint256 _garmentTokenId) function cancelAuction(uint256 _garmentTokenId) ``` ```json { "inputs": [ { "internalType": "uint256", "name": "_garmentTokenId", "type": "uint256" } ], "name": "resultAuction", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_garmentTokenId", "type": "uint256" } ], "name": "cancelAuction", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, ``` #### Minting functions * Requires `minter` role ```solidity function createAuction(uint256 _garmentTokenId, uint256 _reservePrice, uint256 _startTime, uint256 _endTime) ``` ```json { "inputs": [ { "internalType": "uint256", "name": "_garmentTokenId", "type": "uint256" }, { "internalType": "uint256", "name": "_reservePrice", "type": "uint256" }, { "internalType": "uint256", "name": "_startTime", "type": "uint256" }, { "internalType": "uint256", "name": "_endTime", "type": "uint256" } ], "name": "createAuction", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, ``` ### GarmentFactory ``` TODO ``` ### SubGraph Entities #### Garment / Designer stuff ``` DigitalaxGarment - the master 721 token DigitalaxMaterial - the 1155 tokens DigitalaxCollector - a collector/user in the Digitalax system DigitalaxGarmentDesigner - a designer in the Digitalax system ``` #### Auction stuff ``` DigitalaxAuctionContract - global auction config DigitalaxGarmentAuction - auction details DigitalaxGarmentAuctionHistory - auction history ``` ### Sample queries * Get all garments ``` { digitalaxGarments { id designer owner primarySalePrice tokenUri children { amount tokenUri parentId childId contract tokenUri id } } } ``` * Get all live (live resulted) auctions ```gql { digitalaxGarmentAuctions(where:{resulted_not_in:[true]}) { id reservePrice endTime startTime resultedTime resulted topBidder { id } topBid lastBidTime } } ``` * Get auction details ``` { digitalaxGarmentAuctions { id startTime endTime resulted resultedTime topBidder { id } topBid designer { id } garment { id designer owner primarySalePrice tokenUri children { id childId amount tokenUri } } } } ``` * Get token auction history ```gql { digitalaxGarmentAuctionHistories(where:{token_in:["3"]}) { id eventName timestamp transactionHash bidder { id } value token { id owner primarySalePrice tokenUri children { id amount tokenUri parentId childId tokenUri } } } } ``` * Get garments owned by collector ``` { digitalaxCollectors { id childrenOwned { id childId amount owner tokenUri } parentsOwned { id tokenUri designer primarySalePrice children { id } } } } ``` * Get listings for garment designer ``` { digitalaxGarmentDesigners { id listings { reservePrice startTime endTime resulted topBidder { id } topBid lastBidTime } } } ``` * Auction global config ``` { digitalaxAuctionContracts { minBidIncrement bidWithdrawalLockTime platformFee platformFeeRecipient totalSales } } ``` * Get history for days ``` { days{ id totalBidValue totalWithdrawalValue totalNetBidActivity } } ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully