{"id":20648149,"url":"https://github.com/gammaswap/v1-core","last_synced_at":"2025-04-16T14:41:51.847Z","repository":{"id":197321383,"uuid":"535159602","full_name":"gammaswap/v1-core","owner":"gammaswap","description":"Core smart contracts for the GammaSwap V1 protocol","archived":false,"fork":false,"pushed_at":"2025-02-17T06:02:52.000Z","size":2240,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T05:23:51.241Z","etag":null,"topics":["defi","gammaswap","trading","volatility"],"latest_commit_sha":null,"homepage":"https://gammaswap.com","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gammaswap.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":"2022-09-11T01:17:48.000Z","updated_at":"2025-02-17T06:02:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"756992f3-5ddd-489e-a95f-f3a412ebcbcb","html_url":"https://github.com/gammaswap/v1-core","commit_stats":null,"previous_names":["gammaswap/v1-core"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammaswap%2Fv1-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammaswap%2Fv1-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammaswap%2Fv1-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gammaswap%2Fv1-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gammaswap","download_url":"https://codeload.github.com/gammaswap/v1-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752696,"owners_count":21156145,"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":["defi","gammaswap","trading","volatility"],"created_at":"2024-11-16T17:06:38.608Z","updated_at":"2025-04-16T14:41:51.829Z","avatar_url":"https://github.com/gammaswap.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://gammaswap.com\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg width=\"100\" src=\"https://app.gammaswap.com/logo.svg\" alt=\"Gammaswap logo\"\u003e\u003c/a\u003e\u003c/p\u003e\n  \n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/gammaswap/v1-core/actions/workflows/main.yml\"\u003e\n    \u003cimg src=\"https://github.com/gammaswap/v1-core/actions/workflows/main.yml/badge.svg?branch=main\" alt=\"Compile/Test/Publish\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eV1-Core\u003c/h1\u003e\n\n## Description\nThis is the repository for the core smart contracts of the GammaSwap V1 protocol. \n\nThis repository does not contain implementations of GammaPools but rather abstract contracts that can be used to implement GammaPools for different types of CFMMs\n\nThe only implemented contract in this repository is the GammaPoolFactory which instantiates new GammaPools to enable the borrowing of liquidity from CFMMs,\nthe PoolViewer which views storage data from GammaPools, and storage contracts to track loans and store price information.\n\nThe storage contracts to track loans and store price information are not necessary if a subgraph exists to do the same.\n\n## Steps to Run GammaSwap Tests Locally\n\n1. Run `yarn` to install GammaSwap dependencies\n2. Run `yarn test` to run hardhat tests\n3. Run `yarn fuzz` to run foundry tests (Need foundry binaries installed locally)\n\nTo deploy contracts to local live network use v1-deployment repository\n\n### Note\nTo install foundry locally go to [getfoundry.sh](https://getfoundry.sh/)\n\n## Solidity Versions\nCode is built with solidity version 0.8.21. But the evm in hardhat is set to Paris for Arbitrum deployment.\n\nConcrete contracts support only solidity version 0.8.21.\n\nAbstract contracts support solidity version 0.8.4 and up.\n\nInterfaces support solidity version 0.8.0 and up.\n\nGammaPool.sol, GammaPoolERC4626, and GammaSwapLibrary.sol support solidity version 0.8.13 and up due to [abi.encodecall bug](https://soliditylang.org/blog/2022/03/16/encodecall-bug/).\n\nWe used solidity version 0.8.21 so that the code is ready to deploy to ethereum mainnet but set the evm in hardhat to Paris because at the time\narbitrum does not support push0 opcode (shanghai evm).\n\n## Publishing NPM Packages\n\nTo publish an npm package follow the following steps \n\n1. Bump the package.json version to the next level (either major, minor, or patch version)\n2. commit to the main branch adding 'publish package' in the comment section of the commit (e.g. when merging a pull request)\n\n### Rules for updating package.json version\n\n1. If change does not break interface, then it's a patch version update\n2. If change breaks interface, then it's a minor version update\n3. If change is for a new product release to public, it's a major version update\n\n### How to Generate Minimal Beacon Proxy Bytecode\n\nThe source code for the Minimal Beacon Proxy is in /contracts/utils/MinimalBeaconProxy.sol\n\n1. Disable bytecode metadata hash in hardhat config file\n    solidity: { settings: { metadata: { bytecodeHash: \"none\" } } }\n2. Run 'npx hardhat compile'\n3. Retrieve bytecode from MinimalBeaconProxy.json file in artifacts\n\n*The reason for the changes in the bytecode depending on protocolId \u003e 256 is because if protocolId \u003e 256 then it takes\n2 bytes in the bytecode instead of 1 byte, which means the bytecode must allocate this space.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgammaswap%2Fv1-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgammaswap%2Fv1-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgammaswap%2Fv1-core/lists"}