Skip to content

Commit 31d43e1

Browse files
authored
Merge branch 'master' into delFS
2 parents 0fcce58 + ec94174 commit 31d43e1

File tree

94 files changed

+673
-309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+673
-309
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
2727
- OS: [e.g. Windows, Linux or MacOS]
28-
- Browser [e.g. chrome, firefox]
29-
- Version [e.g. 22]
28+
- Browser: [e.g. chrome, firefox]
29+
- Version: [e.g. 22]
3030

3131
**Additional context**
3232
Add any other context about the problem here.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.gg/mh9hFCKkEq).
3+
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.com/invite/nfv6ZYjAeP).
44

55
## Development
66
Remix libraries work closely with [Remix IDE](https://remix.ethereum.org). Each library has a README to explain its application.
@@ -72,7 +72,7 @@ import panelJson from './panel.json';
7272
import enJson from '../en';
7373

7474
// There may have some untranslated content. Always fill in the gaps with EN JSON.
75-
// No need for a defaultMessage prop when render a FormattedMessage component.
75+
// No need for a defaultMessage prop when rendering a FormattedMessage component.
7676
export default Object.assign({}, enJson, {
7777
...panelJson,
7878
})

apps/circuit-compiler/src/app/services/circomPluginClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ export class CircomPluginClient extends PluginClient {
502502
const exists = await this.call('fileManager', 'exists', path)
503503

504504
if (exists) return path
505-
else throw new Error(`Report path ${path} do no exist in the Remix FileSystem`)
505+
else throw new Error(`Report path ${path} does not exist in the Remix FileSystem`)
506506
} else {
507-
throw new Error(`Report path ${path} do no exist in the Remix FileSystem`)
507+
throw new Error(`Report path ${path} does not exist in the Remix FileSystem`)
508508
}
509509
}
510510
}

apps/circuit-compiler/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = composePlugins(withNx(), (config) => {
5555
})
5656
)
5757

