diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be04f3359d..a603101311 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,11 @@ # Contributing -Everyone is very welcome to contribute on the codebase of Remix. Please reach us in [Gitter](https://gitter.im/ethereum/remix) in case of any queries. +Everyone is very welcome to contribute on the codebase of Remix. Please join our [Discord](https://discord.gg/mh9hFCKkEq) in case of any queries. ## Development Remix libraries work closely with [Remix IDE](https://remix.ethereum.org). Each library has a readme to explain its application. -When you add a code in any library, please ensure you add related tests. You can visit [here](https://github.com/ethereum/remix-ide#installation) to test your changes by linking the remix libraries with Remix IDE. +When you add a code in any library, please ensure you add related unit tests. ## Coding style @@ -101,7 +101,7 @@ Well, that depends. If you update an old json file, then you don't need to update it in other languages, because crowdin will do it for you. -But if you add a new json file, then you have to add it in other languages, and import it in `index.js` of all languages. Because crowdin will not update `index.js`, you have to do it manually. +But if you add a new json file, only English is needed. ### How to contribute on translations? Remix is using crowdin to manage translations. If you want to contribute on that, you can do it on crowdin. Check the link below. @@ -110,4 +110,4 @@ https://crowdin.com/project/remix-translation There are many languages, just get into your language, and you will see a folder named `Remix UI`, where you can do the translations. -Not only can you do the translations, you can also review it. If you agree or disagree with some translations, you can vote yes or no. If you vote no, you can comment to explain why you vote no, and give your translation. +Not only you can do the translations, you can also review it. If you agree or disagree with some translations, you can vote YES or NO. If you vote NO, you can comment to explain why you vote NO, and give your translation. diff --git a/README.md b/README.md index e903b3c03f..baec594045 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/ethereum/remix-project?style=flat&logo=github)](https://github.com/ethereum/remix-project/blob/master/CONTRIBUTING.md) [![Awesome Remix](https://img.shields.io/badge/Awesome--Remix-resources-green?logo=awesomelists)](https://github.com/ethereum/awesome-remix) ![GitHub](https://img.shields.io/github/license/ethereum/remix-project) -[![Discord](https://img.shields.io/badge/join-discord-brightgreen.svg?style=flat&logo=discord)](https://discord.gg/q4vS2GVn) +[![Discord](https://img.shields.io/badge/join-discord-brightgreen.svg?style=flat&logo=discord)](https://discord.gg/mh9hFCKkEq) [![Twitter Follow](https://img.shields.io/twitter/follow/ethereumremix?style=flat&logo=twitter&color=green)](https://twitter.com/ethereumremix) @@ -286,4 +286,4 @@ parameters: - Curated list of Remix resources: https://github.com/ethereum/awesome-remix - Medium: https://medium.com/remix-ide - Twitter: https://twitter.com/ethereumremix -- Join Discord: https://discord.gg/q4vS2GVn +- Join Discord: https://discord.gg/mh9hFCKkEq diff --git a/apps/circuit-compiler/src/app/components/compileBtn.tsx b/apps/circuit-compiler/src/app/components/compileBtn.tsx index c778377cc1..30f0b2890c 100644 --- a/apps/circuit-compiler/src/app/components/compileBtn.tsx +++ b/apps/circuit-compiler/src/app/components/compileBtn.tsx @@ -8,12 +8,7 @@ export function CompileBtn () { const { plugin, appState } = useContext(CircuitAppContext) return ( - + + ) } \ No newline at end of file diff --git a/apps/circuit-compiler/src/app/services/circomPluginClient.ts b/apps/circuit-compiler/src/app/services/circomPluginClient.ts index 4d887e996b..8cf855d5ff 100644 --- a/apps/circuit-compiler/src/app/services/circomPluginClient.ts +++ b/apps/circuit-compiler/src/app/services/circomPluginClient.ts @@ -256,6 +256,7 @@ export class CircomPluginClient extends PluginClient { if (depPath) { // if depPath is provided, try to resolve include import from './deps' folder in remix path = pathModule.resolve(depPath.slice(0, depPath.lastIndexOf('/')), include) + path = path.replace('https:/', 'https://') if (path.indexOf('/') === 0) path = path.slice(1) dependencyContent = await this.call('contentImport', 'resolveAndSave', path, null) } else { diff --git a/apps/etherscan/src/app/utils/networks.ts b/apps/etherscan/src/app/utils/networks.ts index 009c81a0c3..5609971a3f 100644 --- a/apps/etherscan/src/app/utils/networks.ts +++ b/apps/etherscan/src/app/utils/networks.ts @@ -16,6 +16,7 @@ export const scanAPIurls = { 100: 'https://api.gnosisscan.io/api', 1101: 'https://api-zkevm.polygonscan.com/api', 59144: 'https://api.lineascan.build/api', + 8453: 'https://api.basescan.org/api', // all testnet 5: 'https://api-goerli.etherscan.io/api', diff --git a/apps/remix-ide-e2e/src/tests/homeTab.test.ts b/apps/remix-ide-e2e/src/tests/homeTab.test.ts index 7285556078..2c009d65b5 100644 --- a/apps/remix-ide-e2e/src/tests/homeTab.test.ts +++ b/apps/remix-ide-e2e/src/tests/homeTab.test.ts @@ -12,6 +12,6 @@ module.exports = { browser .waitForElementVisible('*[data-id="homeTabStartCoding"]') .click('*[data-id="homeTabStartCoding"]') - .waitForElementVisible('div[data-id="treeViewDivtreeViewItemcontracts/helloWorld.sol"]') + .waitForElementVisible('div[data-id="treeViewDivtreeViewItemcontracts/HelloWorld.sol"]') } } \ No newline at end of file diff --git a/apps/remix-ide/src/app/tabs/locales/en/home.json b/apps/remix-ide/src/app/tabs/locales/en/home.json index 76578a4db8..bf51810b49 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/home.json +++ b/apps/remix-ide/src/app/tabs/locales/en/home.json @@ -57,7 +57,7 @@ "home.files": "Files", "home.newFile": "New File", "home.startCoding": "Start Coding", - "home.startCodingPlayground": "Open a playground for prototyping and simply learning", + "home.startCodingPlayground": "Open a playground for prototyping and simple learning", "home.openFile": "Open File", "home.openFileTooltip": "Open a File from your File System", "home.accessFileSystem": "Access File System", diff --git a/libs/remix-lib/src/execution/txExecution.ts b/libs/remix-lib/src/execution/txExecution.ts index cad6ddaf8e..e7eb879c74 100644 --- a/libs/remix-lib/src/execution/txExecution.ts +++ b/libs/remix-lib/src/execution/txExecution.ts @@ -82,8 +82,8 @@ export function checkError (execResult, compiledContracts) { const exceptionError = execResult.errorMessage || '' const error = `Error occured: ${execResult.errorMessage}.\n` let msg = '' - if (exceptionError === errorCode.INVALID_OPCODE) { - msg = '\t\n\tThe execution might have thrown.\n' + if (exceptionError.includes(errorCode.INVALID_OPCODE)) { + msg = '\t\n\tThe execution might have thrown OR the EVM version used by the selected environment is not compatible with the compiler EVM version.\n' ret.error = true } else if (exceptionError === errorCode.OUT_OF_GAS) { msg = '\tThe transaction ran out of gas. Please increase the Gas Limit.\n' @@ -173,4 +173,4 @@ export function checkError (execResult, compiledContracts) { } ret.message = `${error}\n${exceptionError}\n${msg}\nDebug the transaction to get more information.` return ret -} \ No newline at end of file +} diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx index 41d0e13f23..483de9ed54 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -142,19 +142,22 @@ function HomeTabFile({ plugin }: HomeTabFileProps) { await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) await plugin.call('filePanel', 'switchToWorkspace', { name: wName, isLocalHost: false }) // calling once is not working. const content = `// SPDX-License-Identifier: MIT - pragma solidity >=0.6.12 <0.9.0; +pragma solidity >=0.6.12 <0.9.0; - contract HelloWorld { - function print() public pure returns (string memory) { - return "Hello World!"; - } - } +contract HelloWorld { + /** + * @dev Prints Hello World string + */ + function print() public pure returns (string memory) { + return "Hello World!"; + } +} ` if (createFile) { - const { newPath } = await plugin.call('fileManager', 'writeFileNoRewrite', '/contracts/helloWorld.sol', content) + const { newPath } = await plugin.call('fileManager', 'writeFileNoRewrite', '/contracts/HelloWorld.sol', content) await plugin.call('fileManager', 'open', newPath) } else { - await plugin.call('fileManager', 'open', '/contracts/helloWorld.sol') + await plugin.call('fileManager', 'open', '/contracts/HelloWorld.sol') } } diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx new file mode 100644 index 0000000000..2baa737ad2 --- /dev/null +++ b/libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx @@ -0,0 +1,45 @@ +import React, { useEffect, useState } from 'react' +import { Dropdown, DropdownButton } from 'react-bootstrap' +import DropdownItem from 'react-bootstrap/DropdownItem' +import { localeLang } from './types/carouselTypes' + + + +export function LanguageOptions({ plugin }: { plugin: any }) { + const [langOptions, setLangOptions] = useState() + + const changeLanguage = async (lang: string) => { + await plugin.call('locale', 'switchLocale', lang) + } + + useEffect(() => { + plugin.call('locale', 'currentLocale').then(opt => { + setLangOptions(opt.code.toUpperCase()) + }) + }, [langOptions]) + + useEffect(() => { + plugin.on('locale', 'localeChanged', (lang: localeLang) => { + setLangOptions(lang.code.toUpperCase()) + }) + }, [langOptions]) + + return ( + <> +
+ + {['EN', 'ES', 'FR', 'ZH'].map(lang => ( + + { + changeLanguage(lang.toLowerCase()) + setLangOptions(lang) + }} + > + {lang} + + ))} + +
+ + ) +} diff --git a/libs/remix-ui/home-tab/src/lib/components/types/carouselTypes.ts b/libs/remix-ui/home-tab/src/lib/components/types/carouselTypes.ts index 128815d979..1e922f7a83 100644 --- a/libs/remix-ui/home-tab/src/lib/components/types/carouselTypes.ts +++ b/libs/remix-ui/home-tab/src/lib/components/types/carouselTypes.ts @@ -114,3 +114,10 @@ export default class Carousel extends React.Component { direction: Direction; containerRef: React.RefObject; } + +export type localeLang = { + code: string + localeName: string + messages: { [key: string]: string } + name: string +} diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx index a6f3257675..116e724ab6 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx @@ -11,6 +11,7 @@ import HomeTabFeatured from './components/homeTabFeatured' import HomeTabFeaturedPlugins from './components/homeTabFeaturedPlugins' import isElectron from 'is-electron' import { HomeTabFileElectron } from './components/homeTabFileElectron' +import { LanguageOptions } from './components/homeTablangOptions' declare global { interface Window { @@ -64,6 +65,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
+ diff --git a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts index 83a75a3085..08d3e10af4 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts @@ -119,8 +119,10 @@ const getConfirmationCb = (plugin: RunTab, dispatch: React.Dispatch, confir export const continueHandler = (dispatch: React.Dispatch, gasEstimationPrompt: (msg: string) => JSX.Element, error, continueTxExecution, cancelCb) => { if (error) { - const msg = typeof error !== 'string' ? error.message : error - + let msg = typeof error !== 'string' ? error.message : error + + if (msg.includes('invalid opcode')) msg += '\n OR the EVM version used by the selected environment is not compatible with the compiler EVM version.' + dispatch(displayNotification('Gas estimation failed', gasEstimationPrompt(msg), 'Send Transaction', 'Cancel Transaction', () => { continueTxExecution() }, () => { diff --git a/libs/remix-ws-templates/src/templates/playground/contracts/helloWorld.sol b/libs/remix-ws-templates/src/templates/playground/contracts/HelloWorld.sol similarity index 77% rename from libs/remix-ws-templates/src/templates/playground/contracts/helloWorld.sol rename to libs/remix-ws-templates/src/templates/playground/contracts/HelloWorld.sol index 47fabd793a..9ad0641975 100644 --- a/libs/remix-ws-templates/src/templates/playground/contracts/helloWorld.sol +++ b/libs/remix-ws-templates/src/templates/playground/contracts/HelloWorld.sol @@ -2,7 +2,10 @@ pragma solidity >=0.6.12 <0.9.0; contract HelloWorld { + /** + * @dev Prints Hello World string + */ function print() public pure returns (string memory) { return "Hello World!"; } -} \ No newline at end of file +} diff --git a/libs/remix-ws-templates/src/templates/playground/index.ts b/libs/remix-ws-templates/src/templates/playground/index.ts index 52e33a5a43..f5e1638484 100644 --- a/libs/remix-ws-templates/src/templates/playground/index.ts +++ b/libs/remix-ws-templates/src/templates/playground/index.ts @@ -1,7 +1,7 @@ export default async () => { return { // @ts-ignore - 'contracts/helloWorld.sol': (await import('raw-loader!./contracts/helloWorld.sol')).default, + 'contracts/HelloWorld.sol': (await import('raw-loader!./contracts/HelloWorld.sol')).default, // @ts-ignore 'scripts/deploy_with_ethers.ts': (await import('!!raw-loader!./scripts/deploy_with_ethers.ts')).default, // @ts-ignore diff --git a/team-best-practices.md b/team-best-practices.md index a05714dc5d..d9b4b8baec 100644 --- a/team-best-practices.md +++ b/team-best-practices.md @@ -20,10 +20,7 @@ Related links: - Remix-debug NPM module: https://www.npmjs.com/package/@remix-project/remix-debug - Remix-tests NPM module: https://www.npmjs.com/package/@remix-project/remix-tests - Remix documentation: http://remix-ide.readthedocs.io/en/latest/ - - General gitter channel: https://gitter.im/ethereum/remix - - Dev gitter channel: https://gitter.im/ethereum/remix-dev - - Dev plugin gitter channel: https://gitter.im/ethereum/remix-dev-plugin - + - Discord: https://discord.gg/mh9hFCKkEq --- @@ -187,4 +184,4 @@ Before starting coding, we should ensure all devs / contributors are aware of: # Coding best practices - - https://github.com/ethereum/remix-project/blob/master/best-practices.md + - https://github.com/ethereum/remix-project/blob/master/CONTRIBUTING.md