Skip to content

Commit

Permalink
Merge pull request #27 from darwinia-network/darwinia_going_live
Browse files Browse the repository at this point in the history
Added Darwinia network
  • Loading branch information
isunaslabs authored Apr 24, 2023
2 parents d2d0839 + ec47cb4 commit f1c60ad
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 4 deletions.
86 changes: 86 additions & 0 deletions packages/app-config/src/abi/darwiniaContract.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
17 changes: 15 additions & 2 deletions packages/app-config/src/chains/darwinia.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -19,7 +19,7 @@ export const darwinia: ChainConfig = {
ethereumDecimals: 18,
},
contractAddresses: {
multisig: "0x227c3e01071C2429766dDec2267A613e32DD463e", //TODO update this accordingly
multisig: "0xEE62B94230F6F8834Fb1E73152C7348e54d60521",
},
contractInterface: {
multisig: multisigContract,
Expand All @@ -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/",
*
* */
2 changes: 1 addition & 1 deletion packages/app-config/src/supportedNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
2 changes: 1 addition & 1 deletion packages/app-providers/src/walletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1c60ad

Please sign in to comment.