58-
// souce-map loader
58+
// source-map loader
5959
config.module.rules.push({
6060
test: /\.js$/,
6161
use: ["source-map-loader"],

apps/contract-verification/src/app/app.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { CompilerAbstract } from '@remix-project/remix-solidity'
1313
import { useLocalStorage } from './hooks/useLocalStorage'
1414
import { getVerifier } from './Verifiers'
1515
import { ContractDropdownSelection } from './components/ContractDropdown'
16+
import { IntlProvider } from 'react-intl'
1617

1718
const plugin = new ContractVerificationPluginClient()
1819

@@ -32,11 +33,25 @@ const App = () => {
3233
const [proxyAddressError, setProxyAddressError] = useState('')
3334
const [abiEncodedConstructorArgs, setAbiEncodedConstructorArgs] = useState<string>('')
3435
const [abiEncodingError, setAbiEncodingError] = useState<string>('')
36+
const [locale, setLocale] = useState<{ code: string; messages: any }>({
37+
code: 'en',
38+
messages: {}
39+
})
3540

3641
const timer = useRef(null)
3742

3843
useEffect(() => {
3944
plugin.internalEvents.on('verification_activated', () => {
45+
46+
// @ts-ignore
47+
plugin.call('locale', 'currentLocale').then((locale: any) => {
48+
setLocale(locale)
49+
})
50+
51+
// @ts-ignore
52+
plugin.on('locale', 'localeChanged', (locale: any) => {
53+
setLocale(locale)
54+
})
4055
// Fetch compiler artefacts initially
4156
plugin.call('compilerArtefacts' as any, 'getAllCompilerAbstracts').then((obj: any) => {
4257
setCompilationOutput(obj)
@@ -143,11 +158,13 @@ const App = () => {
143158
}, [submittedContracts])
144159

145160
return (
146-
<AppContext.Provider value={{ themeType, setThemeType, clientInstance: plugin, settings, setSettings, chains, compilationOutput, submittedContracts, setSubmittedContracts }}>
147-
<VerifyFormContext.Provider value={{ selectedChain, setSelectedChain, contractAddress, setContractAddress, contractAddressError, setContractAddressError, selectedContract, setSelectedContract, proxyAddress, setProxyAddress, proxyAddressError, setProxyAddressError, abiEncodedConstructorArgs, setAbiEncodedConstructorArgs, abiEncodingError, setAbiEncodingError }}>
148-
<DisplayRoutes />
149-
</VerifyFormContext.Provider>
150-
</AppContext.Provider>
161+
<IntlProvider locale={locale.code} messages={locale.messages}>
162+
<AppContext.Provider value={{ themeType, setThemeType, clientInstance: plugin, settings, setSettings, chains, compilationOutput, submittedContracts, setSubmittedContracts }}>
163+
<VerifyFormContext.Provider value={{ selectedChain, setSelectedChain, contractAddress, setContractAddress, contractAddressError, setContractAddressError, selectedContract, setSelectedContract, proxyAddress, setProxyAddress, proxyAddressError, setProxyAddressError, abiEncodedConstructorArgs, setAbiEncodedConstructorArgs, abiEncodingError, setAbiEncodingError }}>
164+
<DisplayRoutes />
165+
</VerifyFormContext.Provider>
166+
</AppContext.Provider>
167+
</IntlProvider>
151168
)
152169
}
153170

apps/contract-verification/src/app/components/AccordionReceipt.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,32 @@ const ReceiptsBody = ({ receipts }: { receipts: VerificationReceipt[] }) => {
9797
className="list-group-item d-flex flex-row align-items-center"
9898
>
9999
<CustomTooltip
100-
placement="top"
101-
tooltipClasses=" text-break"
102-
tooltipTextClasses="text-capitalize"
103-
tooltipText={`Status: ${receipt.status}${receipt.message ? `, Message: ${receipt.message}` : ''}`}
104-
>
105-
<span className="mr-2">
106-
{['verified', 'partially verified', 'already verified'].includes(receipt.status) ?
107-
<i className="fas fa-check text-success px-1"></i> :
108-
receipt.status === 'fully verified' ?
109-
<i className="fas fa-check-double text-success px-1"></i> :
110-
receipt.status === 'failed' ?
111-
<i className="fas fa-xmark text-warning px-1"></i> :
112-
['pending', 'awaiting implementation verification'].includes(receipt.status) ?
113-
<i className="fas fa-spinner fa-spin"></i> :
114-
<i className="fas fa-question"></i>
115-
}
116-
</span>
117-
</CustomTooltip>
118-
<div className="d-flex flex-row w-100 justify-content-between">
100+
placement="top"
101+
tooltipClasses=" text-break"
102+
tooltipTextClasses="text-capitalize"
103+
tooltipText={`Status: ${receipt.status}${receipt.message ? `, Message: ${receipt.message}` : ''}`}
104+
>
105+
<span className="mr-2">
106+
{['verified', 'partially verified', 'already verified'].includes(receipt.status) ?
107+
<i className="fas fa-check text-success px-1"></i> :
108+
receipt.status === 'fully verified' ?
109+
<i className="fas fa-check-double text-success px-1"></i> :
110+
receipt.status === 'failed' ?
111+
<i className="fas fa-xmark text-warning px-1"></i> :
112+
['pending', 'awaiting implementation verification'].includes(receipt.status) ?
113+
<i className="fas fa-spinner fa-spin"></i> :
114+
<i className="fas fa-question"></i>
115+
}
116+
</span>
117+
</CustomTooltip>
118+
<div className="d-flex flex-row w-100 justify-content-between">
119119
<CustomTooltip placement="top" tooltipClasses=" text-break" tooltipText={`API: ${receipt.verifierInfo.apiUrl}`}>
120120
<span className="font-weight-bold pr-2">{receipt.verifierInfo.name}</span>
121121
</CustomTooltip>
122122
<div className="ml-1">
123123
{!!receipt.lookupUrl && receipt.verifierInfo.name === 'Blockscout' ?
124124
<CopyToClipboard classList="pr-0 py-0" tip="Copy code URL" content={receipt.lookupUrl} direction="top" /> :
125-
!!receipt.lookupUrl && <a href={receipt.lookupUrl} target="_blank" className="fa fas fa-arrow-up-right-from-square"></a>
125+
!!receipt.lookupUrl && <a href={receipt.lookupUrl} target="_blank" className="fa fas fa-arrow-up-right-from-square" rel="noreferrer"></a>
126126
}
127127
</div>
128128
</div>

apps/contract-verification/src/app/components/ConfigInput.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useEffect, useState } from 'react'
22
import { CustomTooltip } from '@remix-ui/helper'
3+
import { FormattedMessage, useIntl } from 'react-intl'
34

45
interface ConfigInputProps {
56
label: string
@@ -13,6 +14,7 @@ interface ConfigInputProps {
1314
export const ConfigInput: React.FC<ConfigInputProps> = ({ label, id, secret, initialValue, saveResult }) => {
1415
const [value, setValue] = useState(initialValue)
1516
const [enabled, setEnabled] = useState(false)
17+
const intl = useIntl()
1618

1719
// Reset state when initialValue changes
1820
useEffect(() => {
@@ -42,7 +44,7 @@ export const ConfigInput: React.FC<ConfigInputProps> = ({ label, id, secret, ini
4244
type={secret ? 'password' : 'text'}
4345
className={`form-control small w-100 ${!enabled ? 'bg-transparent pl-0 border-0' : ''}`}
4446
id={id}
45-
placeholder={`Add ${label}`}
47+
placeholder={intl.formatMessage({ id: "contract-verification.configInputPlaceholder" }, { label })}
4648
value={value}
4749
onChange={(e) => setValue(e.target.value)}
4850
disabled={!enabled}
@@ -51,10 +53,10 @@ export const ConfigInput: React.FC<ConfigInputProps> = ({ label, id, secret, ini
5153
{ enabled ? (
5254
<>
5355
<button type="button" className="btn btn-primary btn-sm ml-2" onClick={handleSave}>
54-
Save
56+
<FormattedMessage id="contract-verification.configInputSaveButton" />
5557
</button>
5658
<button type="button" className="btn btn-secondary btn-sm ml-2" onClick={handleCancel}>
57-
Cancel
59+
<FormattedMessage id="contract-verification.configInputCancelButton" />
5860
</button>
5961
</>
6062
) : (

apps/contract-verification/src/app/components/ConstructorArguments.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ethers } from 'ethers'
33

44
import { AppContext } from '../AppContext'
55
import { ContractDropdownSelection } from './ContractDropdown'
6+
import { FormattedMessage } from 'react-intl'
67

78
interface ConstructorArgumentsProps {
89
abiEncodedConstructorArgs: string
@@ -102,7 +103,9 @@ export const ConstructorArguments: React.FC<ConstructorArgumentsProps> = ({ abiE
102103
<div className="d-flex py-1 align-items-center custom-control custom-checkbox">
103104
<input className="form-check-input custom-control-input" type="checkbox" id="toggleRawInputSwitch" checked={toggleRawInput} onChange={() => setToggleRawInput(!toggleRawInput)} />
104105
<label className="m-0 form-check-label custom-control-label" style={{ paddingTop: '2px' }} htmlFor="toggleRawInputSwitch">
105-
Enter raw ABI-encoded constructor arguments
106+
<FormattedMessage
107+
id="contract-verification.constructorArgumentsToggleRawInput"
108+
/>
106109
</label>
107110
</div>
108111
{toggleRawInput ? (
@@ -122,7 +125,10 @@ export const ConstructorArguments: React.FC<ConstructorArgumentsProps> = ({ abiE
122125
{abiEncodedConstructorArgs && (
123126
<div>
124127
<label className="form-check-label" htmlFor="rawAbiEncodingResult">
125-
ABI-encoded constructor arguments:
128+
<FormattedMessage
129+
id="contract-verification.constructorArgumentsRawAbiEncodingResult"
130+
defaultMessage="ABI-encoded constructor arguments"
131+
/> :
126132
</label>
127133
<textarea className="form-control" rows={5} disabled value={abiEncodedConstructorArgs} id="rawAbiEncodingResult" style={{ opacity: 0.5 }} />
128134
</div>

apps/contract-verification/src/app/components/ContractAddressInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React, { useEffect, useState, useContext } from 'react'
22
import { ethers } from 'ethers/'
33

44
interface ContractAddressInputProps {
5-
label: string
5+
label: string | any
66
id: string
77
contractAddress: string
88
setContractAddress: (address: string) => void
9-
contractAddressError: string
9+
contractAddressError: string | any
1010
setContractAddressError: (error: string) => void
1111
}
1212

apps/contract-verification/src/app/components/ContractDropdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useEffect, useState, useContext, Fragment } from 'react'
22
import './ContractDropdown.css'
33
import { AppContext } from '../AppContext'
4+
import { FormattedMessage } from 'react-intl'
45

56
export interface ContractDropdownSelection {
67
triggerFilePath: string
@@ -42,7 +43,7 @@ export const ContractDropdown: React.FC<ContractDropdownProps> = ({ label, id, s
4243

4344
return (
4445
<div className="form-group">
45-
<label htmlFor={id}>{label}</label>
46+
<label htmlFor={id}><FormattedMessage id="contract-verification.contractDropdownLabel" defaultMessage={label} values={{ label }} /></label>
4647
<select value={selectedContract ? JSON.stringify(selectedContract) : ''}
4748
className={`form-control custom-select pr-4 ${!hasContracts ? 'disabled-cursor text-warning' : ''}`}
4849
id={id}
@@ -65,7 +66,7 @@ export const ContractDropdown: React.FC<ContractDropdownProps> = ({ label, id, s
6566
</optgroup>
6667
))
6768
) : (
68-
<option>Compiled contract required</option>
69+
<option value={''}><FormattedMessage id="contract-verification.contractDropDownDefaultText" defaultMessage={'Compiled contract required'} /></option>
6970
)}
7071
</select>
7172
</div>

0 commit comments

Comments
 (0)