{"id":16560261,"url":"https://github.com/friedger/clarity-profit-sharing-token","last_synced_at":"2025-10-27T19:50:22.765Z","repository":{"id":42820339,"uuid":"264235151","full_name":"friedger/clarity-profit-sharing-token","owner":"friedger","description":"Clarity smart contract for a NFT with profit sharing","archived":false,"fork":false,"pushed_at":"2022-03-26T19:29:14.000Z","size":237,"stargazers_count":9,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T23:37:26.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/friedger.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":"2020-05-15T15:50:56.000Z","updated_at":"2022-08-15T18:29:28.000Z","dependencies_parsed_at":"2022-08-28T07:24:13.258Z","dependency_job_id":null,"html_url":"https://github.com/friedger/clarity-profit-sharing-token","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/friedger/clarity-profit-sharing-token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedger%2Fclarity-profit-sharing-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedger%2Fclarity-profit-sharing-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedger%2Fclarity-profit-sharing-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedger%2Fclarity-profit-sharing-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friedger","download_url":"https://codeload.github.com/friedger/clarity-profit-sharing-token/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friedger%2Fclarity-profit-sharing-token/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281332393,"owners_count":26483032,"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-10-27T02:00:05.855Z","response_time":61,"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":[],"created_at":"2024-10-11T20:28:47.205Z","updated_at":"2025-10-27T19:50:22.727Z","avatar_url":"https://github.com/friedger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Profit-Sharing Token\n\n![Token](images/token.png)\n\n## Description\n\nProfit-sharing token (`pst`) as defined in contract [`token.clar`](contracts/token.clar) is a non-fungible token that represents some dividable value into a number of given parts. The token can be transferred for a price. The price is proposed by a buyer when expressing interest of buying (i.e. creating a call). Then the owner can sell the token to the buyer. When the new owner is re-selling parts of the token the profit will be shared with the previous owner.\n\nPrice of tokens or parts of a token, as well as the profit is represented in the contract through the fungible token `usdt`. The token is minted when creating a call. The amount of tokens show how much many was generated through the sale of the profit-sharing token.\n\nThe contract currently only supports the flow of creating a token, selling it and re-selling it. Limitations are that\n\n- the new owner can't sell the whole token\n- the new owner can sell parts of a token only once (per token)\n\nEach function call of the `token` contract comes with a fee that is taken by the platform maintainers. Fees are paid in `holdng` tokens, these tokens are sold by the platform maintainers. Creating and selling tokens costs a fixed fee, while creating a call costs a variable fee depending on price and value parts.\nThe functions to sell tokens and to pay fees are described in contract [`fee-structure`](contracts/fee-structure.clar). The functions are called by the `token` contract.\n\n## Testing\n\nTests include unit tests for a flow of creating a token of 100 value parts, selling it at $2000 and reselling 50 value parts at $1500.\n\n```\nyarn\nyarn test\n```\n\nAt the end\n\n- the creator has \\$2250 and no token.\n- the buyer/esller has \\$1250 and the original token with 50 value parts of 100.\n- the value part buyer has \\$0 and new token with 50 value parts of 50.\n- the platform earned 575 hodlng in fees.\n\n## Application\n\nThe contract was developed with the liquid natural gas (LNG) trade market in mind. The concept for these contracts was developed in a project by [HODLNG](http://www.hodl.ng/) to build a more secure, more flexible, fair, transparent and balanced LNG trade system.\n\nA `pst` token represents a cargo ship loaded with gas that an exporter sells to an importer. The importer, however, sometimes redirects the ship and sells parts of the gas to another country at a better price without participation of the exporter. With the token contract the process is transparent and profit sharing is built-in.\n\nNote, that the incentives to participate in the platform, the platform management and other details are not represented here. Furthermore, the fee structure is given only exemplary.\n\n## Support\n\n[Hodlng](http://www.hodl.ng) is supporting the development of this smart contract.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedger%2Fclarity-profit-sharing-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriedger%2Fclarity-profit-sharing-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedger%2Fclarity-profit-sharing-token/lists"}