{"id":13718211,"url":"https://github.com/cosmasken/ic-payroll","last_synced_at":"2026-02-20T23:35:33.461Z","repository":{"id":221970917,"uuid":"743253407","full_name":"cosmasken/ic-payroll","owner":"cosmasken","description":"Fully on-chain decentralized Hrms on the internet Computer. Send and Receive Bitcoin. Single \u0026 Bulk Payments. Pay Now or schedule payments.","archived":false,"fork":false,"pushed_at":"2025-04-16T07:13:27.000Z","size":340770,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-05-07T08:44:45.436Z","etag":null,"topics":["ckbtc","dashboard","encode-club","icp","internet-computer","internet-computer-protocol","motoko","on-chain","react","tailwind","tailwindcss","vue"],"latest_commit_sha":null,"homepage":"https://ilcnp-myaaa-aaaal-qjdxa-cai.icp0.io/","language":"Vue","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/cosmasken.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,"zenodo":null}},"created_at":"2024-01-14T19:31:02.000Z","updated_at":"2025-04-16T07:13:31.000Z","dependencies_parsed_at":"2024-09-11T11:07:34.975Z","dependency_job_id":"2b8e80cd-34bb-4f96-b7a5-64fa12a65356","html_url":"https://github.com/cosmasken/ic-payroll","commit_stats":null,"previous_names":["cosmasken/ic-payroll"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cosmasken/ic-payroll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmasken%2Fic-payroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmasken%2Fic-payroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmasken%2Fic-payroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmasken%2Fic-payroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmasken","download_url":"https://codeload.github.com/cosmasken/ic-payroll/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmasken%2Fic-payroll/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T23:24:07.480Z","status":"ssl_error","status_checked_at":"2026-02-20T23:24:06.202Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ckbtc","dashboard","encode-club","icp","internet-computer","internet-computer-protocol","motoko","on-chain","react","tailwind","tailwindcss","vue"],"created_at":"2024-08-03T00:08:22.104Z","updated_at":"2026-02-20T23:35:33.434Z","avatar_url":"https://github.com/cosmasken.png","language":"Vue","funding_links":[],"categories":["Applications"],"sub_categories":["Utilities"],"readme":"![](./media/header.png)\n\n# IC-PAYROLL\n\nIC-PAYROLL is an experimental app to demonstrate a real world use case for [ckBTC](https://internetcomputer.org/ckbtc/) on the Internet Computer. It is a simple Payroll that allows users to accept  and make payments using ckBTC payments.\n\nThe Internet Computer [integrates directly with the Bitcoin network](https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/). This allows canisters on the Internet Computer to receive, hold, and send Bitcoin, all directly with transactions on the Bitcoin network. Chain-key Bitcoin (ckBTC) is an ICRC-1-compliant token that is backed 1:1 by Bitcoin held 100% on the IC mainnet.\n\nFor deeper understanding of the ICP \u003c \u003e BTC integration, see the IC wiki article on [Bitcoin integration](https://wiki.internetcomputer.org/wiki/Bitcoin_Integration).\n\n## Features\n\n- **CRUD Users**: Users logs in with their Internet Identity and adds users they want to make payments to.\n- **Send tokens**: Users can send ckBTC tokens to other users.\n- **Receive tokens**: Users can receive ckBTC tokens from other users.\n- **Bulk transfers**: Users can make bulk transfers to multiple users.\n- **Schedule payments**: Users can schedule payments to be made at a future date.\n- **Receive notifications**: Users can choose to receive notifications by email or SMS when a payment is received. This uses the [HTTP Outcall](https://internetcomputer.org/docs/current/developer-docs/integrations/https-outcalls/) feature of the Internet Computer.\n- **Transaction history**: Users can view a list of transactions made to the store.\n\n## Architecture\n\n### Backend\n\nThe backend is written in Motoko and consist of one canister, `backend`. It exposes the following public methods:\n\n- `getUser` - returns the store configuration for a given principal.\n- `getInvoice` - returns the funding address for a particular user.\n- `updateUser` - updates the store configuration for a given principal.\n- `transferFromSubAccountToCanister` - transfers funds to the canister's account.\n- `transferFromSubAccountToSubAccount` - transfers funds to the another user's account.\n- `runpayroll` - bulk transfers to multiple users/address with various amounts.\n- `send_notifications` - sends notifications to users when a payment is received.\n- `getFundingAddress` - returns the funding address for a particular user.\n- `getFundingBalance` - returns the funding balance for a particular user.\n- `getTradingAddress` - returns the trading address for a particular user.\n- `getTradingBalance` - returns the trading balance for a particular user.\n- `setCourierApiKey` - sets the Courier API key used to send email and SMS notifications. Only the canister controller can call this method.\n\nIn addition to the public methods, the canister uses a [timer](https://internetcomputer.org/docs/current/motoko/main/timers/) to monitor ledger transactions. When a new transaction is found that matches a configured store – depending on the store settings – the canister will send a notification either by email or SMS.\n\n\n### Frontend\n\nThe frontend is written in Javascript/Vite/Vue/TailwindCSS. Users authenticate using the Internet Identity to access their store.\n\nThe frontend interacts with the following IC canisters:\n\n- `backend` - to fetch and update user information as well as make transfers.\n- `ckbtc ledger` - to send ckBTC to other users.\n- `ckbtc index` - to fetch transaction history.\n- `internet identity` - to authenticate users.\n\n# Local deployment\n\n## Prerequisites\n\n- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx).\n- [x] Install [Node.js](https://nodejs.org/en/).\n\n### Use the package,,json scripts to  automate the whole process \n```bash\nnpm run start \u0026\u0026 npm run dev\n```\n\n### This will setup the project and get it running. you can then login and start transacting\n\n### OR Step 1: Start a local instance of the Internet Computer\n\n```bash\ndfx start --clean --background\n```\n\n\n\n### Step 2: Deploy the Internet Identity canister\n\nIntegration with the [Internet Identity](https://internetcomputer.org/internet-identity/) allows store owners to securely setup and manage their store. The Internet Identity canister is already deployed on the IC mainnet. For local development, you need to deploy it to your local instance of the IC.\n\n```bash\ndfx deploy --network local internet_identity\n```\n\n### Step 3: Save current principal as a variable\n\nThe principal will be used when deploying the ledger canister.\n\n```bash\nexport OWNER=$(dfx identity get-principal)\n```\n\n### Step 3: Deploy the ckBTC ledger canister\n\nThe responsibilities of the ledger canister is to keep track of token balances and handle token transfers.\n\nThe ckBTC ledger canister is already deployed on the IC mainnet. ckBTC implements the [ICRC-2](https://internetcomputer.org/docs/current/developer-docs/integrations/icrc-2/) token standard. For local development, we deploy the ledger for an ICRC-2 token mimicking the mainnet setup.\n\nTake a moment to read the details of the call we are making below. Not only are we deploying the ledger canister, we are also:\n\n- Deploying the canister to the same canister ID as the mainnet ledger canister. This is to make it easier to switch between local and mainnet deployments.\n- Naming the token `Local ckBTC / LCKBTC`\n- Setting the owner principal to the principal we saved in the previous step.\n- Minting 100_000_000_000 tokens to the owner principal.\n- Setting the transfer fee to 10 LCKBTC.\n\n```bash\ndfx deploy --network local --specified-id mxzaz-hqaaa-aaaar-qaada-cai ckbtc_ledger --argument '\n  (variant {\n    Init = record {\n      token_name = \"Local ckBTC\";\n      token_symbol = \"LCKBTC\";\n      minting_account = record {\n        owner = principal \"'${OWNER}'\";\n      };\n      initial_balances = vec {\n        record {\n          record {\n            owner = principal \"'${OWNER}'\";\n          };\n          100_000_000_000;\n        };\n      };\n      metadata = vec {};\n      feature_flags = opt record{icrc2 = true };\n      transfer_fee = 10;\n      archive_options = record {\n        trigger_threshold = 2000;\n        num_blocks_to_archive = 1000;\n        controller_id = principal \"'${OWNER}'\";\n      }\n    }\n  })\n'\n```\n\n### Step 4: Deploy the index canister\n\nThe index canister syncs the ledger transactions and indexes them by account.\n\n```bash\ndfx deploy --network local icrc1_index --argument '\n  record {\n   ledger_id = (principal \"mxzaz-hqaaa-aaaar-qaada-cai\");\n  }\n'\n```\n\n### Step 5: Deploy the backend canister\n\nThe backend canister manages the user configuration and sends notifications when a payment is received.\n\nThe `--argument '(0)'` argument is used to initialize the canister with `startBlock` set to 0. This is used to tell the canister to start monitoring the ledger from block 0. When deploying to the IC mainnet, this should be set to the current block height to prevent the canister from processing old transactions.\n\n```bash\ndfx deploy --network local backend --argument '(0)'\n```\n\n### Step 6: Configure the backend canister\n\nThe backend uses [Courier](https://courier.com/) to send email and SMS notifications. If you want to enable notifications, you need to sign up for a Courier account and and create and API key. Then issue the following command:\n\n```bash\ndfx canister --network local call backend setCourierApiKey \"pk_prod_...\"\n```\n### Step 7: Build and run the frontend\n\nRun npm to install dependencies and start the frontend. The frontend will be available at http://localhost:3000.\n\n```bash\nnpm install\nnpm run dev\n```\n\n### Step 8: Generate did files\n```bash\ndfx generate backend\n```\n\nThis generates the did files for the backend canister. You can find the generated files in the `./src/declarations/backend` directory.This is what allows you to call the backend canister from the frontend.\n\n### Step 9: Login and start transacting\nGo to http://localhost:3000 and login with the Internet Identity\n\n### Step 10: Get funds\n```bash\nnpm run mint\n```\n\nEnter the amount of ckBTC you want to mint and the principal you want to mint to. The principal is the Internet Identity principal of the user you want to mint to. You can find the principal by logging in to the frontend and copying the principal from the URL.Also send some funds to the canister so you can receive funds when you request test tokens\n\n### Step 11: Start transacting\nYou can now start transacting with the app. You can send funds to other users and receive funds from other users.\n\nNote that you need to refresh manually to see the updated balance after a transaction.\n\n\n\n# Deploying to the IC mainnet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmasken%2Fic-payroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmasken%2Fic-payroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmasken%2Fic-payroll/lists"}