Merge branch 'master' into fix-dark-theme-highlight-II

pull/1427/head
rorye 3 years ago committed by GitHub
commit c2d01b441b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/remix-ide-e2e/src/commands/verifyContracts.ts
  2. 4
      apps/remix-ide/src/app.js
  3. 18
      apps/remix-ide/src/app/ui/landing-page/landing-page.js
  4. BIN
      apps/remix-ide/src/assets/img/optimismLogo.webp
  5. 6
      libs/remix-analyzer/package.json
  6. 6
      libs/remix-astwalker/package.json
  7. 6
      libs/remix-debug/package.json
  8. 4
      libs/remix-lib/package.json
  9. 6
      libs/remix-simulator/package.json
  10. 6
      libs/remix-solidity/package.json
  11. 10
      libs/remix-tests/package.json
  12. 26
      libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx
  13. 2
      libs/remix-ui/solidity-compiler/src/lib/actions/compiler.ts
  14. 38
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  15. 14
      libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx
  16. 7
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
  17. 4
      libs/remix-url-resolver/package.json
  18. 2
      libs/remixd/package.json
  19. 6
      libs/remixd/src/services/slitherClient.ts

@ -22,6 +22,9 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str
if (opts.version) { if (opts.version) {
browser browser
.click('*[data-id="compilation-details"]') .click('*[data-id="compilation-details"]')
.waitForElementVisible('*[data-id="remixui_treeviewitem_metadata"]')
.pause(2000)
.click('*[data-id="remixui_treeviewitem_metadata"]')
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemcompiler"]') .waitForElementVisible('*[data-id="treeViewDivtreeViewItemcompiler"]')
.pause(2000) .pause(2000)
.click('*[data-id="treeViewDivtreeViewItemcompiler"]') .click('*[data-id="treeViewDivtreeViewItemcompiler"]')

@ -419,6 +419,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
fn: null fn: null
} }
) )
} else {
startWalkthroughService()
} }
// CONTENT VIEWS & DEFAULT PLUGINS // CONTENT VIEWS & DEFAULT PLUGINS
@ -514,6 +516,4 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
if (params.embed) framingService.embed() if (params.embed) framingService.embed()
framingService.start(params) framingService.start(params)
startWalkthroughService()
} }

