From 4d96eab679352c033e4e85a4667e72aa0c42ef87 Mon Sep 17 00:00:00 2001 From: Daniel Simon Date: Tue, 2 Jan 2024 13:08:59 +0700 Subject: [PATCH] feat: add Sepolia testnet --- packages/dev-frontend/src/App.tsx | 10 +++--- .../src/providers/BatchingProvider.ts | 3 +- .../deployments/default/sepolia.json | 32 +++++++++++++++++++ packages/lib-ethers/hardhat.config.ts | 8 ++++- .../lib-ethers/src/EthersLiquityConnection.ts | 2 ++ 5 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 packages/lib-ethers/deployments/default/sepolia.json diff --git a/packages/dev-frontend/src/App.tsx b/packages/dev-frontend/src/App.tsx index d62a90811..0fc369058 100644 --- a/packages/dev-frontend/src/App.tsx +++ b/packages/dev-frontend/src/App.tsx @@ -1,6 +1,6 @@ import React from "react"; import { createClient, WagmiConfig } from "wagmi"; -import { mainnet, goerli, localhost } from "wagmi/chains"; +import { mainnet, goerli, sepolia, localhost } from "wagmi/chains"; import { ConnectKitProvider, getDefaultClient } from "connectkit"; import { Flex, Heading, ThemeProvider, Paragraph, Link } from "theme-ui"; @@ -49,7 +49,7 @@ const UnsupportedMainnetFallback: React.FC = () => ( This app is for testing purposes only. - Please change your network to Görli. + Please change your network to Görli or Sepolia. If you'd like to use the Liquity Protocol on mainnet, please pick a frontend{" "} @@ -74,7 +74,7 @@ const UnsupportedNetworkFallback: React.FC = () => ( Liquity is not supported on this network. - Please switch to mainnet or Görli. + Please switch to mainnet, Görli or Sepolia. ); @@ -93,8 +93,8 @@ const App = () => { isDemoMode || import.meta.env.MODE === "test" ? [localhost] : config.value.testnetOnly - ? [goerli] - : [mainnet, goerli], + ? [goerli, sepolia] + : [mainnet, goerli, sepolia], walletConnectProjectId: config.value.walletConnectProjectId, infuraId: config.value.infuraApiKey, alchemyId: config.value.alchemyApiKey diff --git a/packages/dev-frontend/src/providers/BatchingProvider.ts b/packages/dev-frontend/src/providers/BatchingProvider.ts index 2fe815f08..ccb7fb3b3 100644 --- a/packages/dev-frontend/src/providers/BatchingProvider.ts +++ b/packages/dev-frontend/src/providers/BatchingProvider.ts @@ -11,7 +11,8 @@ const multicallAddress = { 3: "0x53C43764255c17BD724F74c4eF150724AC50a3ed", 4: "0x42Ad527de7d4e9d9d011aC45B31D8551f8Fe9821", 5: "0x77dCa2C955b15e9dE4dbBCf1246B4B85b651e50e", - 42: "0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A" + 42: "0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A", + 11155111: "0xcA11bde05977b3631167028862bE2a173976CA11" }; const hasMulticall = (chainId: number): chainId is keyof typeof multicallAddress => diff --git a/packages/lib-ethers/deployments/default/sepolia.json b/packages/lib-ethers/deployments/default/sepolia.json new file mode 100644 index 000000000..e4f7c534a --- /dev/null +++ b/packages/lib-ethers/deployments/default/sepolia.json @@ -0,0 +1,32 @@ +{ + "chainId": 11155111, + "version": "a0948b633b21ca147471a705e2d07f825f2f2292", + "deploymentDate": 1696838376000, + "bootstrapPeriod": 1209600, + "totalStabilityPoolLQTYReward": "32000000", + "liquidityMiningLQTYRewardRate": "0.257201646090534979", + "_priceFeedIsTestnet": false, + "_uniTokenIsMock": true, + "_isDev": false, + "startBlock": 4455303, + "addresses": { + "activePool": "0x7b6c5109F353236294123B0a55896b760708008c", + "borrowerOperations": "0xe093bC0a552C5cBbE0a07C0094F4AfB6204aa1b9", + "troveManager": "0x9431a9fa3300Cd5Db4733283A864Db3347d89311", + "collSurplusPool": "0xA242Df71374A1a18dB9487823105c0e546c2F57e", + "communityIssuance": "0xf1f7A8AC7CD2e14fE058d23653100fFb781bF338", + "defaultPool": "0x3a4C257ad04A0cae9C0b5BbFb9c2D35fb1F9a0eC", + "hintHelpers": "0xa2d566765185Ba047093D443C01bF0DD52E6c1A3", + "lockupContractFactory": "0x42e6423F2582d5C6FB1242acBde8dC6dFe4C7659", + "lqtyStaking": "0x8a45B418ea7a2896de7b14019ef3030249A8a630", + "priceFeed": "0x92Ef9191856bEa5cef75c9c9bb2C6F1593165aaa", + "sortedTroves": "0x0950ec7965CEf62489D1083763a9a153AC1a0548", + "stabilityPool": "0x32F32E36B1D812357C8C50EAF97363c13ea46a68", + "gasPool": "0x2d7458F23950456eC944B39c07776E0CD7249FE1", + "unipool": "0xb04E34D9Cb45895Ec38418cc2f8ea98cc0A0fb37", + "lusdToken": "0xF9D30b476Bd59b06cF5E14de888035b328E01FcE", + "lqtyToken": "0x351d6ffc84EA65D2949a221B17385226b06764AF", + "multiTroveGetter": "0xA975b76c81686DD2992095Cb9149A3392c63F248", + "uniToken": "0x9dA26Cd36e61CF4642Ad1169a6aA0c466ce7eE00" + } +} \ No newline at end of file diff --git a/packages/lib-ethers/hardhat.config.ts b/packages/lib-ethers/hardhat.config.ts index e75e3a287..ddcfcec9f 100644 --- a/packages/lib-ethers/hardhat.config.ts +++ b/packages/lib-ethers/hardhat.config.ts @@ -81,6 +81,10 @@ const oracleAddresses = { goerli: { chainlink: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e", tellor: "0x51c59c6cAd28ce3693977F2feB4CfAebec30d8a2" + }, + sepolia: { + chainlink: "0x694AA1769357215DE4FAC081bf1f309aDC325306", + tellor: "0x80fc34a2f9FfE86F41580F47368289C402DEc660" } }; @@ -92,7 +96,8 @@ const wethAddresses = { ropsten: "0xc778417E063141139Fce010982780140Aa0cD5Ab", rinkeby: "0xc778417E063141139Fce010982780140Aa0cD5Ab", goerli: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", - kovan: "0xd0A1E359811322d97991E03f863a0C30C2cF029C" + kovan: "0xd0A1E359811322d97991E03f863a0C30C2cF029C", + sepolia: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14" }; const hasWETH = (network: string): network is keyof typeof wethAddresses => network in wethAddresses; @@ -120,6 +125,7 @@ const config: HardhatUserConfig = { ...infuraNetwork("rinkeby"), ...infuraNetwork("goerli"), ...infuraNetwork("kovan"), + ...infuraNetwork("sepolia"), ...infuraNetwork("mainnet"), kiln: { diff --git a/packages/lib-ethers/src/EthersLiquityConnection.ts b/packages/lib-ethers/src/EthersLiquityConnection.ts index 64ad5f8d3..c416cc478 100644 --- a/packages/lib-ethers/src/EthersLiquityConnection.ts +++ b/packages/lib-ethers/src/EthersLiquityConnection.ts @@ -10,6 +10,7 @@ import rinkeby from "../deployments/rinkeby.json"; import ropsten from "../deployments/ropsten.json"; import mainnet from "../deployments/mainnet.json"; import kiln from "../deployments/kiln.json"; +import sepolia from "../deployments/sepolia.json"; import { numberify, panic } from "./_utils"; import { EthersProvider, EthersSigner } from "./types"; @@ -34,6 +35,7 @@ const deployments: { [goerli.chainId]: goerli, [kovan.chainId]: kovan, [kiln.chainId]: kiln, + [sepolia.chainId]: sepolia, ...(dev !== null ? { [dev.chainId]: dev } : {}) };