{"id":27157893,"url":"https://github.com/quantum-leap-labs-inc/minting_cycles","last_synced_at":"2026-01-20T22:34:17.101Z","repository":{"id":280290544,"uuid":"941528474","full_name":"Quantum-Leap-Labs-Inc/minting_cycles","owner":"Quantum-Leap-Labs-Inc","description":"How to programmatically mint cycles in Motoko","archived":false,"fork":false,"pushed_at":"2025-03-02T15:04:52.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T21:52:19.042Z","etag":null,"topics":["cycles","dfinity","dfx","internet-computer-protocol","motoko-language"],"latest_commit_sha":null,"homepage":"","language":"Motoko","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/Quantum-Leap-Labs-Inc.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":"2025-03-02T14:08:46.000Z","updated_at":"2025-04-07T17:11:48.000Z","dependencies_parsed_at":"2025-03-02T15:22:58.917Z","dependency_job_id":"4f641930-b8cc-46f9-b67e-535c4e5a8921","html_url":"https://github.com/Quantum-Leap-Labs-Inc/minting_cycles","commit_stats":null,"previous_names":["demali-876/minting_cycles"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Quantum-Leap-Labs-Inc/minting_cycles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Leap-Labs-Inc%2Fminting_cycles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Leap-Labs-Inc%2Fminting_cycles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Leap-Labs-Inc%2Fminting_cycles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Leap-Labs-Inc%2Fminting_cycles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantum-Leap-Labs-Inc","download_url":"https://codeload.github.com/Quantum-Leap-Labs-Inc/minting_cycles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantum-Leap-Labs-Inc%2Fminting_cycles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28616989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T22:24:05.405Z","status":"ssl_error","status_checked_at":"2026-01-20T22:20:31.342Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cycles","dfinity","dfx","internet-computer-protocol","motoko-language"],"created_at":"2025-04-08T21:52:23.642Z","updated_at":"2026-01-20T22:34:17.064Z","avatar_url":"https://github.com/Quantum-Leap-Labs-Inc.png","language":"Motoko","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Minting Cycles in Motoko**\n\nThis repository provides an example of how to **programmatically mint cycles** in **Motoko** by interacting with the **ICP Ledger** and the **Cycles Minting Canister (CMC)**.\n\n## **Overview**\n\nTo mint cycles for a canister, the process involves two main steps:\n1. **Send ICP to the CMC canister** via an `icrc1_transfer` transaction on the ICP ledger.\n2. **Notify the CMC** with the block index and canister ID to convert the ICP into cycles for the target canister.\n\n### **Process Flow**\n\n```mermaid\nsequenceDiagram\n    User-\u003e\u003eLedger: Send ICP to CMC via Ledger\n    Ledger--\u003e\u003eUser: Return block index\n    User-\u003e\u003eCMC: Send block index and canister ID\n    CMC-\u003e\u003eCanister: Mint cycles\n    CMC--\u003e\u003eUser: Confirm cycles minted\n```\n\n## **Project Structure**\n\n```md\n/minting_cycles\n│── src/minting_cycles_backend\n│   ├── utils/\n│   │   ├── types/\n│   ├── main.mo  # Main Motoko file handling cycle minting\n│── README.md    # Project documentation\n```\n\n## **How It Works**\n\n1. Transfers ICP to the **CMC canister**.\n2. Retrieves the **block index** from the transfer.\n3. Calls `notify_top_up` with the **block index** and **target canister ID**.\n4. The **CMC converts ICP into cycles** and credits them to the specified canister.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum-leap-labs-inc%2Fminting_cycles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantum-leap-labs-inc%2Fminting_cycles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum-leap-labs-inc%2Fminting_cycles/lists"}