{"id":13767599,"url":"https://github.com/oxheadalpha/smart-contracts","last_synced_at":"2025-05-10T23:30:48.233Z","repository":{"id":40673901,"uuid":"213987288","full_name":"oxheadalpha/smart-contracts","owner":"oxheadalpha","description":"A library of smart contracts","archived":true,"fork":false,"pushed_at":"2024-01-10T09:33:00.000Z","size":1871,"stargazers_count":101,"open_issues_count":10,"forks_count":31,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-06T00:02:00.371Z","etag":null,"topics":["fa2","ligo","smart-contracts","taquito","tezos","tzip-12"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/oxheadalpha.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":"2019-10-09T17:56:36.000Z","updated_at":"2024-11-04T23:42:43.000Z","dependencies_parsed_at":"2023-10-13T13:11:14.540Z","dependency_job_id":"449dd3eb-245a-41d0-ada0-af6c8468b52b","html_url":"https://github.com/oxheadalpha/smart-contracts","commit_stats":null,"previous_names":["tqtezos/smart-contracts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxheadalpha%2Fsmart-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxheadalpha%2Fsmart-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxheadalpha%2Fsmart-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxheadalpha%2Fsmart-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxheadalpha","download_url":"https://codeload.github.com/oxheadalpha/smart-contracts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"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":["fa2","ligo","smart-contracts","taquito","tezos","tzip-12"],"created_at":"2024-08-03T16:01:10.159Z","updated_at":"2025-05-10T23:30:47.506Z","avatar_url":"https://github.com/oxheadalpha.png","language":"OCaml","funding_links":[],"categories":["Development","OCaml"],"sub_categories":["Templates and Examples"],"readme":"# FA2 Contracts Implementation\n\nThis repository contains multiple sub-projects implementing different flavors of\nthe FA2 token standard.\n\n## Shared LIGO code\n\n[shared](shared) directory contains common code shared by all sub-project.\nThe FA2-related LIGO artifacts are:\n\n- [shared/fa2](shared/fa2) - FA2 interface and standard errors definition.\n- [shared/fa2/lib](shared/fa2/lib) - Helpers, various bits and pieces\n  used by the FA2 implementation.\n  - [shared/fa2/lib/fa2_operator_lib.mligo](shared/fa2/lib/fa2_operator_lib.mligo) -\n    helper functions to manage and validate FA2 operators.\n  - [shared/fa2/lib/fa2_owner_hook_lib.mligo](shared/fa2/lib/fa2_owner_hooks_lib.mligo) -\n    helper functions to support sender/receiver hooks.\n- [shared/fa2_modules](shared/fa2_modules) - modules implementing additional contract\n  functionality to be mixed into the final FA2 contract.\n  - [shared/fa2_modules/simple_admin.mligo](shared/fa2_modules/simple_admin.mligo) -\n    implementation of the admin entry points that let to pause/unpause the contract\n    and change the admin.\n  - [shared/fa2_modules/token_admin.mligo](shared/fa2_modules/token_admin.mligo) -\n    implementation of the admin entry points that let change the admin and\n    pause/unpause transfers per individual tokens.\n- [shared/fa2_clients](shared/fa2_clients) - FA2 client contracts used for testing.\n\n## Sub-Projects Structure\n\nThe sub-projects symlink shared code into their respective directories. Each\nsub-project has `ligo` directory that contains all LIGO-related files:\n\n- symlinked shared common code.\n- `src` directory with the LIGO implementation of the particular FA2 contract(s).\n- `out` directory with the contracts compiled to Michelson.\n\nThe design of each FA2 contract follows the same pattern and consists of the following\nsource files:\n\n- `fa2_xxx_token.mligo` - implementation of the FA2 entry points and FA2 core logic.\n- `token_manager.mligo` - implementation of mint, burn, create token(s) entry points.\n- `fa2_xxx_asset.mligo` - assembly of different modules into a complete FA2 contract.\n  The assembly includes FA2 entry points and core logic (`fa2_xxx_token.mligo`),\n  mint/burn entry points (`token_manager.mligo`)\n  and the administrator entry points\n  ([shared/fa2_modules/simple_admin.mligo](shared/fa2_modules/simple_admin.mligo)).\n\n## Implemented FA2 Contracts\n\n### [single_asset](single_asset)\n\n[fa2_single_asset.mligo](single_asset/ligo/src/fa2_single_asset.mligo) implementation\nof the FA2 contract that supports single fungible tokens (a.k.a ERC-20).\n\n[fa2_single_asset_with_hooks.mligo](single_asset/ligo/src/fa2_single_asset_with_hooks.mligo)\nimplementation of the FA2 contract that supports single fungible tokens (a.k.a ERC-20)\nand sender/receiver hooks.\n\n[fa12_lorentz.tz](single_asset/lorentz/out/fa12_lorentz.tz)\nimplementation of the FA1.2 contract that supports single fungible tokens\n(a.k.a. ERC-20).\n\n### [multi_asset](multi_asset)\n\n[fa2_multi_asset.mligo](multi_asset/ligo/src/fa2_multi_asset.mligo) implementation\nof the FA2 contract that supports multiple fungible tokens (a.k.a. ERC-1155).\n\n[fa2_granular_multi_asset.mligo](multi_asset/ligo/src/fa2_granular_multi_asset.mligo)\nimplementation of the FA2 contract that supports multiple fungible tokens\n(a.k.a. ERC-1155) that allows pausing/un-pausing transfers on individual tokens.\n\n### [fa2_hooks](fa2_hooks)\n\n[fa2_multi_asset.mligo](fa2_hooks/ligo/src/fa2_multi_asset.mligo) implementation\nof the FA2 contract that supports multiple fungible tokens (a.k.a. ERC-1155) and\nsender/receiver hooks.\n\n### [nft_asset](nft_assets)\n\n[fa2_nft_asset.mligo](nft_assets/ligo/src/fa2_nft_asset.mligo) implementation\nof the NFT FA2 contract (a.k.a. ERC-721). The contract supports multiple \"families\"\nof NFT tokens that share the same token metadata.\n\n### [collectibles](collectibles)\n\n[fa2_fixed_collection_asset.mligo](collectibles/ligo/src/fa2_fixed_collection_asset.mligo)\nimplementation of the fixed collection of NFT tokens (a.k.a. ERC-721). The FA2\ncontract is originated with the predefined set of NFT tokens. Tokens cannot be\nminted or burned.\n\n### [fractional](fractional)\n\n[fractional_dao.mligo](fractional/ligo/src/fractional_dao.mligo) implementation\nof DAO that manages fractional ownership of NFT tokens. The DAO is the owner of\nan NFT token in the corresponding FA2 NFT contract and also manages fractional\nownership fungible token for each owned NFT. Holders of the linked ownership fungible\ntokens can vote (directly or using signed permit) on transfer of the NFT token to\nsome other address.\n\n### [generic_fractional_dao](generic_fractional_dao)\n\n[fractional_dao.mligo](generic_fractional_dao/ligo/src/fractional_dao.mligo)\nimplementation of a generic fractional DAO user fractional voting to control any\ngeneric operation represented by a lambda function. Such lambda can transfer tokens,\nbuy/sell tokens on market place or auction or perform any other generic operation.\nFractional ownership is controlled by allocation of the ownership fungible token\nmanaged by the DAO. The DAO itself is a FA2 contracts that supports standard FA2\nAPI to manage the ownership token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxheadalpha%2Fsmart-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxheadalpha%2Fsmart-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxheadalpha%2Fsmart-contracts/lists"}