diff --git a/package.json b/package.json index 570d78d..888c3f1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "oracles-dapps-validators", "version": "0.1.0", "private": true, - "homepage": "https://rstormsf.github.io/oracles-dapps-validators", + "homepage": "https://oraclesorg.github.io/poa-dapps-validators", "dependencies": { "clipboard": "^1.7.1", "gh-pages": "^1.1.0", @@ -22,7 +22,7 @@ }, "scripts": { "predeploy": "npm run build", - "deploy": "gh-pages -d build -o rstorm", + "deploy": "gh-pages -d build -o origin", "build-css": "node-sass-chokidar src/index/index.scss -o src/index", "watch-css": "npm run build-css && node-sass-chokidar src/index/index.scss -o src/index --watch --recursive", "start-js": "react-scripts start", diff --git a/src/contracts/KeysManager.contract.js b/src/contracts/KeysManager.contract.js index eac2eb3..8adefb7 100644 --- a/src/contracts/KeysManager.contract.js +++ b/src/contracts/KeysManager.contract.js @@ -1,7 +1,9 @@ import KeysManagerAbi from './keysManager.abi.json' import Web3 from 'web3'; +import {KEYS_MANAGER_ADDRESS} from './addresses'; + +console.log('Keys Manager', KEYS_MANAGER_ADDRESS); -const KEYS_MANAGER_ADDRESS = '0xfc90125492e58dbfe80c0bfb6a2a759c4f703ca8'; export default class KeysManager { constructor(){ if(window.web3.currentProvider){ diff --git a/src/contracts/Metadata.contract.js b/src/contracts/Metadata.contract.js index 635fe51..3da3c66 100644 --- a/src/contracts/Metadata.contract.js +++ b/src/contracts/Metadata.contract.js @@ -2,6 +2,7 @@ import PoaConsensus from './PoaConsensus.contract' import MetadataAbi from './metadata.abi.json' import Web3 from 'web3'; import moment from 'moment'; +import {METADATA_ADDRESS} from './addresses'; var toAscii = function(hex) { var str = '', i = 0, @@ -17,7 +18,7 @@ var toAscii = function(hex) { return str; }; -const METADATA_ADDRESS = '0xa1b344ee240564f61117f2dbf999547ad4b871ed'; +console.log('Metadata contract:', METADATA_ADDRESS) export default class Metadata { constructor(){ if(window.web3.currentProvider){ diff --git a/src/contracts/PoaConsensus.contract.js b/src/contracts/PoaConsensus.contract.js index dab58ac..3316336 100644 --- a/src/contracts/PoaConsensus.contract.js +++ b/src/contracts/PoaConsensus.contract.js @@ -1,12 +1,13 @@ import poaConsensusAbi from './poaConsensus.abi.json' import Web3 from 'web3'; +import {POA_ADDRESS} from './addresses'; -const KEYS_MANAGER_ADDRESS = '0x8bf38d4764929064f2d4d3a56520a76ab3df415b'; +console.log('POA Address ' , POA_ADDRESS) export default class POAConsensus { constructor(){ if(window.web3.currentProvider){ let web3_10 = new Web3(window.web3.currentProvider); - this.poaInstance = new web3_10.eth.Contract(poaConsensusAbi, KEYS_MANAGER_ADDRESS); + this.poaInstance = new web3_10.eth.Contract(poaConsensusAbi, POA_ADDRESS); } } async getValidators(){ diff --git a/src/contracts/addresses.js b/src/contracts/addresses.js new file mode 100644 index 0000000..5ed09e6 --- /dev/null +++ b/src/contracts/addresses.js @@ -0,0 +1,5 @@ +module.exports = { + METADATA_ADDRESS: '0xa1b344ee240564f61117f2dbf999547ad4b871ed', + KEYS_MANAGER_ADDRESS: '0xfc90125492e58dbfe80c0bfb6a2a759c4f703ca8', + POA_ADDRESS: '0x8bf38d4764929064f2d4d3a56520a76ab3df415b' +} \ No newline at end of file diff --git a/src/getWeb3.js b/src/getWeb3.js index 9478f5c..96101be 100644 --- a/src/getWeb3.js +++ b/src/getWeb3.js @@ -16,17 +16,22 @@ let getWeb3 = () => { web3 = new window.Web3(web3.currentProvider) web3.version.getNetwork((err, netId) => { let netIdName; + console.log('netId', netId); switch (netId) { - case "12648430": - netIdName = 'Oracles' - console.log('This is oracles') + case "99": + netIdName = 'Core' + console.log('This is Core', netId) + break; + case "77": + netIdName = 'Sokol' + console.log('This is Sokol', netId) break; default: netIdName = 'ERROR' errorMsg = `You aren't connected to POA Network. Please, switch on POA plugin and refresh the page. Check POA Network wiki for more info.` - console.log('This is an unknown network.') + console.log('This is an unknown network.', netId) } var defaultAccount = web3.eth.defaultAccount || null; if(defaultAccount === null){ diff --git a/src/index.js b/src/index.js index 275e3bb..05f297d 100644 --- a/src/index.js +++ b/src/index.js @@ -30,7 +30,7 @@ function generateElement(msg){ class AppMainRouter extends Component { constructor(props){ super(props); - this.rootPath = '/oracles-dapps-validators' + this.rootPath = '/poa-dapps-validators' history.listen(this.onRouteChange.bind(this)); this.onSetRender = this.onSetRender.bind(this); this.onPendingChangesRender = this.onPendingChangesRender.bind(this); @@ -134,7 +134,7 @@ class AppMainRouter extends Component { this.setState({searchTerm: term.target.value.toLowerCase()}) } render(){ - console.log('v2.03') + console.log('v2.04') const search = this.state.showSearch ? : '' const loading = this.state.loading ? : '' return (