Skip to content

Commit

Permalink
fix: security issue (#36)
Browse files Browse the repository at this point in the history
* fix: security issue
* fix: update src/actions/web3.ts

Co-authored-by: Marin Petrunić <[email protected]>
  • Loading branch information
wei3erHase and mpetrunic authored Oct 27, 2021
1 parent ff74aa4 commit 45aaf6b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/actions/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const opts: IProviderOptions = {
walletconnect: {
package: WalletConnectProvider, // required
options: {
network: "kovan",
cacheProvider: false,
infuraId: "fd1f29ab70844ef48e644489a411d4b3" // required
}
}
Expand All @@ -24,5 +26,9 @@ export function getWeb3Provider(): JsonRpcProvider {


export async function getWeb3Signer(): Promise<Web3Provider> {
return new providers.Web3Provider(await web3Modal.connect())
const provider = new providers.Web3Provider(await web3Modal.connect())
if(provider.network.chainId !== 69) {
throw new Error("Invalid network")
}
return provider;
}

0 comments on commit 45aaf6b

Please sign in to comment.