{"id":13524821,"url":"https://github.com/tuminfei/icrc7_launchpad","last_synced_at":"2025-04-01T03:32:46.759Z","repository":{"id":234198478,"uuid":"788422026","full_name":"tuminfei/icrc7_launchpad","owner":"tuminfei","description":"An example implementation of ICRC7 containing ICRC37 and ICRC3 standards.","archived":false,"fork":false,"pushed_at":"2024-05-22T15:16:01.000Z","size":1302,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-23T05:28:40.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuminfei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-18T11:41:25.000Z","updated_at":"2024-05-27T12:12:50.559Z","dependencies_parsed_at":"2024-05-06T15:11:23.226Z","dependency_job_id":"2c521b68-8f0a-44bb-94dd-ae8d6636458f","html_url":"https://github.com/tuminfei/icrc7_launchpad","commit_stats":null,"previous_names":["tuminfei/icrc7_launchpad"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuminfei%2Ficrc7_launchpad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuminfei%2Ficrc7_launchpad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuminfei%2Ficrc7_launchpad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuminfei%2Ficrc7_launchpad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuminfei","download_url":"https://codeload.github.com/tuminfei/icrc7_launchpad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222698187,"owners_count":17024877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:13.736Z","updated_at":"2025-04-01T03:32:46.753Z","avatar_url":"https://github.com/tuminfei.png","language":"Rust","funding_links":[],"categories":["Fungible and Non-fungible Tokens (NFTs)"],"sub_categories":["Implementations"],"readme":"# icrc7_launchpad\n\n**ICRC7 Launchpad** is a powerful tool designed to streamline the creation of ICRC7 NFT canisters. With the **ICRC7 Launchpad**, users can easily deploy ICRC7-based NFT canisters tailored to their needs by simply modifying the `icrc7_launchpad.sh` script.\n\n## Key Components\n\n1. **ICRC7 Launchpad**:  \n   A canister-based launcher that simplifies the deployment of ICRC7 NFT canisters. It abstracts the complexities of configuration and setup, enabling users to focus on their projects.\n\n2. **ICRC7**:  \n   The core ICRC canister contract code. This serves as the foundation for ICRC7-based NFTs, providing essential functionality for token operations.\n\n3. **ICRC7 Types**:  \n   A dedicated type library for ICRC7. This library defines the structures and data types required to interact with ICRC7 canisters, ensuring consistency and ease of integration.\n\n## Use Cases\n\n- Launch new NFT collections with ease.\n- Experiment with ICRC7 token features and functionalities.\n- Provide an infrastructure for decentralized applications leveraging NFTs.\n\n## How It Works\n\n1. Modify the `icrc7_launchpad.sh` script to include your desired configuration, such as token name, symbol, metadata, and supply parameters.\n2. Execute the script to deploy a new ICRC7 canister on the Internet Computer.\n3. Interact with the newly created NFT canister using the ICRC7 Types library for seamless integration into your application.\n\n---\n\nGet started with the **ICRC7 Launchpad** and unlock the potential of ICRC7 NFTs on the Internet Computer!\n\n\n```\n\ndfx start --background\n\ndfx deploy icrc7_launchpad\n\nsh icrc7_launchpad.sh\n\n```\n\n```bash\n\n#!/bin/bash\n\nICRC7_LAUNCHPAD_CANISTER_ID=\"icrc7_launchpad\"\n\n# Arguments for the `mint_collection_canister` method\nARG=$(cat \u003c\u003cEOF\n(\n  record {\n    icrc7_supply_cap = opt 1000000;\n    icrc7_description = opt \"An example collection description\";\n    tx_window = opt 86400;\n    icrc7_max_query_batch_size = opt 500;\n    ...\n    ...\n  }\n)\nEOF\n)\n\n# Call the canister method\ndfx canister call \"$ICRC7_LAUNCHPAD_CANISTER_ID\" mint_collection_canister \"$ARG\"\n\n```\n\n## Creating Asset Storage and Uploading Assets\n\nThe **ICRC7 Launchpad** also supports asset storage for uploading and managing images or files associated with your NFTs. \n\nFollow the steps below to create asset storage and upload your assets:\n\n### 1. Deploy the Asset Storage Canister\nRun the following command to create an asset storage canister:  \n```bash\ndfx deploy ic_canister_assets\n```\n\n### 2. Organize Local Assets\n\nPlace all your local assets (e.g., images, files) into the `assets` directory in your project.\n\nSupports directory synchronization, which ensures that the entire assets directory, including all subdirectories and files, is uploaded and synchronized to the canister.\n\nThis process maintains the directory structure, allowing seamless access to files and directories stored in the canister.\n\n```\n\nassets/\n└── nft/\n    ├── nft1.png\n    ├── nft2.png\n└── nft_image.jpg\n\n```\n\n### 3. Set Upload Parameters\nModify the relevant parameters in `tests/src/lib.rs` to specify details for the upload process, such as:\n- Path to the `assets` directory.\n- Metadata or configurations related to the assets.\n\n### 4. Execute the Upload Test\nRun the following command to upload the assets to the canister:\n```bash\ncargo test --package tests --lib -- --show-output\n```\n\n### 5. Retrieve Asset URLs\nAfter the upload is complete, the script will output the paths of the uploaded assets. Use these paths to link the uploaded images or files to your NFTs.\n\n```\nexample: nft_image.jpg\n         /nft/nft1.jpg\n         /nft/nft2.jpg\n\nlocal network: http://{ic_canister_assets_canister_id}.raw.localhost:4943/nft_image.jpg\n               http://{ic_canister_assets_canister_id}.raw.localhost:4943/nft/nft1.jpg\n               http://{ic_canister_assets_canister_id}.raw.localhost:4943/nft/nft2.jpg\n\nic network: https://{ic_canister_assets_canister_id}.raw.icp0.io/nft_image.jpg\n            https://{ic_canister_assets_canister_id}.raw.icp0.io/nft/nft1.jpg\n            https://{ic_canister_assets_canister_id}.raw.icp0.io/nft/nft2.jpg  \n\n```\n\n## ICRC7 Init\n\nICRC7 Init args:\n\n```\npub struct InitArg {\n    pub minting_account: Option\u003cAccount\u003e,\n    pub icrc7_symbol: String,\n    pub icrc7_name: String,\n    pub icrc7_description: Option\u003cString\u003e,\n    pub icrc7_logo: Option\u003cString\u003e,\n    pub icrc7_supply_cap: Option\u003cu128\u003e,\n    pub icrc7_max_query_batch_size: Option\u003cu16\u003e,\n    pub icrc7_max_update_batch_size: Option\u003cu16\u003e,\n    pub icrc7_max_take_value: Option\u003cu128\u003e,\n    pub icrc7_default_take_value: Option\u003cu128\u003e,\n    pub icrc7_max_memo_size: Option\u003cu32\u003e,\n    pub icrc7_atomic_batch_transfers: Option\u003cbool\u003e,\n    pub tx_window: Option\u003cu64\u003e,\n    pub permitted_drift: Option\u003cu64\u003e,\n    pub approval_init: Option\u003cInitApprovalsArg\u003e,    // ICRC37 Init args\n    pub archive_init: Option\u003cInitArchiveArg\u003e,       // ICRC3 Init args\n}\n```\n\nICRC37 Init args:\n\n```\ntype InitApprovalsArg = record {\n    max_approvals : opt nat16;\n    max_approvals_per_token_or_collection : opt nat16;\n    settle_to_approvals : opt nat16;\n    max_revoke_approvals : opt nat16;\n    collection_approval_requires_token : opt bool;\n}\n```\n\nICRC3 Init args:\n\n```\ntype InitArchiveArg = record {\n    maxRecordsToArchive : nat;                    //Max number of archive items to archive in one round\n    archiveIndexType : IndexType;                 //Index type to use for the memory of the archive\n    maxArchivePages : nat;                        //Max number of pages allowed on the archivserver\n    settleToRecords : nat;                        //number of records to settle to during the clean up process\n    archiveCycles : nat;                          //number of cycles to sent to a new archive canister;\n    maxActiveRecords : nat;                       //allowed max active records on this canister\n    maxRecordsInArchiveInstance : nat;            //specify the max number of archive items to put on an archive instance\n    archiveControllers : opt opt vec principal;   //override the default controllers. The canister will always add itself to this group;\n}\n```\n\n## ICIC7\n\n### ICRC-7\n\nICRC-7 is the minimal standard for the implementation of Non-Fungible Tokens (NFTs) on the Internet Computer.\n\nA token ledger implementation following this standard hosts an NFT collection (collection), which is a set of NFTs.\n\nICRC-7 does not handle approval-related operations such as approve and transfer_from itself. Those operations are specified by ICRC-37 which extends ICRC-7 with approval semantics.\n\n[ICRC-7](https://github.com/dfinity/ICRC/blob/icrc_7_and_37/ICRCs/ICRC-7/ICRC-7.md)\n\n### ICRC-37\n\n[ICRC-37](https://github.com/dfinity/ICRC/blob/icrc_7_and_37/ICRCs/ICRC-37/ICRC-37.md)\n\n### ICRC-3\n\n[ICRC-3](https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-3/README.md)\n\n\n### Scripts\n\n#### Deploying Icrc7 Canister\n\n```bash\ndfx deploy icrc7 --argument '(record{                                  \nminting_account= opt record {\n    owner = principal \"3yyxm-t5fpe-v32em-ac6lr-xyort-wuscb-dvl4x-3wnwi-hqkyj-xortw-oqe\";                                     \n    subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n  };                  \nicrc7_supply_cap= null;\nicrc7_description= opt \"ICP Flower Collection\";\ntx_window= null;                        \npermitted_drift= null;                  \nicrc7_max_take_value= opt 100;\nicrc7_max_memo_size= opt 1000;\nicrc7_symbol= \"ICFL\";\nicrc7_max_update_batch_size= opt 100;\nicrc7_max_query_batch_size= opt 100;\nicrc7_atomic_batch_transfers= null;\nicrc7_default_take_value= opt 100;\nicrc7_logo= null;\nicrc7_name= \"ICP Flower\";\napproval_init= null;\narchive_init= null\n})'\n```\n\n```bash\ndfx deploy icrc7 --argument '(record{                                  \nminting_account= opt record {\n        owner = principal \"3yyxm-t5fpe-v32em-ac6lr-xyort-wuscb-dvl4x-3wnwi-hqkyj-xortw-oqe\";                                     \n        subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n    };                  \nicrc7_supply_cap= null;\nicrc7_description= opt \"ICP Flower Collection\";\ntx_window= null;                        \npermitted_drift= null;                  \nicrc7_max_take_value= null;\nicrc7_max_memo_size= null;\nicrc7_symbol= \"ICFL\";\nicrc7_max_update_batch_size= null;\nicrc7_max_query_batch_size= null;\nicrc7_atomic_batch_transfers= null;\nicrc7_default_take_value= null;\nicrc7_logo= null;\nicrc7_name= \"ICP Flower\";\napproval_init= null;\narchive_init= opt record {\n        maxRecordsToArchive= 2;\n        archiveIndexType= variant {Stable};\n        maxArchivePages= 3;\n        settleToRecords= 2;\n        archiveCycles= 1000000000000;\n        maxActiveRecords= 4;\n        maxRecordsInArchiveInstance= 4;\n        archiveControllers= null\n    }\n})'\n```\n\n#### Minting NFT\n\n```bash\ndfx canister call icrc7 mint '(record{                                  \nto= record {\n    owner = principal \"3yyxm-t5fpe-v32em-ac6lr-xyort-wuscb-dvl4x-3wnwi-hqkyj-xortw-oqe\";                                     \n    subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n  };          \ntoken_id=1;\nmemo= null;\nfrom_subaccount= null;                  \ntoken_description= opt \"Token Number 1\";\ntoken_logo= null;\ntoken_name= null\n})'\n```\n\n\n#### Transfer NFT\n\n```bash\ndfx canister call icrc7 icrc7_transfer '(vec{\n  record{\n    to=record {\n      owner = principal \"t4egw-clf4w-qbpli-svryg-7yqq6-jt2yj-7v755-mabir-zmx6i-vp4fr-fqe\";\n      subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n    };\n    token_id= 1;\n    from_subaccount= null;\n    memo= null;\n    created_at_time= null\n  }\n})'\n```\n\n#### Approve NFT\n\n```bash\ndfx canister call icrc7 icrc37_approve_tokens '(vec{ \n  record{\n    token_id= 2;                               \n    approval_info= record {\n      memo= null;\n      from_subaccount= null;\n      created_at_time= null;\n      expires_at= null;\n      spender= record {\n          owner = principal \"o2zom-piy75-ifbnk-nhhlq-362su-4vsx5-ptl2s-ec4jw-osbv4-nygtw-dae\";                                     \n          subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n      }\n  }\n}     \n})'\n\ndfx canister call icrc7 icrc37_approve_collection '(vec{ \n  record{\n    token_id= 2;                               \n    approval_info= record {\n      memo= null;\n      from_subaccount= null;\n      created_at_time= null;\n      expires_at= null;\n      spender= record {\n          owner = principal \"o2zom-piy75-ifbnk-nhhlq-362su-4vsx5-ptl2s-ec4jw-osbv4-nygtw-dae\";                                     \n          subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n      }\n  }\n}     \n})'\n```\n\n#### Transfer From NFT\n\n```bash\ndfx canister call icrc7 icrc37_transfer_from '(vec{\n  record{\n    from= record {\n        owner = principal \"3yyxm-t5fpe-v32em-ac6lr-xyort-wuscb-dvl4x-3wnwi-hqkyj-xortw-oqe\";                                     \n        subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n    };\n    to= record {\n        owner = principal \"t4egw-clf4w-qbpli-svryg-7yqq6-jt2yj-7v755-mabir-zmx6i-vp4fr-fqe\";                                     \n        subaccount = opt blob \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\";\n    };\n    spender_subaccount= null;\n    token_id= 2;\n    memo= opt blob \"123\";\n    created_at_time= null\n  }\n})'\n```\n\n#### Burn NFT\n\nThe implementation of the burn method does not delete the token; rather, it transfers the token to a burn_address (akin to a zero address).\n\n```bash\ndfx canister call icrc7 burn '(vec {\n  record {\n    token_id = 1 : nat;\n    memo = opt blob \"Burning token 1\";\n    from_subaccount = null\n  }\n})'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuminfei%2Ficrc7_launchpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuminfei%2Ficrc7_launchpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuminfei%2Ficrc7_launchpad/lists"}