Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
e2baa051
Unverified
Commit
e2baa051
authored
Dec 13, 2021
by
Noah Zinsmeister
Committed by
GitHub
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fix for polygon proposal title (#2974)
parent
a5b152da
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
index.ts
src/constants/proposals/index.ts
+1
-0
polygon_proposal_title.ts
src/constants/proposals/polygon_proposal_title.ts
+1
-0
hooks.ts
src/state/governance/hooks.ts
+16
-3
No files found.
src/constants/proposals/index.ts
View file @
e2baa051
export
const
UNISWAP_GRANTS_START_BLOCK
=
11473815
export
const
UNISWAP_GRANTS_START_BLOCK
=
11473815
export
const
BRAVO_START_BLOCK
=
13059344
export
const
BRAVO_START_BLOCK
=
13059344
export
const
ONE_BIP_START_BLOCK
=
13551293
export
const
ONE_BIP_START_BLOCK
=
13551293
export
const
POLYGON_START_BLOCK
=
13786993
src/constants/proposals/polygon_proposal_title.ts
0 → 100644
View file @
e2baa051
export
const
POLYGON_PROPOSAL_TITLE
=
'
Should Uniswap v3 be deployed to Polygon?
'
src/state/governance/hooks.ts
View file @
e2baa051
...
@@ -8,6 +8,7 @@ import { formatUnits } from '@ethersproject/units'
...
@@ -8,6 +8,7 @@ import { formatUnits } from '@ethersproject/units'
import
{
t
}
from
'
@lingui/macro
'
import
{
t
}
from
'
@lingui/macro
'
import
{
abi
as
GOV_ABI
}
from
'
@uniswap/governance/build/GovernorAlpha.json
'
import
{
abi
as
GOV_ABI
}
from
'
@uniswap/governance/build/GovernorAlpha.json
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
CurrencyAmount
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
POLYGON_PROPOSAL_TITLE
}
from
'
constants/proposals/polygon_proposal_title
'
import
{
UNISWAP_GRANTS_PROPOSAL_DESCRIPTION
}
from
'
constants/proposals/uniswap_grants_proposal_description
'
import
{
UNISWAP_GRANTS_PROPOSAL_DESCRIPTION
}
from
'
constants/proposals/uniswap_grants_proposal_description
'
import
{
import
{
useGovernanceBravoContract
,
useGovernanceBravoContract
,
...
@@ -21,7 +22,12 @@ import { useCallback, useMemo } from 'react'
...
@@ -21,7 +22,12 @@ import { useCallback, useMemo } from 'react'
import
{
calculateGasMargin
}
from
'
utils/calculateGasMargin
'
import
{
calculateGasMargin
}
from
'
utils/calculateGasMargin
'
import
{
SupportedChainId
}
from
'
../../constants/chains
'
import
{
SupportedChainId
}
from
'
../../constants/chains
'
import
{
BRAVO_START_BLOCK
,
ONE_BIP_START_BLOCK
,
UNISWAP_GRANTS_START_BLOCK
}
from
'
../../constants/proposals
'
import
{
BRAVO_START_BLOCK
,
ONE_BIP_START_BLOCK
,
POLYGON_START_BLOCK
,
UNISWAP_GRANTS_START_BLOCK
,
}
from
'
../../constants/proposals
'
import
{
UNI
}
from
'
../../constants/tokens
'
import
{
UNI
}
from
'
../../constants/tokens
'
import
{
useLogs
}
from
'
../logs/hooks
'
import
{
useLogs
}
from
'
../logs/hooks
'
import
{
useSingleCallResult
,
useSingleContractMultipleData
}
from
'
../multicall/hooks
'
import
{
useSingleCallResult
,
useSingleContractMultipleData
}
from
'
../multicall/hooks
'
...
@@ -217,14 +223,21 @@ export function useAllProposalData(): { data: ProposalData[]; loading: boolean }
...
@@ -217,14 +223,21 @@ export function useAllProposalData(): { data: ProposalData[]; loading: boolean }
return
{
return
{
data
:
proposalsCallData
.
map
((
proposal
,
i
)
=>
{
data
:
proposalsCallData
.
map
((
proposal
,
i
)
=>
{
let
description
=
formattedLogs
[
i
]?.
description
const
startBlock
=
parseInt
(
proposal
?.
result
?.
startBlock
?.
toString
())
const
startBlock
=
parseInt
(
proposal
?.
result
?.
startBlock
?.
toString
())
let
description
=
formattedLogs
[
i
]?.
description
if
(
startBlock
===
UNISWAP_GRANTS_START_BLOCK
)
{
if
(
startBlock
===
UNISWAP_GRANTS_START_BLOCK
)
{
description
=
UNISWAP_GRANTS_PROPOSAL_DESCRIPTION
description
=
UNISWAP_GRANTS_PROPOSAL_DESCRIPTION
}
}
let
title
=
description
?.
split
(
/#+
\s
|
\n
/g
)[
1
]
if
(
startBlock
===
POLYGON_START_BLOCK
)
{
title
=
POLYGON_PROPOSAL_TITLE
}
return
{
return
{
id
:
proposal
?.
result
?.
id
.
toString
(),
id
:
proposal
?.
result
?.
id
.
toString
(),
title
:
description
?.
split
(
/# |
\n
/g
)[
1
]
??
t
`Untitled`
,
title
:
title
??
t
`Untitled`
,
description
:
description
??
t
`No description.`
,
description
:
description
??
t
`No description.`
,
proposer
:
proposal
?.
result
?.
proposer
,
proposer
:
proposal
?.
result
?.
proposer
,
status
:
proposalStatesCallData
[
i
]?.
result
?.[
0
]
??
ProposalState
.
UNDETERMINED
,
status
:
proposalStatesCallData
[
i
]?.
result
?.[
0
]
??
ProposalState
.
UNDETERMINED
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment