forked from Uniswap/v4-periphery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78600e5
commit 7fd708c
Showing
42 changed files
with
2,629 additions
and
876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Update docker image | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
env: | ||
IMAGE_NAME: neonlabsorg/uniswap-v4 | ||
jobs: | ||
dockerize: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
git submodule update --init --remote --recursive | ||
- name: Define tag | ||
id: define-env | ||
run: | | ||
if [[ "${{ github.ref_name }}" == 'main' ]]; then | ||
tag='latest' | ||
else | ||
tag='${{ github.ref_name }}' | ||
fi | ||
echo "tag=${tag}" | ||
echo "tag=${tag}" >> $GITHUB_OUTPUT | ||
- name: Build image | ||
run: | | ||
docker build -t $IMAGE_NAME:${{ steps.define-env.outputs.tag }} . | ||
- name: Push image | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p "${{ secrets.DOCKER_PASSWORD }}" | ||
echo "Push image $IMAGE_NAME:${{ steps.define-env.outputs.tag }} to Docker registry" | ||
docker push --all-tags $IMAGE_NAME |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "lib/v4-core"] | ||
path = lib/v4-core | ||
url = https://github.com/Uniswap/v4-core | ||
[submodule "lib/permit2"] | ||
path = lib/permit2 | ||
url = https://github.com/Uniswap/permit2 | ||
[submodule "lib/v4-core"] | ||
path = lib/v4-core | ||
url = https://github.com/neonlabsorg/uniswap-v4-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM python:3.10 | ||
|
||
COPY . /app | ||
|
||
WORKDIR /app | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# CMD pytest --network=$NETWORK test_v4_router.py -vvv -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
from utils import EthAccounts, Faucet, NeonChainWeb3Client | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def web3_client(): | ||
print(f"Proxy IP: {os.environ.get('PROXY_IP', '')}") | ||
return NeonChainWeb3Client(f"http://{os.environ.get('PROXY_IP', '')}:9090/solana") | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def faucet(web3_client) -> Faucet: | ||
return Faucet(f"http://{os.environ.get('PROXY_IP', '')}:3333", web3_client) | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def accounts(web3_client, faucet): | ||
return EthAccounts(web3_client, faucet) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def pool_manager(accounts, web3_client): | ||
contract, _ = web3_client.deploy_and_get_contract( | ||
contract="lib/v4-core/src/PoolManager.sol", | ||
version="0.8.26", | ||
contract_name="PoolManager", | ||
account=accounts[0], | ||
import_remapping={ | ||
"solmate/": f"{os.getcwd()}/lib/permit2/lib/solmate/", | ||
}, | ||
) | ||
print(f"Pool manager address: {contract.address}") | ||
yield contract | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def v4_router(accounts, pool_manager, web3_client): | ||
contract, _ = web3_client.deploy_and_get_contract( | ||
contract="test/mocks/MockV4Router.sol", | ||
version="0.8.26", | ||
contract_name="MockV4Router", | ||
account=accounts[0], | ||
constructor_args=[pool_manager.address], | ||
import_remapping={ | ||
"solmate/": f"{os.getcwd()}/lib/permit2/lib/solmate/", | ||
}, | ||
) | ||
print(f"V4 Router address: {contract.address}") | ||
yield contract, pool_manager | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def position_manager(accounts, pool_manager, web3_client): | ||
contract, _ = web3_client.deploy_and_get_contract( | ||
contract="lib/v4-core/src/test/PoolModifyLiquidityTest.sol", | ||
version="0.8.26", | ||
contract_name="PoolModifyLiquidityTest", | ||
account=accounts[0], | ||
constructor_args=[pool_manager.address], | ||
) | ||
print(f"Position manager address: {contract.address}") | ||
yield contract | ||
|
||
|
||
v4_router_test_contracts = [ | ||
"V4Router.t.sol", | ||
"V4Router2.t.sol", | ||
"V4Router3.t.sol", | ||
"V4Router4.t.sol", | ||
"V4Router5.t.sol", | ||
"V4Router6.t.sol", | ||
"V4Router7.t.sol", | ||
"V4Router8.t.sol", | ||
"V4Router9.t.sol", | ||
] | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def v4_router_test(request, accounts, v4_router, position_manager, web3_client): | ||
v4, pool_manager = v4_router | ||
deployed_contracts = dict() | ||
|
||
contract_name = "" | ||
if request.node.get_closest_marker("contract_filename"): | ||
contract_name = request.node.get_closest_marker("contract_filename").kwargs.get("name", "") | ||
|
||
for name in v4_router_test_contracts if contract_name == "" else [contract_name]: | ||
contract, _ = web3_client.deploy_and_get_contract( | ||
contract=f"test/router/{name}", | ||
version="0.8.26", | ||
contract_name="V4RouterTest", | ||
account=accounts[0], | ||
constructor_args=[v4.address, pool_manager.address, position_manager.address], | ||
import_remapping={ | ||
"forge-std": f"{os.getcwd()}/lib/v4-core/lib/forge-std/src", | ||
"solmate/": f"{os.getcwd()}/lib/permit2/lib/solmate/", | ||
"permit2/": f"{os.getcwd()}/lib/permit2/", | ||
}, | ||
) | ||
deployed_contracts[name] = contract | ||
yield deployed_contracts |
Submodule v4-core
updated
33 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
aiohappyeyeballs==2.4.0 | ||
aiohttp==3.10.5 | ||
aiosignal==1.3.1 | ||
annotated-types==0.7.0 | ||
anyio==4.4.0 | ||
async-timeout==4.0.3 | ||
attrs==24.2.0 | ||
base58==2.1.1 | ||
bitarray==2.9.2 | ||
black==24.8.0 | ||
certifi==2024.8.30 | ||
charset-normalizer==3.3.2 | ||
ckzg==2.0.1 | ||
click==8.1.7 | ||
construct==2.10.68 | ||
construct-typing==0.5.6 | ||
cytoolz==0.12.3 | ||
eth-account==0.13.3 | ||
eth-hash==0.7.0 | ||
eth-keyfile==0.8.1 | ||
eth-keys==0.5.1 | ||
eth-rlp==2.1.0 | ||
eth-typing==5.0.0 | ||
eth-utils==5.0.0 | ||
eth_abi==5.1.0 | ||
exceptiongroup==1.2.2 | ||
frozenlist==1.4.1 | ||
h11==0.14.0 | ||
hexbytes==1.2.1 | ||
httpcore==1.0.5 | ||
httpx==0.27.2 | ||
idna==3.8 | ||
iniconfig==2.0.0 | ||
isort==5.13.2 | ||
jsonalias==0.1.1 | ||
multidict==6.1.0 | ||
mypy-extensions==1.0.0 | ||
packaging==23.2 | ||
parsimonious==0.10.0 | ||
pathspec==0.12.1 | ||
platformdirs==4.3.6 | ||
pluggy==1.5.0 | ||
py-solc-x==2.0.3 | ||
pycryptodome==3.20.0 | ||
pydantic==2.9.1 | ||
pydantic_core==2.23.3 | ||
pytest==8.3.3 | ||
pyunormalize==15.1.0 | ||
regex==2024.7.24 | ||
requests==2.32.3 | ||
rlp==4.0.1 | ||
sniffio==1.3.1 | ||
solana==0.34.3 | ||
solders==0.21.0 | ||
tomli==2.0.1 | ||
toolz==0.12.1 | ||
types-requests==2.32.0.20240907 | ||
typing_extensions==4.12.2 | ||
urllib3==2.2.2 | ||
web3==7.2.0 | ||
websockets==11.0.3 | ||
yarl==1.11.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.