Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
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
vicotor
frontend
Commits
02498657
Unverified
Commit
02498657
authored
Dec 18, 2023
by
Igor Stuev
Committed by
GitHub
Dec 18, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1422 from blockscout/fe-1418
soldity check only for validated contracts + keys fix
parents
fe5bb8b2
6c70d875
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
SolidityscanReport.tsx
ui/address/SolidityscanReport.tsx
+25
-11
Address.tsx
ui/pages/Address.tsx
+1
-1
No files found.
ui/address/SolidityscanReport.tsx
View file @
02498657
...
@@ -45,6 +45,30 @@ interface Props {
...
@@ -45,6 +45,30 @@ interface Props {
hash
:
string
;
hash
:
string
;
}
}
type
ItemProps
=
{
item
:
DistributionItem
;
vulnerabilities
:
SolidityscanReport
[
'
scan_report
'
][
'
scan_summary
'
][
'
issue_severity_distribution
'
];
vulnerabilitiesCount
:
number
;
}
const
SolidityScanReportItem
=
({
item
,
vulnerabilities
,
vulnerabilitiesCount
}:
ItemProps
)
=>
{
const
bgBar
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
yetAnotherGrayColor
=
useColorModeValue
(
'
gray.400
'
,
'
gray.500
'
);
return
(
<>
<
Box
w=
{
3
}
h=
{
3
}
bg=
{
item
.
color
}
borderRadius=
"6px"
mr=
{
2
}
></
Box
>
<
Flex
justifyContent=
"space-between"
mr=
{
3
}
>
<
Text
>
{
item
.
name
}
</
Text
>
<
Text
color=
{
vulnerabilities
[
item
.
id
]
>
0
?
'
text
'
:
yetAnotherGrayColor
}
>
{
vulnerabilities
[
item
.
id
]
}
</
Text
>
</
Flex
>
<
Box
bg=
{
bgBar
}
h=
"10px"
borderRadius=
"8px"
>
<
Box
bg=
{
item
.
color
}
w=
{
vulnerabilities
[
item
.
id
]
/
vulnerabilitiesCount
}
h=
"10px"
borderRadius=
"8px"
/>
</
Box
>
</>
);
};
const
SolidityscanReport
=
({
className
,
hash
}:
Props
)
=>
{
const
SolidityscanReport
=
({
className
,
hash
}:
Props
)
=>
{
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
...
@@ -58,7 +82,6 @@ const SolidityscanReport = ({ className, hash }: Props) => {
...
@@ -58,7 +82,6 @@ const SolidityscanReport = ({ className, hash }: Props) => {
const
score
=
Number
(
data
?.
scan_report
.
scan_summary
.
score_v2
);
const
score
=
Number
(
data
?.
scan_report
.
scan_summary
.
score_v2
);
const
bgBar
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
chartGrayColor
=
useColorModeValue
(
'
gray.100
'
,
'
gray.700
'
);
const
chartGrayColor
=
useColorModeValue
(
'
gray.100
'
,
'
gray.700
'
);
const
yetAnotherGrayColor
=
useColorModeValue
(
'
gray.400
'
,
'
gray.500
'
);
const
yetAnotherGrayColor
=
useColorModeValue
(
'
gray.400
'
,
'
gray.500
'
);
const
popoverBgColor
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
popoverBgColor
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
...
@@ -136,16 +159,7 @@ const SolidityscanReport = ({ className, hash }: Props) => {
...
@@ -136,16 +159,7 @@ const SolidityscanReport = ({ className, hash }: Props) => {
<
Text
py=
"7px"
variant=
"secondary"
fontSize=
"xs"
fontWeight=
{
500
}
>
Vulnerabilities distribution
</
Text
>
<
Text
py=
"7px"
variant=
"secondary"
fontSize=
"xs"
fontWeight=
{
500
}
>
Vulnerabilities distribution
</
Text
>
<
Grid
templateColumns=
"20px 1fr 100px"
alignItems=
"center"
rowGap=
{
2
}
>
<
Grid
templateColumns=
"20px 1fr 100px"
alignItems=
"center"
rowGap=
{
2
}
>
{
DISTRIBUTION_ITEMS
.
map
(
item
=>
(
{
DISTRIBUTION_ITEMS
.
map
(
item
=>
(
<>
<
SolidityScanReportItem
item=
{
item
}
key=
{
item
.
id
}
vulnerabilities=
{
vulnerabilities
}
vulnerabilitiesCount=
{
vulnerabilitiesCount
}
/>
<
Box
w=
{
3
}
h=
{
3
}
bg=
{
item
.
color
}
borderRadius=
"6px"
mr=
{
2
}
></
Box
>
<
Flex
justifyContent=
"space-between"
mr=
{
3
}
>
<
Text
>
{
item
.
name
}
</
Text
>
<
Text
color=
{
vulnerabilities
[
item
.
id
]
>
0
?
'
text
'
:
yetAnotherGrayColor
}
>
{
vulnerabilities
[
item
.
id
]
}
</
Text
>
</
Flex
>
<
Box
bg=
{
bgBar
}
h=
"10px"
borderRadius=
"8px"
>
<
Box
bg=
{
item
.
color
}
w=
{
vulnerabilities
[
item
.
id
]
/
vulnerabilitiesCount
}
h=
"10px"
borderRadius=
"8px"
/>
</
Box
>
</>
))
}
))
}
</
Grid
>
</
Grid
>
</
Box
>
</
Box
>
...
...
ui/pages/Address.tsx
View file @
02498657
...
@@ -189,7 +189,7 @@ const AddressPageContent = () => {
...
@@ -189,7 +189,7 @@ const AddressPageContent = () => {
<
AddressQrCode
address=
{
{
hash
}
}
isLoading=
{
isLoading
}
/>
<
AddressQrCode
address=
{
{
hash
}
}
isLoading=
{
isLoading
}
/>
<
AccountActionsMenu
isLoading=
{
isLoading
}
/>
<
AccountActionsMenu
isLoading=
{
isLoading
}
/>
<
HStack
ml=
"auto"
gap=
{
2
}
/>
<
HStack
ml=
"auto"
gap=
{
2
}
/>
{
addressQuery
.
data
?.
is_contract
&&
config
.
UI
.
views
.
address
.
solidityscanEnabled
&&
<
SolidityscanReport
hash=
{
hash
}
/>
}
{
addressQuery
.
data
?.
is_contract
&&
addressQuery
.
data
?.
is_verified
&&
config
.
UI
.
views
.
address
.
solidityscanEnabled
&&
<
SolidityscanReport
hash=
{
hash
}
/>
}
<
NetworkExplorers
type=
"address"
pathParam=
{
hash
}
/>
<
NetworkExplorers
type=
"address"
pathParam=
{
hash
}
/>
</
Flex
>
</
Flex
>
);
);
...
...
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