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
64c74843
Commit
64c74843
authored
Mar 06, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contract verification: other methods
parent
532f7e7a
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
94 additions
and
87 deletions
+94
-87
BlockEpochElectionRewardDetailsDesktop.tsx
...k/epochRewards/BlockEpochElectionRewardDetailsDesktop.tsx
+1
-1
BlockEpochElectionRewardDetailsMobile.tsx
...ck/epochRewards/BlockEpochElectionRewardDetailsMobile.tsx
+1
-1
ContractVerificationForm.tsx
ui/contractVerification/ContractVerificationForm.tsx
+19
-19
ContractVerificationFieldCommit.tsx
...ctVerification/fields/ContractVerificationFieldCommit.tsx
+7
-7
ContractVerificationFieldContractIndex.tsx
...ication/fields/ContractVerificationFieldContractIndex.tsx
+9
-6
ContractVerificationFieldGitHubRepo.tsx
...rification/fields/ContractVerificationFieldGitHubRepo.tsx
+1
-2
ContractVerificationFieldSources.tsx
...tVerification/fields/ContractVerificationFieldSources.tsx
+2
-1
ContractVerificationFieldZkCompiler.tsx
...rification/fields/ContractVerificationFieldZkCompiler.tsx
+14
-13
ContractVerificationSolidityFoundry.tsx
...ification/methods/ContractVerificationSolidityFoundry.tsx
+3
-2
ContractVerificationSolidityHardhat.tsx
...ification/methods/ContractVerificationSolidityHardhat.tsx
+3
-2
ContractVerificationStylusGitHubRepo.tsx
...fication/methods/ContractVerificationStylusGitHubRepo.tsx
+0
-1
ContractVerificationVyperMultiPartFile.tsx
...cation/methods/ContractVerificationVyperMultiPartFile.tsx
+2
-1
utils.ts
ui/contractVerification/utils.ts
+4
-0
FieldError.tsx
ui/shared/forms/components/FieldError.tsx
+1
-1
DragAndDropArea.tsx
ui/shared/forms/inputs/file/DragAndDropArea.tsx
+4
-4
FileInput.tsx
ui/shared/forms/inputs/file/FileInput.tsx
+8
-11
FileSnippet.tsx
ui/shared/forms/inputs/file/FileSnippet.tsx
+14
-14
TxInfo.tsx
ui/tx/details/TxInfo.tsx
+1
-1
No files found.
ui/block/epochRewards/BlockEpochElectionRewardDetailsDesktop.tsx
View file @
64c74843
...
@@ -90,7 +90,7 @@ const BlockEpochElectionRewardDetailsDesktop = ({ type, token }: Props) => {
...
@@ -90,7 +90,7 @@ const BlockEpochElectionRewardDetailsDesktop = ({ type, token }: Props) => {
{
query
.
isFetching
&&
<
ContentLoader
maxW=
"200px"
mt=
{
3
}
/>
}
{
query
.
isFetching
&&
<
ContentLoader
maxW=
"200px"
mt=
{
3
}
/>
}
{
query
.
isError
&&
<
Text
color=
"error"
mt=
{
3
}
>
Something went wrong. Unable to load next page.
</
Text
>
}
{
query
.
isError
&&
<
Text
color=
"
text.
error"
mt=
{
3
}
>
Something went wrong. Unable to load next page.
</
Text
>
}
<
Box
h=
"0"
w=
"100px"
ref=
{
cutRef
}
/>
<
Box
h=
"0"
w=
"100px"
ref=
{
cutRef
}
/>
</
Box
>
</
Box
>
...
...
ui/block/epochRewards/BlockEpochElectionRewardDetailsMobile.tsx
View file @
64c74843
...
@@ -73,7 +73,7 @@ const BlockEpochElectionRewardDetailsMobile = ({ type, token }: Props) => {
...
@@ -73,7 +73,7 @@ const BlockEpochElectionRewardDetailsMobile = ({ type, token }: Props) => {
{
query
.
isFetching
&&
<
ContentLoader
maxW=
"200px"
mt=
{
3
}
/>
}
{
query
.
isFetching
&&
<
ContentLoader
maxW=
"200px"
mt=
{
3
}
/>
}
{
query
.
isError
&&
<
Text
color=
"error"
mt=
{
3
}
>
Something went wrong. Unable to load next page.
</
Text
>
}
{
query
.
isError
&&
<
Text
color=
"
text.
error"
mt=
{
3
}
>
Something went wrong. Unable to load next page.
</
Text
>
}
<
Box
h=
"0"
w=
"100px"
mt=
"-12px"
ref=
{
cutRef
}
/>
<
Box
h=
"0"
w=
"100px"
mt=
"-12px"
ref=
{
cutRef
}
/>
</
Flex
>
</
Flex
>
...
...
ui/contractVerification/ContractVerificationForm.tsx
View file @
64c74843
...
@@ -24,15 +24,15 @@ import ContractVerificationFieldAddress from './fields/ContractVerificationField
...
@@ -24,15 +24,15 @@ import ContractVerificationFieldAddress from './fields/ContractVerificationField
import
ContractVerificationFieldLicenseType
from
'
./fields/ContractVerificationFieldLicenseType
'
;
import
ContractVerificationFieldLicenseType
from
'
./fields/ContractVerificationFieldLicenseType
'
;
import
ContractVerificationFieldMethod
from
'
./fields/ContractVerificationFieldMethod
'
;
import
ContractVerificationFieldMethod
from
'
./fields/ContractVerificationFieldMethod
'
;
import
ContractVerificationFlattenSourceCode
from
'
./methods/ContractVerificationFlattenSourceCode
'
;
import
ContractVerificationFlattenSourceCode
from
'
./methods/ContractVerificationFlattenSourceCode
'
;
//
import ContractVerificationMultiPartFile from './methods/ContractVerificationMultiPartFile';
import
ContractVerificationMultiPartFile
from
'
./methods/ContractVerificationMultiPartFile
'
;
//
import ContractVerificationSolidityFoundry from './methods/ContractVerificationSolidityFoundry';
import
ContractVerificationSolidityFoundry
from
'
./methods/ContractVerificationSolidityFoundry
'
;
//
import ContractVerificationSolidityHardhat from './methods/ContractVerificationSolidityHardhat';
import
ContractVerificationSolidityHardhat
from
'
./methods/ContractVerificationSolidityHardhat
'
;
//
import ContractVerificationSourcify from './methods/ContractVerificationSourcify';
import
ContractVerificationSourcify
from
'
./methods/ContractVerificationSourcify
'
;
//
import ContractVerificationStandardInput from './methods/ContractVerificationStandardInput';
import
ContractVerificationStandardInput
from
'
./methods/ContractVerificationStandardInput
'
;
//
import ContractVerificationStylusGitHubRepo from './methods/ContractVerificationStylusGitHubRepo';
import
ContractVerificationStylusGitHubRepo
from
'
./methods/ContractVerificationStylusGitHubRepo
'
;
//
import ContractVerificationVyperContract from './methods/ContractVerificationVyperContract';
import
ContractVerificationVyperContract
from
'
./methods/ContractVerificationVyperContract
'
;
//
import ContractVerificationVyperMultiPartFile from './methods/ContractVerificationVyperMultiPartFile';
import
ContractVerificationVyperMultiPartFile
from
'
./methods/ContractVerificationVyperMultiPartFile
'
;
//
import ContractVerificationVyperStandardInput from './methods/ContractVerificationVyperStandardInput';
import
ContractVerificationVyperStandardInput
from
'
./methods/ContractVerificationVyperStandardInput
'
;
import
{
prepareRequestBody
,
formatSocketErrors
,
getDefaultValues
,
METHOD_LABELS
}
from
'
./utils
'
;
import
{
prepareRequestBody
,
formatSocketErrors
,
getDefaultValues
,
METHOD_LABELS
}
from
'
./utils
'
;
interface
Props
{
interface
Props
{
...
@@ -161,15 +161,15 @@ const ContractVerificationForm = ({ method: methodFromQuery, config, hash }: Pro
...
@@ -161,15 +161,15 @@ const ContractVerificationForm = ({ method: methodFromQuery, config, hash }: Pro
const methods = React.useMemo(() => {
const methods = React.useMemo(() => {
return {
return {
'flattened-code': <ContractVerificationFlattenSourceCode config={ config }/>,
'flattened-code': <ContractVerificationFlattenSourceCode config={ config }/>,
//
'standard-input': <ContractVerificationStandardInput config={ config }/>,
'standard-input': <ContractVerificationStandardInput config={ config }/>,
//
sourcify: <ContractVerificationSourcify/>,
sourcify: <ContractVerificationSourcify/>,
//
'multi-part': <ContractVerificationMultiPartFile/>,
'multi-part': <ContractVerificationMultiPartFile/>,
//
'vyper-code': <ContractVerificationVyperContract config={ config }/>,
'vyper-code': <ContractVerificationVyperContract config={ config }/>,
//
'vyper-multi-part': <ContractVerificationVyperMultiPartFile/>,
'vyper-multi-part': <ContractVerificationVyperMultiPartFile/>,
//
'vyper-standard-input': <ContractVerificationVyperStandardInput/>,
'vyper-standard-input': <ContractVerificationVyperStandardInput/>,
//
'solidity-hardhat': <ContractVerificationSolidityHardhat config={ config }/>,
'solidity-hardhat': <ContractVerificationSolidityHardhat config={ config }/>,
//
'solidity-foundry': <ContractVerificationSolidityFoundry/>,
'solidity-foundry': <ContractVerificationSolidityFoundry/>,
//
'stylus-github-repository': <ContractVerificationStylusGitHubRepo/>,
'stylus-github-repository': <ContractVerificationStylusGitHubRepo/>,
};
};
}, [ config ]);
}, [ config ]);
const method = watch('method');
const method = watch('method');
...
@@ -201,7 +201,7 @@ const ContractVerificationForm = ({ method: methodFromQuery, config, hash }: Pro
...
@@ -201,7 +201,7 @@ const ContractVerificationForm = ({ method: methodFromQuery, config, hash }: Pro
<ContractVerificationFieldMethod methods={ config.verification_options }/>
<ContractVerificationFieldMethod methods={ config.verification_options }/>
</Grid>
</Grid>
{ content }
{ content }
{ formState.errors.root?.message && <Text color="
error"
mt={ 4 } fontSize="sm" whiteSpace="pre-wrap">{ formState.errors.root.message }</Text> }
{ formState.errors.root?.message && <Text color="
text.error"
mt={ 4 } fontSize="sm" whiteSpace="pre-wrap">{ formState.errors.root.message }</Text> }
{ Boolean(method) && methodValue !== 'solidity-hardhat' && methodValue !== 'solidity-foundry' && (
{ Boolean(method) && methodValue !== 'solidity-hardhat' && methodValue !== 'solidity-foundry' && (
<Button
<Button
size="md"
size="md"
...
...
ui/contractVerification/fields/ContractVerificationFieldCommit.tsx
View file @
64c74843
import
{
chakra
,
Code
,
Link
}
from
'
@chakra-ui/react
'
;
import
{
Code
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
...
@@ -6,6 +6,7 @@ import type { FormFields } from '../types';
...
@@ -6,6 +6,7 @@ import type { FormFields } from '../types';
import
delay
from
'
lib/delay
'
;
import
delay
from
'
lib/delay
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
FormFieldText
from
'
ui/shared/forms/fields/FormFieldText
'
;
import
FormFieldText
from
'
ui/shared/forms/fields/FormFieldText
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
...
@@ -98,20 +99,19 @@ const ContractVerificationFieldCommit = ({ latestCommitHash }: Props) => {
...
@@ -98,20 +99,19 @@ const ContractVerificationFieldCommit = ({ latestCommitHash }: Props) => {
<
FormFieldText
<
FormFields
>
<
FormFieldText
<
FormFields
>
name="commit_hash"
name="commit_hash"
placeholder="Commit hash"
placeholder="Commit hash"
isRequired
required
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
onBlur=
{
handleBlur
}
onBlur=
{
handleBlur
}
rules=
{
rules
}
rules=
{
rules
}
/
>
/
>
{
latestCommitHash
&&
(
{
latestCommitHash
?
(
<
chakra
.
div
>
<
div
>
<
span
>
We have found the latest commit hash for the repository:
</
span
>
<
span
>
We have found the latest commit hash for the repository:
</
span
>
<
Code
color=
"text_secondary"
>
{
latestCommitHash
.
slice
(
0
,
7
)
}
</
Code
>
<
Code
color=
"text_secondary"
>
{
latestCommitHash
.
slice
(
0
,
7
)
}
</
Code
>
<
span
>
. If you want to use it,
</
span
>
<
span
>
. If you want to use it,
</
span
>
<
Link
onClick=
{
handleUseLatestCommitClick
}
>
click here
</
Link
>
<
Link
onClick=
{
handleUseLatestCommitClick
}
>
click here
</
Link
>
<
span
>
.
</
span
>
<
span
>
.
</
span
>
</
chakra
.
div
>
</
div
>
)
}
)
:
null
}
</
ContractVerificationFormRow
>
</
ContractVerificationFormRow
>
);
);
};
};
...
...
ui/contractVerification/fields/ContractVerificationFieldContractIndex.tsx
View file @
64c74843
import
{
useUpdateEffect
}
from
'
@chakra-ui/react
'
;
import
{
createListCollection
,
useUpdateEffect
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
Option
}
from
'
ui/shared/forms/inputs/select/types
'
;
import
type
{
Option
}
from
'
ui/shared/forms/inputs/select/types
'
;
import
FormField
FancySelect
from
'
ui/shared/forms/fields/FormFieldFancy
Select
'
;
import
FormField
Select
from
'
ui/shared/forms/fields/FormField
Select
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
...
@@ -37,18 +37,21 @@ const ContractVerificationFieldContractIndex = () => {
...
@@ -37,18 +37,21 @@ const ContractVerificationFieldContractIndex = () => {
setOptions
([]);
setOptions
([]);
},
[
sources
]);
},
[
sources
]);
const
collection
=
React
.
useMemo
(()
=>
{
return
createListCollection
({
items
:
options
});
},
[
options
]);
if
(
options
.
length
===
0
)
{
if
(
options
.
length
===
0
)
{
return
null
;
return
null
;
}
}
return
(
return
(
<
ContractVerificationFormRow
>
<
ContractVerificationFormRow
>
<
FormField
Fancy
Select
<
FormFields
,
'
contract_index
'
>
<
FormFieldSelect
<
FormFields
,
'
contract_index
'
>
name="contract_index"
name="contract_index"
placeholder="Contract name"
placeholder="Contract name"
options=
{
options
}
collection=
{
collection
}
isRequired
required
isAsync=
{
false
}
/
>
/
>
</
ContractVerificationFormRow
>
</
ContractVerificationFormRow
>
);
);
...
...
ui/contractVerification/fields/ContractVerificationFieldGitHubRepo.tsx
View file @
64c74843
...
@@ -73,8 +73,7 @@ const ContractVerificationFieldGitHubRepo = ({ onCommitHashChange }: Props) => {
...
@@ -73,8 +73,7 @@ const ContractVerificationFieldGitHubRepo = ({ onCommitHashChange }: Props) => {
<
FormFieldUrl
<
FormFields
>
<
FormFieldUrl
<
FormFields
>
name="repository_url"
name="repository_url"
placeholder="GitHub repository URL"
placeholder="GitHub repository URL"
isRequired
required
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
onBlur=
{
handleBlur
}
onBlur=
{
handleBlur
}
rules=
{
rules
}
rules=
{
rules
}
/
>
/
>
...
...
ui/contractVerification/fields/ContractVerificationFieldSources.tsx
View file @
64c74843
import
{
Text
,
B
utton
,
B
ox
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Text
,
Box
,
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
ControllerRenderProps
,
FieldPathValue
,
ValidateResult
}
from
'
react-hook-form
'
;
import
type
{
ControllerRenderProps
,
FieldPathValue
,
ValidateResult
}
from
'
react-hook-form
'
;
import
{
Controller
,
useFormContext
}
from
'
react-hook-form
'
;
import
{
Controller
,
useFormContext
}
from
'
react-hook-form
'
;
...
@@ -6,6 +6,7 @@ import { Controller, useFormContext } from 'react-hook-form';
...
@@ -6,6 +6,7 @@ import { Controller, useFormContext } from 'react-hook-form';
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
{
Mb
}
from
'
lib/consts
'
;
import
{
Mb
}
from
'
lib/consts
'
;
import
{
Button
}
from
'
toolkit/chakra/button
'
;
import
FieldError
from
'
ui/shared/forms/components/FieldError
'
;
import
FieldError
from
'
ui/shared/forms/components/FieldError
'
;
import
DragAndDropArea
from
'
ui/shared/forms/inputs/file/DragAndDropArea
'
;
import
DragAndDropArea
from
'
ui/shared/forms/inputs/file/DragAndDropArea
'
;
import
FileInput
from
'
ui/shared/forms/inputs/file/FileInput
'
;
import
FileInput
from
'
ui/shared/forms/inputs/file/FileInput
'
;
...
...
ui/contractVerification/fields/ContractVerificationFieldZkCompiler.tsx
View file @
64c74843
import
{
Box
,
Link
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
createListCollection
}
from
'
@chakra-ui/react
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -6,8 +6,8 @@ import type { FormFields } from '../types';
...
@@ -6,8 +6,8 @@ import type { FormFields } from '../types';
import
type
{
SmartContractVerificationConfig
}
from
'
types/client/contract
'
;
import
type
{
SmartContractVerificationConfig
}
from
'
types/client/contract
'
;
import
{
getResourceKey
}
from
'
lib/api/useApiQuery
'
;
import
{
getResourceKey
}
from
'
lib/api/useApiQuery
'
;
import
FormFieldFancySelect
from
'
ui/shared/forms/fields/FormFieldFancySelect
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
FormFieldSelect
from
'
ui/shared/forms/fields/FormFieldSelect
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
...
@@ -21,25 +21,26 @@ const ContractVerificationFieldZkCompiler = () => {
...
@@ -21,25 +21,26 @@ const ContractVerificationFieldZkCompiler = () => {
config
?.
zk_compiler_versions
?.
map
((
option
)
=>
({
label
:
option
,
value
:
option
}))
||
[]
config
?.
zk_compiler_versions
?.
map
((
option
)
=>
({
label
:
option
,
value
:
option
}))
||
[]
),
[
config
?.
zk_compiler_versions
]);
),
[
config
?.
zk_compiler_versions
]);
const
loadOptions
=
React
.
useCallback
(
async
(
inputValue
:
string
)
=>
{
// TODO @tom2drum implement filtering the options
return
options
.
filter
(({
label
})
=>
!
inputValue
||
label
.
toLowerCase
().
includes
(
inputValue
.
toLowerCase
()))
const
collection
=
React
.
useMemo
(()
=>
{
const
items
=
options
// .filter(({ label }) => !inputValue || label.toLowerCase().includes(inputValue.toLowerCase()))
.
slice
(
0
,
OPTIONS_LIMIT
);
.
slice
(
0
,
OPTIONS_LIMIT
);
return
createListCollection
({
items
});
},
[
options
]);
},
[
options
]);
return
(
return
(
<
ContractVerificationFormRow
>
<
ContractVerificationFormRow
>
<
FormField
Fancy
Select
<
FormFields
,
'
zk_compiler
'
>
<
FormFieldSelect
<
FormFields
,
'
zk_compiler
'
>
name="zk_compiler"
name="zk_compiler"
placeholder="ZK compiler (enter version or use the dropdown)"
placeholder="ZK compiler (enter version or use the dropdown)"
placeholderIcon=
{
<
IconSvg
name=
"search"
/>
}
collection=
{
collection
}
loadOptions=
{
loadOptions
}
required
defaultOptions
isRequired
isAsync
/
>
/
>
<
Box
>
<
Box
>
<
Link
isE
xternal
href=
"https://docs.zksync.io/zk-stack/components/compiler/specification#glossary"
>
zksolc
</
Link
>
<
Link
e
xternal
href=
"https://docs.zksync.io/zk-stack/components/compiler/specification#glossary"
>
zksolc
</
Link
>
<
span
>
compiler version.
</
span
>
<
span
>
compiler version.
</
span
>
</
Box
>
</
Box
>
</
ContractVerificationFormRow
>
</
ContractVerificationFormRow
>
...
...
ui/contractVerification/methods/ContractVerificationSolidityFoundry.tsx
View file @
64c74843
import
{
Box
,
Flex
,
Link
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
ContractVerificationFormCodeSnippet
from
'
../ContractVerificationFormCodeSnippet
'
;
import
ContractVerificationFormCodeSnippet
from
'
../ContractVerificationFormCodeSnippet
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
...
@@ -29,7 +30,7 @@ const ContractVerificationSolidityFoundry = () => {
...
@@ -29,7 +30,7 @@ const ContractVerificationSolidityFoundry = () => {
</
Flex
>
</
Flex
>
<
Box
whiteSpace=
"pre-wrap"
>
<
Box
whiteSpace=
"pre-wrap"
>
<
span
>
Full tutorial about contract verification via Foundry on Blockscout is available
</
span
>
<
span
>
Full tutorial about contract verification via Foundry on Blockscout is available
</
span
>
<
Link
href=
"https://docs.blockscout.com/for-users/verifying-a-smart-contract/foundry-verification"
target=
"_blank"
>
<
Link
href=
"https://docs.blockscout.com/for-users/verifying-a-smart-contract/foundry-verification"
external
>
here
here
</
Link
>
</
Link
>
</
Box
>
</
Box
>
...
...
ui/contractVerification/methods/ContractVerificationSolidityHardhat.tsx
View file @
64c74843
import
{
Box
,
Flex
,
Link
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
...
@@ -6,6 +6,7 @@ import type { FormFields } from '../types';
...
@@ -6,6 +6,7 @@ import type { FormFields } from '../types';
import
type
{
SmartContractVerificationConfig
}
from
'
types/client/contract
'
;
import
type
{
SmartContractVerificationConfig
}
from
'
types/client/contract
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
ContractVerificationFormCodeSnippet
from
'
../ContractVerificationFormCodeSnippet
'
;
import
ContractVerificationFormCodeSnippet
from
'
../ContractVerificationFormCodeSnippet
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
import
ContractVerificationFormRow
from
'
../ContractVerificationFormRow
'
;
...
@@ -56,7 +57,7 @@ const ContractVerificationSolidityHardhat = ({ config: formConfig }: { config: S
...
@@ -56,7 +57,7 @@ const ContractVerificationSolidityHardhat = ({ config: formConfig }: { config: S
</
Flex
>
</
Flex
>
<
Box
whiteSpace=
"pre-wrap"
>
<
Box
whiteSpace=
"pre-wrap"
>
<
span
>
Full tutorial about contract verification via Hardhat on Blockscout is available
</
span
>
<
span
>
Full tutorial about contract verification via Hardhat on Blockscout is available
</
span
>
<
Link
href=
"https://docs.blockscout.com/for-users/verifying-a-smart-contract/hardhat-verification-plugin"
target=
"_blank"
>
<
Link
href=
"https://docs.blockscout.com/for-users/verifying-a-smart-contract/hardhat-verification-plugin"
external
>
here
here
</
Link
>
</
Link
>
</
Box
>
</
Box
>
...
...
ui/contractVerification/methods/ContractVerificationStylusGitHubRepo.tsx
View file @
64c74843
...
@@ -23,7 +23,6 @@ const ContractVerificationStylusGitHubRepo = () => {
...
@@ -23,7 +23,6 @@ const ContractVerificationStylusGitHubRepo = () => {
<
FormFieldText
<
FormFields
>
<
FormFieldText
<
FormFields
>
name="path_prefix"
name="path_prefix"
placeholder="Path prefix"
placeholder="Path prefix"
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
/
>
/
>
<
span
>
<
span
>
The crate should be located in the root directory. If it is not the case, please specify the relative path from
The crate should be located in the root directory. If it is not the case, please specify the relative path from
...
...
ui/contractVerification/methods/ContractVerificationVyperMultiPartFile.tsx
View file @
64c74843
import
{
Link
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
ContractVerificationMethod
from
'
../ContractVerificationMethod
'
;
import
ContractVerificationMethod
from
'
../ContractVerificationMethod
'
;
import
ContractVerificationFieldCompiler
from
'
../fields/ContractVerificationFieldCompiler
'
;
import
ContractVerificationFieldCompiler
from
'
../fields/ContractVerificationFieldCompiler
'
;
import
ContractVerificationFieldEvmVersion
from
'
../fields/ContractVerificationFieldEvmVersion
'
;
import
ContractVerificationFieldEvmVersion
from
'
../fields/ContractVerificationFieldEvmVersion
'
;
...
...
ui/contractVerification/utils.ts
View file @
64c74843
...
@@ -324,6 +324,10 @@ function reduceLibrariesArray(libraries: Array<ContractLibrary> | undefined) {
...
@@ -324,6 +324,10 @@ function reduceLibrariesArray(libraries: Array<ContractLibrary> | undefined) {
return
;
return
;
}
}
if
(
libraries
.
every
((
item
)
=>
item
.
name
===
''
&&
item
.
address
===
''
))
{
return
;
}
return
libraries
.
reduce
<
Record
<
string
,
string
>>
((
result
,
item
)
=>
{
return
libraries
.
reduce
<
Record
<
string
,
string
>>
((
result
,
item
)
=>
{
result
[
item
.
name
]
=
item
.
address
;
result
[
item
.
name
]
=
item
.
address
;
return
result
;
return
result
;
...
...
ui/shared/forms/components/FieldError.tsx
View file @
64c74843
...
@@ -7,7 +7,7 @@ interface Props {
...
@@ -7,7 +7,7 @@ interface Props {
}
}
const
FieldError
=
({
message
,
className
}:
Props
)
=>
{
const
FieldError
=
({
message
,
className
}:
Props
)
=>
{
return
<
Box
className=
{
className
}
color=
"error"
textStyle=
"sm"
mt=
{
2
}
wordBreak=
"break-word"
>
{
message
}
</
Box
>;
return
<
Box
className=
{
className
}
color=
"
text.
error"
textStyle=
"sm"
mt=
{
2
}
wordBreak=
"break-word"
>
{
message
}
</
Box
>;
};
};
export
default
chakra
(
FieldError
);
export
default
chakra
(
FieldError
);
ui/shared/forms/inputs/file/DragAndDropArea.tsx
View file @
64c74843
import
{
chakra
,
Center
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
chakra
,
Center
}
from
'
@chakra-ui/react
'
;
import
type
{
DragEvent
}
from
'
react
'
;
import
type
{
DragEvent
}
from
'
react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -50,8 +50,8 @@ const DragAndDropArea = ({ onDrop, children, className, isDisabled, fullFilePath
...
@@ -50,8 +50,8 @@ const DragAndDropArea = ({ onDrop, children, className, isDisabled, fullFilePath
}
}
},
[
isDisabled
]);
},
[
isDisabled
]);
const
disabledBorderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
)
;
const
disabledBorderColor
=
{
_light
:
'
blackAlpha.200
'
,
_dark
:
'
whiteAlpha.200
'
}
;
const
borderColor
=
isDragOver
?
'
link
_hovered
'
:
'
link
'
;
const
borderColor
=
isDragOver
?
'
link
.primary.hover
'
:
'
link.primary
'
;
return
(
return
(
<
Center
<
Center
...
@@ -61,7 +61,7 @@ const DragAndDropArea = ({ onDrop, children, className, isDisabled, fullFilePath
...
@@ -61,7 +61,7 @@ const DragAndDropArea = ({ onDrop, children, className, isDisabled, fullFilePath
borderWidth=
"2px"
borderWidth=
"2px"
borderColor=
{
isDisabled
?
disabledBorderColor
:
borderColor
}
borderColor=
{
isDisabled
?
disabledBorderColor
:
borderColor
}
_hover=
{
{
_hover=
{
{
borderColor
:
isDisabled
?
disabledBorderColor
:
'
link
_hovered
'
,
borderColor
:
isDisabled
?
disabledBorderColor
:
'
link
.primary.hover
'
,
}
}
}
}
borderRadius=
"base"
borderRadius=
"base"
borderStyle=
"dashed"
borderStyle=
"dashed"
...
...
ui/shared/forms/inputs/file/FileInput.tsx
View file @
64c74843
import
{
InputGroup
,
VisuallyHiddenInput
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
VisuallyHidden
}
from
'
@chakra-ui/react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
ControllerRenderProps
,
FieldValues
,
Path
}
from
'
react-hook-form
'
;
import
type
{
ControllerRenderProps
,
FieldValues
,
Path
}
from
'
react-hook-form
'
;
import
{
Input
}
from
'
toolkit/chakra/input
'
;
interface
InjectedProps
{
interface
InjectedProps
{
onChange
:
(
files
:
Array
<
File
>
)
=>
void
;
onChange
:
(
files
:
Array
<
File
>
)
=>
void
;
}
}
...
@@ -53,17 +55,12 @@ const FileInput = <Values extends FieldValues, Names extends Path<Values>>({ chi
...
@@ -53,17 +55,12 @@ const FileInput = <Values extends FieldValues, Names extends Path<Values>>({ chi
const
content
=
typeof
children
===
'
function
'
?
children
(
injectedProps
)
:
children
;
const
content
=
typeof
children
===
'
function
'
?
children
(
injectedProps
)
:
children
;
return
(
return
(
<
InputGroup
onClick=
{
handleClick
}
onBlur=
{
handleInputBlur
}
>
<
Box
onClick=
{
handleClick
}
>
<
VisuallyHiddenInput
<
VisuallyHidden
>
type=
"file"
<
Input
type=
"file"
onChange=
{
handleInputChange
}
onBlur=
{
handleInputBlur
}
ref=
{
ref
}
accept=
{
accept
}
multiple=
{
multiple
}
name=
{
field
.
name
}
/>
onChange=
{
handleInputChange
}
</
VisuallyHidden
>
ref=
{
ref
}
accept=
{
accept
}
multiple=
{
multiple
}
name=
{
field
.
name
}
/>
{
content
}
{
content
}
</
InputGroup
>
</
Box
>
);
);
}
;
}
;
...
...
ui/shared/forms/inputs/file/FileSnippet.tsx
View file @
64c74843
import
{
Box
,
Flex
,
Text
,
useColorModeValue
,
IconButton
,
chakra
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Text
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
IconButton
}
from
'
toolkit/chakra/icon-button
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -41,7 +43,6 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
...
@@ -41,7 +43,6 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
const
fileExtension
=
getFileExtension
(
file
.
name
);
const
fileExtension
=
getFileExtension
(
file
.
name
);
const
fileIcon
=
FILE_ICONS
[
fileExtension
]
||
'
files/placeholder
'
;
const
fileIcon
=
FILE_ICONS
[
fileExtension
]
||
'
files/placeholder
'
;
const
iconColor
=
useColorModeValue
(
'
gray.600
'
,
'
gray.400
'
);
return
(
return
(
<
Flex
<
Flex
...
@@ -54,11 +55,11 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
...
@@ -54,11 +55,11 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
<
IconSvg
<
IconSvg
name=
{
fileIcon
}
name=
{
fileIcon
}
boxSize=
"74px"
boxSize=
"74px"
color=
{
error
?
'
error
'
:
iconColor
}
color=
{
error
?
'
text.error
'
:
{
_light
:
'
gray.600
'
,
_dark
:
'
gray.400
'
}
}
mr=
{
2
}
mr=
{
2
}
borderWidth=
"2px"
borderWidth=
"2px"
borderRadius=
"md"
borderRadius=
"md"
borderColor=
{
useColorModeValue
(
'
blackAlpha.100
'
,
'
whiteAlpha.200
'
)
}
borderColor=
{
{
_light
:
'
blackAlpha.100
'
,
_dark
:
'
whiteAlpha.200
'
}
}
p=
{
3
}
p=
{
3
}
/>
/>
<
Box
maxW=
"calc(100% - 58px - 24px)"
>
<
Box
maxW=
"calc(100% - 58px - 24px)"
>
...
@@ -68,35 +69,34 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
...
@@ -68,35 +69,34 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
overflow=
"hidden"
overflow=
"hidden"
textOverflow=
"ellipsis"
textOverflow=
"ellipsis"
whiteSpace=
"nowrap"
whiteSpace=
"nowrap"
color=
{
error
?
'
error
'
:
'
initial
'
}
color=
{
error
?
'
text.
error
'
:
'
initial
'
}
>
>
{
file
.
name
}
{
file
.
name
}
</
Text
>
</
Text
>
{
Boolean
(
error
)
&&
(
{
Boolean
(
error
)
&&
(
<
Tooltip
<
Tooltip
label=
{
error
}
content=
{
error
}
placement=
"top"
positioning=
{
{
placement
:
'
top
'
}
}
maxW=
{
{
base
:
'
calc(100vw - 8px)
'
,
lg
:
'
320px
'
}
}
>
>
<
Box
cursor=
"pointer"
display=
"inherit"
onClick=
{
handleErrorHintIconClick
}
ml=
{
1
}
>
<
Box
cursor=
"pointer"
display=
"inherit"
onClick=
{
handleErrorHintIconClick
}
ml=
{
1
}
>
<
IconSvg
name=
"info"
boxSize=
{
5
}
color=
"error"
/>
<
IconSvg
name=
"info"
boxSize=
{
5
}
color=
"
text.
error"
/>
</
Box
>
</
Box
>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
<
IconButton
<
IconButton
aria
-
label=
"remove"
aria
-
label=
"remove"
icon=
{
<
IconSvg
name=
"cross"
boxSize=
{
6
}
/>
}
boxSize=
{
6
}
boxSize=
{
6
}
variant=
"simple"
display=
"inline-block"
display=
"inline-block"
flexShrink=
{
0
}
flexShrink=
{
0
}
ml=
"auto"
ml=
"auto"
onClick=
{
handleRemove
}
onClick=
{
handleRemove
}
isD
isabled=
{
isDisabled
}
d
isabled=
{
isDisabled
}
alignSelf=
"flex-start"
alignSelf=
"flex-start"
/>
>
<
IconSvg
name=
"cross"
boxSize=
{
6
}
/>
</
IconButton
>
</
Flex
>
</
Flex
>
<
Text
variant=
"
secondary"
mt=
{
1
}
>
<
Text
color=
"text.
secondary"
mt=
{
1
}
>
{
file
.
size
.
toLocaleString
(
undefined
,
{
notation
:
'
compact
'
,
maximumFractionDigits
:
2
,
unit
:
'
byte
'
,
unitDisplay
:
'
narrow
'
,
style
:
'
unit
'
})
}
{
file
.
size
.
toLocaleString
(
undefined
,
{
notation
:
'
compact
'
,
maximumFractionDigits
:
2
,
unit
:
'
byte
'
,
unitDisplay
:
'
narrow
'
,
style
:
'
unit
'
})
}
</
Text
>
</
Text
>
</
Box
>
</
Box
>
...
...
ui/tx/details/TxInfo.tsx
View file @
64c74843
...
@@ -124,7 +124,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
...
@@ -124,7 +124,7 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
const
executionFailedBadge
=
toAddress
?.
is_contract
&&
Boolean
(
data
.
status
)
&&
data
.
result
!==
'
success
'
?
(
const
executionFailedBadge
=
toAddress
?.
is_contract
&&
Boolean
(
data
.
status
)
&&
data
.
result
!==
'
success
'
?
(
<
Tooltip
content=
"Error occurred during contract execution"
>
<
Tooltip
content=
"Error occurred during contract execution"
>
<
chakra
.
span
display=
"inline-flex"
ml=
{
2
}
mr=
{
1
}
>
<
chakra
.
span
display=
"inline-flex"
ml=
{
2
}
mr=
{
1
}
>
<
IconSvg
name=
"status/error"
boxSize=
{
4
}
color=
"error"
cursor=
"pointer"
/>
<
IconSvg
name=
"status/error"
boxSize=
{
4
}
color=
"
text.
error"
cursor=
"pointer"
/>
</
chakra
.
span
>
</
chakra
.
span
>
</
Tooltip
>
</
Tooltip
>
)
:
null
;
)
:
null
;
...
...
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