Skip to content

gammaswap/v2-deltaswap

Repository files navigation

Gammaswap logo

Compile/Test/Publish

V2-DeltaSwap

Description

DeltaSwap is an AMM that employes the constant product market maker formula used by UniswapV2 but without or low trading fees on transactions with low market impact

Note

Built with solidity version 0.8.19 because Arbitrum doesn't support 0.8.21

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

    *must use second init code hash when running foundry tests.

Note

If code is updated print init code hash for hardhat tests from DeltaSwapV2Factory.spec.ts. Uncomment the part in the BeforeEach statement. This is the first init_code_hash shown in DeltaSwapLibrary.sol. For foundry tests uncomment the part in DeltaSwapSetup.sol initDeltaSwap. This is the second init code hash.

The difference in initcode hashes for foundry tests and hardhat tests seems to be because of foundry inserting metadata into the solidity code, which makes the code compile to a different bytecode and unrecognized by the router contract. The actual bytecode use in a live network would be the one in the first line of the DeltaSwapLibrary.sol file. The one produced by the Factory contract hardhat unit test.

About

GammaSwap decentralized feeless spot exchange

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published