Skip to content

Commit 16d48eb

Browse files
alexkeatingmds1
andauthored
Inital perpetual open router (#1)
* forge install: solmate * forge install: perp-curie-contract v2.4.5 * forge install: openzeppelin-contracts v4.8.2 * Working example * Cleanup * Update to pass linting * Update to pass linting * Add Optimism rpc url * Make changes based on feedback * Fix formatting * Remove SARIF * Add permalinks for interfaces * Fix toml * Add some natspec * Scopelint format * Convert to fallback function * Fix format * Remove unused import * Fix scopelint * Change comment * Changes based on feedback * Add receive to remove warning * Working closePosition * Update deposit * Add benchmarks * Some changes based on comments * More changes based on comments * Remove comment * style: fmt new statements * style: forge fmt * Add comments * Fix formatting * Change to internal * Change wording of comments --------- Co-authored-by: Matt Solomon <[email protected]>
1 parent b66daf2 commit 16d48eb

27 files changed

+4144
-67
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
env:
1111
FOUNDRY_PROFILE: ci
12+
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }}
1213

1314
jobs:
1415
build:
@@ -75,7 +76,7 @@ jobs:
7576
uses: zgosalvez/github-actions-report-lcov@v2
7677
with:
7778
coverage-files: ./lcov.info
78-
minimum-coverage: 100 # Set coverage threshold.
79+
minimum-coverage: 80 # Set coverage threshold.
7980

8081
lint:
8182
runs-on: ubuntu-latest
@@ -100,23 +101,3 @@ jobs:
100101
run: |
101102
scopelint --version
102103
scopelint check
103-
104-
slither-analyze:
105-
runs-on: ubuntu-latest
106-
permissions:
107-
security-events: write
108-
steps:
109-
- uses: actions/checkout@v3
110-
111-
- name: Run Slither
112-
uses: crytic/[email protected]
113-
id: slither # Required to reference this step in the next step.
114-
with:
115-
fail-on: none # Required to avoid failing the CI run regardless of findings.
116-
sarif: results.sarif
117-
slither-args: --filter-paths "./lib|./test" --exclude naming-convention
118-
119-
- name: Upload SARIF file
120-
uses: github/codeql-action/upload-sarif@v2
121-
with:
122-
sarif_file: ${{ steps.slither.outputs.sarif }}

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
[submodule "lib/forge-std"]
22
path = lib/forge-std
33
url = https://github.com/foundry-rs/forge-std
4+
[submodule "lib/solmate"]
5+
path = lib/solmate
6+
url = https://github.com/transmissions11/solmate
7+
[submodule "lib/perp-curie-contract"]
8+
path = lib/perp-curie-contract
9+
url = https://github.com/perpetual-protocol/perp-curie-contract
10+
[submodule "lib/openzeppelin-contracts"]
11+
path = lib/openzeppelin-contracts
12+
url = https://github.com//OpenZeppelin/openzeppelin-contracts

broadcast/Benchmark.s.sol/10/run-1681856767.json

Lines changed: 1060 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/Benchmark.s.sol/10/run-latest.json

Lines changed: 1060 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/10/run-1681853983.json

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/10/run-latest.json

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.

foundry.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[profile.default]
2+
fs_permissions = [{ access = "read", path = "./broadcast" }]
23
optimizer = true
34
optimizer_runs = 10_000_000
45
solc_version = "0.8.16"
@@ -16,6 +17,13 @@
1617

1718
[fmt]
1819
bracket_spacing = false
20+
ignore = [
21+
"src/interface/IAccountBalance.sol",
22+
"src/lib/AccountMarket.sol",
23+
"src/interface/IClearingHouse.sol",
24+
"src/interface/IVault.sol",
25+
"src/test/interface/IDelegateApproval.sol",
26+
]
1927
int_types = "long"
2028
line_length = 100
2129
multiline_func_header = "attributes_first"
@@ -24,3 +32,9 @@
2432
single_line_statement_blocks = "single"
2533
tab_width = 2
2634
wrap_comments = true
35+
36+
# ===============================
37+
# ======== RPC Endpoints ========
38+
# ===============================
39+
[rpc_endpoints]
40+
optimism = "${OPTIMISM_RPC_URL}"

lib/openzeppelin-contracts

Submodule openzeppelin-contracts added at d00acef

lib/perp-curie-contract

Submodule perp-curie-contract added at 4e187e4

lib/solmate

Submodule solmate added at 2001af4

0 commit comments

Comments
 (0)