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

WIP : QuickExchange - UniSwap v3 Support #5244

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
61094ec
change rinky to sepolia
shendel Jul 22, 2024
cd99f82
uni v3 swap - erc20-erc20 base
shendel Jul 25, 2024
c9d58ce
univ3 - swap native to erc20
shendel Jul 26, 2024
5e15821
univ3 - swap token to native coin
shendel Jul 26, 2024
3ffc1e7
univ3 - func - get user liquidity pools
shendel Jul 26, 2024
b5db8fe
uni v3 - positions - more info about liquidity
shendel Aug 6, 2024
e8f2bd9
uni v3 - positions - min and max price
shendel Aug 6, 2024
ad6db99
univ3 - pools - gui (draft)
shendel Aug 6, 2024
8fb96af
uni v3 - gui - pools with info (draft)
shendel Aug 7, 2024
bb69ac8
univ3 - allow change pool via fee
shendel Aug 7, 2024
ba81536
uni3 - position cart (draft)
shendel Aug 10, 2024
7133c59
univ3 - remove liqudity
shendel Sep 13, 2024
6dec905
univ3 - decrease liq (wrap / unwrap)
shendel Sep 18, 2024
8e1ef5e
fix test build
shendel Sep 18, 2024
e8e7019
univ3 - add liq (draft)
shendel Sep 19, 2024
ae45238
univ3 - add liq - get balance and allowance
shendel Sep 20, 2024
37819d8
univ3 - add liq - check and make approve
shendel Sep 20, 2024
21a1636
univ3 - add liq - buttons logics
shendel Sep 20, 2024
c4a3c96
univ3 - add liq (with native)
shendel Sep 20, 2024
d8b56f9
univ3 - add liq - correct calc amounts
shendel Sep 20, 2024
7d3216e
univ3 add liq - full logic after add
shendel Sep 20, 2024
980bb33
univ3 - styles - amount input control
shendel Sep 21, 2024
638aa27
univ3 - corrent add liq for pos in out range
shendel Sep 21, 2024
697a382
uin - pos info block (styles)
shendel Sep 21, 2024
6961d2a
univ3 - backbutton styles
shendel Sep 21, 2024
224bf06
univ3 - switch carts - scroll to top if view big (mobile)
shendel Sep 21, 2024
3d56a22
uni - pos info block (liquidity)
shendel Sep 21, 2024
f1ff282
univ3 - remove liq - styles
shendel Sep 21, 2024
bc28bc2
disable add custom token test (temp)
shendel Sep 21, 2024
a88db80
univ3 - manage closed positions
shendel Sep 21, 2024
666cc04
univ3 - fix del liq - correct native wrap
shendel Sep 21, 2024
e9804b3
fix - closed filter
shendel Sep 21, 2024
a5bd484
ui - closed at top + fix closed show
shendel Sep 21, 2024
cb8241f
univ3 - add liq - fix float amounts
shendel Sep 21, 2024
6231501
univ3 - pos list - correct native show
shendel Sep 21, 2024
afd57f6
univ3 - mint new pos - draft
shendel Sep 24, 2024
d2eec65
uni - mint form - draft
shendel Sep 24, 2024
7ed4d07
univ3 - mint pos - getPriceRoundedToTick
shendel Sep 25, 2024
f1628b5
univ3 - mint form - calc low/high price by tick
shendel Sep 25, 2024
0f4c66b
univ3 - mint - amounts input (draft)
shendel Sep 25, 2024
2ffe7bf
univ3 - mint - out of range process
shendel Sep 25, 2024
c6e1cd3
univ3 - form - calc deposti amount (need optimize code)
shendel Sep 25, 2024
e96d750
univ3 - min - current price + fix calc token0/token1
shendel Sep 25, 2024
c768961
univ3 - mint position in exist fee pool
shendel Sep 26, 2024
3bd5a3e
uni - new pool native-token
shendel Sep 26, 2024
a12ac02
univ3 - fix mint new pool with different decimals
shendel Oct 4, 2024
b3e2eff
ethlike - allow get estimated gas in wei
shendel Oct 5, 2024
dd1db3a
uni - mint new pool - styles
shendel Oct 5, 2024
b97f220
exanange - wrap/unwrap (draft)
shendel Oct 6, 2024
787043e
quickswap - wrap/unwrap native coins
shendel Oct 6, 2024
3b38c43
more tx info (wrap/unwrap)
shendel Oct 6, 2024
75218f9
remove logs
shendel Oct 6, 2024
f6941f8
translate - extract messages
shendel Oct 6, 2024
439706b
infura apikey
shendel Dec 4, 2024
0bb9d42
fix test build
shendel Dec 4, 2024
9e6be97
update patch
shendel Dec 4, 2024
1b3c49f
fix
shendel Dec 4, 2024
fd48422
Update package.json
shendel Dec 4, 2024
84fdd0f
remove polygon from test
shendel Dec 4, 2024
a273419
Merge branch 'iinfura2024' into univ3
shendel Dec 18, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
mkdir ./tests/e2e/screenshots
npm run test:e2e:actions
- name: Upload failure screenshots
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: failure-screenshots
path: ./tests/e2e/screenshots
if-no-files-found: ignore
- name: Upload screenshots
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: screenshots
path: ./tests/e2e/screenshots
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
"https-browserify": "^1.0.0",
"hyperdiff": "^2.0.8",
"jest": "^27.0.0",
"jsbi": "^4.3.0",
"kraken-api": "^1.0.1",
"libp2p-kad-dht": "^0.23.1",
"libp2p-webrtc-star": "^0.23.0",
Expand Down Expand Up @@ -207,6 +208,7 @@
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.6",
"@uniswap/v2-periphery": "^1.1.0-beta.0",
"@uniswap/v3-periphery": "^1.4.4",
"@walletconnect/client": "^1.3.3",
"@walletconnect/core": "^1.3.3",
"@walletconnect/http-connection": "^1.3.3",
Expand All @@ -228,6 +230,7 @@
"bitcoinjs-lib": "5.1.6",
"bitcoinjs-message": "^2.1.0",
"bitcore-lib": "^8.25.10",
"cipher-base": "1.0.4",
"classnames": "^2.2.5",
"command-line-args": "^5.0.2",
"command-line-usage": "^6.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/common/multicall/abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "abi": [{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Multicall2.Call[]","name":"calls","type":"tuple[]"}],"name":"aggregate","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes[]","name":"returnData","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Multicall2.Call[]","name":"calls","type":"tuple[]"}],"name":"blockAndAggregate","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Multicall2.Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getBlockHash","outputs":[{"internalType":"bytes32","name":"blockHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockNumber","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockCoinbase","outputs":[{"internalType":"address","name":"coinbase","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockDifficulty","outputs":[{"internalType":"uint256","name":"difficulty","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockGasLimit","outputs":[{"internalType":"uint256","name":"gaslimit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getEthBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastBlockHash","outputs":[{"internalType":"bytes32","name":"blockHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"requireSuccess","type":"bool"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Multicall2.Call[]","name":"calls","type":"tuple[]"}],"name":"tryAggregate","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Multicall2.Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"requireSuccess","type":"bool"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Multicall2.Call[]","name":"calls","type":"tuple[]"}],"name":"tryBlockAndAggregate","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Multicall2.Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"}] }
4 changes: 4 additions & 0 deletions src/common/wrappedcoin/abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{"constant": false,"inputs": [{"name": "wad","type": "uint256"}],"name": "withdraw","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},
{"constant": false,"inputs": [],"name": "deposit","outputs": [],"payable": true,"stateMutability": "payable","type": "function"}
]
36 changes: 36 additions & 0 deletions src/front/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,42 @@ const config = {
hour: 'numeric',
minute: 'numeric',
},


// Uni V3 - Global configuration
// ChainId -> Configuration
// More chains at https://github.com/Uniswap/sdks/blob/main/sdks/sdk-core/src/addresses.ts
// Multicall - v2
UNISWAP_V3_CONTRACTS: {
1: { // Eth mainnet
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
quoter: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
router: '0xE592427A0AEce92De3Edee1F18E0157C05861564',
position_manager: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
multicall: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
},
11155111: { // Eth Sepolia testnet
factory: '0x0227628f3F023bb0B980b67D528571c95c6DaC1c',
quoter: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
router: '0xE592427A0AEce92De3Edee1F18E0157C05861564',
position_manager: '0x1238536071E1c677A632429e3655c799b22cDA52',
multicall: '0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07',
},
56: { // Binance
factory: '0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7',
quoter: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
router: '0xE592427A0AEce92De3Edee1F18E0157C05861564',
position_manager: '0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613',
multicall: '0x963Df249eD09c358A4819E39d9Cd5736c3087184',
},
137: { // Polygon
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
quoter: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
router: '0xE592427A0AEce92De3Edee1F18E0157C05861564',
position_manager: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
multicall: '0xed386Fe855C1EFf2f843B910923Dd8846E45C5A4',
},
}
}


Expand Down
1 change: 1 addition & 0 deletions src/front/config/mainnet/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export default {
fkwscan: 'https://explorer.fokawa.com/api',
phpxscan: 'https://explorer.phpx.network/api',
WalletConnectProjectId: 'a23677c4af3139b4eccb52981f76ad94',
InfuraApiKey: 'fdd4494101ed4a28b41bb66d7fe9c692',
}
4 changes: 2 additions & 2 deletions src/front/config/mainnet/web3.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
provider: 'https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c',
provider: 'https://mainnet.infura.io/v3/{INFURA_API_KEY}',
binance_provider: 'https://bsc-dataseed.binance.org/',
matic_provider: 'https://polygon.meowrpc.com',
matic_provider: 'https://polygon-rpc.com/', //'https://polygon.meowrpc.com',
arbitrum_provider: 'https://arb1.arbitrum.io/rpc',
xdai_provider: 'https://rpc.gnosischain.com',
ftm_provider: 'https://rpc.ftm.tools',
Expand Down
1 change: 1 addition & 0 deletions src/front/config/testnet/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ export default {
txinfo: 'https://txinfo.onout.org',
noxon: 'https://noxon.wpmix.net',
WalletConnectProjectId: 'a23677c4af3139b4eccb52981f76ad94',
InfuraApiKey: 'fdd4494101ed4a28b41bb66d7fe9c692',
}
2 changes: 1 addition & 1 deletion src/front/config/testnet/evmNetworkVersions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default [
4, // ETH Testnet (Rinkeby)
11155111, // ETH Testnet (Sepolia)
97, // BSC Testnet
80001, // MATIC Testnet
421611, // ARBITRUM Testnet (Rinkeby)
Expand Down
6 changes: 3 additions & 3 deletions src/front/config/testnet/evmNetworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import link from './link'
export default {
ETH: {
currency: 'ETH',
chainId: '0x4',
networkVersion: 4,
chainName: 'Rinkeby Test Network',
chainId: '0xAA36A7',
networkVersion: 11155111,
chainName: 'Sepolia Test Network',
rpcUrls: [web3.provider],
blockExplorerUrls: [link.etherscan]
},
Expand Down
2 changes: 1 addition & 1 deletion src/front/config/testnet/link.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
bitpay: 'https://www.blockchain.com/btc-testnet', //'https://test-insight.swap.online/insight',
// bitpay: 'https://test-insight.bitpay.com',
etherscan: 'https://rinkeby.etherscan.io',
etherscan: 'https://sepolia.etherscan.io',
bscscan: 'https://testnet.bscscan.com',
arbitrum: 'https://rinkeby-explorer.arbitrum.io',
maticscan: 'https://mumbai.polygonscan.com',
Expand Down
2 changes: 1 addition & 1 deletion src/front/config/testnet/web3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
provider: 'https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c',
provider: 'https://sepolia.infura.io/v3/{INFURA_API_KEY}',
binance_provider: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
matic_provider: 'https://polygon-testnet.public.blastapi.io',
arbitrum_provider: 'https://rinkeby.arbitrum.io/rpc',
Expand Down
27 changes: 14 additions & 13 deletions src/front/externalConfigs/mainnet-localhost.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ window.buildOptions = {
eth: true,
bnb: true,
matic: true,
arbeth: true,
aureth: true,
xdai: true,
ftm: true,
avax: true,
movr: true,
one: true,
ame: true,
ghost: true,
arbeth: false,
aureth: false,
xdai: false,
ftm: false,
avax: false,
movr: false,
one: false,
ame: false,
ghost: false,
next: false,
phi_v1: true,
phi: true,
fkw: true,
phpx: true,
phi_v1: false,
phi: false,
fkw: false,
phpx: false,
},
blockchainSwapEnabled: {
btc: true,
Expand Down Expand Up @@ -183,4 +183,5 @@ window.buildOptions = {
invoiceEnabled: true, // Allow create invoices
showWalletBanners: true,
addAllEnabledWalletsAfterRestoreOrCreateSeedPhrase: false,
preventMultiTab: false,
}
2 changes: 1 addition & 1 deletion src/front/shared/helpers/externalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ const externalConfig = () => {
})
}
}

window.appConfig = config
return config
}

Expand Down
Loading
Loading