Skip to content

Commit

Permalink
Merge pull request #8 from rajkharvar/skale
Browse files Browse the repository at this point in the history
Support skale network
rajkharvar authored Mar 28, 2022
2 parents 17cea3b + 0f7fd38 commit 3fe51d4
Showing 5 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions .env.tpl
Original file line number Diff line number Diff line change
@@ -3,5 +3,6 @@ ROPSTEN_RPC=
RINKEBY_RPC=
GOERLI_RPC=
KOVAN_RPC=
SKALE_RPC=
ETHERSCAN_KEY=
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -25,3 +25,4 @@ npx hardhat help
| Rinkeby | 0x3399dCff80b82f78af79686f9f5Cd731AD765786 |
| Goerli | 0xD286f3D834E6030F178C395C9ba33d32B427cAD3 |
| Kovan | 0x0cD252390E7e46D7Ecf48D225fBB56D8fBd6Faf1 |
| Skale | 0x73a41d6b7889fBF94d059C943bc58dd18c600bfa |
9 changes: 7 additions & 2 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -5,9 +5,10 @@ import Header from "./components/Headers";
import Payment from "./components/Payment";
import WalletInfo from "./components/WalletInfo";
import Warn from "./components/Warn";
import Web3Modal from "web3modal";
import Web3Modal, { CHAIN_DATA_LIST } from "web3modal";
import Connect from "./components/Connect";
import { initState, reducer } from "./reducers/index";
import { chains } from "./utils/constants";

export const NetworkContext = createContext();

@@ -37,8 +38,12 @@ function App() {
const signer = await provider.getSigner();
const address = await signer.getAddress();

if (chainId === chains.skale) {
dispatch({ type: "SET_NETWORK", payload: "skale" });
} else {
dispatch({ type: "SET_NETWORK", payload: name });
}
dispatch({ type: "SET_CHAIN_ID", payload: chainId });
dispatch({ type: "SET_NETWORK", payload: name });
setAddress(address);
setIsLoading(false);
} catch (error) {
19 changes: 12 additions & 7 deletions frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const chains = {
3: "ropsten",
4: "rinkeby",
5: "goerli",
42: "kovan",
80001: "maticmum",
export const chains = {
ropsten: 3,
rinkeby: 4,
goerli: 5,
kovan: 42,
maticmum: 80001,
skale: 416452918254875,
};

export const disperseAddresses = {
@@ -22,6 +23,9 @@ export const disperseAddresses = {
80001:
import.meta.VITE_DISPERSE_MATIC_MUMBAI ||
"0xaf6f4A737188571d128477DEe81d54Bc63De6d80",
416452918254875:
import.meta.VITE_DISPERSE_SKALE ||
"0x73a41d6b7889fBF94d059C943bc58dd18c600bfa",
};

export const scans = {
@@ -30,7 +34,8 @@ export const scans = {
5: "https://goerli.etherscan.io/",
42: "https://kovan.etherscan.io/",
80001: "https://mumbai.polygonscan.com/",
416452918254875: "http://faint-acubens.explorer.dappnet.skalenodes.com/",
};

export const warnMessage =
"*Supports ropsten, rinkeby, goerli, kovan and mumbai(matic)*";
"*Supports ropsten, rinkeby, goerli, kovan, skale and mumbai(matic)*";
16 changes: 15 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
@@ -7,15 +7,24 @@ const ROPSTEN_RPC = process.env.ROPSTEN_RPC;
const RINKEBY_RPC = process.env.RINKEBY_RPC;
const GOERLI_RPC = process.env.GOERLI_RPC;
const KOVAN_RPC = process.env.KOVAN_RPC;
const SKALE_RPC = process.env.SKALE_RPC;
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY;
const privateKey = process.env.PRIVATE_KEY;

/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.4",
defaultNetwork: "hardhat",
solidity: {
version: "0.8.0",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
chainId: 1337,
@@ -40,6 +49,11 @@ module.exports = {
url: MUMBAI_RPC,
accounts: [privateKey],
},
skale: {
url: SKALE_RPC,
accounts: [privateKey],
gasPrice: 100000,
},
},
etherscan: {
apiKey: ETHERSCAN_KEY,

1 comment on commit 3fe51d4

@vercel
Copy link

@vercel vercel bot commented on 3fe51d4 Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.