{"id":19735988,"url":"https://github.com/gear-sv/gear-contracts","last_synced_at":"2025-08-01T09:04:43.580Z","repository":{"id":55322223,"uuid":"193010854","full_name":"gear-sv/gear-contracts","owner":"gear-sv","description":"compile, test, deploy cpp code to bitcoin ","archived":false,"fork":false,"pushed_at":"2023-01-07T09:40:15.000Z","size":18802,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T03:05:17.152Z","etag":null,"topics":["cpp","emscripten","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gear-sv.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}},"created_at":"2019-06-21T01:41:04.000Z","updated_at":"2019-10-20T19:23:04.000Z","dependencies_parsed_at":"2023-02-06T20:07:01.084Z","dependency_job_id":null,"html_url":"https://github.com/gear-sv/gear-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gear-sv/gear-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gear-sv%2Fgear-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gear-sv%2Fgear-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gear-sv%2Fgear-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gear-sv%2Fgear-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gear-sv","download_url":"https://codeload.github.com/gear-sv/gear-contracts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gear-sv%2Fgear-contracts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267638565,"owners_count":24119764,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cpp","emscripten","npm"],"created_at":"2024-11-12T01:04:37.500Z","updated_at":"2025-08-01T09:04:43.527Z","avatar_url":"https://github.com/gear-sv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gear-contracts\n\nExample test, compile, deploy harness for BSV powered c++ contracts.\n\n![deLorean Time Machine](delorean.jpg)\n___\n\n### Install [Emscripten](https://emscripten.org/docs/)\n\nMacOS Installation Instructions:\n\n1. `brew install emscripten`\n```\nInstalls to /usr/local/Cellar/emscripten/[version].\n\nGenerates default config file at `~/.emscripten`.\n```\n\n2. Follow configuration steps by updating your `~/.emscripten` file accordingly.\n```\nManually set LLVM_ROOT to\n  /usr/local/opt/emscripten/libexec/llvm/bin\nand comment out BINARYEN_ROOT\nin ~/.emscripten after running `emcc` for the first time.\n```\n\n### Install gear-contracts\n`npm i gear-contracts -g`\n___\n\n### Create Project\n`gear-contracts init [project_name]`\n\n```\nGenerates a minimal contract harness.\n\ncontracts\n  FungibleToken.h\n  FungibleToken.cpp\n  NamingService.h\n  NamingService.cpp\n  NonFungibleToken.h\n  NonFungibleToken.cpp\n\ntests\n  FungibleToken.test.js\n  NamingService.test.js\n  NonFungibleToken.test.js\n\noutput\n  [compiled emscripten modules]\n  [compiled wasm binaries]\n  [gzip contract package tar]\n```\n### Create account\n1. `gear-contracts keys`\n```\nCreates key pair.\nSaves privateKey, publicKey, and address to key.json.\nGenerates QR code image of address to address.png.\n```\n2. Fund account by sending some bsv to the generated address in `key.json`. You can easily scan the QR code and send payment with HandCash.\n\n### Compile\n`gear-contracts compile [contract_name]`\n\n```\nCompiles c++ code to wasm bytecode to out/[contract_name].out.wasm.\nGenerates javascript module interface to out/[contract_name].out.js.\n```\n\n### Package\n`gear-contracts package [contract_name]`\n\n```\nPackages and gzips contract files to out/[contract_name].tar.gz\n```\n\n### Test\n`gear-contracts test [contract_name]`\n\n### Deploy\n`gear-contracts deploy [contract_name]`\n\n```\nPackages contract files (.wasm) (.cpp) (.js) (.json).\nFormats gearsv contract deploy call.\nBroadcasts transaction.\n\nCheck for the deployment transaction at https://whatsonchain.com/address/[address]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgear-sv%2Fgear-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgear-sv%2Fgear-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgear-sv%2Fgear-contracts/lists"}