Skip to content

Commit d6ab471

Browse files
authored
chore: V1.5 featuring SuperformRouter Plus (#614)
1 parent 6722777 commit d6ab471

File tree

275 files changed

+38367
-1066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+38367
-1066
lines changed

.github/workflows/CI.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ concurrency:
66

77
on:
88
push:
9-
branches: [main, develop, v1]
9+
branches: [main, develop, v1.5]
1010
pull_request:
11-
branches: [main, develop, v1]
11+
branches: [main, develop]
1212

1313
env:
1414
BSC_RPC_URL: ${{ secrets.BSC_RPC_URL }}
@@ -19,8 +19,11 @@ env:
1919
AVALANCHE_RPC_URL: ${{ secrets.AVALANCHE_RPC_URL }}
2020
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }}
2121
FANTOM_RPC_URL: ${{ secrets.FANTOM_RPC_URL }}
22+
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
23+
BSC_TESTNET_RPC_URL: ${{ secrets.BSC_TESTNET_RPC_URL }}
2224
LINEA_RPC_URL: ${{ secrets.LINEA_RPC_URL }}
2325
BLAST_RPC_URL: ${{ secrets.BLAST_RPC_URL }}
26+
BARTIO_RPC_URL: ${{ secrets.BARTIO_RPC_URL }}
2427
BSC_RPC_URL_QN: ${{ secrets.BSC_RPC_URL }}
2528
ARBITRUM_RPC_URL_QN: ${{ secrets.ARBITRUM_RPC_URL }}
2629
OPTIMISM_RPC_URL_QN: ${{ secrets.OPTIMISM_RPC_URL }}
@@ -29,8 +32,11 @@ env:
2932
AVALANCHE_RPC_URL_QN: ${{ secrets.AVALANCHE_RPC_URL }}
3033
BASE_RPC_URL_QN: ${{ secrets.BASE_RPC_URL }}
3134
FANTOM_RPC_URL_QN: ${{ secrets.FANTOM_RPC_URL }}
35+
SEPOLIA_RPC_URL_QN: ${{ secrets.SEPOLIA_RPC_URL }}
36+
BSC_TESTNET_RPC_URL_QN: ${{ secrets.BSC_TESTNET_RPC_URL }}
3237
LINEA_RPC_URL_QN: ${{ secrets.LINEA_RPC_URL }}
3338
BLAST_RPC_URL_QN: ${{ secrets.BLAST_RPC_URL }}
39+
BARTIO_RPC_URL_QN: ${{ secrets.BARTIO_RPC_URL }}
3440
TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }}
3541
TENDERLY_PROJECT_SLUG: "v1" # your project slug
3642
TENDERLY_ACCOUNT_ID: "superform" # your username or organization name
@@ -50,6 +56,11 @@ jobs:
5056
- name: "Install Foundry"
5157
uses: "foundry-rs/foundry-toolchain@v1"
5258

59+
60+
- name: "Show the Foundry version"
61+
run: "forge --version"
62+
63+
5364
- name: "Show the Foundry config"
5465
run: "forge config"
5566

@@ -165,7 +176,7 @@ jobs:
165176
run: "make coverage"
166177

167178
- name: "Upload coverage report to Codecov"
168-
uses: "codecov/codecov-action@v4"
179+
uses: "codecov/codecov-action@v5"
169180
env:
170181
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
171182
with:

Makefile

Lines changed: 152 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# (-include to ignore error if it does not exist)
33
-include .env
44

