Compare commits

..

3 Commits

Author SHA1 Message Date
86291f933b
fix representation of clapped percentage
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
2026-03-15 12:20:52 +03:00
3d5340e49a
avoid zero division in the bond details hook
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
2026-03-14 19:06:43 +03:00
bff5faa58c
localStorage for governance should be differentiated by chainId
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
2026-03-14 10:49:47 +03:00
7 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "ghost-dao-interface", "name": "ghost-dao-interface",
"private": true, "private": true,
"version": "0.6.0", "version": "0.6.3",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -78,7 +78,7 @@ export const BONDING_CALCULATOR_ADDRESSES = {
} }
export const GATEKEEPER_ADDRESSES = { export const GATEKEEPER_ADDRESSES = {
[NetworkId.TESTNET_SEPOLIA]: "0xc85129A097773B7F8970a7364c928C05f265E6A1", [NetworkId.TESTNET_SEPOLIA]: "0xd735cA07984a16911222c08411A80e24EB38869B",
[NetworkId.TESTNET_MORDOR]: "0x4823F1DC785D721eAdD2bD218E1eeD63aF67fBF4", [NetworkId.TESTNET_MORDOR]: "0x4823F1DC785D721eAdD2bD218E1eeD63aF67fBF4",
} }

View File

@ -126,7 +126,7 @@ const Bridge = ({ chainId, address, config, connect }) => {
const applauseThreshold = useApplauseThreshold(); const applauseThreshold = useApplauseThreshold();
const evmNetwork = useEvmNetwork({ evmChainId: chainId }); const evmNetwork = useEvmNetwork({ evmChainId: chainId });
const totalStakedAmount = useErasTotalStake({ const totalStakedAmount = useErasTotalStake({
eraIndex: eraIndex?.index ?? 0, epochIndex: eraIndex?.index ?? 0,
}); });
const authorities = useAuthorities({ const authorities = useAuthorities({
currentSession: watchTransaction?.sessionIndex ?? currentSession currentSession: watchTransaction?.sessionIndex ?? currentSession

View File

@ -43,7 +43,7 @@ const NewProposal = ({ config, address, connect, chainId }) => {
const theme = useTheme(); const theme = useTheme();
const myStoredProposals = localStorage.getItem(`${MY_PROPOSALS_PREFIX}-${address}`); const myStoredProposals = localStorage.getItem(`${MY_PROPOSALS_PREFIX}-${chainId}-${address}`);
const [myProposals, setMyProposals] = useState( const [myProposals, setMyProposals] = useState(
myStoredProposals ? JSON.parse(myStoredProposals).map(id => BigInt(id)) : [] myStoredProposals ? JSON.parse(myStoredProposals).map(id => BigInt(id)) : []
); );
@ -63,7 +63,7 @@ const NewProposal = ({ config, address, connect, chainId }) => {
useEffect(() => { useEffect(() => {
const toStore = JSON.stringify(myProposals.map(id => id.toString())); const toStore = JSON.stringify(myProposals.map(id => id.toString()));
localStorage.setItem(`${MY_PROPOSALS_PREFIX}-${address}`, toStore); localStorage.setItem(`${MY_PROPOSALS_PREFIX}-${chainId}-${address}`, toStore);
}, [myProposals]); }, [myProposals]);
useEffect(() => { useEffect(() => {

View File

@ -154,11 +154,11 @@ const ProposalDetails = ({ chainId, address, connect, config }) => {
const result = await castVote(chainId, address, proposalId, support); const result = await castVote(chainId, address, proposalId, support);
if (result) { if (result) {
const storedVotedProposals = localStorage.getItem(`${VOTED_PROPOSALS_PREFIX}-${address}`); const storedVotedProposals = localStorage.getItem(`${VOTED_PROPOSALS_PREFIX}-${chainId}-${address}`);
const proposals = JSON.parse(storedVotedProposals || "[]").map(id => BigInt(id)); const proposals = JSON.parse(storedVotedProposals || "[]").map(id => BigInt(id));
proposals.push(proposalId); proposals.push(proposalId);
const toStore = JSON.stringify(proposals.map(id => id.toString())); const toStore = JSON.stringify(proposals.map(id => id.toString()));
localStorage.setItem(`${VOTED_PROPOSALS_PREFIX}-${address}`, toStore); localStorage.setItem(`${VOTED_PROPOSALS_PREFIX}-${chainId}-${address}`, toStore);
await queryClient.invalidateQueries(); await queryClient.invalidateQueries();
} }
setIsPending(false); setIsPending(false);

View File

@ -52,12 +52,12 @@ const ProposalsList = ({ chainId, address, config }) => {
const [proposalsFilter, setProposalFilter] = useState("active"); const [proposalsFilter, setProposalFilter] = useState("active");
const myStoredProposals = localStorage.getItem(`${MY_PROPOSALS_PREFIX}-${address}`); const myStoredProposals = localStorage.getItem(`${MY_PROPOSALS_PREFIX}-${chainId}-${address}`);
const [myProposals, setMyProposals] = useState( const [myProposals, setMyProposals] = useState(
myStoredProposals ? JSON.parse(myStoredProposals).map(id => BigInt(id)) : [] myStoredProposals ? JSON.parse(myStoredProposals).map(id => BigInt(id)) : []
); );
const storedVotedProposals = localStorage.getItem(`${VOTED_PROPOSALS_PREFIX}-${address}`); const storedVotedProposals = localStorage.getItem(`${VOTED_PROPOSALS_PREFIX}-${chainId}-${address}`);
const [votedProposals, setVotedProposals] = useState( const [votedProposals, setVotedProposals] = useState(
storedVotedProposals ? JSON.parse(storedVotedProposals).map(id => BigInt(id)) : [] storedVotedProposals ? JSON.parse(storedVotedProposals).map(id => BigInt(id)) : []
); );

View File

@ -132,7 +132,7 @@ export const useLiveBonds = (chainId) => {
const quoteTokenPerBaseToken = new DecimalBigNumber(marketPrice, 9); const quoteTokenPerBaseToken = new DecimalBigNumber(marketPrice, 9);
const priceInUsd = quoteTokenPerBaseToken.mul(baseTokenPerUsd).mul(quoteTokenPerUsd).mul(markdown).div(originalCoefficient); const priceInUsd = quoteTokenPerBaseToken.mul(baseTokenPerUsd).mul(quoteTokenPerUsd).mul(markdown).div(originalCoefficient);
const discount = baseTokenPerUsd._value > 0n const discount = ftsoPrice._value > 0n
? ftsoPrice.sub(priceInUsd).div(ftsoPrice) ? ftsoPrice.sub(priceInUsd).div(ftsoPrice)
: new DecimalBigNumber("0", ftsoPrice._decimals); : new DecimalBigNumber("0", ftsoPrice._decimals);