{"id":22192008,"url":"https://github.com/cryptape/kabletop-contracts","last_synced_at":"2025-03-24T20:44:22.929Z","repository":{"id":43887906,"uuid":"447943591","full_name":"cryptape/kabletop-contracts","owner":"cryptape","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-15T02:43:44.000Z","size":2553,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T01:17:26.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryptape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-14T11:26:49.000Z","updated_at":"2022-06-30T02:44:38.000Z","dependencies_parsed_at":"2022-08-25T11:32:00.633Z","dependency_job_id":null,"html_url":"https://github.com/cryptape/kabletop-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Fkabletop-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Fkabletop-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Fkabletop-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptape%2Fkabletop-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptape","download_url":"https://codeload.github.com/cryptape/kabletop-contracts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245351762,"owners_count":20601090,"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-12-02T12:18:43.621Z","updated_at":"2025-03-24T20:44:22.899Z","avatar_url":"https://github.com/cryptape.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kabletop-contracts\n\nKabletop is a generic turn-based game framework built on CKB. Its network architecture is designed on a peer-to-peer basis, and is implemented by node-to-node interaction using state channel technology. A game developed on this framework will be able to implement both the game client logic and the CKB smart contract logic. Games will be developed in Lua and the framework itself is based on Rust and C.\n\nKabletop consists of four types of contracts: **nft contract**, **wallet contract**, **payment contract** and **Kabletop contract**. For more details refer to https://talk.nervos.org/t/kabletop/5715.\n\n## NFT Contract\n\nNFT Contract acts as a temporary simple NFT protocol for Kabletop soon to be replaced by other official NFT protocols such as Mibao. \n\nThe NFT format proclaimed in the contract is just an NFT which represents 20 bytes, which can also be called H160. More NFTs you have in Kabletop means more CKBs to be staked. In Kabletop, By having more NFTs, users will need to pledge more CKBs for storing these NFTs. All staked CKBs can be seen as TVLs for Kabletop.\n\nNFT can be also deleted and transferred to others, these two operations will release CKBs.\n\n\u003e Build contract:\n\n``` sh\ncapsule build -n nft\n```\n\n\u003e Run tests:\n\n``` sh\ncd tests/nft\ncargo test -- --nocapture\n```\n\n## Wallet Contract\n\nThe wallet contract, or ownerlock contract, represents the wallet of the NFT creator. The wallet contract implements a similar logic to the ACP (AnyoneCanPay) contract. This contract requires use in conjunction with a payment contract.\n\n\u003e Build contract:\n\n``` sh\ncapsule build -n wallet\n```\n\n\u003e Run tests:\n\n``` sh\ncd tests/wallet\ncargo test -- --nocapture\n```\n\n## Payment Contract\n\nPayment contract listens and processes purchases from NFT owners. The payment contract should always run alongside the wallet contract.\n\nIf the owner of both the wallet and the payment contracts is also the creator of the NFT, then the data represents the incremental rules set by the creator for the NFT, i.e., the output probability of each NFT.\n\nIf the owners of the wallet contract and the payment contract are the creators of the NFT and the owner of the NFT respectively, the data represents the number of NFT card packs purchased by the owners so far.\n\n\n\u003e Build contract:\n\n ``` sh\n capsule build -n payment\n ```\n\n\u003e Run tests:\n\n``` sh\ncd tests/payment\ncargo test -- --nocapture\n```\n\n## Kabletop Contract (or Channel Contract)\n\nKabletop contract is written in C and has fully integrated the Lua interpreter engine to run the Lua code that carries the GamePlay logic in CKB-VM.\n\nThe Kabletop contract only supports two-player turn-based matchmaking scenarios at the moment. Each player signs their opponent's turn data which will be placed in the Witnesses field eventually.\n\n\n\u003e Build contract:\n\n ``` sh\n capsule build -n kabletop\n ```\n\n\u003e Run tests:\n\n``` sh\ncd tests/kabletop\ncargo test -- --nocapture\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptape%2Fkabletop-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptape%2Fkabletop-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptape%2Fkabletop-contracts/lists"}