Merge branch 'master' into dependabot/npm_and_yarn/apps/remix-ide-e2e/openzeppelin/contracts-4.9.2

pull/3827/head
Aniket 1 year ago committed by GitHub
commit 6ab8ac79b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/config.yml
  2. 7
      .eslintrc.json
  3. 2
      apps/remix-ide-e2e/package.json
  4. 8
      apps/remix-ide-e2e/yarn.lock
  5. 2
      apps/remix-ide/ci/splice_tests.js
  6. 2
      apps/remix-ide/src/app/tabs/search.tsx
  7. 6
      apps/remix-ide/src/blockchain/helper.ts
  8. 6
      libs/remix-analyzer/test/analysis/staticAnalysisCommon-test.ts
  9. 4
      libs/remix-core-plugin/src/types/contract.ts
  10. 2
      libs/remix-debug/test.ts
  11. 2
      libs/remix-solidity/src/compiler/types.ts
  12. 2
      libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.tsx
  13. 48
      libs/remix-ui/editor/src/lib/providers/codeActionProvider.ts
  14. 16
      libs/remix-ui/editor/src/lib/providers/quickfixes.ts
  15. 2
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  16. 4
      libs/remix-ui/file-decorators/src/lib/types/index.ts
  17. 2
      libs/remix-ui/helper/src/lib/components/PluginViewWrapper.tsx
  18. 2
      libs/remix-ui/run-tab/src/lib/actions/deploy.ts
  19. 6
      libs/remix-ui/search/src/lib/components/results/SearchHelper.ts
  20. 2
      libs/remix-ui/static-analyser/src/lib/actions/staticAnalysisActions.ts
  21. 2
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
  22. 2
      libs/remix-ui/vertical-icons-panel/src/lib/vertical-icons-context-menu.tsx
  23. 14
      libs/remix-ui/workspace/src/lib/components/workspace-hamburger-item.tsx
  24. 6
      libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx
  25. 2
      libs/remix-ui/workspace/src/lib/contexts/index.ts
  26. 2
      libs/remix-ws-templates/src/templates/gnosisSafeMultisig/scripts/deploy_with_ethers.ts
  27. 2
      libs/remix-ws-templates/src/templates/ozerc1155/scripts/deploy_with_ethers.ts
  28. 2
      libs/remix-ws-templates/src/templates/ozerc20/scripts/deploy_with_ethers.ts
  29. 2
      libs/remix-ws-templates/src/templates/ozerc721/scripts/deploy_with_ethers.ts
  30. 2
      libs/remix-ws-templates/src/templates/remixDefault/scripts/deploy_with_ethers.ts
  31. 2
      libs/remix-ws-templates/src/templates/zeroxErc20/scripts/deploy_with_ethers.ts
  32. 23
      lint-fix-targets.js
  33. 18
      yarn.lock

@ -5,7 +5,7 @@ parameters:
type: boolean
default: false
orbs:
browser-tools: circleci/browser-tools@1.4.1
browser-tools: circleci/browser-tools@1.4.3
jobs:
build:
docker:

@ -47,7 +47,8 @@
"eslint-disable-next-line no-empty": "off",
"no-empty": "off",
"jsx-a11y/anchor-is-valid": "off",
"@typescript-eslint/no-inferrable-types": "off"
"@typescript-eslint/no-inferrable-types": "off",
"indent": ["error", 2]
}
},
{
@ -58,7 +59,9 @@
"extends": [
"plugin:@nrwl/nx/javascript"
],
"rules": {}
"rules": {
"indent": ["error", 2]
}
}
],
"globals": {

@ -7,7 +7,7 @@
},
"dependencies": {
"@openzeppelin/contracts": "^4.9.2",
"@openzeppelin/contracts-upgradeable": "^4.8.3",
"@openzeppelin/contracts-upgradeable": "^4.9.2",
"@openzeppelin/upgrades-core": "^1.22.0",
"@openzeppelin/wizard": "^0.1.1",
"@remix-project/remixd": "../../dist/libs/remixd",

@ -14,10 +14,10 @@
pathval "1.1.1"
type-detect "4.0.8"
"@openzeppelin/contracts-upgradeable@^4.8.3":
version "4.8.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f"
integrity sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==
"@openzeppelin/contracts-upgradeable@^4.9.2":
version "4.9.2"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.2.tgz#a817c75688f8daede420052fbcb34e52482e769e"
integrity sha512-siviV3PZV/fHfPaoIC51rf1Jb6iElkYWnNYZ0leO23/ukXuvOyoC/ahy8jqiV7g+++9Nuo3n/rk5ajSN/+d/Sg==
"@openzeppelin/contracts@^4.9.2":
version "4.9.2"

@ -24,4 +24,4 @@ exec(cmd, (error, stdout, stderr) => {
parts.push(files.slice(i * splitIndex, (i + 1) * splitIndex))
}
console.log(parts[job].join('\n'))
});
});

