Skip to content

Commit

Permalink
Holesky redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
lilchizh committed Mar 4, 2024
1 parent 2f5f8a8 commit 9a41b4b
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VITE_INFO_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/integral-core
VITE_LIMIT_ORDERS_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/integral-limit-order
VITE_BLOCKS_GRAPH=https://api.thegraph.com/subgraphs/name/iliaazhel/goerli-blocks
VITE_INFURA_RPC=https://goerli.infura.io/v3/5c55489ae3414b8b9a1a328b577f89bb
VITE_INFURA_RPC=https://1rpc.io/holesky
VITE_WALLETCONNECT_PROJECT_ID=79c313a96c99edbc26d06cd97bff1126
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Algebra Integral UI

[Algebra Integral on Goerli](https://integral.algebra.finance)
[Algebra Integral on Holesky](https://integral.algebra.finance)

To launch the application locally:

Expand Down
1 change: 0 additions & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const config: CodegenConfig = {
overwrite: true,
schema: [
"https://api.thegraph.com/subgraphs/name/iliaazhel/integral-core",
"https://api.thegraph.com/subgraphs/name/iliaazhel/integral-limit-order",
"https://api.thegraph.com/subgraphs/name/iliaazhel/goerli-blocks"
],
documents: "src/graphql/queries/!(*.d).{ts,tsx}",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@apollo/client": "^3.8.4",
"@cryptoalgebra/integral-sdk": "^0.9.2",
"@cryptoalgebra/integral-sdk": "^0.11.9",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-hover-card": "^1.0.7",
Expand All @@ -29,7 +29,7 @@
"clsx": "^2.0.0",
"dayjs": "^1.11.10",
"graphql": "^16.8.1",
"jsbi": "^4.3.0",
"jsbi": "^3.2.5",
"lightweight-charts": "^4.1.0",
"localforage": "^1.10.0",
"lodash.keyby": "^4.6.0",
Expand Down
29 changes: 11 additions & 18 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { defineChain } from "viem"

const projectId = import.meta.env.VITE_WALLETCONNECT_PROJECT_ID

const goerliChain = defineChain({
id: 5,
network: 'goerli',
name: 'Goerli',
nativeCurrency: { name: 'Goerli Ether', symbol: 'ETH', decimals: 18 },
const holeskyChain = defineChain({
id: 17000,
network: 'holesky',
name: 'Holesky',
nativeCurrency: { name: 'Holesky Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: [import.meta.env.VITE_INFURA_RPC],
Expand All @@ -24,40 +24,33 @@ const goerliChain = defineChain({
blockExplorers: {
etherscan: {
name: 'Etherscan',
url: 'https://goerli.etherscan.io',
url: 'https://holesky.etherscan.io',
},
default: {
name: 'Etherscan',
url: 'https://goerli.etherscan.io',
url: 'https://holesky.etherscan.io',
},
},
contracts: {
ensRegistry: {
address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
},
ensUniversalResolver: {
address: '0x56522D00C410a43BFfDF00a9A569489297385790',
blockCreated: 8765204,
},
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 6507670,
blockCreated: 77,
},
},
testnet: true,
})

const chains = [goerliChain]
const chains = [holeskyChain]
const wagmiConfig = defaultWagmiConfig({ chains, projectId, metadata: { name: 'Algebra Integral', description: 'DEX engine', url: 'https://integral.algebra.finance', icons: [''] } })

createWeb3Modal({
wagmiConfig,
projectId,
chains,
chainImages: {
5: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png'
17000: 'https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png'
},
defaultChain: goerliChain,
defaultChain: holeskyChain,
themeVariables: {
'--w3m-accent': '#2797ff'
}
Expand Down
14 changes: 2 additions & 12 deletions src/components/common/CurrencyLogo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import React from "react";
import { Address } from "wagmi";
import EthLogo from '@/assets/tokens/ether.svg'
import USDTLogo from '@/assets/tokens/usdt.png'
import USDCLogo from '@/assets/tokens/usdc.svg'
import WBTCLogo from '@/assets/tokens/wbtc.svg'
import { cn } from "@/lib/utils";
import { Skeleton } from "@/components/ui/skeleton";

Expand All @@ -16,21 +14,13 @@ interface CurrencyLogoProps {
}

export const specialTokens: { [key: Address]: { symbol: string; logo: string } } = {
['0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6']: {
['0x94373a4919b3240d86ea41593d5eba789fef3848']: {
symbol: 'ETH',
logo: EthLogo
},
['0x5aefba317baba46eaf98fd6f381d07673bca6467']: {
['0x7d98346b3b000c55904918e3d9e2fc3f94683b01']: {
symbol: 'USDT',
logo: USDTLogo
},
['0x49a390a3dfd2d01389f799965f3af5961f87d228']: {
symbol: 'WBTC',
logo: WBTCLogo
},
['0xbc892d5f23d3733cff8986d011ca8ff1249d16ca']: {
symbol: 'USDC',
logo: USDCLogo
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/common/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AlgebraLogo from "@/assets/algebra-logo.svg"
import AlgebraIntegral from "@/assets/algebra-itegral.svg"
import { NavLink } from "react-router-dom"
import { useWeb3Modal, useWeb3ModalState } from "@web3modal/wagmi/react"
import { DEFAULT_CHAIN_ID } from "@/constants/default-chain-id"
import { DEFAULT_CHAIN_ID, DEFAULT_CHAIN_NAME } from "@/constants/default-chain-id"
import { Button } from "@/components/ui/button"
import { UnplugIcon, WalletIcon } from "lucide-react"

Expand Down Expand Up @@ -33,7 +33,7 @@ const Account = () => {
if (selectedNetworkId !== DEFAULT_CHAIN_ID) return <div className="flex justify-end">
<Button onClick={() => open({
view: 'Networks'
})} size={'sm'} variant={'destructive'} className="hidden md:block">Connect to Goerli</Button>
})} size={'sm'} variant={'destructive'} className="hidden md:block">{`Connect to ${DEFAULT_CHAIN_NAME}`}</Button>
<Button onClick={() => open({
view: 'Networks'
})} size={'icon'} variant={'icon'} className="md:hidden text-red-500">
Expand Down
4 changes: 2 additions & 2 deletions src/components/create-position/AddLiquidityButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Loader from "@/components/common/Loader";
import { Button } from "@/components/ui/button";
import { ALGEBRA_POSITION_MANAGER } from "@/constants/addresses";
import { DEFAULT_CHAIN_ID } from "@/constants/default-chain-id";
import { DEFAULT_CHAIN_ID, DEFAULT_CHAIN_NAME } from "@/constants/default-chain-id";
import { usePrepareAlgebraPositionManagerMulticall } from "@/generated";
import { useApprove } from "@/hooks/common/useApprove";
import { useTransitionAwait } from "@/hooks/common/useTransactionAwait";
Expand Down Expand Up @@ -81,7 +81,7 @@ export const AddLiquidityButton = ({ baseCurrency, quoteCurrency, mintInfo, pool

if (!account) return <Button onClick={() => open()}>Connect Wallet</Button>

if (isWrongChain) return <Button variant={'destructive'} onClick={() => open({ view: 'Networks' })}>Connect to Goerli</Button>
if (isWrongChain) return <Button variant={'destructive'} onClick={() => open({ view: 'Networks' })}>{`Connect to ${DEFAULT_CHAIN_NAME}`}</Button>

if ((approvalStateA === ApprovalState.NOT_APPROVED || approvalStateA === ApprovalState.PENDING || approvalStateB === ApprovalState.NOT_APPROVED || approvalStateB === ApprovalState.PENDING)) return <div className="flex w-full gap-2">
{(approvalStateA === ApprovalState.NOT_APPROVED || approvalStateA === ApprovalState.PENDING) && <Button disabled={approvalStateA === ApprovalState.PENDING} className="w-full" onClick={() => approvalCallbackA && approvalCallbackA()}>{approvalStateA === ApprovalState.PENDING ? <Loader /> : `Approve ${mintInfo.currencies.CURRENCY_A?.symbol}`}</Button>}
Expand Down
2 changes: 1 addition & 1 deletion src/components/position/PositionNFT/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PositionNFT = ({ positionId }: PositionNFTProps) => {

const json = uri && JSON.parse(atob(uri.slice('data:application/json;base64,'.length)))

const openSeaLink = `https://testnets.opensea.io/assets/goerli/${ALGEBRA_POSITION_MANAGER}/${positionId}`
const openSeaLink = `https://testnets.opensea.io/assets/holesky/${ALGEBRA_POSITION_MANAGER}/${positionId}`

useEffect(() => {

Expand Down
4 changes: 2 additions & 2 deletions src/components/swap/SwapButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Loader from "@/components/common/Loader";
import { Button } from "@/components/ui/button";
import { DEFAULT_CHAIN_ID } from "@/constants/default-chain-id";
import { DEFAULT_CHAIN_ID, DEFAULT_CHAIN_NAME } from "@/constants/default-chain-id";
import { useApproveCallbackFromTrade } from "@/hooks/common/useApprove";
import { useUSDCValue } from "@/hooks/common/useUSDCValue";
import { useSwapCallback } from "@/hooks/swap/useSwapCallback";
Expand Down Expand Up @@ -77,7 +77,7 @@ const SwapButton = () => {

if (!account) return <Button onClick={() => open()}>Connect Wallet</Button>

if (isWrongChain) return <Button variant={'destructive'} onClick={() => open({view: 'Networks'})}>Connect to Berachain</Button>
if (isWrongChain) return <Button variant={'destructive'} onClick={() => open({view: 'Networks'})}>{`Connect to ${DEFAULT_CHAIN_NAME}`}</Button>

if (routeNotFound && userHasSpecifiedInputOutput)
return (
Expand Down
16 changes: 7 additions & 9 deletions src/constants/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Address } from "viem";

export const POOL_INIT_CODE_HASH: Address = '0x177d5fbf994f4d130c008797563306f1a168dc689f81b2fa23b4396931014d91'
export const POOL_INIT_CODE_HASH: Address = '0xf96d2474815c32e070cd63233f06af5413efc5dcb430aee4ff18cc29007c562d'

export const ALGEBRA_FACTORY: Address = '0x4b36b366f262E5418Ba2D49C3Eb7C546cc48Fa65'
export const ALGEBRA_FACTORY: Address = '0x6AD6A4f233F1E33613e996CCc17409B93fF8bf5f'

export const ALGEBRA_POOL_DEPLOYER: Address = '0x520D420d0d61D24c099AEca8b5cc20E8Cb5792F5'
export const ALGEBRA_POOL_DEPLOYER: Address = '0x69D57B9D705eaD73a5d2f2476C30c55bD755cc2F'

export const ALGEBRA_LIMIT_ORDER_PLUGIN: Address = '0x3324dacE92E12CE421B4fC339f7A0FB6CEA70781'
export const ALGEBRA_POSITION_MANAGER: Address = '0x5AeFBA317BAba46EAF98Fd6f381d07673bcA6467'

export const ALGEBRA_POSITION_MANAGER: Address = '0xce17699E8d694239Cb2Fa61980DAc1551EA9673F'
export const ALGEBRA_QUOTER: Address = '0x38A5C36FA8c8c9E4649b51FCD61810B14e7ce047'

export const ALGEBRA_QUOTER: Address = '0xe62cF6039630B65aEeACf59cA0AB9fc97FFa3cAC' //0x69D57B9D705eaD73a5d2f2476C30c55bD755cc2F
export const ALGEBRA_QUOTER_V2: Address = '0x83D4a9Ea77a4dbA073cD90b30410Ac9F95F93E7C'

export const ALGEBRA_QUOTER_V2: Address = '0xc6CaFB01954563147e6Cc15cD8bbc63D722c05Ba'

export const ALGEBRA_ROUTER: Address = '0x9548F884eC3737088796f91aec95d434e71229b0'
export const ALGEBRA_ROUTER: Address = '0xEC250E6856e14A494cb1f0abC61d72348c79F418'
7 changes: 4 additions & 3 deletions src/constants/default-chain-id.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const DEFAULT_CHAIN_ID = 0x138D5
export const DEFAULT_NATIVE_SYMBOL = 'BERA'
export const DEFAULT_NATIVE_NAME = 'Bera Token'
export const DEFAULT_CHAIN_ID = 0x4268
export const DEFAULT_CHAIN_NAME = 'Holesky'
export const DEFAULT_NATIVE_SYMBOL = 'ETH'
export const DEFAULT_NATIVE_NAME = 'Ether'
2 changes: 1 addition & 1 deletion src/hooks/common/useTransactionAwait.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Link, useNavigate } from "react-router-dom";
import { Address, useWaitForTransaction } from "wagmi";

const ViewTxOnExplorer = ({hash}: { hash: Address | undefined }) => hash ? <ToastAction altText="View on explorer" asChild>
<Link to={`https://goerli.etherscan.io/tx/${hash}`} target={'_blank'} className="border-none gap-2 hover:bg-transparent hover:text-blue-400">
<Link to={`https://holesky.etherscan.io/tx/${hash}`} target={'_blank'} className="border-none gap-2 hover:bg-transparent hover:text-blue-400">
View on explorer
<ExternalLinkIcon size={16} />
</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/state/swapStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useSwapState = create<SwapState>((set, get) => ({
currencyId: ADDRESS_ZERO
},
[SwapField.OUTPUT]: {
currencyId: '0x6581e59a1c8da66ed0d313a0d4029dce2f746cc5'
currencyId: '0x7d98346b3b000c55904918e3d9e2fc3f94683b01'
},
wasInverted: false,
lastFocusedField: SwapField.INPUT,
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -554,18 +554,18 @@
stream-browserify "^3.0.0"
util "^0.12.4"

"@cryptoalgebra/integral-sdk@^0.9.2":
version "0.9.2"
resolved "https://registry.yarnpkg.com/@cryptoalgebra/integral-sdk/-/integral-sdk-0.9.2.tgz#7a7364e929158d7db124887680f06aaf33758d0d"
integrity sha512-Dnd0rbY1hoBDfwuf1n/BrKgemku+fAjn+Sb2FjXowEKOniJmnkMkm6woCLCKraiJLPMv8bEAG1tppwLQ1bDFXA==
"@cryptoalgebra/integral-sdk@^0.11.9":
version "0.11.9"
resolved "https://registry.yarnpkg.com/@cryptoalgebra/integral-sdk/-/integral-sdk-0.11.9.tgz#5600120044365dc3aecb700996aa6c84f8dde292"
integrity sha512-NsEleu8daHkSNlZv+obwVCaMjLJibqkaM5Gx+5m+e3NPoDQHG7Gu30u7wV48oLP3wpy3bOKELjdzgxEcaDNOyA==
dependencies:
"@ethersproject/abi" "^5.7.0"
"@ethersproject/address" "^5.7.0"
"@ethersproject/solidity" "^5.7.0"
"@ethersproject/units" "^5.7.0"
big.js "^6.2.1"
decimal.js-light "^2.5.1"
jsbi "^4.3.0"
jsbi "^3.2.5"
numeral "^2.0.6"
tiny-invariant "^1.3.1"
tiny-warning "^1.0.3"
Expand Down Expand Up @@ -5452,10 +5452,10 @@ js-yaml@^4.0.0, js-yaml@^4.1.0:
dependencies:
argparse "^2.0.1"

jsbi@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.3.0.tgz#b54ee074fb6fcbc00619559305c8f7e912b04741"
integrity sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g==
jsbi@^3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6"
integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ==

jsesc@^2.5.1:
version "2.5.2"
Expand Down

0 comments on commit 9a41b4b

Please sign in to comment.