diff --git a/packages/app-config/src/abi/darwiniaContract.json b/packages/app-config/src/abi/darwiniaContract.json new file mode 100644 index 0000000..df22214 --- /dev/null +++ b/packages/app-config/src/abi/darwiniaContract.json @@ -0,0 +1,86 @@ +[ + { + "name": "Deployed", + "type": "event", + "inputs": [ + { + "name": "addr", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "name": "bytecode", + "type": "function", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "name": "computeAddress", + "type": "function", + "inputs": [ + { + "name": "public_key", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "owners", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "threhold", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "name": "deploy", + "type": "function", + "inputs": [ + { + "name": "public_key", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "owners", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "threhold", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + } +] diff --git a/packages/app-config/src/chains/darwinia.ts b/packages/app-config/src/chains/darwinia.ts index 9780c40..812dac3 100644 --- a/packages/app-config/src/chains/darwinia.ts +++ b/packages/app-config/src/chains/darwinia.ts @@ -1,5 +1,5 @@ import { ChainConfig } from "@darwinia/app-types"; -import multisigContract from "../abi/contract.json"; +import multisigContract from "../abi/darwiniaContract.json"; export const darwinia: ChainConfig = { name: "Darwinia", @@ -19,7 +19,7 @@ export const darwinia: ChainConfig = { ethereumDecimals: 18, }, contractAddresses: { - multisig: "0x227c3e01071C2429766dDec2267A613e32DD463e", //TODO update this accordingly + multisig: "0xEE62B94230F6F8834Fb1E73152C7348e54d60521", }, contractInterface: { multisig: multisigContract, @@ -31,3 +31,16 @@ export const darwinia: ChainConfig = { wssURL: "wss://rpc.darwinia.network", }, }; + +/* + * DevNet + * httpsURLs: ["https://cors.zimjs.com/http://g1.dev.darwinia.network:10000"] + * graphQlURL: "https://api.subquery.network/sq/isunaslabs/darwinia2", + * wssURL: "ws://g1.dev.darwinia.network:20000", + * + * LiveNet + * httpURLs: ["https://rpc.darwinia.network"] + * wssURL: "wss://rpc.darwinia.network", + * graphQlURL: "https://subql.darwinia.network/subql-apps-darwinia/", + * + * */ diff --git a/packages/app-config/src/supportedNetworks.ts b/packages/app-config/src/supportedNetworks.ts index b2313b3..0f4d20d 100644 --- a/packages/app-config/src/supportedNetworks.ts +++ b/packages/app-config/src/supportedNetworks.ts @@ -4,4 +4,4 @@ import { darwinia } from "./chains/darwinia"; import { pangolin } from "./chains/pangolin"; import { pangoro } from "./chains/pangoro"; -export const supportedNetworks: ChainConfig[] = [crab]; +export const supportedNetworks: ChainConfig[] = [crab, darwinia]; diff --git a/packages/app-providers/src/walletProvider.tsx b/packages/app-providers/src/walletProvider.tsx index 350664a..20ef148 100644 --- a/packages/app-providers/src/walletProvider.tsx +++ b/packages/app-providers/src/walletProvider.tsx @@ -218,7 +218,7 @@ export const WalletProvider = ({ children }: PropsWithChildren) => { /*This will be fired once the connection to the wallet is successful*/ useEffect(() => { - if (!selectedNetwork) { + if (!selectedNetwork || !isEthereumWalletInstalled()) { return; } //refresh the page with the newly selected account