{"id":24054609,"url":"https://github.com/cardinal-cryptography/common-amm-stable-swap","last_synced_at":"2025-04-22T20:45:49.202Z","repository":{"id":244382886,"uuid":"778204753","full_name":"Cardinal-Cryptography/common-amm-stable-swap","owner":"Cardinal-Cryptography","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-21T09:16:03.000Z","size":1896,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T18:41:36.602Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cardinal-Cryptography.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-03-27T09:28:52.000Z","updated_at":"2024-09-12T06:59:39.000Z","dependencies_parsed_at":"2024-06-14T11:45:48.520Z","dependency_job_id":"13054b93-62f8-483d-941c-2be246f34d7b","html_url":"https://github.com/Cardinal-Cryptography/common-amm-stable-swap","commit_stats":null,"previous_names":["cardinal-cryptography/common-amm-stable-swap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcommon-amm-stable-swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcommon-amm-stable-swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcommon-amm-stable-swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fcommon-amm-stable-swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cardinal-Cryptography","download_url":"https://codeload.github.com/Cardinal-Cryptography/common-amm-stable-swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250322043,"owners_count":21411693,"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":"2025-01-09T03:48:59.259Z","updated_at":"2025-04-22T20:45:49.183Z","avatar_url":"https://github.com/Cardinal-Cryptography.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Common logo](common_logo.svg \"Common logo\")\n\nThis repository contains an implementation of StableSwap contract for Common DEX.\n\n## Versions\n\n[ink! 4.3.0](https://github.com/paritytech/ink/tree/v4.3.0)\n`cargo-contract` in version `3.2.0`\n\n## License\n\nApache 2.0\n\n### 🏗️ How to use - Contracts\n\n##### 💫 Build\n\nUse these [instructions](https://use.ink/getting-started/setup) to set up your ink!/Rust environment.\nTo build all contracts, run this command from the project root directory:\n\n```sh\nmake build-all\n```\n\n##### 💫 Build verifiably\n\nGiven a deployed set of contracts with some code hashes, it's possible to check that the contract has been produced from a certain version of the source code in this repo (say a given commit). To do so:\n\n1. `git checkout $COMMIT`\n2. `make build-dockerized`.\n\nYou can also run `make build-dockerized` and ensure that the generated code hashes are the same as the ones found on chian.\n\nThe contracts will be deployed using the same docker image as the one used for this procedure, which smooths out indeterminism in ink! contract compilation.\n\nThe reason to build contracts with this command is to allow for _reproducible builds_ (ink! contracts' builds are not deterministic).\n\n##### How to verify\n\nCheck out the repository at commit `TODO` (after deployment) and in the root of the project run the command above. This will output contracts' builds to `/target/ink` directory.\n\nFor every contract there's a separate folder in which you will find `\u003ccontract\u003e.json` containing contract's metadata. One of the keys is `source.hash`. Compare that to the code hash of the on-chain contract.\n\n##### 💫 Wrap\n\nUse these [instructions](https://github.com/Cardinal-Cryptography/ink-wrapper#installation) to set up your `ink-wrapper` environment.\nOnce you have built your contracts, you can wrap them by running this command from the project root directory:\n\n```sh\nmake wrap-all\n```\n\nYou can also build and wrap the contracts in one step using:\n\n```sh\nmake build-and-wrap-all\n```\n\n##### 💫 Run checks\n\nRust code checks and unit tests can be run from the root directory of the project:\n\n```sh\nmake check-all\n```\n\n##### 💫 Run unit test\n\nTo manually run unit tests, use:\n\n```sh\ncargo test\n```\n\n##### 💫 Run DRink! tests\n\nTo run the DRink! test suite, execute the following command from the root directory of the project.\n\n```sh\nmake all-drink\n```\n\nThis will:\n\n- Build and wrap your contracts.\n- Run e2e tests, using DRink! environment.\n\n##### 💫 Help\n\nYou can see a list of available `make` recipes by running:\n\n```sh\nmake help\n```\n\n## Acknowledgement\n\nThe contracts here implement a StableSwap invariant AMM based on the Curve and Ref Finance. Code has been adapted to work with ink! and be more easily integrated with already-existing Common AMM.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fcommon-amm-stable-swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardinal-cryptography%2Fcommon-amm-stable-swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fcommon-amm-stable-swap/lists"}