Skip to content

Commit

Permalink
Aknowledge sepolia network
Browse files Browse the repository at this point in the history
  • Loading branch information
Akim Mamedov committed Feb 21, 2024
1 parent 4ef9b11 commit 49d7f1a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function App() {

useEffect(() => {
console.log("nerwork: " + network)
if (!merkleRootFetched && network) {
if (!merkleRootFetched && network && network !== "unknown") {
dispatch(fetchMerkleRoot(network))
dispatch(fetchCurrentAward(network))
dispatch(fetchNextHalvePeriod(network))
Expand Down
5 changes: 4 additions & 1 deletion web/src/hooks/useWeb3Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export const useWeb3Connection = () => {

const connect = useCallback(async () => {
const provider = await web3Modal.connect();
const web3Provider = new providers.Web3Provider(provider);
const web3Provider = new providers.Web3Provider(provider, {
name: "sepolia",
chainId: 11155111,
});
const signer = web3Provider.getSigner();
const address = await signer.getAddress();
const network = await web3Provider.getNetwork();
Expand Down
3 changes: 2 additions & 1 deletion web/src/store/actions/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export const setWeb3Provider = (provider, web3Provider, address, network) => ({
provider,
web3Provider,
address,
chainId: network.chainId
chainId: network.chainId,
network: network.name
}
})

Expand Down
2 changes: 1 addition & 1 deletion web/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const hideString = (str) => {
export const infuraUrlFactory = (network) => {
switch (network) {
case "sepolia":
return `https://sepolia.infura.io/v3/${REACT_APP_INFURA_KEY}`;
return `https://rpc.sepolia.org`;

default:
return `https://mainnet.infura.io/v3/${REACT_APP_INFURA_KEY}`;
Expand Down

0 comments on commit 49d7f1a

Please sign in to comment.