@ -216,7 +216,7 @@ export class LandingPage extends ViewPlugin {
const invertNum = (themeQuality === 'dark') ? 1 : 0 const invertNum = (themeQuality === 'dark') ? 1 : 0
if (this.solEnv.getElementsByTagName('img')[0]) this.solEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` if (this.solEnv.getElementsByTagName('img')[0]) this.solEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
if (this.debuggerEnv.getElementsByTagName('img')[0]) this.debuggerEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` if (this.optimismEnv.getElementsByTagName('img')[0]) this.optimismEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
if (this.solhintEnv.getElementsByTagName('img')[0]) this.solhintEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` if (this.solhintEnv.getElementsByTagName('img')[0]) this.solhintEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
if (this.learnEthEnv.getElementsByTagName('img')[0]) this.learnEthEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` if (this.learnEthEnv.getElementsByTagName('img')[0]) this.learnEthEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
if (this.sourcifyEnv.getElementsByTagName('img')[0]) this.sourcifyEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` if (this.sourcifyEnv.getElementsByTagName('img')[0]) this.sourcifyEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
@ -277,10 +277,10 @@ export class LandingPage extends ViewPlugin {
this.verticalIcons.select('solidity') this.verticalIcons.select('solidity')
_paq.push(['trackEvent', 'pluginManager', 'userActivate', 'solidity']) _paq.push(['trackEvent', 'pluginManager', 'userActivate', 'solidity'])
} }
const startDebugger = async () => { const startOptimism = async () => {
await this.appManager.activatePlugin('debugger') await this.appManager.activatePlugin('optimism-compiler')
this.verticalIcons.select('debugger') this.verticalIcons.select('optimism-compiler')
_paq.push(['trackEvent', 'pluginManager', 'userActivate', 'debugger']) _paq.push(['trackEvent', 'pluginManager', 'userActivate', 'optimism-compiler'])
} }
const startSolhint = async () => { const startSolhint = async () => {
await this.appManager.activatePlugin(['solidity', 'solhint']) await this.appManager.activatePlugin(['solidity', 'solhint'])
@ -385,8 +385,8 @@ export class LandingPage extends ViewPlugin {
// main // main
this.solEnv = createLargeButton('assets/img/solidityLogo.webp', 'solidityLogo', 'Solidity', startSolidity) this.solEnv = createLargeButton('assets/img/solidityLogo.webp', 'solidityLogo', 'Solidity', startSolidity)
// Featured // Featured
this.debuggerEnv = createLargeButton('assets/img/debuggerLogo.webp', 'debuggerLogo', 'Debugger', startDebugger) this.optimismEnv = createLargeButton('assets/img/optimismLogo.webp', 'optimismLogo', 'Optimism', startOptimism)
this.solhintEnv = createLargeButton('assets/img/solhintLogo.png', 'solhintLogo', 'solhint linter', startSolhint) this.solhintEnv = createLargeButton('assets/img/solhintLogo.png', 'solhintLogo', 'Solhint linter', startSolhint)
this.learnEthEnv = createLargeButton('assets/img/learnEthLogo.webp', 'learnEthLogo', 'LearnEth', startLearnEth) this.learnEthEnv = createLargeButton('assets/img/learnEthLogo.webp', 'learnEthLogo', 'LearnEth', startLearnEth)
this.sourcifyEnv = createLargeButton('assets/img/sourcifyLogo.webp', 'sourcifyLogo', 'Sourcify', startSourceVerify) this.sourcifyEnv = createLargeButton('assets/img/sourcifyLogo.webp', 'sourcifyLogo', 'Sourcify', startSourceVerify)
this.moreEnv = createLargeButton('assets/img/moreLogo.webp', 'moreLogo', 'More', startPluginManager) this.moreEnv = createLargeButton('assets/img/moreLogo.webp', 'moreLogo', 'More', startPluginManager)
@ -395,7 +395,7 @@ export class LandingPage extends ViewPlugin {
const themeQuality = globalRegistry.get('themeModule').api.currentTheme().quality const themeQuality = globalRegistry.get('themeModule').api.currentTheme().quality
const invertNum = (themeQuality === 'dark') ? 1 : 0 const invertNum = (themeQuality === 'dark') ? 1 : 0
this.solEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` this.solEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
this.debuggerEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` this.optimismEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
this.solhintEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` this.solhintEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
this.learnEthEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` this.learnEthEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
this.sourcifyEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})` this.sourcifyEnv.getElementsByTagName('img')[0].style.filter = `invert(${invertNum})`
@ -505,10 +505,10 @@ export class LandingPage extends ViewPlugin {
<h4>Featured Plugins</h4> <h4>Featured Plugins</h4>
<div class="d-flex flex-row pt-2"> <div class="d-flex flex-row pt-2">
${this.solEnv} ${this.solEnv}
${this.optimismEnv}
${this.learnEthEnv} ${this.learnEthEnv}
${this.solhintEnv} ${this.solhintEnv}
${this.sourcifyEnv} ${this.sourcifyEnv}
${this.debuggerEnv}
${this.moreEnv} ${this.moreEnv}
</div> </div>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-analyzer", "name": "@remix-project/remix-analyzer",
"version": "0.5.12", "version": "0.5.13",
"description": "Tool to perform static analysis on Solidity smart contracts", "description": "Tool to perform static analysis on Solidity smart contracts",
"main": "index.js", "main": "index.js",
"types": ".index.d.ts", "types": ".index.d.ts",
@ -23,7 +23,7 @@
"@ethereumjs/tx": "^3.2.1", "@ethereumjs/tx": "^3.2.1",
"@ethereumjs/vm": "^5.4.1", "@ethereumjs/vm": "^5.4.1",
"@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-astwalker": "^0.0.26",
"@remix-project/remix-lib": "^0.5.3", "@remix-project/remix-lib": "^0.5.4",
"async": "^2.6.2", "async": "^2.6.2",
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
"ethers": "^5.1.4", "ethers": "^5.1.4",
@ -51,5 +51,5 @@
"typescript": "^3.7.5" "typescript": "^3.7.5"
}, },
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-astwalker", "name": "@remix-project/remix-astwalker",
"version": "0.0.33", "version": "0.0.34",
"description": "Tool to walk through Solidity AST", "description": "Tool to walk through Solidity AST",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -37,7 +37,7 @@
"@ethereumjs/block": "^3.3.0", "@ethereumjs/block": "^3.3.0",
"@ethereumjs/tx": "^3.2.1", "@ethereumjs/tx": "^3.2.1",
"@ethereumjs/vm": "^5.4.1", "@ethereumjs/vm": "^5.4.1",
"@remix-project/remix-lib": "^0.5.3", "@remix-project/remix-lib": "^0.5.4",
"@types/tape": "^4.2.33", "@types/tape": "^4.2.33",
"async": "^2.6.2", "async": "^2.6.2",
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
@ -53,5 +53,5 @@
"tap-spec": "^5.0.0" "tap-spec": "^5.0.0"
}, },
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-debug", "name": "@remix-project/remix-debug",
"version": "0.5.3", "version": "0.5.4",
"description": "Tool to debug Ethereum transactions", "description": "Tool to debug Ethereum transactions",
"contributors": [ "contributors": [
{ {
@ -23,7 +23,7 @@
"@ethereumjs/tx": "^3.2.1", "@ethereumjs/tx": "^3.2.1",
"@ethereumjs/vm": "^5.4.1", "@ethereumjs/vm": "^5.4.1",
"@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-astwalker": "^0.0.26",
"@remix-project/remix-lib": "^0.5.3", "@remix-project/remix-lib": "^0.5.4",
"async": "^2.6.2", "async": "^2.6.2",
"commander": "^2.19.0", "commander": "^2.19.0",
"deep-equal": "^1.0.1", "deep-equal": "^1.0.1",
@ -61,5 +61,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-lib", "name": "@remix-project/remix-lib",
"version": "0.5.3", "version": "0.5.4",
"description": "Library to various Remix tools", "description": "Library to various Remix tools",
"contributors": [ "contributors": [
{ {
@ -53,5 +53,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-simulator", "name": "@remix-project/remix-simulator",
"version": "0.2.3", "version": "0.2.4",
"description": "Ethereum IDE and tools for the web", "description": "Ethereum IDE and tools for the web",
"contributors": [ "contributors": [
{ {
@ -18,7 +18,7 @@
"@ethereumjs/common": "^2.2.0", "@ethereumjs/common": "^2.2.0",
"@ethereumjs/tx": "^3.2.1", "@ethereumjs/tx": "^3.2.1",
"@ethereumjs/vm": "^5.4.1", "@ethereumjs/vm": "^5.4.1",
"@remix-project/remix-lib": "^0.5.3", "@remix-project/remix-lib": "^0.5.4",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^3.1.0", "async": "^3.1.0",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
@ -66,5 +66,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-solidity", "name": "@remix-project/remix-solidity",
"version": "0.4.3", "version": "0.4.4",
"description": "Tool to load and run Solidity compiler", "description": "Tool to load and run Solidity compiler",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",
@ -18,7 +18,7 @@
"@ethereumjs/block": "^3.3.0", "@ethereumjs/block": "^3.3.0",
"@ethereumjs/tx": "^3.2.1", "@ethereumjs/tx": "^3.2.1",
"@ethereumjs/vm": "^5.4.1", "@ethereumjs/vm": "^5.4.1",
"@remix-project/remix-lib": "^0.5.3", "@remix-project/remix-lib": "^0.5.4",
"async": "^2.6.2", "async": "^2.6.2",
"eslint-scope": "^5.0.0", "eslint-scope": "^5.0.0",
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
@ -59,5 +59,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme",
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-tests", "name": "@remix-project/remix-tests",
"version": "0.2.3", "version": "0.2.4",
"description": "Tool to test Solidity smart contracts", "description": "Tool to test Solidity smart contracts",
"main": "src/index.js", "main": "src/index.js",
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
@ -39,9 +39,9 @@
"@ethereumjs/common": "^2.2.0", "@ethereumjs/common": "^2.2.0",
"@ethereumjs/tx": "^3.2.1", "@ethereumjs/tx": "^3.2.1",
"@ethereumjs/vm": "^5.4.1", "@ethereumjs/vm": "^5.4.1",
"@remix-project/remix-lib": "^0.5.3", "@remix-project/remix-lib": "^0.5.4",
"@remix-project/remix-simulator": "^0.2.3", "@remix-project/remix-simulator": "^0.2.4",
"@remix-project/remix-solidity": "^0.4.3", "@remix-project/remix-solidity": "^0.4.4",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^2.6.0", "async": "^2.6.0",
"axios": ">=0.21.1", "axios": ">=0.21.1",
@ -77,5 +77,5 @@
"typescript": "^3.3.1" "typescript": "^3.3.1"
}, },
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -16,6 +16,24 @@ export const ModalDialog = (props: ModalDialogProps) => {
modal.current.focus() modal.current.focus()
}, [props.hide]) }, [props.hide])
useEffect(() => {
function handleBlur (e) {
if (!e.currentTarget.contains(e.relatedTarget)) {
e.stopPropagation()
if (document.activeElement !== this) {
handleHide()
}
}
}
if (modal.current) {
modal.current.addEventListener('blur', handleBlur)
return () => {
modal.current.removeEventListener('blur', handleBlur)
}
}
}, [modal.current])
const modalKeyEvent = (keyCode) => { const modalKeyEvent = (keyCode) => {
if (keyCode === 27) { // Esc if (keyCode === 27) { // Esc
if (props.cancelFn) props.cancelFn() if (props.cancelFn) props.cancelFn()
@ -40,13 +58,6 @@ export const ModalDialog = (props: ModalDialogProps) => {
handleHide() handleHide()
} }
const handleBlur = (e) => {
if (!e.currentTarget.contains(e.relatedTarget)) {
e.stopPropagation()
handleHide()
}
}
return ( return (
<div <div
data-id={`${props.id}ModalDialogContainer-react`} data-id={`${props.id}ModalDialogContainer-react`}
@ -58,7 +69,6 @@ export const ModalDialog = (props: ModalDialogProps) => {
> >
<div className="modal-dialog" role="document"> <div className="modal-dialog" role="document">
<div <div
onBlur={handleBlur}
ref={modal} ref={modal}
tabIndex={-1} tabIndex={-1}
className={'modal-content remixModalContent ' + (props.modalClass ? props.modalClass : '')} className={'modal-content remixModalContent ' + (props.modalClass ? props.modalClass : '')}

@ -44,7 +44,7 @@ export const listenToEvents = (editor, compileTabLogic) => (dispatch: React.Disp
}) })
compileTabLogic.compiler.event.register('loadingCompiler', () => { compileTabLogic.compiler.event.register('loadingCompiler', () => {
dispatch(setCompilerMode('compilationDuration')) dispatch(setCompilerMode('loadingCompiler'))
}) })
compileTabLogic.compiler.event.register('compilerLoaded', () => { compileTabLogic.compiler.event.register('compilerLoaded', () => {

@ -8,6 +8,14 @@ import { resetEditorMode, listenToEvents } from './actions/compiler'
import './css/style.css' import './css/style.css'
declare global {
interface Window {
_paq: any
}
}
const _paq = window._paq = window._paq || [] //eslint-disable-line
export const CompilerContainer = (props: CompilerContainerProps) => { export const CompilerContainer = (props: CompilerContainerProps) => {
const { editor, config, queryParams, compileTabLogic, tooltip, modal, compiledFileName, setHardHatCompilation, updateCurrentVersion, isHardHatProject, configurationSettings } = props // eslint-disable-line const { editor, config, queryParams, compileTabLogic, tooltip, modal, compiledFileName, setHardHatCompilation, updateCurrentVersion, isHardHatProject, configurationSettings } = props // eslint-disable-line
const [state, setState] = useState({ const [state, setState] = useState({
@ -27,8 +35,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
language: '', language: '',
evmVersion: '' evmVersion: ''
}) })
const [disableCompileButton, setDisableCompileButton] = useState<boolean>(false)
const compileIcon = useRef(null) const compileIcon = useRef(null)
const warningIcon = useRef(null)
const promptMessageInput = useRef(null) const promptMessageInput = useRef(null)
const [hhCompilation, sethhCompilation] = useState(false) const [hhCompilation, sethhCompilation] = useState(false)
const [compilerContainer, dispatch] = useReducer(compilerReducer, compilerInitialState) const [compilerContainer, dispatch] = useReducer(compilerReducer, compilerInitialState)
@ -75,6 +83,9 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
}, [compileTabLogic]) }, [compileTabLogic])
useEffect(() => { useEffect(() => {
const isDisabled = !compiledFileName || (compiledFileName && !isSolFileSelected(compiledFileName))
setDisableCompileButton(isDisabled)
setState(prevState => { setState(prevState => {
return { ...prevState, compiledFileName } return { ...prevState, compiledFileName }
}) })
@ -235,14 +246,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
} }
const compilationDuration = (speed: number) => { const compilationDuration = (speed: number) => {
if (!warningIcon.current) return
if (speed > 1000) { if (speed > 1000) {
const msg = `Last compilation took ${speed}ms. We suggest to turn off autocompilation.` console.log(`Last compilation took ${speed}ms. We suggest to turn off autocompilation.`)
warningIcon.current.setAttribute('title', msg)
warningIcon.current.style.visibility = 'visible'
} else {
warningIcon.current.style.visibility = 'hidden'
} }
} }
@ -256,8 +261,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
if (!compileIcon.current) return if (!compileIcon.current) return
compileIcon.current.setAttribute('title', 'compiler is loading, please wait a few moments.') compileIcon.current.setAttribute('title', 'compiler is loading, please wait a few moments.')
compileIcon.current.classList.add('remixui_spinningIcon') compileIcon.current.classList.add('remixui_spinningIcon')
warningIcon.current.style.visibility = 'hidden'
_updateLanguageSelector() _updateLanguageSelector()
setDisableCompileButton(true)
} }
const compilerLoaded = () => { const compilerLoaded = () => {
@ -265,6 +270,9 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
compileIcon.current.setAttribute('title', '') compileIcon.current.setAttribute('title', '')
compileIcon.current.classList.remove('remixui_spinningIcon') compileIcon.current.classList.remove('remixui_spinningIcon')
if (state.autoCompile) compile() if (state.autoCompile) compile()
const isDisabled = !compiledFileName || (compiledFileName && !isSolFileSelected(compiledFileName))
setDisableCompileButton(isDisabled)
} }
const compilationFinished = () => { const compilationFinished = () => {
@ -272,6 +280,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
compileIcon.current.setAttribute('title', 'idle') compileIcon.current.setAttribute('title', 'idle')
compileIcon.current.classList.remove('remixui_spinningIcon') compileIcon.current.classList.remove('remixui_spinningIcon')
compileIcon.current.classList.remove('remixui_bouncingIcon') compileIcon.current.classList.remove('remixui_bouncingIcon')
_paq.push(['trackEvent', 'compiler', 'compiled_with_version', _retrieveVersion()])
} }
const scheduleCompilation = () => { const scheduleCompilation = () => {
@ -292,7 +301,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
if (!isSolFileSelected()) return if (!isSolFileSelected()) return
_setCompilerVersionFromPragma(currentFile) _setCompilerVersionFromPragma(currentFile)
compileTabLogic.runCompiler() compileTabLogic.runCompiler(hhCompilation)
} }
const _retrieveVersion = (version?) => { const _retrieveVersion = (version?) => {
@ -440,6 +449,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const handleNightliesChange = (e) => { const handleNightliesChange = (e) => {
const checked = e.target.checked const checked = e.target.checked
if (!checked) handleLoadVersion(state.defaultVersion)
config.set('includeNightlies', checked) config.set('includeNightlies', checked)
setState(prevState => { setState(prevState => {
return { ...prevState, includeNightlies: checked } return { ...prevState, includeNightlies: checked }
@ -522,6 +532,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<label className="remixui_compilerLabel form-check-label" htmlFor="evmVersionSelector">EVM Version</label> <label className="remixui_compilerLabel form-check-label" htmlFor="evmVersionSelector">EVM Version</label>
<select value={state.evmVersion} onChange={(e) => handleEvmVersionChange(e.target.value)} className="custom-select" id="evmVersionSelector"> <select value={state.evmVersion} onChange={(e) => handleEvmVersionChange(e.target.value)} className="custom-select" id="evmVersionSelector">
<option data-id={state.evmVersion === 'default' ? 'selected' : ''} value="default">compiler default</option> <option data-id={state.evmVersion === 'default' ? 'selected' : ''} value="default">compiler default</option>
<option data-id={state.evmVersion === 'berlin' ? 'selected' : ''} value="berlin">berlin</option>
<option data-id={state.evmVersion === 'muirGlacier' ? 'selected' : ''} value="muirGlacier">muirGlacier</option> <option data-id={state.evmVersion === 'muirGlacier' ? 'selected' : ''} value="muirGlacier">muirGlacier</option>
<option data-id={state.evmVersion === 'istanbul' ? 'selected' : ''} value="istanbul">istanbul</option> <option data-id={state.evmVersion === 'istanbul' ? 'selected' : ''} value="istanbul">istanbul</option>
<option data-id={state.evmVersion === 'petersburg' ? 'selected' : ''} value="petersburg">petersburg</option> <option data-id={state.evmVersion === 'petersburg' ? 'selected' : ''} value="petersburg">petersburg</option>
@ -566,11 +577,10 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<label className="form-check-label custom-control-label" htmlFor="enableHardhat">Enable Hardhat Compilation</label> <label className="form-check-label custom-control-label" htmlFor="enableHardhat">Enable Hardhat Compilation</label>
</div> </div>
} }
<button id="compileBtn" data-id="compilerContainerCompileBtn" className="btn btn-primary btn-block remixui_disabled mt-3" title="Compile" onClick={compile} disabled={!state.compiledFileName || (state.compiledFileName && !isSolFileSelected(state.compiledFileName))}> <button id="compileBtn" data-id="compilerContainerCompileBtn" className="btn btn-primary btn-block remixui_disabled mt-3" title="Compile" onClick={compile} disabled={disableCompileButton}>
<span> <span>
<i ref={warningIcon} title="Compilation Slow" style={{ visibility: 'hidden' }} className="remixui_warnCompilationSlow fas fa-exclamation-triangle" aria-hidden="true"></i> { <i ref={compileIcon} className="fas fa-sync remixui_icon" aria-hidden="true"></i> }
{ warningIcon.current && warningIcon.current.style.visibility === 'hidden' && <i ref={compileIcon} className="fas fa-sync remixui_icon" aria-hidden="true"></i> } Compile { typeof state.compiledFileName === 'string' ? helper.extractNameFromKey(state.compiledFileName) || '<no file selected>' : '<no file selected>' }
Compile { state.compiledFileName || '<no file selected>' }
</span> </span>
</button> </button>
</header> </header>

@ -162,17 +162,25 @@ export const ContractSelection = (props: ContractSelectionProps) => {
} }
const contractProperties = contractsDetails[selectedContract] || {} const contractProperties = contractsDetails[selectedContract] || {}
const log = <div className="remixui_detailsJSON"> const log = <div className="remixui_detailsJSON">
<TreeView>
{ {
Object.keys(contractProperties).map((propertyName, index) => { Object.keys(contractProperties).map((propertyName, index) => {
const copyDetails = <span className="remixui_copyDetails"><CopyToClipboard content={contractProperties[propertyName]} direction='top' /></span> const copyDetails = <span className="remixui_copyDetails"><CopyToClipboard content={contractProperties[propertyName]} direction='top' /></span>
const questionMark = <span className="remixui_questionMark"><i title={ help[propertyName] } className="fas fa-question-circle" aria-hidden="true"></i></span> const questionMark = <span className="remixui_questionMark"><i title={ help[propertyName] } className="fas fa-question-circle" aria-hidden="true"></i></span>
return (<div className="remixui_log" key={index}> return (
<div className="remixui_key">{ propertyName } { copyDetails } { questionMark }</div> <div className="remixui_log" key={index}>
<TreeViewItem
label={
<div data-id={`remixui_treeviewitem_${propertyName}`} className="remixui_key">{ propertyName } { copyDetails } { questionMark }</div>
}>
{ insertValue(contractProperties, propertyName) } { insertValue(contractProperties, propertyName) }
</div>) </TreeViewItem>
</div>
)
}) })
} }
</TreeView>
</div> </div>
modal(selectedContract, log, 'Close', null) modal(selectedContract, log, 'Close', null)

@ -89,6 +89,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
dispatch({ type: '', payload: {} }) dispatch({ type: '', payload: {} })
// Show 'Enable Slither Analysis' checkbox // Show 'Enable Slither Analysis' checkbox
if (currentWorkspace && currentWorkspace.isLocalhost === true) setShowSlither('visible') if (currentWorkspace && currentWorkspace.isLocalhost === true) setShowSlither('visible')
else {
setShowSlither('hidden')
setSlitherEnabled(false)
}
}) })
return () => { } return () => { }
}, [props]) }, [props])
@ -245,8 +249,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
showWarnings(warningMessage, 'warningModuleName') showWarnings(warningMessage, 'warningModuleName')
props.event.trigger('staticAnaysisWarning', [warningCount]) props.event.trigger('staticAnaysisWarning', [warningCount])
} }
}).catch((error) => { }).catch(() => {
console.log('Error found:', error) // This should be removed once testing done
props.analysisModule.call('terminal', 'log', { type: 'error', value: '[Slither Analysis]: Error occured! See remixd console for details.' }) props.analysisModule.call('terminal', 'log', { type: 'error', value: '[Slither Analysis]: Error occured! See remixd console for details.' })
showWarnings(warningMessage, 'warningModuleName') showWarnings(warningMessage, 'warningModuleName')
}) })

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-url-resolver", "name": "@remix-project/remix-url-resolver",
"version": "0.0.24", "version": "0.0.25",
"description": "Solidity import url resolver engine", "description": "Solidity import url resolver engine",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",
@ -42,5 +42,5 @@
"typescript": "^3.1.6" "typescript": "^3.1.6"
}, },
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "5e91f3010a7198f1b2d90cc7796bda750c58f1ea" "gitHead": "664824605fa84648c79770631da371d4f81e0052"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remixd", "name": "@remix-project/remixd",
"version": "0.4.2", "version": "0.5.0",
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",

@ -120,9 +120,9 @@ export class SlitherClient extends PluginClient {
allowPaths = allowPathString allowPaths = allowPathString
remaps = remapString.trim() remaps = remapString.trim()
} }
const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths}` : '' const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths} ` : ''
const optimizeOption: string = optimize ? ' --optimize ' : '' const optimizeOption: string = optimize ? '--optimize ' : ''
const evmOption: string = evmVersion ? ` --evm-version ${evmVersion}` : '' const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : ''
const solcArgs: string = optimizeOption || evmOption || allowPathsOption ? `--solc-args '${allowPathsOption}${optimizeOption}${evmOption}'` : '' const solcArgs: string = optimizeOption || evmOption || allowPathsOption ? `--solc-args '${allowPathsOption}${optimizeOption}${evmOption}'` : ''
const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : ''

Loading…
Cancel
Save