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
e2a293c6
Unverified
Commit
e2a293c6
authored
Sep 19, 2023
by
tom goriunov
Committed by
GitHub
Sep 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to re-verify partially verified contracts from UI (#1178)
Fixes #1155
parent
db6c1650
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
ContractCode.tsx
ui/address/contract/ContractCode.tsx
+4
-2
ContractVerification.tsx
ui/pages/ContractVerification.tsx
+1
-1
No files found.
ui/address/contract/ContractCode.tsx
View file @
e2a293c6
...
@@ -86,6 +86,8 @@ const ContractCode = ({ addressHash, noSocket }: Props) => {
...
@@ -86,6 +86,8 @@ const ContractCode = ({ addressHash, noSocket }: Props) => {
return <DataFetchAlert/>;
return <DataFetchAlert/>;
}
}
const canBeVerified = !data?.is_self_destructed && (!data?.is_verified || data.is_partially_verified);
const verificationButton = isPlaceholderData ? <Skeleton w="130px" h={ 8 } mr={ 3 } ml="auto" borderRadius="base"/> : (
const verificationButton = isPlaceholderData ? <Skeleton w="130px" h={ 8 } mr={ 3 } ml="auto" borderRadius="base"/> : (
<Button
<Button
size="sm"
size="sm"
...
@@ -253,7 +255,7 @@ const ContractCode = ({ addressHash, noSocket }: Props) => {
...
@@ -253,7 +255,7 @@ const ContractCode = ({ addressHash, noSocket }: Props) => {
<RawDataSnippet
<RawDataSnippet
data={ data.creation_bytecode }
data={ data.creation_bytecode }
title="Contract creation code"
title="Contract creation code"
rightSlot={
data.is_verified || data.is_self_destructed ? null : verificationButton
}
rightSlot={
canBeVerified ? verificationButton : null
}
beforeSlot={ data.is_self_destructed ? (
beforeSlot={ data.is_self_destructed ? (
<Alert status="info" whiteSpace="pre-wrap" mb={ 3 }>
<Alert status="info" whiteSpace="pre-wrap" mb={ 3 }>
Contracts that self destruct in their constructors have no contract code published and cannot be verified.
Contracts that self destruct in their constructors have no contract code published and cannot be verified.
...
@@ -268,7 +270,7 @@ const ContractCode = ({ addressHash, noSocket }: Props) => {
...
@@ -268,7 +270,7 @@ const ContractCode = ({ addressHash, noSocket }: Props) => {
<RawDataSnippet
<RawDataSnippet
data={ data.deployed_bytecode }
data={ data.deployed_bytecode }
title="Deployed ByteCode"
title="Deployed ByteCode"
rightSlot={ !data?.creation_bytecode &&
!(data.is_verified || data.is_self_destructed)
? verificationButton : null }
rightSlot={ !data?.creation_bytecode &&
canBeVerified
? verificationButton : null }
textareaMaxHeight="200px"
textareaMaxHeight="200px"
isLoading={ isPlaceholderData }
isLoading={ isPlaceholderData }
/>
/>
...
...
ui/pages/ContractVerification.tsx
View file @
e2a293c6
...
@@ -51,7 +51,7 @@ const ContractVerification = () => {
...
@@ -51,7 +51,7 @@ const ContractVerification = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[
]);
},
[
]);
const
isVerifiedContract
=
contractQuery
.
data
?.
is_verified
;
const
isVerifiedContract
=
contractQuery
.
data
?.
is_verified
&&
!
contractQuery
.
data
.
is_partially_verified
;
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
isVerifiedContract
)
{
if
(
isVerifiedContract
)
{
...
...
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