Skip to content

Commit

Permalink
Merge pull request #1 from h20liquidity/2023-02-21-h20-strat
Browse files Browse the repository at this point in the history
Twap Mirror
  • Loading branch information
Siddharth2207 authored Mar 12, 2024
2 parents 13b210e + e0cbe98 commit d0c3077
Show file tree
Hide file tree
Showing 28 changed files with 902 additions and 1,363 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/forge-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
fail-fast: true
runs-on: ubuntu-latest
env:
RPC_URL_POLYGON: ${{ secrets. RPC_URL_POLYGON }}
RPC_URL_POLYGON: ${{ secrets. RPC_URL_POLYGON}}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -18,7 +18,9 @@ jobs:
uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2

- run: nix run .#uniswap-prelude
- run: nix run .#rainix-sol-prelude
- run: nix run .#i9r-prelude
working-directory: lib/rain.interpreter
- run: nix run .#rainix-sol-test
working-directory: lib/rain.orderbook/lib/rain.interpreter
- run: mkdir -p test/csvs
- run: nix run .#rainix-sol-test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ out
cache
broadcast
.env
test/csvs/*
15 changes: 12 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
[submodule "lib/rain.intorastring"]
path = lib/rain.intorastring
url = https://github.com/rainlanguage/rain.intorastring
[submodule "lib/rain.interpreter"]
path = lib/rain.interpreter
url = https://github.com/rainlanguage/rain.interpreter
[submodule "lib/rain.orderbook"]
path = lib/rain.orderbook
url = https://github.com/rainlanguage/rain.orderbook.git
[submodule "lib/rain.uniswap"]
path = lib/rain.uniswap
url = https://github.com/rainlanguage/rain.uniswap.git
[submodule "lib/h20.pubstrats"]
path = lib/h20.pubstrats
url = https://github.com/h20liquidity/h20.pubstrats.git
[submodule "lib/view-quoter-v3"]
path = lib/view-quoter-v3
url = https://github.com/Uniswap/view-quoter-v3
37 changes: 18 additions & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@
let
pkgs = rainix.pkgs.${system};
in {
packages = rainix.packages.${system};
packages = rec {
uniswap-prelude = rainix.mkTask.${system} {
name = "uniswap-prelude";
body = ''
set -euxo pipefail
FOUNDRY_PROFILE=reference forge build --force
FOUNDRY_PROFILE=quoter forge build --force
'';
additionalBuildInputs = rainix.sol-build-inputs.${system};
};
} // rainix.packages.${system};
devShells = rainix.devShells.${system};
}
);
Expand Down
43 changes: 42 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ libs = ['lib']

# See more config options https://github.com/foundry-rs/foundry/tree/master/config

# Needed for dotrain compose
ffi = true

solc = "0.8.19"
optimizer = true
optimizer_runs = 100000
Expand All @@ -14,7 +17,45 @@ cbor_metadata = false

# Build metadata used for testing rain meta aware contracts in this folder rather
# than expose ffi to forge.
fs_permissions = [{ access = "read", path = "./meta"}]
fs_permissions = [
{ access = "read", path = "out/reference/UniswapV2LibraryConcrete.sol/UniswapV2LibraryConcrete.json" },
{ access = "read", path = "out/quoter/Quoter.sol/Quoter.json" },
{ access = "read", path = "./lib/rain.orderbook/lib/rain.interpreter/meta/RainterpreterExpressionDeployerNPE2.rain.meta"},
{ access = "read-write", path = "test/csvs"}
]

remappings = [
"rain.interpreter/=lib/rain.orderbook/lib/rain.interpreter/src",
"rain.metadata/=lib/rain.orderbook/lib/rain.metadata/src"
]


[fuzz]
runs = 1024

[profile.reference]

solc = "0.6.6"
src = "reference/src"
test = 'reference/test'
script = 'reference/script'
out = "out/reference/"
libs = ["reference/lib"]
remappings = [
"v2-core/=reference/lib/v2-core/",
"v2-periphery/=reference/lib/v2-periphery/",
"@uniswap/v2-core/=reference/lib/v2-core/",
"@uniswap/v2-periphery/=reference/lib/v2-periphery/"
]

[profile.quoter]

solc = "0.7.6"
src = "lib/view-quoter-v3/contracts"
test = "lib/view-quoter-v3/test"
script = "lib/view-quoter-v3/script"
out = "out/quoter/"
libs = ["lib/view-quoter-v3/lib"]
remappings = [
"v3-periphery/=lib/view-quoter-v3/lib/v3-periphery/",
]
1 change: 1 addition & 0 deletions lib/h20.pubstrats
Submodule h20.pubstrats added at 4d75db
1 change: 0 additions & 1 deletion lib/rain.interpreter
Submodule rain.interpreter deleted from 820672
2 changes: 1 addition & 1 deletion lib/rain.intorastring
1 change: 1 addition & 0 deletions lib/rain.orderbook
Submodule rain.orderbook added at fc241e
1 change: 1 addition & 0 deletions lib/rain.uniswap
Submodule rain.uniswap added at c71ab2
1 change: 1 addition & 0 deletions lib/view-quoter-v3
Submodule view-quoter-v3 added at 064967
92 changes: 0 additions & 92 deletions src/SushiV2UniV3TwapTrendStrat.rain

This file was deleted.

Loading

0 comments on commit d0c3077

Please sign in to comment.