Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniswap V3 Integration (WIP) #6

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "v3-core"]
path = v3-core
url = https://github.com/Uniswap/uniswap-v3-core.git
[submodule "v3-periphery"]
path = v3-periphery
url = https://github.com/Uniswap/uniswap-v3-periphery.git
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,39 @@ docker:
docker build --build-arg VERSION=$(GIT_VERSION) -t bonedaddy/go-defi:$(GIT_VERSION) .
docker image tag bonedaddy/go-defi:$(GIT_VERSION) bonedaddy/go-defi:latest

.PHONY: flatten-dependencies
flatten-dependencies:
@echo "generating abis"
(cd v3-core ; npm run compile ; cp -r abis/contracts/* ../abi/uniswap/v3/core)
(cd v3-periphery ; npm run compile ; cp -r abis/contracts/* ../abi/uniswap/v3/periphery)

.PHONY: abigen
abigen:
abigen \
--abi abi/uniswap/v3/core/UniswapV3Factory.sol/UniswapV3Factory.json \
--bin bin/uniswap/v3/core/UniswapV3Factory.bin \
--pkg v3factory \
--out bindings/uniswap/v3/factory/bindings.go
abigen \
--abi abi/uniswap/v3/core/UniswapV3Pool.sol/UniswapV3Pool.json \
--bin bin/uniswap/v3/core/UniswapV3Pool.bin \
--pkg v3pool \
--out bindings/uniswap/v3/pool/bindings.go
abigen \
--abi abi/uniswap/v3/core/UniswapV3PoolDeployer.sol/UniswapV3PoolDeployer.json \
--bin bin/uniswap/v3/core/UniswapV3PoolDeployer.bin \
--pkg v3pooldeployer \
--out bindings/uniswap/v3/pooldeployer/bindings.go
abigen \
--abi abi/uniswap/v3/periphery/NonfungiblePositionManager.sol/NonfungiblePositionManager.json \
--bin bin/uniswap/v3/periphery/NonfungiblePositionManager.bin \
--pkg v3nftposmanager \
--out bindings/uniswap/v3/nftposmanager/bindings.go
abigen \
--abi abi/uniswap/v3/periphery/SwapRouter.sol/SwapRouter.json \
--bin bin/uniswap/v3/periphery/SwapRouter.bin \
--pkg v3swaprouter \
--out bindings/uniswap/v3/swaprouter/bindings.go

.PHONY: release
release:
Expand Down
236 changes: 236 additions & 0 deletions abi/uniswap/v3/core/UniswapV3Factory.sol/UniswapV3Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"indexed": true,
"internalType": "int24",
"name": "tickSpacing",
"type": "int24"
}
],
"name": "FeeAmountEnabled",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "oldOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnerChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "token0",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token1",
"type": "address"
},
{
"indexed": true,
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"indexed": false,
"internalType": "int24",
"name": "tickSpacing",
"type": "int24"
},
{
"indexed": false,
"internalType": "address",
"name": "pool",
"type": "address"
}
],
"name": "PoolCreated",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenA",
"type": "address"
},
{
"internalType": "address",
"name": "tokenB",
"type": "address"
},
{
"internalType": "uint24",
"name": "fee",
"type": "uint24"
}
],
"name": "createPool",
"outputs": [
{
"internalType": "address",
"name": "pool",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"internalType": "int24",
"name": "tickSpacing",
"type": "int24"
}
],
"name": "enableFeeAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint24",
"name": "",
"type": "uint24"
}
],
"name": "feeAmountTickSpacing",
"outputs": [
{
"internalType": "int24",
"name": "",
"type": "int24"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint24",
"name": "",
"type": "uint24"
}
],
"name": "getPool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "parameters",
"outputs": [
{
"internalType": "address",
"name": "factory",
"type": "address"
},
{
"internalType": "address",
"name": "token0",
"type": "address"
},
{
"internalType": "address",
"name": "token1",
"type": "address"
},
{
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"internalType": "int24",
"name": "tickSpacing",
"type": "int24"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "setOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
Loading