1.0.3 • Published 12 days ago

@teamteanpm2024/quae-dignissimos-quo v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 days ago

Description

This is the repository for the core smart contracts of the GammaSwap V1 protocol.

This repository does not contain implementations of GammaPools but rather abstract contracts that can be used to implement GammaPools for different types of CFMMs

The only implemented contract in this repository is the GammaPoolFactory which instantiates new GammaPools to enable the borrowing of liquidity from CFMMs, the PoolViewer which views storage data from GammaPools, and storage contracts to track loans and store price information.

The storage contracts to track loans and store price information are not necessary if a subgraph exists to do the same.

Steps to Run GammaSwap Tests Locally

  1. Run yarn to install GammaSwap dependencies
  2. Run yarn test to run hardhat tests
  3. Run yarn fuzz to run foundry tests (Need foundry binaries installed locally)

To deploy contracts to local live network use v1-deployment repository

Note

To install foundry locally go to getfoundry.sh

Solidity Versions

Code is built with solidity version 0.8.21. But the evm in hardhat is set to Paris for Arbitrum deployment.

Concrete contracts support only solidity version 0.8.21.

Abstract contracts support solidity version 0.8.4 and up.

Interfaces support solidity version 0.8.0 and up.

GammaPool.sol, GammaPoolERC4626, and GammaSwapLibrary.sol support solidity version 0.8.13 and up due to abi.encodecall bug.

We 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 arbitrum does not support push0 opcode (shanghai evm).

Publishing NPM Packages

To publish an npm package follow the following steps

  1. Bump the package.json version to the next level (either major, minor, or patch version)
  2. commit to the main branch adding 'publish package' in the comment section of the commit (e.g. when merging a pull request)

Rules for updating package.json version

  1. If change does not break interface, then it's a patch version update
  2. If change breaks interface, then it's a minor version update
  3. If change is for a new product release to public, it's a major version update

How to Generate Minimal Beacon Proxy Bytecode

The source code for the Minimal Beacon Proxy is in /contracts/utils/MinimalBeaconProxy.sol

  1. Disable bytecode metadata hash in hardhat config file solidity: { settings: { metadata: { bytecodeHash: "none" } } }
  2. Run 'npx hardhat compile'
  3. Retrieve bytecode from MinimalBeaconProxy.json file in artifacts

*The reason for the changes in the bytecode depending on protocolId > 256 is because if protocolId > 256 then it takes 2 bytes in the bytecode instead of 1 byte, which means the bytecode must allocate this space.