5-
65
# only export these env vars if ENVIRONMENT = local
76
ifeq ($(ENVIRONMENT), local)
87
export ETHEREUM_RPC_URL = $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/ETHEREUM_RPC_URL/credential)
@@ -15,6 +14,7 @@ ifeq ($(ENVIRONMENT), local)
1514
export FANTOM_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/FANTOM_RPC_URL/credential)
1615
export LINEA_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/LINEA_RPC_URL/credential)
1716
export BLAST_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BLAST_RPC_URL/credential)
17+
export BARTIO_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BARTIO_RPC_URL/credential)
1818
export ETHEREUM_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/ETHEREUM_RPC_URL/credential)
1919
export BSC_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BSC_RPC_URL/credential)
2020
export AVALANCHE_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/AVALANCHE_RPC_URL/credential)
@@ -23,27 +23,158 @@ ifeq ($(ENVIRONMENT), local)
2323
export OPTIMISM_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/OPTIMISM_RPC_URL/credential)
2424
export BASE_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BASE_RPC_URL/credential)
2525
export FANTOM_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/FANTOM_RPC_URL/credential)
26+
export SEPOLIA_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/SEPOLIA_RPC_URL/credential)
27+
export BSC_TESTNET_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BSC_TESTNET_RPC_URL/credential)
2628
export LINEA_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/LINEA_RPC_URL/credential)
2729
export BLAST_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BLAST_RPC_URL/credential)
30+
export BARTIO_RPC_URL_QN := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BARTIO_RPC_URL/credential)
31+
endif
32+
33+
# Check for required dependencies
34+
CHECK_FORGE := $(shell command -v forge 2> /dev/null)
35+
CHECK_SOLC := $(shell command -v solc 2> /dev/null)
36+
CHECK_ABIGEN := $(shell command -v abigen 2> /dev/null)
37+
CHECK_ITYFUZZ := $(shell ityfuzz -v forge 2> /dev/null)
38+
39+
40+
check-forge:
41+
ifndef CHECK_FORGE
42+
$(error "Forge is not installed. Please install Forge and retry.")
43+
endif
44+
45+
check-solc:
46+
ifndef CHECK_SOLC
47+
$(error "Solc is not installed. Please install solc and retry.")
48+
endif
49+
50+
check-abigen:
51+
ifndef CHECK_ABIGEN
52+
$(error "Abigen is not installed. Please install Abigen and retry.")
2853
endif
2954

