From a129938171385569c29c70dad7d1dd7a35b8546e Mon Sep 17 00:00:00 2001 From: VargaElod23 Date: Thu, 27 Apr 2023 13:10:03 +0300 Subject: [PATCH 1/2] reroute dpos through proxy --- services/community-site/src/services/useDpos.ts | 4 ++-- services/community-site/src/utils/networks.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/services/community-site/src/services/useDpos.ts b/services/community-site/src/services/useDpos.ts index f515d658c..afe28fac7 100644 --- a/services/community-site/src/services/useDpos.ts +++ b/services/community-site/src/services/useDpos.ts @@ -37,7 +37,7 @@ function useDpos() { try { const contract = new ethers.Contract( - '0x00000000000000000000000000000000000000fe', + '0xC403E07453693aD68A939fB909D36d87d8682Fe5', abi, mainnetProvider, ); @@ -57,7 +57,7 @@ function useDpos() { return instance; } const contract = new ethers.Contract( - '0x00000000000000000000000000000000000000fe', + '0xC403E07453693aD68A939fB909D36d87d8682Fe5', abi, browserProvider, ); diff --git a/services/community-site/src/utils/networks.ts b/services/community-site/src/utils/networks.ts index fecf34235..524410e98 100644 --- a/services/community-site/src/utils/networks.ts +++ b/services/community-site/src/utils/networks.ts @@ -50,4 +50,16 @@ export const networks: Networks = { }, indexerUrl: 'https://indexer.devnet.taraxa.io', }, + 200: { + chainName: 'Taraxa PRNET-2460', + rpcUrl: 'https://rpc-pr-2460.prnet.taraxa.io/', + iconUrl: 'https://community.taraxa.io/logo192.png', + blockExplorerUrl: 'https://explorer-pr-2460.prnet.taraxa.io/', + nativeCurrency: { + name: 'TARA', + symbol: 'TARA', + decimals: 18, + }, + indexerUrl: 'https://indexer-pr-2460.prnet.taraxa.io', + }, }; From 4f8f3eb36c693076a1a214629cc93c832af14ba0 Mon Sep 17 00:00:00 2001 From: VargaElod23 Date: Thu, 27 Apr 2023 13:19:41 +0300 Subject: [PATCH 2/2] reroute register function through proxy --- services/community-site/src/services/useDpos.ts | 2 ++ services/community-site/src/services/useValidators.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/community-site/src/services/useDpos.ts b/services/community-site/src/services/useDpos.ts index afe28fac7..8ae28bed8 100644 --- a/services/community-site/src/services/useDpos.ts +++ b/services/community-site/src/services/useDpos.ts @@ -17,6 +17,7 @@ function useDpos() { 'function getTotalEligibleVotesCount() view returns (uint64)', 'function getUndelegations(address delegator, uint32 batch) view returns (tuple(uint256 stake, uint64 block, address validator)[] undelegations, bool end)', 'function getValidator(address validator) view returns (tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) validator_info)', + 'function getExternalValidator(address validator) view returns (tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) validator_info)', 'function getValidatorEligibleVotesCount(address validator) view returns (uint64)', 'function getValidators(uint32 batch) view returns (tuple(address account, tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) info)[] validators, bool end)', 'function getValidatorsFor(address owner, uint32 batch) view returns (tuple(address account, tuple(uint256 total_stake, uint256 commission_reward, uint16 commission, uint64 last_commission_change, address owner, string description, string endpoint) info)[] validators, bool end)', @@ -26,6 +27,7 @@ function useDpos() { 'function setCommission(address validator, uint16 commission)', 'function setValidatorInfo(address validator, string description, string endpoint)', 'function undelegate(address validator, uint256 amount)', + 'function registerExternalValidator(address validator, bytes proof, bytes vrf_key, uint16 commission, string description, string endpoint) payable', ]; const mainnetDpos = useMemo(() => { diff --git a/services/community-site/src/services/useValidators.tsx b/services/community-site/src/services/useValidators.tsx index 0523d3438..e808b3b00 100644 --- a/services/community-site/src/services/useValidators.tsx +++ b/services/community-site/src/services/useValidators.tsx @@ -138,7 +138,7 @@ export default () => { description: string, endpoint: string, ): Promise => { - return await browserDpos!.registerValidator( + return await browserDpos!.registerExternalValidator( validator, proof, vrfKey,