@ -14,7 +14,7 @@ const profile = {
documentation: '',
version: packageJson.version,
maintainedBy: 'Remix'
}
}
export class SearchPlugin extends ViewPlugin {

@ -5,10 +5,10 @@ const transactionDetailsLinks = {
Kovan: 'https://kovan.etherscan.io/tx/',
Goerli: 'https://goerli.etherscan.io/tx/',
Sepolia: 'https://sepolia.etherscan.io/tx/'
}
}
export function etherScanLink (network: string, hash: string): string {
export function etherScanLink (network: string, hash: string): string {
if (transactionDetailsLinks[network]) {
return transactionDetailsLinks[network] + hash
}
}
}

@ -40,11 +40,11 @@ test('staticAnalysisCommon.helpers.buildFunctionSignature', function (t) {
'function (bytes memory) payable returns (bool,bytes memory)',
'check fixed call type')
t.equal(common.lowLevelCallTypes['CALL-0.4'].type,
t.equal(common.lowLevelCallTypes['CALL-0.4'].type,
'function () payable returns (bool)',
'check fixed call type for versions before 0.5.0')
t.equal(common.lowLevelCallTypes.CALLCODE.type,
t.equal(common.lowLevelCallTypes.CALLCODE.type,
'function () payable returns (bool)',
'check fixed callcode type')
@ -56,7 +56,7 @@ t.equal(common.lowLevelCallTypes.CALLCODE.type,
'function (bytes memory) returns (bool,bytes memory)',
'check fixed delegatecall type')
t.equal(common.lowLevelCallTypes['DELEGATECALL-0.4'].type,
t.equal(common.lowLevelCallTypes['DELEGATECALL-0.4'].type,
'function () returns (bool)',
'check fixed delegatecall type for version before 0.5.0')
})

@ -191,7 +191,7 @@ export interface ContractSources {
}
}
export interface NetworkDeploymentFile {
export interface NetworkDeploymentFile {
id: string,
network: string,
deployments: {
@ -204,7 +204,7 @@ export interface ContractSources {
}[]
}
export interface SolcBuildFile {
export interface SolcBuildFile {
solcInput: SolcInput,
solcOutput: SolcOutput
}

@ -67,7 +67,7 @@ cmdLine.startDebug(tx, shortFilename)
cmdLine.events.on('source', () => {
cmdLine.getSource().forEach(console.dir)
})
// })
// })
// })
const repl = require('repl')

@ -502,6 +502,6 @@ export interface BytecodeObject {
}
}
export interface EsWebWorkerHandlerInterface {
export interface EsWebWorkerHandlerInterface {
getWorker(): Worker
}

@ -104,7 +104,7 @@ export const ButtonNavigation = ({ stepOverBack, stepIntoBack, stepIntoForward,
tagId: 'overbackTooltip',
tooltipMsg: 'Step over forward',
}
}
}
const jumpMarkupStructure = {
jumpPreviousBreakpointJSX : {
markup: (

@ -0,0 +1,48 @@
import { Monaco } from "@monaco-editor/react"
import monaco from "../../types/monaco"
import { EditorUIProps } from "../remix-ui-editor"
import { default as fixes } from "./quickfixes"
export class RemixCodeActionProvider implements monaco.languages.CodeActionProvider {
props: EditorUIProps
monaco: Monaco
constructor(props: any, monaco: any) {
this.props = props
this.monaco = monaco
}
async provideCodeActions (
model /**ITextModel*/,
range /**Range*/,
context /**CodeActionContext*/,
token /**CancellationToken*/
) {
const actions = context.markers.map(error => {
const errStrings = Object.keys(fixes)
const errStr = errStrings.find(es => error.message.includes(es))
const fix = fixes[errStr]
return {
title: fix.title,
diagnostics: [error],
kind: "quickfix",
edit: {
edits: [
{
resource: model.uri,
edit: {
range: fix.range || error,
text: fix.message
}
}
]
},
isPreferred: true
}
})
return {
actions: actions,
dispose: () => {}
}
}
}

@ -0,0 +1,16 @@
export default {
"Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.": {
"title": "Add open-source license",
"message": "// SPDX-License-Identifier: GPL-3.0"
},
"Warning: Source file does not specify required compiler version! Consider adding" : {
"title": "Add pragma line",
"message": "pragma solidity ^0.*.*;",
"range": {
startLineNumber: 2,
endLineNumber: 2,
startColumn: 1,
endColumn: 1
}
}
}

@ -15,6 +15,7 @@ import { RemixReferenceProvider } from './providers/referenceProvider'
import { RemixCompletionProvider } from './providers/completionProvider'
import { RemixHighLightProvider } from './providers/highlightProvider'
import { RemixDefinitionProvider } from './providers/definitionProvider'
import { RemixCodeActionProvider } from './providers/codeActionProvider'
import './remix-ui-editor.css'
@ -749,6 +750,7 @@ export const EditorUI = (props: EditorUIProps) => {
monacoRef.current.languages.registerReferenceProvider('remix-solidity', new RemixReferenceProvider(props, monaco))
monacoRef.current.languages.registerHoverProvider('remix-solidity', new RemixHoverProvider(props, monaco))
monacoRef.current.languages.registerCompletionItemProvider('remix-solidity', new RemixCompletionProvider(props, monaco))
monaco.languages.registerCodeActionProvider("remix-solidity", new RemixCodeActionProvider(props, monaco))
loadTypes(monacoRef.current)
}

@ -5,7 +5,7 @@ export enum fileDecorationType {
None = 'NONE'
}
export type fileDecoration = {
export type fileDecoration = {
path: string,
isDirectory: boolean,
fileStateType: fileDecorationType,
@ -20,7 +20,7 @@ export enum fileDecorationType {
comment?: string[] | string
}
export interface FileType {
export interface FileType {
path: string,
name?: string,
isDirectory?: boolean,

@ -21,4 +21,4 @@ export const PluginViewWrapper = (props: IPluginViewWrapperProps) => {
:<></>
}</>
)
}
}

@ -258,7 +258,7 @@ export const loadAddress = (plugin: RunTab, dispatch: React.Dispatch<any>, contr
}
}
)
}
}
export const getContext = (plugin: RunTab) => {
return plugin.blockchain.context()

@ -17,9 +17,9 @@ export const getDirectory = async (dir: string, plugin: any) => {
}
}
return result
}
}
const normalize = filesList => {
const normalize = filesList => {
const folders = []
const files = []
Object.keys(filesList || {}).forEach(key => {
@ -36,7 +36,7 @@ export const getDirectory = async (dir: string, plugin: any) => {
}
})
return [...folders, ...files]
}
}
export const findLinesInStringWithMatch = (str: string, re: RegExp) => {
return str

@ -44,7 +44,7 @@ export const compilation = (analysisModule: AnalysisTab,
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function run (lastCompilationResult, lastCompilationSource, currentFile: string, state: RemixUiStaticAnalyserState, props: RemixUiStaticAnalyserProps, isSupportedVersion, showSlither, categoryIndex: number[], groupedModules, runner, _paq, message, showWarnings, allWarnings: React.RefObject<any>, warningContainer: React.RefObject<any>, calculateWarningStateEntries: (e:[string, any][]) => {length: number, errors: any[] }, warningState, setHints: React.Dispatch<React.SetStateAction<SolHintReport[]>>, hints: SolHintReport[], setSlitherWarnings: React.Dispatch<React.SetStateAction<any[]>>, setSsaWarnings: React.Dispatch<React.SetStateAction<any[]>>,
slitherEnabled: boolean, setStartAnalysis: React.Dispatch<React.SetStateAction<boolean>>, solhintEnabled: boolean, basicEnabled: boolean) {
slitherEnabled: boolean, setStartAnalysis: React.Dispatch<React.SetStateAction<boolean>>, solhintEnabled: boolean, basicEnabled: boolean) {
setStartAnalysis(true)
setHints([])
setSsaWarnings([])

@ -265,7 +265,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
) : (
<span> </span>
)
}
}
<span className="" title={Position in ${fileName}}>Pos: ${locationString}</span>
</span>`;
};

@ -106,7 +106,7 @@ const MenuForLinks = ({
)
}
function ClickOutside(ref: React.MutableRefObject<HTMLElement>, hideFn: () => void) {
function ClickOutside(ref: React.MutableRefObject<HTMLElement>, hideFn: () => void) {
useEffect(() => {
function handleClickOutside(event: any) {
if (ref.current && !ref.current.contains(event.target)) {

@ -48,10 +48,10 @@ export function HamburgerMenuItem (props: HamburgerMenuItemProps) {
</Dropdown.Item>
</>
)
}
}
// keeping the following for a later use:
export function NavHamburgerMenuItem (props: HamburgerMenuItemProps) {
// keeping the following for a later use:
export function NavHamburgerMenuItem (props: HamburgerMenuItemProps) {
const { hideOption } = props
const uid = 'workspace' + props.kind
return (
@ -87,15 +87,15 @@ export function HamburgerMenuItem (props: HamburgerMenuItemProps) {
</NavDropdown.Item>
</>
)
}
}
export interface HamburgerSubMenuItemProps {
export interface HamburgerSubMenuItemProps {
id: string
title: string
subMenus: Array<HamburgerMenuItemProps>
}
export function HamburgerSubMenuItem (props: HamburgerSubMenuItemProps) {
export function HamburgerSubMenuItem (props: HamburgerSubMenuItemProps) {
return (
<>
<NavDropdown
@ -110,4 +110,4 @@ export function HamburgerMenuItem (props: HamburgerMenuItemProps) {
</NavDropdown>
</>
)
}
}

@ -82,10 +82,10 @@ export function HamburgerMenu (props: HamburgerMenuProps) {
}}></HamburgerMenuItem>
</>
)
}
}
// keep for later use
/*<HamburgerSubMenuItem
// keep for later use
/*<HamburgerSubMenuItem
id="web3-script-menu"
title="Web3 Scripts"
subMenus={[

@ -46,6 +46,6 @@ export const FileSystemContext = createContext<{
dispatchCreateTsSolGithubAction: () => Promise<void>,
dispatchCreateSlitherGithubAction: () => Promise<void>
dispatchCreateHelperScripts: (script: string) => Promise<void>
}>(null)
}>(null)

@ -7,4 +7,4 @@ import { deploy } from './ethers-lib'
} catch (e) {
console.log(e.message)
}
})()
})()

@ -7,4 +7,4 @@ import { deploy } from './ethers-lib'
} catch (e) {
console.log(e.message)
}
})()
})()

@ -7,4 +7,4 @@ import { deploy } from './ethers-lib'
} catch (e) {
console.log(e.message)
}
})()
})()

@ -7,4 +7,4 @@ import { deploy } from './ethers-lib'
} catch (e) {
console.log(e.message)
}
})()
})()

@ -11,4 +11,4 @@ import { deploy } from './ethers-lib'
} catch (e) {
console.log(e.message)
}
})()
})()

@ -7,4 +7,4 @@ import { deploy } from './ethers-lib'
} catch (e) {
console.log(e.message)
}
})()
})()

@ -0,0 +1,23 @@
const { spawnSync, execSync } = require('child_process')
const fs = require('fs')
const { exit } = require('process')
execSync('yarn nx graph --file=./projects.json')
const file = fs.readFileSync('projects.json')
const projects = JSON.parse(file)
console.log(Object.keys(projects.graph.nodes))
for(let node of Object.keys(projects.graph.nodes)){
if(projects.graph.nodes[node].data.targets.lint){
console.log(projects.graph.nodes[node].data.name)
const result = spawnSync('yarn', ['lint', projects.graph.nodes[node].data.name, '--fix'])
if(result.status == 0){
console.log('success')
}else{
console.log(result.stdout.toString())
console.log(result.stderr.toString())
}
}
}

@ -4673,14 +4673,14 @@
"@octokit/openapi-types" "^11.2.0"
"@openzeppelin/contracts-upgradeable@^4.8.1":
version "4.8.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f"
integrity sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==
version "4.9.2"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.2.tgz#a817c75688f8daede420052fbcb34e52482e769e"
integrity sha512-siviV3PZV/fHfPaoIC51rf1Jb6iElkYWnNYZ0leO23/ukXuvOyoC/ahy8jqiV7g+++9Nuo3n/rk5ajSN/+d/Sg==
"@openzeppelin/contracts@^4.7.3":
version "4.8.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a"
integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==
version "4.9.2"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1"
integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg==
"@openzeppelin/upgrades-core@^1.22.0":
version "1.22.0"
@ -27631,9 +27631,9 @@ winston@^3.3.3:
winston-transport "^4.4.0"
word-wrap@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
version "1.2.4"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f"
integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==
wordwrap@0.0.2:
version "0.0.2"

Loading…
Cancel
Save