30-
# deps
31-
install:; forge install
32-
update:; forge update
33-
34-
# Build & test
35-
build :; FOUNDRY_PROFILE=production forge build
36-
build-unoptimized :; FOUNDRY_PROFILE=localdev forge build
37-
build-sizes :; FOUNDRY_PROFILE=production forge build --sizes
38-
test-vvv :; forge test --match-test test_DstSwapIndex0DirectToCSRIndex1 --evm-version cancun -vvv
39-
ftest :; forge test --evm-version cancun
40-
test-ci :; forge test --no-match-path "test/invariant/**/*.sol" --evm-version cancun
41-
coverage :; FOUNDRY_PROFILE=coverage forge coverage --no-match-path "test/invariant/**/*.sol" --no-match-contract SmokeTest --evm-version cancun --report lcov
42-
coverage-t :; FOUNDRY_PROFILE=coverage forge coverage --match-contract 5115 --evm-version cancun --report lcov
43-
smoke-test :; forge test --match-contract SmokeTest -vvv
44-
invariant :; forge test --match-path "test/invariant/**/*.sol" --evm-version cancun -vvv
45-
invariant-rewards :; forge test --match-test invariant_tokenBalances --evm-version cancun -vvv
46-
clean :; forge clean
47-
snapshot :; forge snapshot
48-
fmt :; forge fmt && forge fmt test/
49-
ityfuzz :; ityfuzz evm -m -- forge test
55+
check-ityfuzz:
56+
ifndef CHECK_ITYFUZZ
57+
$(error "ityfuzz is not installed. Please install ityfuzz and retry.")
58+
endif
59+
60+
# Targets that require the checks
61+
generate: check-forge check-solc check-abigen
62+
install: check-forge
63+
update: check-forge
64+
build: check-forge
65+
build-unoptimized: check-forge
66+
build-sizes: check-forge
67+
test-vvv: check-forge
68+
ftest: check-forge
69+
test-ci: check-forge
70+
coverage: check-forge
71+
coverage-t: check-forge
72+
smoke-test: check-forge
73+
invariant: check-forge
74+
invariant-rewards: check-forge
75+
clean: check-forge
76+
snapshot: check-forge
77+
fmt: check-forge
78+
ityfuzz: check-ityfuzz
79+
80+
.PHONY: generate
81+
generate: build ## Generates go bindings for smart contracts
82+
./script/utils/retrieve-abis.sh
83+
84+
# General
85+
abigen --abi out/SuperformRouter.sol/SuperformRouter.abi --pkg contracts --type SFRouter --out contracts/SuperformRouter.go
86+
abigen --abi out/SuperformFactory.sol/SuperformFactory.abi --pkg contracts --type SFFactory --out contracts/SuperformFactory.go
87+
abigen --abi out/SuperPositions.sol/SuperPositions.abi --pkg contracts --type SuperPositions --out contracts/SuperPositions.go
88+
abigen --abi out/VaultClaimer.sol/VaultClaimer.abi --pkg contracts --type VaultClaimer --out contracts/VaultClaimer.go
89+
abigen --abi out/CoreStateRegistry.sol/CoreStateRegistry.abi --pkg contracts --type CoreStateRegistry --out contracts/CoreStateRegistry.go
90+
91+
# Payments
92+
abigen --abi out/PaymentHelper.sol/PaymentHelper.abi --pkg contracts --type PaymentHelper --out contracts/PaymentHelper.go
93+
abigen --abi out/PayMaster.sol/PayMaster.abi --pkg contracts --type PayMaster --out contracts/PayMaster.go
94+
95+
# Forms
96+
abigen --abi out/ERC4626Form.sol/ERC4626Form.abi --pkg contracts --type ERC4626Form --out contracts/ERC4626Form.go
97+
98+
# Superform router plus
99+
abigen --abi out/SuperformRouterPlus.sol/SuperformRouterPlus.abi --pkg contracts --type SuperformRouterPlus --out contracts/SuperformRouterPlus.go
100+
abigen --abi out/SuperformRouterPlusAsync.sol/SuperformRouterPlusAsync.abi --pkg contracts --type SuperformRouterPlusAsync --out contracts/SuperformRouterPlusAsync.go
101+
102+
.PHONY: install
103+
install: ## Installs the project
104+
forge install
105+
106+
.PHONY: update
107+
update: ## Updates the project
108+
forge update
109+
110+
.PHONY: build
111+
build: ## Builds the project
112+
FOUNDRY_PROFILE=production forge build
113+
114+
.PHONY: build-unoptimized
115+
build-unoptimized: ## Builds the project unoptimized
116+
FOUNDRY_PROFILE=localdev forge build
117+
118+
.PHONY: build-sizes
119+
build-sizes: ## Builds the project and shows sizes
120+
FOUNDRY_PROFILE=production forge build --sizes
121+
122+
.PHONY: test-vvv
123+
test-vvv: ## Runs tests with verbose output
124+
forge test --match-test test_superRegistryAddresses --evm-version cancun -vv
125+
126+
.PHONY: ftest
127+
ftest: ## Runs tests with cancun evm version
128+
forge test --evm-version cancun
129+
130+
.PHONY: test-ci
131+
test-ci: ## Runs tests in CI mode
132+
forge test --no-match-path "test/invariant/**/*.sol" --evm-version cancun
133+
134+
.PHONY: coverage
135+
coverage: ## Runs coverage
136+
FOUNDRY_PROFILE=coverage forge coverage --no-match-path "test/invariant/**/*.sol" --evm-version cancun --report lcov
137+
138+
.PHONY: coverage-t
139+
coverage-t: ## Runs coverage for a specific contract
140+
FOUNDRY_PROFILE=coverage forge coverage --match-contract 7540 --evm-version cancun --report lcov
141+
142+
.PHONY: smoke-test
143+
smoke-test: ## Runs smoke tests
144+
forge test --match-contract SmokeTest -vvv
145+
146+
.PHONY: invariant
147+
invariant: ## Runs invariant tests
148+
forge test --match-path "test/invariant/**/*.sol" --evm-version cancun -vvv
149+
150+
.PHONY: invariant-rewards
151+
invariant-rewards: ## Runs invariant tests for rewards
152+
forge test --match-test invariant_tokenBalances --evm-version cancun -vvv
153+
154+
.PHONY: clean
155+
clean: ## Cleans the project
156+
forge clean
157+
158+
.PHONY: snapshot
159+
snapshot: ## Creates a snapshot
160+
forge snapshot
161+
162+
.PHONY: fmt
163+
fmt: ## Formats the project
164+
forge fmt && forge fmt test/
165+
166+
.PHONY: ityfuzz
167+
ityfuzz: ## Runs ityfuzz
168+
ityfuzz evm -m -- forge test
169+
170+
## Help display.
171+
## Pulls comments from beside commands and prints a nicely formatted
172+
## display with the commands and their usage information.
173+
.DEFAULT_GOAL := help
174+
175+
.PHONY: help
176+
help: ## Prints this help
177+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
178+
| sort \
179+
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
180+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ OPTIMISM_RPC_URL=
144144
ETHEREUM_RPC_URL=
145145
BASE_RPC_URL=
146146
FANTOM_RPC_URL=
147+
SEPOLIA_RPC_URL=
147148
```
148149

149150
3. Install submodule dependencies:

0 commit comments

Comments
 (0)