{"id":13517879,"url":"https://github.com/OpenST/mosaic-contracts","last_synced_at":"2025-03-31T09:30:57.455Z","repository":{"id":44220707,"uuid":"108171643","full_name":"OpenST/mosaic-contracts","owner":"OpenST","description":"Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps","archived":false,"fork":false,"pushed_at":"2022-12-10T16:30:54.000Z","size":11199,"stargazers_count":114,"open_issues_count":37,"forks_count":31,"subscribers_count":33,"default_branch":"develop","last_synced_at":"2024-11-01T23:30:40.400Z","etag":null,"topics":["blockchain","ethereum","metablockchain","mosaic","openst-protocol","ost","sharding","simpletoken"],"latest_commit_sha":null,"homepage":"https://discuss.openst.org/c/mosaic","language":"JavaScript","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/OpenST.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-24T19:09:30.000Z","updated_at":"2024-08-12T19:33:34.000Z","dependencies_parsed_at":"2023-01-26T09:31:01.538Z","dependency_job_id":null,"html_url":"https://github.com/OpenST/mosaic-contracts","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fmosaic-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fmosaic-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fmosaic-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenST%2Fmosaic-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenST","download_url":"https://codeload.github.com/OpenST/mosaic-contracts/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246446794,"owners_count":20778873,"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":["blockchain","ethereum","metablockchain","mosaic","openst-protocol","ost","sharding","simpletoken"],"created_at":"2024-08-01T05:01:38.328Z","updated_at":"2025-03-31T09:30:56.642Z","avatar_url":"https://github.com/OpenST.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# 💠 Mosaic Contracts\n\n![Build master](https://img.shields.io/travis/OpenST/mosaic-contracts/master.svg?label=build%20master\u0026style=flat)\n![Build develop](https://img.shields.io/travis/OpenST/mosaic-contracts/develop.svg?label=build%20develop\u0026style=flat)\n![npm version](https://img.shields.io/npm/v/@openst/mosaic-contracts.svg?style=flat)\n[![Discuss on Discourse](https://img.shields.io/discourse/https/discuss.openst.org/topics.svg?style=flat)][discourse]\n[![Chat on Gitter](https://img.shields.io/gitter/room/OpenSTFoundation/SimpleToken.svg?style=flat)][gitter]\n\nMosaic is a parallelization schema for decentralized applications.\nIt composes heterogeneous blockchain systems into one another.\nDecentralized applications can use Mosaic to compute over a composed network of multiple blockchain systems in parallel.\n\nMosaic enables building scalable blockchain token economies through the bidirectional transposition of ERC20 tokens on one blockchain, the *origin* chain, and a utility token representation on another blockchain, the *auxiliary* chain.\n\nThe protocol defines a set of actions that together perform atomic token transfers across two blockchains using gateway contracts. A gateway for a given EIP20 token is comprised of a `EIP20Gateway` contract on origin, a corresponding `EIP20CoGateway` contract on auxiliary, and and an ERC20 utility token contract on auxiliary that mints and burns utility tokens to atomically mirror tokens staked and unstaked on the origin chain.\n\nAtomicity is achieved using a 2-phase message passing architecture between the chains. Messages are declared on the source chain, and confirmed on the target chain with Patricia Merkle proofs once the source chain is finalized. Once messages are confirmed on the target chain, they can efficiently progressed with a hashlock.\nMessages can also be reverted if they are not yet completed on the target chain.\n\nYou can read [the draft of the mosaic whitepaper][mosaic whitepaper] or [the original OpenST whitepaper][openst whitepaper].\n\n## Instructions\n\n### For JS Consumers\n\n#### Installation\n\n```bash\nnpm install @openst/mosaic-contracts\n```\n\n#### Usage\n\n```typescript\n// Load the contracts' meta-data from the package:\nimport { contracts } from \"@openst/mosaic-contracts\";\n\n// Access the ABIs and BINs directly on the contracts. For example:\nconst anchorAbi = contracts.Anchor.abi;\nconst anchorBinary = contracts.Anchor.bin;\n```\n\n`@openst/mosaic-contracts` also includes the contract interacts.\n\nExample of using the contract interacts. \n```typescript\nimport { Interacts} from \"@openst/mosaic-contracts\";\n\nconst anchor:Anchor = Interacts.getAnchor(web3, '0xAnchorContractAddress');\nconst gateway:EIP20Gateway = Interacts.getEIP20Gateway(web3, '0xEIP20GatewayContactAddress');\n```\nExample with Web3 contracts.\n```typescript\nimport { contracts } from \"@openst/mosaic-contracts\";\n\nconst jsonInterface = contracts.Anchor.abi;\nconst contract = new web3.eth.Contract(jsonInterface, address, options);\n\nconst anchor:Anchor = contract as Anchor;\n\n```\n### For Direct Users\n\nThis section is only required if you want to *set up a **new** mosaic chain.*\n\n#### Installation\n\n```bash\ngit clone https://github.com/OpenST/mosaic-contracts.git\ncd mosaic-contracts\nnpm run update # Runs `git submodule update --init --recursive \u0026\u0026 npm ci`\nnpm run compile:all\n```\n\n#### Usage\n\nThere is a deployment tool available for deployment and set-up:\n\n```bash\nnode ./tools/blue_deployment/index.js\n```\n\n\u003e ⚠️ Note that this feature is still very experimental ⚠️\n\n## Related Work\n\n[mosaic.js] uses this package to provide a JavaScript abstraction layer of the mosaic contracts.\nYou can use [mosaic.js] directly to deploy the contracts and interact with them.\n\n## Contributing\n\n### Set-up\n\n```bash\ngit clone https://github.com/OpenST/mosaic-contracts.git\ncd mosaic-contracts\nnpm run update # Runs `git submodule update --init --recursive \u0026\u0026 npm ci`\nnpm run compile:all\nnpm run ganache\nnpm run test\n```\n\n### Guidelines\n\nThere are multiple ways to contribute to this project. However, before contributing, please first review the [Code of Conduct].\n\nWe track our [issues] on GitHub.\n\nTo contribute code, please ensure that your submissions adhere to the [Style Guide]; please also be aware that this project is under active development and we have not yet established firm contribution guidelines or acceptance criteria.\n\n### Community\n\n* [Forum][discourse]\n* [Gitter]\n\n[code of conduct]: https://github.com/OpenSTFoundation/mosaic-contracts/blob/develop/CODE_OF_CONDUCT.md\n[discourse]: https://discuss.openst.org/\n[gitter]: https://gitter.im/OpenSTFoundation/SimpleToken\n[issues]: https://github.com/OpenST/mosaic-contracts/issues\n[mosaic.js]: https://github.com/OpenST/mosaic.js\n[mosaic whitepaper]: https://github.com/OpenST/mosaic-contracts/blob/develop/docs/mosaicv0.pdf\n[openst whitepaper]: https://drive.google.com/file/d/0Bwgf8QuAEOb7Z2xIeUlLd21DSjQ/view\n[style guide]: https://github.com/OpenST/mosaic-contracts/blob/develop/SOLIDITY_STYLE_GUIDE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenST%2Fmosaic-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenST%2Fmosaic-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenST%2Fmosaic-contracts/lists"}