From 2663991b95d21ad53289ef5d6b291aa9dc3c5498 Mon Sep 17 00:00:00 2001 From: avysel Date: Tue, 1 Nov 2022 15:39:17 +0100 Subject: [PATCH 1/7] fix: fix tx injection message --- src/components/actions/ballot/BallotButtons.tsx | 9 +++++---- src/components/actions/upvote/UpVoteButton.tsx | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/actions/ballot/BallotButtons.tsx b/src/components/actions/ballot/BallotButtons.tsx index 005b161..138721a 100644 --- a/src/components/actions/ballot/BallotButtons.tsx +++ b/src/components/actions/ballot/BallotButtons.tsx @@ -48,8 +48,6 @@ function BallotButtons({ Tezos, wallet, userAddress }: { Tezos: TezosToolkit, wa const forgeAndSend = async (ballotValue: 'yay' | 'nay' | 'pass'): Promise => { try { - - console.log("1. create operation object"); const operation = await createBallotOperation(ballotValue); @@ -124,7 +122,7 @@ function BallotButtons({ Tezos, wallet, userAddress }: { Tezos: TezosToolkit, wa if (opResult?.status === Constants.APPLIED) { console.log("Operation applied") setStatusType('success'); - setFeedbackMessage(`Ballot confirmed. Check it.`); + setFeedbackMessage(`Ballot confirmed. Check it.`); window.location.reload(); } @@ -146,7 +144,10 @@ function BallotButtons({ Tezos, wallet, userAddress }: { Tezos: TezosToolkit, wa try { const opHash = await forgeAndSend(ballotValue); - subscribe(opHash); + //subscribe(opHash); + setStatusType('success'); + setFeedbackMessage(`Operation sent. Check it.`); + setWaiting(false); } catch (error: any) { console.log(error); diff --git a/src/components/actions/upvote/UpVoteButton.tsx b/src/components/actions/upvote/UpVoteButton.tsx index a44377c..849c6b7 100644 --- a/src/components/actions/upvote/UpVoteButton.tsx +++ b/src/components/actions/upvote/UpVoteButton.tsx @@ -120,7 +120,7 @@ function UpVoteButton({ Tezos, wallet, userAddress, proposal }: { Tezos: TezosTo if (opResult?.status === Constants.APPLIED) { console.log("Operation applied") setStatusType('success'); - setFeedbackMessage(`Upvote confirmed. Check it.`); + setFeedbackMessage(`Upvote confirmed. Check it.`); window.location.reload(); } @@ -142,7 +142,10 @@ function UpVoteButton({ Tezos, wallet, userAddress, proposal }: { Tezos: TezosTo try { const opHash = await forgeAndSend(); - subscribe(opHash); + //subscribe(opHash); + setStatusType('success'); + setFeedbackMessage(`Operation sent. Check it.`); + setWaiting(false); } catch (error: any) { console.log(error); From 1cac555df704327e4eb05f8748e336bfdd135f2f Mon Sep 17 00:00:00 2001 From: avysel Date: Tue, 1 Nov 2022 15:41:35 +0100 Subject: [PATCH 2/7] docs: add node version in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c24fd90..d23b9d3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Online voting interface for Tezos bakers. ### Made with +- Node.js 16 - React - Craco - Typescript From 295b4634ec655b019de6c26ab5fa592dbfffea8e Mon Sep 17 00:00:00 2001 From: avysel Date: Tue, 1 Nov 2022 21:00:01 +0100 Subject: [PATCH 3/7] feat: multi proposals upvote --- src/App.tsx | 7 ++-- src/components/actions/MyBallot.tsx | 12 ++++--- src/components/actions/upvote/UpVote.tsx | 15 ++++---- .../actions/upvote/UpVoteButton.tsx | 36 +++++++++++++++---- src/components/proposal/Proposal.tsx | 32 ++++++++++++----- 5 files changed, 72 insertions(+), 30 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c04d17c..3b882c4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,6 +9,7 @@ import Sponsors from './components/Sponsors'; import { localForger } from '@taquito/local-forging' import { useState } from 'react'; import Constants from "./Constants"; +import { ProposalsResponseItem } from '@taquito/rpc'; function App() { @@ -16,7 +17,7 @@ function App() { Tezos.setForgerProvider(localForger); const [period, setPeriod] = useState(Constants.Period.NONE); - const [proposal, setProposal] = useState(); + const [proposals, setProposals] = useState([]); return (
@@ -24,10 +25,10 @@ function App() { - + - + diff --git a/src/components/actions/MyBallot.tsx b/src/components/actions/MyBallot.tsx index 00e272e..fa78e5e 100644 --- a/src/components/actions/MyBallot.tsx +++ b/src/components/actions/MyBallot.tsx @@ -5,8 +5,10 @@ import Constants from "../../Constants"; import Ballot from "./ballot/Ballot"; import Wallet from "../wallet/Wallet"; import UpVote from "./upvote/UpVote"; +import { ProposalsResponseItem } from '@taquito/rpc'; -function MyBallot({ Tezos, period, proposal }: { Tezos: TezosToolkit, period: string, proposal: string | undefined }) { + +function MyBallot({ Tezos, period, proposals }: { Tezos: TezosToolkit, period: string, proposals: ProposalsResponseItem[] }) { const [userAddress, setUserAddress] = useState(""); const [wallet, setWallet] = useState(); @@ -21,12 +23,12 @@ function MyBallot({ Tezos, period, proposal }: { Tezos: TezosToolkit, period: st setIsBallot(period === Constants.Period.PROMOTION || period === Constants.Period.EXPLORATION); setIsUpvote(period === Constants.Period.PROPOSAL); - console.log(`proposal ${proposal}`); + console.log(`proposal ${proposals}`); console.log(`isBallot ${isBallot}`); console.log(`isUpvote ${isUpvote}`); })(); - }, [period, proposal]); + }, [period, proposals]); return (
@@ -44,7 +46,7 @@ function MyBallot({ Tezos, period, proposal }: { Tezos: TezosToolkit, period: st userAddress && isBallot &&

- +
} @@ -52,7 +54,7 @@ function MyBallot({ Tezos, period, proposal }: { Tezos: TezosToolkit, period: st userAddress && isUpvote &&

- +
} diff --git a/src/components/actions/upvote/UpVote.tsx b/src/components/actions/upvote/UpVote.tsx index 74427bb..8f6015c 100644 --- a/src/components/actions/upvote/UpVote.tsx +++ b/src/components/actions/upvote/UpVote.tsx @@ -4,17 +4,18 @@ import { useEffect, useState } from "react"; import { Alert } from "react-bootstrap"; import UpVoteButton from "./UpVoteButton"; import UpVoteResult from "./UpVoteResult"; +import { ProposalsResponseItem } from '@taquito/rpc'; -function UpVote({ Tezos, wallet, userAddress, isDelegate, proposal }: { Tezos: TezosToolkit, wallet: BeaconWallet, userAddress: string, isDelegate: boolean, proposal: string | undefined }) { +function UpVote({ Tezos, wallet, userAddress, isDelegate, proposals }: { Tezos: TezosToolkit, wallet: BeaconWallet, userAddress: string, isDelegate: boolean, proposals: ProposalsResponseItem[] }) { const [hasVoted, setHasVoted] = useState(false); useEffect(() => { (async () => { - + // TODO what about has voted? })(); - }, [proposal]); + }, [proposals]); return ( <> @@ -27,7 +28,7 @@ function UpVote({ Tezos, wallet, userAddress, isDelegate, proposal }: { Tezos: T
} { - isDelegate && !proposal && + isDelegate && proposals.length == 0 &&
No proposals submitted for upvote yet. @@ -35,11 +36,11 @@ function UpVote({ Tezos, wallet, userAddress, isDelegate, proposal }: { Tezos: T
} { - isDelegate && proposal && !hasVoted && - + isDelegate && proposals.length > 0 && !hasVoted && + } { - isDelegate && proposal && hasVoted && + isDelegate && proposals.length > 0 && hasVoted && } diff --git a/src/components/actions/upvote/UpVoteButton.tsx b/src/components/actions/upvote/UpVoteButton.tsx index a44377c..c9fd4f2 100644 --- a/src/components/actions/upvote/UpVoteButton.tsx +++ b/src/components/actions/upvote/UpVoteButton.tsx @@ -6,26 +6,30 @@ import bs58check from "bs58check"; import { useState } from "react"; import { Alert, Button, Col, Row, Spinner } from "react-bootstrap"; import Constants from "../../../Constants"; -import { OperationObject, PreapplyResponse } from '@taquito/rpc'; +import { OperationObject, PreapplyResponse, ProposalsResponseItem } from '@taquito/rpc'; import Parser from 'html-react-parser'; import Config from "../../../Config"; -function UpVoteButton({ Tezos, wallet, userAddress, proposal }: { Tezos: TezosToolkit, wallet: BeaconWallet, userAddress: string, proposal: string | undefined }) { +function UpVoteButton({ Tezos, wallet, userAddress, proposals }: { Tezos: TezosToolkit, wallet: BeaconWallet, userAddress: string, proposals: ProposalsResponseItem[] }) { const [showAlert, setShowAlert] = useState(false); const [statusType, setStatusType] = useState<'success' | 'danger' | 'primary'>(); const [feedbackMessage, setFeedbackMessage] = useState(""); const [waiting, setWaiting] = useState(false); + const [selectedProposals, setSelectedProposals] = useState([]); const createUpvoteOperation = async (): Promise => { - if (proposal === undefined) { + if (proposals === undefined || proposals.length == 0) { throw new Error("No proposals submitted yet"); } const branch: string = await Tezos.rpc.getBlockHash(); const period: number = (await Tezos.rpc.getCurrentPeriod()).voting_period.index; + console.log("Upvote for "); + console.log(selectedProposals); + const operation = { "branch": branch, "contents": [ @@ -33,7 +37,7 @@ function UpVoteButton({ Tezos, wallet, userAddress, proposal }: { Tezos: TezosTo "kind": OpKind.PROPOSALS, "source": userAddress, "period": period, - "proposals": [proposal] + "proposals": selectedProposals } ] }; @@ -154,15 +158,35 @@ function UpVoteButton({ Tezos, wallet, userAddress, proposal }: { Tezos: TezosTo } } - const upVote = async (): Promise => { sendUpVoteOperation(); }; + const handleChange = (e: React.ChangeEvent) => { + const { value, checked } = e.target; + if (checked) { + setSelectedProposals(prev => [...prev, value]); + } else { + setSelectedProposals(prev => prev.filter(x => x !== value)); + } + } + return ( <>
-
Click on the button to upvote for the proposal:
+
Select proposals you want to upvote and click on the button to send your vote.
+ +
+ {proposals.map((item, i) =>
+ {item[0]} + +
)} +
diff --git a/src/components/proposal/Proposal.tsx b/src/components/proposal/Proposal.tsx index eace4d0..88b5af5 100644 --- a/src/components/proposal/Proposal.tsx +++ b/src/components/proposal/Proposal.tsx @@ -3,10 +3,13 @@ import { Dispatch, SetStateAction, useEffect, useState } from "react"; import { Card } from "react-bootstrap"; import ProposalStat from "./ProposalStat"; import Constants from "../../Constants"; +import { ProposalsResponseItem } from '@taquito/rpc'; +import BigNumber from 'bignumber.js'; +import React from "react"; -function Proposal({ Tezos, setPeriod, setProposal }: { Tezos: TezosToolkit, setPeriod: Dispatch>, setProposal: Dispatch> }) { +function Proposal({ Tezos, setPeriod, setProposals }: { Tezos: TezosToolkit, setPeriod: Dispatch>, setProposals: Dispatch> }) { - const [proposalHash, setProposalHash] = useState(""); + const [proposals, setInternalProposals] = useState([]); const [remaining, setRemaining] = useState(0); const [periodKind, setPeriodKind] = useState(""); @@ -16,7 +19,8 @@ function Proposal({ Tezos, setPeriod, setProposal }: { Tezos: TezosToolkit, setP Tezos.rpc.getCurrentPeriod() .then((period) => { console.log(`Current period: ${JSON.stringify(period)}`) - const kind = period.voting_period.kind + let kind = period.voting_period.kind; + setRemaining(period.remaining); setPeriodKind(kind); setPeriod(kind); @@ -30,8 +34,8 @@ function Proposal({ Tezos, setPeriod, setProposal }: { Tezos: TezosToolkit, setP .then((proposals) => { console.log(proposals); if (proposals && proposals[0]) { - setProposalHash(proposals[0][0]); - setProposal(proposals[0][0]); + setProposals(proposals); + setInternalProposals(proposals); } }); @@ -44,11 +48,14 @@ function Proposal({ Tezos, setPeriod, setProposal }: { Tezos: TezosToolkit, setP Tezos.rpc.getCurrentProposal() .then((hash) => { const proposalHash: string = hash?.toString() || ""; - setProposalHash(proposalHash); - setProposal(proposalHash); + const proposalsListOfOne: ProposalsResponseItem[] = [ + [proposalHash, BigNumber(0)] + ]; + setProposals(proposalsListOfOne); + setInternalProposals(proposalsListOfOne); console.log(`proposal hash ${proposalHash}`) }) - .catch((error) => { console.error(error); setProposalHash("error") }); + .catch((error) => { console.error(error); /*setProposalHash("error")*/ }); break; default: @@ -68,8 +75,15 @@ function Proposal({ Tezos, setPeriod, setProposal }: { Tezos: TezosToolkit, setP

Proposal

-
Prococol:
{proposalHash}
Period:
{periodKind}
+
+
Prococol:
+ {proposals.map((item: ProposalsResponseItem) => ( + +
{item[0]}
+
+ ))} +
Remaining:
{remaining}
From d9e194d7e50bf5eb0aef7955e16ca1c34b8b67ee Mon Sep 17 00:00:00 2001 From: avysel Date: Tue, 1 Nov 2022 21:11:44 +0100 Subject: [PATCH 4/7] feat: improve layout & display --- src/components/proposal/Proposal.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/proposal/Proposal.tsx b/src/components/proposal/Proposal.tsx index 88b5af5..dbbce1f 100644 --- a/src/components/proposal/Proposal.tsx +++ b/src/components/proposal/Proposal.tsx @@ -76,16 +76,17 @@ function Proposal({ Tezos, setPeriod, setProposals }: { Tezos: TezosToolkit, set

Proposal

Period:
{periodKind}
+
Remaining:
{remaining}
-
Prococol:
+
Protocol:
{proposals.map((item: ProposalsResponseItem) => (
{item[0]}
))}
-
Remaining:
{remaining}
+
From 59b429b1e49411feaf6c819059e13cf6a00af34f Mon Sep 17 00:00:00 2001 From: avysel Date: Tue, 1 Nov 2022 23:45:00 +0100 Subject: [PATCH 5/7] feat: WIP upvote status --- src/components/proposal/Proposal.tsx | 24 ++++++++--- ...roposalStat.tsx => ProposalBallotStat.tsx} | 4 +- .../proposal/ProposalUpvoteStat.tsx | 42 +++++++++++++++++++ 3 files changed, 63 insertions(+), 7 deletions(-) rename src/components/proposal/{ProposalStat.tsx => ProposalBallotStat.tsx} (94%) create mode 100644 src/components/proposal/ProposalUpvoteStat.tsx diff --git a/src/components/proposal/Proposal.tsx b/src/components/proposal/Proposal.tsx index dbbce1f..a7bba9b 100644 --- a/src/components/proposal/Proposal.tsx +++ b/src/components/proposal/Proposal.tsx @@ -1,11 +1,12 @@ import { TezosToolkit } from "@taquito/taquito"; import { Dispatch, SetStateAction, useEffect, useState } from "react"; import { Card } from "react-bootstrap"; -import ProposalStat from "./ProposalStat"; +import ProposalBallotStat from "./ProposalBallotStat"; import Constants from "../../Constants"; import { ProposalsResponseItem } from '@taquito/rpc'; import BigNumber from 'bignumber.js'; import React from "react"; +import ProposalUpvoteStat from "./ProposalUpvoteStat"; function Proposal({ Tezos, setPeriod, setProposals }: { Tezos: TezosToolkit, setPeriod: Dispatch>, setProposals: Dispatch> }) { @@ -13,6 +14,12 @@ function Proposal({ Tezos, setPeriod, setProposals }: { Tezos: TezosToolkit, set const [remaining, setRemaining] = useState(0); const [periodKind, setPeriodKind] = useState(""); +const fakeProposals: ProposalsResponseItem[] = [ + ["proposal1", new BigNumber(12000000)], + ["proposal2", new BigNumber(25000000)], + ["proposal3", new BigNumber(69460856603261)] +] + useEffect(() => { (async () => { @@ -79,16 +86,23 @@ function Proposal({ Tezos, setPeriod, setProposals }: { Tezos: TezosToolkit, set
Remaining:
{remaining}
Protocol:
- {proposals.map((item: ProposalsResponseItem) => ( - + {proposals.map((item: ProposalsResponseItem, index) => ( +
{item[0]}
))}
-
+
- + { + /*periodKind === Constants.Period.PROPOSAL && */ + + } + { + (periodKind === Constants.Period.EXPLORATION || periodKind === Constants.Period.PROMOTION) && false && + + }
diff --git a/src/components/proposal/ProposalStat.tsx b/src/components/proposal/ProposalBallotStat.tsx similarity index 94% rename from src/components/proposal/ProposalStat.tsx rename to src/components/proposal/ProposalBallotStat.tsx index 9e95b60..f7a8e6a 100644 --- a/src/components/proposal/ProposalStat.tsx +++ b/src/components/proposal/ProposalBallotStat.tsx @@ -2,7 +2,7 @@ import { TezosToolkit } from "@taquito/taquito"; import { useEffect, useState } from "react"; import { ProgressBar } from "react-bootstrap"; -function ProposalStat({ Tezos }: { Tezos: TezosToolkit }) { +function ProposalBallotStat({ Tezos }: { Tezos: TezosToolkit }) { const [yayPct, setYayPct] = useState(0); const [nayPct, setNayPct] = useState(0); @@ -46,4 +46,4 @@ function ProposalStat({ Tezos }: { Tezos: TezosToolkit }) { ); } -export default ProposalStat; \ No newline at end of file +export default ProposalBallotStat; \ No newline at end of file diff --git a/src/components/proposal/ProposalUpvoteStat.tsx b/src/components/proposal/ProposalUpvoteStat.tsx new file mode 100644 index 0000000..b3a7282 --- /dev/null +++ b/src/components/proposal/ProposalUpvoteStat.tsx @@ -0,0 +1,42 @@ +import { TezosToolkit } from "@taquito/taquito"; +import { useEffect, useState } from "react"; +import { ProposalsResponseItem } from '@taquito/rpc'; +import React from "react"; +import BigNumber from 'bignumber.js'; + +function ProposalUpvoteStat({ Tezos, proposals }: { Tezos: TezosToolkit, proposals: ProposalsResponseItem[] }) { + + const [votingPower, setVotingPower] = useState(BigNumber(1)); + + useEffect(() => { + (async () => { + + Tezos.rpc.getVotesListings().then((listing) => { + const totalVotingPower = listing.reduce((accumulator, item) => (item.voting_power) ? BigNumber.sum(accumulator, item.voting_power) : accumulator, new BigNumber(0)); + setVotingPower(totalVotingPower); + }) + + })(); + }, []); + + return ( +
+
Upvote status
+ +
+ {proposals.map((item: ProposalsResponseItem, index: number) => ( + +
+ {item[0]} + + {( item[1].dividedBy(votingPower).multipliedBy(100).toPrecision(3, BigNumber.ROUND_UP) ).toString()}% + +
+
+ ))} +
+
+ ) +} + +export default ProposalUpvoteStat; \ No newline at end of file From b059fe969ac8bfd6a144ab826c3d2b94149e50e7 Mon Sep 17 00:00:00 2001 From: avysel Date: Thu, 3 Nov 2022 18:23:42 +0100 Subject: [PATCH 6/7] feat: upvote status --- src/Config.tsx | 8 ++++- src/components/actions/upvote/UpVote.tsx | 2 +- .../actions/upvote/UpVoteButton.tsx | 2 +- src/components/proposal/Proposal.tsx | 33 +++++++++---------- .../proposal/ProposalUpvoteStat.tsx | 7 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/Config.tsx b/src/Config.tsx index 4231830..d96c9d3 100644 --- a/src/Config.tsx +++ b/src/Config.tsx @@ -14,12 +14,18 @@ networks.set('ghostnet', { viewerUrl: "https://ghostnet.tzkt.io" }); +networks.set('k', { + networkType: NetworkType.KATHMANDUNET, + rpcUrl: "https://rpc.kathmandunet.teztnets.xyz/", + viewerUrl: "https://kathmandunet.tzkt.io" +}); + let Config = { application: { name: "Tezocracy.xyz", githubRepository: "https://github.com/tezocracy/tezocracy.xyz" }, - network: networks.get('mainnet') + network: networks.get('k') } export default Config; diff --git a/src/components/actions/upvote/UpVote.tsx b/src/components/actions/upvote/UpVote.tsx index 8f6015c..1ea014c 100644 --- a/src/components/actions/upvote/UpVote.tsx +++ b/src/components/actions/upvote/UpVote.tsx @@ -28,7 +28,7 @@ function UpVote({ Tezos, wallet, userAddress, isDelegate, proposals }: { Tezos:
} { - isDelegate && proposals.length == 0 && + isDelegate && proposals.length === 0 &&
No proposals submitted for upvote yet. diff --git a/src/components/actions/upvote/UpVoteButton.tsx b/src/components/actions/upvote/UpVoteButton.tsx index 53884c4..375aea6 100644 --- a/src/components/actions/upvote/UpVoteButton.tsx +++ b/src/components/actions/upvote/UpVoteButton.tsx @@ -20,7 +20,7 @@ function UpVoteButton({ Tezos, wallet, userAddress, proposals }: { Tezos: TezosT const createUpvoteOperation = async (): Promise => { - if (proposals === undefined || proposals.length == 0) { + if (proposals === undefined || proposals.length === 0) { throw new Error("No proposals submitted yet"); } diff --git a/src/components/proposal/Proposal.tsx b/src/components/proposal/Proposal.tsx index a7bba9b..044e5fd 100644 --- a/src/components/proposal/Proposal.tsx +++ b/src/components/proposal/Proposal.tsx @@ -14,12 +14,6 @@ function Proposal({ Tezos, setPeriod, setProposals }: { Tezos: TezosToolkit, set const [remaining, setRemaining] = useState(0); const [periodKind, setPeriodKind] = useState(""); -const fakeProposals: ProposalsResponseItem[] = [ - ["proposal1", new BigNumber(12000000)], - ["proposal2", new BigNumber(25000000)], - ["proposal3", new BigNumber(69460856603261)] -] - useEffect(() => { (async () => { @@ -84,23 +78,28 @@ const fakeProposals: ProposalsResponseItem[] = [

Proposal

Period:
{periodKind}
Remaining:
{remaining}
-
-
Protocol:
- {proposals.map((item: ProposalsResponseItem, index) => ( - -
{item[0]}
-
- ))} -
+ + { + (periodKind === Constants.Period.EXPLORATION || periodKind === Constants.Period.PROMOTION) && + +
+
Protocol:
+ {proposals.map((item: ProposalsResponseItem, index) => ( + +
{item[0]}
+
+ ))} +
+ }

{ - /*periodKind === Constants.Period.PROPOSAL && */ - + periodKind === Constants.Period.PROPOSAL && + } { - (periodKind === Constants.Period.EXPLORATION || periodKind === Constants.Period.PROMOTION) && false && + (periodKind === Constants.Period.EXPLORATION || periodKind === Constants.Period.PROMOTION) && }
diff --git a/src/components/proposal/ProposalUpvoteStat.tsx b/src/components/proposal/ProposalUpvoteStat.tsx index b3a7282..73e1a95 100644 --- a/src/components/proposal/ProposalUpvoteStat.tsx +++ b/src/components/proposal/ProposalUpvoteStat.tsx @@ -27,9 +27,10 @@ function ProposalUpvoteStat({ Tezos, proposals }: { Tezos: TezosToolkit, proposa {proposals.map((item: ProposalsResponseItem, index: number) => (
- {item[0]} - - {( item[1].dividedBy(votingPower).multipliedBy(100).toPrecision(3, BigNumber.ROUND_UP) ).toString()}% + {item[0]} +   + + ({( item[1].dividedBy(votingPower).multipliedBy(100).toPrecision(3, BigNumber.ROUND_UP) ).toString()}%)
From 324ed1aa9ae6bf85391799a20da2687149927c92 Mon Sep 17 00:00:00 2001 From: avysel Date: Thu, 3 Nov 2022 18:34:03 +0100 Subject: [PATCH 7/7] set mainnet --- src/Config.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config.tsx b/src/Config.tsx index d96c9d3..69b4146 100644 --- a/src/Config.tsx +++ b/src/Config.tsx @@ -25,7 +25,7 @@ let Config = { name: "Tezocracy.xyz", githubRepository: "https://github.com/tezocracy/tezocracy.xyz" }, - network: networks.get('k') + network: networks.get('mainnet') } export default Config;