superstructserializationES2015monorepoTypedArraytddeslintplugindeep-copyspringidlegenericsschemachromiumfantasy-landnested cssInt8ArrayirqinferencematchAllratelimitrfc4122Array.prototype.containszerosignalsqueuextermstreamsindicatorpathdayjsglobES2018byteOffsetxdg-openprotocol-buffersArrayhasOwnoptimizerrandompromisesfind-upeast-asian-widthfull-widthviewinspectSymboltelephonevalidationshebanglesscssvalidatorstylesheetstabledataviewcryptowaitjson-schemaobjextensionairbnb_.extendcall-bindpatchprotobuffastifysetterES6slotjsxpackage managerweakmapcolorsettextbyteLengthrm -rfparselessregularwindowsnodejsconcatMapgraphqlshimcode pointscss nestingterminalbluebirdcallboundoutputcoreexitdescriptionJSON-SchemalinuxECMAScript 2017persistentsharedwgetresolveclibootstrap cssimportsortStreamswarningstatelessdefaultserializerless mixinsfast-clone[[Prototype]]regexramdarobust3deventsposexssastmovehttpsdescriptorsreact posepopmotionUint32Arraywaapiwebsitees2018pureES2020Object.assignsigtermpnpm9jsonpathgetintrinsicbddweaksetansihttpcollection.es6rmdirfseventsjapanesesafecheckwidthfilterapiframeworkInt32Arraybabel-coreES2016opensinterruptsa11ytestingmochaargvfunctionses2017trimLeftcssentriestrimimmerjoiflagspoint-freecomputed-typesomitsymbolformatlinkdatenodeless compilerspeccall-boundArrayBuffer.prototype.slicemetadataprivatestarttyped arraylimites-shimsvariablesintrinsicartdropcallbindmulti-packageslicesameValueZeroqueueMicrotaskprototypeobjectfullwidthgetPrototypeOfcolorsiteratorexpressbrowserthreegetOwnPropertyDescriptorspeedcmdwordwrapphoneclonecryptmapObservablesconfigiteratefastclonees2015setImmediatetsexpressioninstallwebautoprefixerReactiveExtensionstoolsuninstalllazyjson-schema-validationeslintformattingURLSearchParamssetPrototypeOfURLerrorefficienttypedarraysReflect.getPrototypeOfECMAScript 2021tappackage.jsontc39boundtimevaluescommanderstatustermsequencecompile lessrequirenopebcryptchineselinewrappreserve-symlinksfilei18nESIteratordeepsymlinksES2019babelBigInt64Arraytoobjectdependency managerpostcss-pluginarrayECMAScript 2020toolkit6to5react-testing-librarytostringtagstylematchbundlerargparseinputtypeerrorenvironmentbundlingcolourpyyamlfigletsidereact-hooksWebSocketspolyfillstringnumberargumentreadablemixinschromeawesomesauceconsolejwtletsymbolswatchFileECMAScript 2016languageelectronequalchildfunctionalbindhooksreadrmincludesmimetypesoptimistdefinePropertyeditorcompilerHyBilockfilegesturesloadingworkspace:*mrugettercallnamewatcher@@toStringTagaccessorjesteventDispatcherfast-copydataViewquotemimeduplexwrapcommandtrimRightpushstylesmobilekeyscolumnsFunction.prototype.namerequestgradients cssMapparentsfindLastIndexes-shim APIdotenvgrouprapidwordbreakutilitiesFloat32ArraygetpackagesyupArrayBufferfastcopyzoddeterministictakeArrayBuffer#sliceenvprunekeyinternalregular expressionsperformantjsdiffcacheenderlaunchtypeses5redux-toolkithigher-orderparentreducercurldebugutilsCSSStyleDeclarationexeArray.prototype.flattenMicrosoftpropexit-codeemojitaskArray.prototype.findLastfromsearchlruprefixRxJSStyleSheetapolloECMAScript 2015WeakMapObject.valuesstringifieropenernamesl10nformsrecursivecontainssettingsArray.prototype.findLastIndexarraybuffertypesafedependenciespicomatchsuperagentInt16Arrayconnectwalkingwritable.envenumerableCSSreduxsyntaxerrorpostcsstestsyntaxforEachiterationrm -fr0callbackcreateES3jasminejslintRFC-6455xdgwhatwgdescriptormime-dbnativenegative zerostyleguideclientxhr256queryopenvariables in cssdeepcopyvestES8mkdirvalueES2017mkdirsajvchaiES2021eslintconfig$.extendtrimEndassertsmatchesassertionratemodulestacitecmascriptrgbupsharedarraybufferArray.prototype.includesECMAScript 2018testerECMAScript 2023Object.isvalidatesanitizationhelpershandlersreal-timettyunicodeio-tsoperating-systemcollectionguidfindpropertyclassnameECMAScript 5Streamcommand-lineUint16Arrayclassnamesfindupclass-validatorbytereduceECMAScript 2019extendoffseteslint-pluginarktypereactSetreact-hook-formprotobreakdireventEmitterreact animationArray.prototype.filterflattentypedpositivedeleteescapetouchpropertieswhichshellUint8ArrayprogressmomentstructuredCloneisparserfastvartypescripttypeoncewatchconfigurableremovelistenersnegativeflatapploggingtoStringTagTypeBoxES7domconcattoSortedschemejsonsymlinkwatchinggetoptserializedragdatanpmtypeofharmonyrangeerrorfixed-widthexecRxdeepclonebusyes6processutil.inspectextratoArraygradients css3WebSocketassignfetchRegExp.prototype.flagsfoldermake dirpackageredactgdprpromisestringifydom-testing-libraryjavascriptstreams2authenticationfsString.prototype.trimjson-schema-validatorstylingscheme-validationAsyncIteratorcircular
1.0.2

13 days ago

1.0.3

12 days ago

1.0.1

14 days ago

1.0.0

15 days ago