git4refactor
filip mertens 7 months ago
parent 7da0d585f3
commit 32d9abf089
  1. 6
      apps/remix-ide/src/app/components/hidden-panel.tsx
  2. 8
      apps/remix-ide/src/app/components/main-panel.tsx
  3. 14
      apps/remix-ide/src/app/components/preload.tsx
  4. 8
      apps/remix-ide/src/app/components/side-panel.tsx
  5. 10
      apps/remix-ide/src/app/components/vertical-icons.tsx
  6. 10
      apps/remix-ide/src/app/files/dgitProvider.ts
  7. 2
      apps/remix-ide/src/app/files/electronProvider.ts
  8. 13
      apps/remix-ide/src/app/files/fileManager.ts
  9. 1
      apps/remix-ide/src/app/files/fileProvider.ts
  10. 1
      apps/remix-ide/src/app/files/fileSystem.ts
  11. 2
      apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts
  12. 1
      apps/remix-ide/src/app/files/filesystems/indexedDB.ts
  13. 2
      apps/remix-ide/src/app/files/filesystems/localStorage.ts
  14. 6
      apps/remix-ide/src/app/panels/terminal.tsx
  15. 3
      apps/remix-ide/src/app/plugins/code-format.ts
  16. 1
      apps/remix-ide/src/app/plugins/code-format/parser.ts
  17. 2
      apps/remix-ide/src/app/plugins/compile-details.tsx
  18. 2
      apps/remix-ide/src/app/plugins/config.ts
  19. 8
      apps/remix-ide/src/app/plugins/contractFlattener.tsx
  20. 2
      apps/remix-ide/src/app/plugins/electron/compilerLoaderPlugin.ts
  21. 6
      apps/remix-ide/src/app/plugins/electron/fsPlugin.ts
  22. 4
      apps/remix-ide/src/app/plugins/file-decorator.ts
  23. 1
      apps/remix-ide/src/app/plugins/git.tsx
  24. 10
      apps/remix-ide/src/app/plugins/notification.tsx
  25. 4
      apps/remix-ide/src/app/plugins/openaigpt.tsx
  26. 1
      apps/remix-ide/src/app/plugins/parser/code-parser.tsx
  27. 5
      apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts
  28. 6
      apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts
  29. 9
      apps/remix-ide/src/app/plugins/parser/services/code-parser-gas-service.ts
  30. 8
      apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts
  31. 10
      apps/remix-ide/src/app/plugins/parser/types/antlr-types.ts
  32. 20
      apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx
  33. 40
      apps/remix-ide/src/app/plugins/remixGuide.tsx
  34. 24
      apps/remix-ide/src/app/plugins/remixd-handle.tsx
  35. 26
      apps/remix-ide/src/app/plugins/solcoderAI.tsx
  36. 10
      apps/remix-ide/src/app/plugins/solidity-script.tsx
  37. 28
      apps/remix-ide/src/app/plugins/solidity-umlgen.tsx
  38. 10
      apps/remix-ide/src/app/plugins/vyper-compilation-details.tsx
  39. 20
      apps/remix-ide/src/app/providers/abstract-provider.tsx
  40. 8
      apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx
  41. 6
      apps/remix-ide/src/app/providers/external-http-provider.tsx
  42. 4
      apps/remix-ide/src/app/providers/foundry-provider.tsx
  43. 4
      apps/remix-ide/src/app/providers/ganache-provider.tsx
  44. 2
      apps/remix-ide/src/app/providers/goerli-vm-fork-provider.tsx
  45. 4
      apps/remix-ide/src/app/providers/hardhat-provider.tsx
  46. 2
      apps/remix-ide/src/app/providers/injected-arbitrum-one-provider.tsx
  47. 8
      apps/remix-ide/src/app/providers/injected-custom-provider.tsx
  48. 2
      apps/remix-ide/src/app/providers/injected-ephemery-testnet-provider.tsx
  49. 2
      apps/remix-ide/src/app/providers/injected-optimism-provider.tsx
  50. 2
      apps/remix-ide/src/app/providers/injected-provider-default.tsx
  51. 2
      apps/remix-ide/src/app/providers/injected-provider-trustwallet.tsx
  52. 16
      apps/remix-ide/src/app/providers/injected-provider.tsx
  53. 2
      apps/remix-ide/src/app/providers/mainnet-vm-fork-provider.tsx
  54. 2
      apps/remix-ide/src/app/providers/sepolia-vm-fork-provider.tsx
  55. 8
      apps/remix-ide/src/app/providers/vm-provider.tsx
  56. 2
      apps/remix-ide/src/app/tabs/compile-and-run.ts
  57. 4
      apps/remix-ide/src/app/tabs/search.tsx
  58. 6
      apps/remix-ide/src/app/tabs/settings-tab.tsx
  59. 54
      apps/remix-ide/src/blockchain/blockchain.tsx
  60. 1
      apps/remix-ide/src/blockchain/providers/vm.ts
  61. 2
      apps/remix-ide/src/blockchain/providers/worker-vm.ts
  62. 10
      apps/remix-ide/src/index.tsx

@ -1,9 +1,9 @@
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import React from 'react' import React from 'react'
import {AbstractPanel} from './panel' import { AbstractPanel } from './panel'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {RemixPluginPanel} from '@remix-ui/panel' import { RemixPluginPanel } from '@remix-ui/panel'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
const profile = { const profile = {
name: 'hiddenPanel', name: 'hiddenPanel',

@ -1,8 +1,8 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {AbstractPanel} from './panel' import { AbstractPanel } from './panel'
import {RemixPluginPanel} from '@remix-ui/panel' import { RemixPluginPanel } from '@remix-ui/panel'
import packageJson from '../../../../../package.json' import packageJson from '../../../../../package.json'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
const profile = { const profile = {
name: 'mainPanel', name: 'mainPanel',
@ -60,7 +60,7 @@ export class MainPanel extends AbstractPanel {
render() { render() {
return ( return (
<div style={{height: '100%', width: '100%'}} data-id="mainPanelPluginsContainer"> <div style={{ height: '100%', width: '100%' }} data-id="mainPanelPluginsContainer">
<PluginViewWrapper plugin={this} /> <PluginViewWrapper plugin={this} />
</div> </div>
) )

@ -1,12 +1,12 @@
import {RemixApp} from '@remix-ui/app' import { RemixApp } from '@remix-ui/app'
import axios from 'axios' import axios from 'axios'
import React, {useEffect, useRef, useState} from 'react' import React, { useEffect, useRef, useState } from 'react'
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {fileSystem, fileSystems} from '../files/fileSystem' import { fileSystem, fileSystems } from '../files/fileSystem'
import {indexedDBFileSystem} from '../files/filesystems/indexedDB' import { indexedDBFileSystem } from '../files/filesystems/indexedDB'
import {localStorageFS} from '../files/filesystems/localStorage' import { localStorageFS } from '../files/filesystems/localStorage'
import {fileSystemUtility, migrationTestData} from '../files/filesystems/fileSystemUtility' import { fileSystemUtility, migrationTestData } from '../files/filesystems/fileSystemUtility'
import './styles/preload.css' import './styles/preload.css'
import isElectron from 'is-electron' import isElectron from 'is-electron'
const _paq = (window._paq = window._paq || []) const _paq = (window._paq = window._paq || [])
@ -83,7 +83,7 @@ export const Preload = (props: any) => {
} }
useEffect (() => { useEffect (() => {
if(isElectron()){ if (isElectron()){
loadAppComponent() loadAppComponent()
return return
} }

@ -1,10 +1,10 @@
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import React from 'react' import React from 'react'
import {AbstractPanel} from './panel' import { AbstractPanel } from './panel'
import {RemixPluginPanel} from '@remix-ui/panel' import { RemixPluginPanel } from '@remix-ui/panel'
import packageJson from '../../../../../package.json' import packageJson from '../../../../../package.json'
import {RemixUIPanelHeader} from '@remix-ui/panel' import { RemixUIPanelHeader } from '@remix-ui/panel'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
// const csjs = require('csjs-inject') // const csjs = require('csjs-inject')
const sidePanel = { const sidePanel = {

@ -1,11 +1,11 @@
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import React from 'react' import React from 'react'
import packageJson from '../../../../../package.json' import packageJson from '../../../../../package.json'
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {EventEmitter} from 'events' import { EventEmitter } from 'events'
import {IconRecord, RemixUiVerticalIconsPanel} from '@remix-ui/vertical-icons-panel' import { IconRecord, RemixUiVerticalIconsPanel } from '@remix-ui/vertical-icons-panel'
import {Profile} from '@remixproject/plugin-utils' import { Profile } from '@remixproject/plugin-utils'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
const profile = { const profile = {
name: 'menuicons', name: 'menuicons',

@ -27,7 +27,6 @@ declare global {
interface Window { remixFileSystemCallback: IndexedDBStorage; remixFileSystem: any; } interface Window { remixFileSystemCallback: IndexedDBStorage; remixFileSystem: any; }
} }
const profile: LibraryProfile = { const profile: LibraryProfile = {
name: 'dGitProvider', name: 'dGitProvider',
displayName: 'Decentralized git', displayName: 'Decentralized git',
@ -162,7 +161,6 @@ class DGitProvider extends Plugin {
return status return status
} }
const status = await git.statusMatrix({ const status = await git.statusMatrix({
...await this.addIsomorphicGitConfigFS(), ...await this.addIsomorphicGitConfigFS(),
...cmd ...cmd
@ -265,7 +263,6 @@ class DGitProvider extends Plugin {
return status return status
} }
const status = await git.log({ const status = await git.log({
...await this.addIsomorphicGitConfigFS(), ...await this.addIsomorphicGitConfigFS(),
...cmd, ...cmd,
@ -986,7 +983,7 @@ class DGitProvider extends Plugin {
// OCTOKIT FEATURES // OCTOKIT FEATURES
async remotebranches(input: { owner: string, repo: string, token: string, page: number, per_page: number }) { async remotebranches(input: { owner: string, repo: string, token: string, page: number, per_page: number }) {
console.log(input) console.log(input)
const octokit = new Octokit({ const octokit = new Octokit({
@ -1003,8 +1000,6 @@ class DGitProvider extends Plugin {
return data.data return data.data
} }
async getGitHubUser(input: { token: string }): Promise<{ async getGitHubUser(input: { token: string }): Promise<{
user: GitHubUser, user: GitHubUser,
ratelimit: RateLimit ratelimit: RateLimit
@ -1023,7 +1018,6 @@ class DGitProvider extends Plugin {
const localResetTime = ratelimit.data.rate.reset * 1000 const localResetTime = ratelimit.data.rate.reset * 1000
const localResetTimeString = new Date(localResetTime).toLocaleString() const localResetTimeString = new Date(localResetTime).toLocaleString()
console.log('rate limit', localResetTimeString) console.log('rate limit', localResetTimeString)
const user = await octokit.request('GET /user') const user = await octokit.request('GET /user')
@ -1118,13 +1112,11 @@ class DGitProvider extends Plugin {
'Accept': 'application/vnd.github.v3+json', // GitHub API v3 media type 'Accept': 'application/vnd.github.v3+json', // GitHub API v3 media type
}; };
const url = `${baseURL}?visibility=private,public&page=${page}&per_page=${perPage}&sort=${sort}&direction=${direction}`; const url = `${baseURL}?visibility=private,public&page=${page}&per_page=${perPage}&sort=${sort}&direction=${direction}`;
const response = await axios.get(url, { headers }); const response = await axios.get(url, { headers });
repositories.push(...response.data); repositories.push(...response.data);
return repositories return repositories
} }

@ -1,6 +1,5 @@
import FileProvider from "./fileProvider" import FileProvider from "./fileProvider"
declare global { declare global {
interface Window { interface Window {
remixFileSystem: any remixFileSystem: any
@ -50,7 +49,6 @@ export class ElectronProvider extends FileProvider {
} }
} }
// isDirectory is already included // isDirectory is already included
// this is a more efficient version of the default implementation // this is a more efficient version of the default implementation
async resolveDirectory(path, cb) { async resolveDirectory(path, cb) {

@ -4,7 +4,7 @@ import { saveAs } from 'file-saver'
import JSZip from 'jszip' import JSZip from 'jszip'
import { Plugin } from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper' import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper'
import helper from '../../lib/helper.js' import helper from '../../lib/helper.js'
import { RemixAppManager } from '../../remixAppManager' import { RemixAppManager } from '../../remixAppManager'
@ -266,11 +266,11 @@ class FileManager extends Plugin {
if (await this.exists(path)) { if (await this.exists(path)) {
const newPath = await helper.createNonClashingNameAsync(path, this) const newPath = await helper.createNonClashingNameAsync(path, this)
const content = await this.setFileContent(newPath, data) const content = await this.setFileContent(newPath, data)
return {newContent: content, newPath} return { newContent: content, newPath }
} else { } else {
const ret = await this.setFileContent(path, data) const ret = await this.setFileContent(path, data)
this.emit('fileAdded', path) this.emit('fileAdded', path)
return {newContent: ret, newpath: path} return { newContent: ret, newpath: path }
} }
} catch (e) { } catch (e) {
throw new Error(e) throw new Error(e)
@ -709,7 +709,7 @@ class FileManager extends Plugin {
// TODO: Only keep `this.emit` (issue#2210) // TODO: Only keep `this.emit` (issue#2210)
this.emit('noFileSelected') this.emit('noFileSelected')
if(!change.readonly){ if (!change.readonly){
let file = this.normalize(change.path) let file = this.normalize(change.path)
const resolved = this.getPathFromUrl(file) const resolved = this.getPathFromUrl(file)
file = resolved.file file = resolved.file
@ -722,7 +722,7 @@ class FileManager extends Plugin {
} }
async closeDiff(change: commitChange) { async closeDiff(change: commitChange) {
if(!change.readonly){ if (!change.readonly){
const file = this.normalize(change.path) const file = this.normalize(change.path)
delete this.openedFiles[file] delete this.openedFiles[file]
if (!Object.keys(this.openedFiles).length) { if (!Object.keys(this.openedFiles).length) {
@ -734,7 +734,6 @@ class FileManager extends Plugin {
this.emit('closeDiff', change) this.emit('closeDiff', change)
} }
async openFile(file?: string) { async openFile(file?: string) {
if (!file) { if (!file) {
this.emit('noFileSelected') this.emit('noFileSelected')
@ -751,7 +750,6 @@ class FileManager extends Plugin {
this.openedFiles[file] = file this.openedFiles[file] = file
let content = '' let content = ''
try { try {
content = await provider.get(file) content = await provider.get(file)
@ -963,7 +961,6 @@ class FileManager extends Plugin {
return exists return exists
} }
async moveFileIsAllowed (src: string, dest: string) { async moveFileIsAllowed (src: string, dest: string) {
try { try {
src = this.normalize(src) src = this.normalize(src)

@ -5,7 +5,6 @@ import EventManager from 'events'
import { Storage } from '@remix-project/remix-lib' import { Storage } from '@remix-project/remix-lib'
import pathModule from 'path' import pathModule from 'path'
export default class FileProvider { export default class FileProvider {
event: any event: any
type: any type: any

@ -67,6 +67,5 @@ export class fileSystems {
return null return null
} }
} }

@ -72,7 +72,6 @@ export class fileSystemUtility {
} }
} }
/** /**
* copy the folder recursively * copy the folder recursively
* @param {string} path is the folder to be copied over * @param {string} path is the folder to be copied over
@ -150,7 +149,6 @@ export class fileSystemUtility {
} }
} }
/* eslint-disable no-template-curly-in-string */ /* eslint-disable no-template-curly-in-string */
export const migrationTestData = { export const migrationTestData = {
'.workspaces': { '.workspaces': {

@ -47,7 +47,6 @@ export class IndexedDBStorage extends LightningFS {
} }
} }
export class indexedDBFileSystem extends fileSystem { export class indexedDBFileSystem extends fileSystem {
constructor() { constructor() {
super() super()

@ -48,7 +48,7 @@ export class localStorageFS extends fileSystem {
localStorage.setItem(test, test); localStorage.setItem(test, test);
localStorage.removeItem(test); localStorage.removeItem(test);
resolve(true) resolve(true)
} catch(e) { } catch (e) {
reject(e) reject(e)
} }
}) })

@ -3,7 +3,7 @@ import React from 'react' // eslint-disable-line
import { RemixUiTerminal, RemixUITerminalWrapper } from '@remix-ui/terminal' // eslint-disable-line import { RemixUiTerminal, RemixUITerminalWrapper } from '@remix-ui/terminal' // eslint-disable-line
import { Plugin } from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
import { PluginViewWrapper } from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
import vm from 'vm' import vm from 'vm'
import EventManager from '../../lib/events' import EventManager from '../../lib/events'
@ -11,7 +11,6 @@ import EventManager from '../../lib/events'
import { CompilerImports } from '@remix-project/core-plugin' // eslint-disable-line import { CompilerImports } from '@remix-project/core-plugin' // eslint-disable-line
import { RemixUiXterminals } from '@remix-ui/xterm' import { RemixUiXterminals } from '@remix-ui/xterm'
const KONSOLES = [] const KONSOLES = []
function register(api) { KONSOLES.push(api) } function register(api) { KONSOLES.push(api) }
@ -113,7 +112,6 @@ class Terminal extends Plugin {
} }
onActivation() { onActivation() {
this.renderComponent() this.renderComponent()
} }
@ -142,7 +140,7 @@ class Terminal extends Plugin {
} }
updateComponent(state) { updateComponent(state) {
return( return (
<RemixUITerminalWrapper <RemixUITerminalWrapper
plugin={state.plugin} plugin={state.plugin}
onReady={state.onReady} onReady={state.onReady}

@ -210,8 +210,6 @@ export class CodeFormat extends Plugin {
this.call('notification', 'toast', `Error parsing prettier config file: ${prettierConfigFile}`) this.call('notification', 'toast', `Error parsing prettier config file: ${prettierConfigFile}`)
} }
// merge options // merge options
if (parsed) { if (parsed) {
options = { options = {
@ -251,7 +249,6 @@ export class CodeFormat extends Plugin {
} }
} }
const result = this.prettier.format(content, { const result = this.prettier.format(content, {
plugins: [sol as any, this.ts, this.babel, this.espree, this.yml], plugins: [sol as any, this.ts, this.babel, this.espree, this.yml],
parser: parserName, parser: parserName,

@ -194,4 +194,3 @@ export function parse(text, _parsers, options) {
return parsed; return parsed;
} }

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { ViewPlugin } from '@remixproject/engine-web' import { ViewPlugin } from '@remixproject/engine-web'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
import { RemixAppManager } from '../../remixAppManager' import { RemixAppManager } from '../../remixAppManager'
import { RemixUiCompileDetails } from '@remix-ui/solidity-compile-details' import { RemixUiCompileDetails } from '@remix-ui/solidity-compile-details'

@ -1,6 +1,6 @@
import { Plugin } from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import { QueryParams } from '@remix-project/remix-lib' import { QueryParams } from '@remix-project/remix-lib'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
const profile = { const profile = {
name: 'config', name: 'config',

@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {customAction} from '@remixproject/plugin-api' import { customAction } from '@remixproject/plugin-api'
import {concatSourceFiles, getDependencyGraph, normalizeContractPath} from '@remix-ui/solidity-compiler' import { concatSourceFiles, getDependencyGraph, normalizeContractPath } from '@remix-ui/solidity-compiler'
import type {CompilerInput, CompilationSource } from '@remix-project/remix-solidity' import type { CompilerInput, CompilationSource } from '@remix-project/remix-solidity'
const _paq = (window._paq = window._paq || []) const _paq = (window._paq = window._paq || [])

@ -1,7 +1,7 @@
import { ElectronPlugin } from '@remixproject/engine-electron'; import { ElectronPlugin } from '@remixproject/engine-electron';
import { Plugin } from '@remixproject/engine'; import { Plugin } from '@remixproject/engine';
import { baseURLBin, baseURLWasm } from '@remix-project/remix-solidity' import { baseURLBin, baseURLWasm } from '@remix-project/remix-solidity'
import axios, {AxiosResponse} from 'axios' import axios, { AxiosResponse } from 'axios'
import { iSolJsonBinData } from '@remix-project/remix-lib' import { iSolJsonBinData } from '@remix-project/remix-lib'
const profile = { const profile = {

@ -78,7 +78,7 @@ export class fsPlugin extends ElectronPlugin {
try { try {
path = fixPath(path) path = fixPath(path)
const stat = await this.call('fs', 'stat', path) const stat = await this.call('fs', 'stat', path)
if(!stat) return undefined if (!stat) return undefined
stat.isDirectory = () => stat.isDirectoryValue stat.isDirectory = () => stat.isDirectoryValue
stat.isFile = () => !stat.isDirectoryValue stat.isFile = () => !stat.isDirectoryValue
return stat return stat
@ -90,7 +90,7 @@ export class fsPlugin extends ElectronPlugin {
try { try {
path = fixPath(path) path = fixPath(path)
const stat = await this.call('fs', 'lstat', path) const stat = await this.call('fs', 'lstat', path)
if(!stat) return undefined if (!stat) return undefined
stat.isDirectory = () => stat.isDirectoryValue stat.isDirectory = () => stat.isDirectoryValue
stat.isFile = () => !stat.isDirectoryValue stat.isFile = () => !stat.isDirectoryValue
return stat return stat
@ -116,7 +116,7 @@ export class fsPlugin extends ElectronPlugin {
await this.call('fileManager', 'refresh') await this.call('fileManager', 'refresh')
}) })
this.on('fs', 'error', async (error: string) => { this.on('fs', 'error', async (error: string) => {
if(error === 'ENOSPC'){ if (error === 'ENOSPC'){
this.call('notification', 'alert', { this.call('notification', 'alert', {
id: 'fsError', id: 'fsError',
message: 'Cannot watch file changes. There are too many files in your project.' message: 'Cannot watch file changes. There are too many files in your project.'

@ -55,8 +55,8 @@ export class FileDecorator extends Plugin {
if (!from) return if (!from) return
const filteredState = this._fileStates.filter((state) => { const filteredState = this._fileStates.filter((state) => {
if(state.owner != from) return true if (state.owner != from) return true
if(path && state.path != path) return true if (path && state.path != path) return true
}) })
const newState = [...filteredState].sort(sortByPath) const newState = [...filteredState].sort(sortByPath)

@ -13,7 +13,6 @@ const profile = {
icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxLjAwNyA4LjIyMTY4QzIxLjAxMDUgNy41Mjc5MiAyMC44MjA3IDYuODQ2ODkgMjAuNDU5MSA2LjI1NDg1QzIwLjA5NzQgNS42NjI4MSAxOS41NzggNS4xODMxNSAxOC45NTkyIDQuODY5NTdDMTguMzQwMyA0LjU1NiAxNy42NDYzIDQuNDIwOTEgMTYuOTU1MSA0LjQ3OTQxQzE2LjI2MzcgNC41Mzc5MyAxNS42MDI1IDQuNzg3NzMgMTUuMDQ1IDUuMjAwODVDMTQuNDg3NyA1LjYxMzk3IDE0LjA1NjMgNi4xNzQwOSAxMy43OTkzIDYuODE4NUMxMy41NDI0IDcuNDYyOSAxMy40Njk3IDguMTY2MTMgMTMuNTg5OCA4Ljg0OTQ0QzEzLjcwOTkgOS41MzI3NCAxNC4wMTc3IDEwLjE2OTIgMTQuNDc4OSAxMC42ODc0QzE0Ljk0MDIgMTEuMjA1NiAxNS41MzY3IDExLjU4NTIgMTYuMjAxNSAxMS43ODM2QzE1Ljk1NiAxMi4yODI0IDE1LjU3NjMgMTIuNzAzIDE1LjEwNDkgMTIuOTk3OUMxNC42MzM2IDEzLjI5MjkgMTQuMDg5NCAxMy40NTA1IDEzLjUzMzQgMTMuNDUzMkgxMC41NDRDOS40MzcyNiAxMy40NTcxIDguMzcxNjMgMTMuODcyNyA3LjU1NDUxIDE0LjYxOTFWNy4zOTgwOUM4LjQ2MTg0IDcuMjEyODggOS4yNjgwOCA2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SA2LjE1MDI3QzE4LjUzNzkgNi4zMTk5NyAxOC44ODgxIDYuNjA3MzQgMTkuMTM0NCA2Ljk3NjA1QzE5LjM4MDcgNy4zNDQ3NiAxOS41MTIzIDcuNzc4MjMgMTkuNTEyMyA4LjIyMTY4QzE5LjUxMjMgOC44MTYzMiAxOS4yNzYgOS4zODY2IDE4Ljg1NTYgOS44MDcwNkMxOC40MzUxIDEwLjIyNzUgMTcuODY0OCAxMC40NjM4IDE3LjI3MDIgMTAuNDYzOFoiIGZpbGw9IiM0MjQyNDIiLz4KPC9zdmc+Cg=="
} }
export class GitPlugin extends ViewPlugin { export class GitPlugin extends ViewPlugin {
constructor() { constructor() {

@ -1,8 +1,8 @@
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {LibraryProfile, MethodApi, StatusEvents} from '@remixproject/plugin-utils' import { LibraryProfile, MethodApi, StatusEvents } from '@remixproject/plugin-utils'
import {AppModal} from '@remix-ui/app' import { AppModal } from '@remix-ui/app'
import {AlertModal} from '@remix-ui/app' import { AlertModal } from '@remix-ui/app'
import {dispatchModalInterface} from '@remix-ui/app' import { dispatchModalInterface } from '@remix-ui/app'
interface INotificationApi { interface INotificationApi {
events: StatusEvents events: StatusEvents

@ -19,7 +19,7 @@ export class OpenAIGpt extends Plugin {
async message(prompt): Promise<CreateChatCompletionResponse> { async message(prompt): Promise<CreateChatCompletionResponse> {
this.call('layout', 'maximizeTerminal') this.call('layout', 'maximizeTerminal')
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Waiting for GPT answer...'}) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Waiting for GPT answer...' })
let result let result
try { try {
result = await ( result = await (
@ -39,7 +39,7 @@ export class OpenAIGpt extends Plugin {
if (result && result.choices && result.choices.length) { if (result && result.choices && result.choices.length) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.choices[0].message.content }) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.choices[0].message.content })
} else if (result.error) { } else if (result.error) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error }) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error })
} else { } else {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'No response...' }) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'No response...' })

@ -544,7 +544,6 @@ export class CodeParser extends Plugin {
return nodeDefinition.ast return nodeDefinition.ast
} }
return nodeDefinition.parser return nodeDefinition.parser
} }

@ -4,7 +4,7 @@ import { AstNode } from "@remix-project/remix-solidity"
import { CodeParser } from "../code-parser" import { CodeParser } from "../code-parser"
import { antlr } from '../types' import { antlr } from '../types'
import { pathToFileURL } from 'url' import { pathToFileURL } from 'url'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
const SolidityParser = (window as any).SolidityParser = (window as any).SolidityParser || [] const SolidityParser = (window as any).SolidityParser = (window as any).SolidityParser || []
@ -201,7 +201,6 @@ export default class CodeParserAntlrService {
return nodes return nodes
} }
/** /**
* *
* @param ast * @param ast
@ -247,7 +246,7 @@ export default class CodeParserAntlrService {
try { try {
const startTime = Date.now() const startTime = Date.now()
const blocks = (SolidityParser as any).parseBlock(fileContent, { loc: true, range: true, tolerant: true }) const blocks = (SolidityParser as any).parseBlock(fileContent, { loc: true, range: true, tolerant: true })
if(this.cache[this.plugin.currentFile] && this.cache[this.plugin.currentFile].blockDurations){ if (this.cache[this.plugin.currentFile] && this.cache[this.plugin.currentFile].blockDurations){
this.cache[this.plugin.currentFile].blockDurations = [...this.cache[this.plugin.currentFile].blockDurations.slice(-this.parserThresholdSampleAmount), Date.now() - startTime] this.cache[this.plugin.currentFile].blockDurations = [...this.cache[this.plugin.currentFile].blockDurations.slice(-this.parserThresholdSampleAmount), Date.now() - startTime]
this.setFileParsingState(this.plugin.currentFile) this.setFileParsingState(this.plugin.currentFile)
} }

@ -75,7 +75,6 @@ export default class CodeParserCompiler {
length: error.sourceLocation.end - error.sourceLocation.start length: error.sourceLocation.end - error.sourceLocation.start
}, lineBreaks) }, lineBreaks)
const filePath = error.sourceLocation.file const filePath = error.sourceLocation.file
const fileTarget = await this.plugin.call('fileManager', 'getUrlFromPath', filePath) const fileTarget = await this.plugin.call('fileManager', 'getUrlFromPath', filePath)
@ -110,11 +109,10 @@ export default class CodeParserCompiler {
nodesPerFile: {}, nodesPerFile: {},
} }
this.plugin._buildIndex(data, source) this.plugin._buildIndex(data, source)
// cast from the remix-plugin interface to the solidity one. Should be fixed when remix-plugin move to the remix-project repository // cast from the remix-plugin interface to the solidity one. Should be fixed when remix-plugin move to the remix-project repository
const extractedFiledNodes = this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult) const extractedFiledNodes = this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult)
if(extractedFiledNodes) { if (extractedFiledNodes) {
this.plugin.nodeIndex.nodesPerFile[this.plugin.currentFile] = extractedFiledNodes this.plugin.nodeIndex.nodesPerFile[this.plugin.currentFile] = extractedFiledNodes
} }
await this.plugin.gasService.showGasEstimates() await this.plugin.gasService.showGasEstimates()
@ -227,7 +225,7 @@ export default class CodeParserCompiler {
const fileTarget = await this.plugin.call('fileManager', 'getPathFromUrl', fileName) const fileTarget = await this.plugin.call('fileManager', 'getPathFromUrl', fileName)
await this.plugin.call('fileDecorator', 'clearFileDecorators', fileTarget.file) await this.plugin.call('fileDecorator', 'clearFileDecorators', fileTarget.file)
} }
if(decorators.length > 0) if (decorators.length > 0)
await this.plugin.call('fileDecorator', 'setFileDecorators', decorators) await this.plugin.call('fileDecorator', 'setFileDecorators', decorators)
await this.plugin.call('editor', 'clearErrorMarkers', filesWithOutErrors) await this.plugin.call('editor', 'clearErrorMarkers', filesWithOutErrors)

@ -33,17 +33,16 @@ export default class CodeParserGasService {
} }
async showGasEstimates() { async showGasEstimates() {
const showGasConfig = await this.plugin.call('config', 'getAppParameter', 'show-gas') const showGasConfig = await this.plugin.call('config', 'getAppParameter', 'show-gas')
if(!showGasConfig) { if (!showGasConfig) {
await this.plugin.call('editor', 'discardLineTexts') await this.plugin.call('editor', 'discardLineTexts')
return return
} }
this.plugin.currentFile = await this.plugin.call('fileManager', 'file') this.plugin.currentFile = await this.plugin.call('fileManager', 'file')
// cast from the remix-plugin interface to the solidity one. Should be fixed when remix-plugin move to the remix-project repository // cast from the remix-plugin interface to the solidity one. Should be fixed when remix-plugin move to the remix-project repository
const extractedFiledNodes = await this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult) const extractedFiledNodes = await this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult)
if(extractedFiledNodes) { if (extractedFiledNodes) {
this.plugin.nodeIndex.nodesPerFile[this.plugin.currentFile] = extractedFiledNodes this.plugin.nodeIndex.nodesPerFile[this.plugin.currentFile] = extractedFiledNodes
} }
@ -72,10 +71,8 @@ export default class CodeParserGasService {
this.plugin.call('editor', 'addLineText', linetext, estimate.range.fileName) this.plugin.call('editor', 'addLineText', linetext, estimate.range.fileName)
} }
} }
} }
} }

@ -1,5 +1,5 @@
'use strict' 'use strict'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
import { CodeParser } from "../code-parser"; import { CodeParser } from "../code-parser";
export type CodeParserImportsData = { export type CodeParserImportsData = {
@ -20,7 +20,7 @@ export default class CodeParserImports {
} }
async getImports(){ async getImports(){
if(!this.data || !this.data.files || !this.data.timestamp || this.data.timestamp != this.directoryUpdateCacheTimeStamp){ if (!this.data || !this.data.files || !this.data.timestamp || this.data.timestamp != this.directoryUpdateCacheTimeStamp){
await this.setFileTree() await this.setFileTree()
} }
return this.data return this.data
@ -33,9 +33,9 @@ export default class CodeParserImports {
.filter(x => x !== '') .filter(x => x !== '')
.map(x => x.replace('./node_modules/', '')) .map(x => x.replace('./node_modules/', ''))
.filter(x => { .filter(x => {
if(x.includes('@openzeppelin')) { if (x.includes('@openzeppelin')) {
return !x.includes('mock') return !x.includes('mock')
}else{ } else {
return true return true
} }
}) })

@ -24,7 +24,6 @@ interface Token {
} }
} }
interface Location { interface Location {
start: { start: {
line: number line: number
@ -594,7 +593,6 @@ export type Statement =
type ASTMap<U> = { [K in ASTNodeTypeString]: U extends { type: K } ? U : never } type ASTMap<U> = { [K in ASTNodeTypeString]: U extends { type: K } ? U : never }
type ASTTypeMap = ASTMap<ASTNode> type ASTTypeMap = ASTMap<ASTNode>
export const astNodeTypes = [ export const astNodeTypes = [
'SourceUnit', 'SourceUnit',
'PragmaDirective', 'PragmaDirective',
@ -673,9 +671,6 @@ export const astNodeTypes = [
'InvalidNode' 'InvalidNode'
] as const ] as const
export const binaryOpValues = [ export const binaryOpValues = [
'+', '+',
'-', '-',
@ -725,8 +720,3 @@ export const unaryOpValues = [
] as const ] as const
export type UnaryOp = typeof unaryOpValues[number] export type UnaryOp = typeof unaryOpValues[number]

@ -1,9 +1,9 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {AppModal} from '@remix-ui/app' import { AppModal } from '@remix-ui/app'
import {PermissionHandlerDialog, PermissionHandlerValue} from '@remix-ui/permission-handler' import { PermissionHandlerDialog, PermissionHandlerValue } from '@remix-ui/permission-handler'
import {Profile} from '@remixproject/plugin-utils' import { Profile } from '@remixproject/plugin-utils'
const profile = { const profile = {
name: 'permissionhandler', name: 'permissionhandler',
@ -89,7 +89,7 @@ export class PermissionHandlerPlugin extends Plugin {
if (!this.permissions[to.name][method][from.name]) return this.openPermission(from, to, method, message, sensitiveCall) if (!this.permissions[to.name][method][from.name]) return this.openPermission(from, to, method, message, sensitiveCall)
} }
const {allow, hash} = sensitiveCall ? this.sessionPermissions[to.name][method][from.name] : this.permissions[to.name][method][from.name] const { allow, hash } = sensitiveCall ? this.sessionPermissions[to.name][method][from.name] : this.permissions[to.name][method][from.name]
if (!allow) { if (!allow) {
const warning = this.notAllowWarning(from, to, method) const warning = this.notAllowWarning(from, to, method)
const warnEl = const warnEl =
@ -97,9 +97,9 @@ export class PermissionHandlerPlugin extends Plugin {
<span>{ warning }</span> <span>{ warning }</span>
<div className='d-flex flex-row'> <div className='d-flex flex-row'>
<span onClick={()=>{}}>To change the permission go to </span> <span onClick={()=>{}}>To change the permission go to </span>
<span className='px-2' style={{fontWeight: 'bolder'}}>Plugin Manager</span> <span className='px-2' style={{ fontWeight: 'bolder' }}>Plugin Manager</span>
<img alt="" id="permissionModalImagesFrom" src="/assets/img/pluginManager.webp" style={{height: '1rem', width: '1rem'}} /> <img alt="" id="permissionModalImagesFrom" src="/assets/img/pluginManager.webp" style={{ height: '1rem', width: '1rem' }} />
<span className='pl-1' style={{fontWeight: 'bolder'}}> / Permissions</span> <span className='pl-1' style={{ fontWeight: 'bolder' }}> / Permissions</span>
</div> </div>
</div> </div>
this.call('notification', 'toast', warnEl) this.call('notification', 'toast', warnEl)
@ -130,7 +130,7 @@ export class PermissionHandlerPlugin extends Plugin {
} }
const modal: AppModal = { const modal: AppModal = {
id: 'PermissionHandler', id: 'PermissionHandler',
title: <FormattedMessage id="permissionHandler.permissionNeededFor" values={{to: to.displayName || to.name}} />, title: <FormattedMessage id="permissionHandler.permissionNeededFor" values={{ to: to.displayName || to.name }} />,
message: <PermissionHandlerDialog plugin={this} theme={await this.getTheme()} value={value}></PermissionHandlerDialog>, message: <PermissionHandlerDialog plugin={this} theme={await this.getTheme()} value={value}></PermissionHandlerDialog>,
okLabel: <FormattedMessage id="permissionHandler.accept" />, okLabel: <FormattedMessage id="permissionHandler.accept" />,
cancelLabel: <FormattedMessage id="permissionHandler.decline" /> cancelLabel: <FormattedMessage id="permissionHandler.decline" />

@ -114,7 +114,7 @@ export class RemixGuidePlugin extends ViewPlugin {
tagList={['L2', 'AI']} tagList={['L2', 'AI']}
logo='/assets/img/soliditySurvey2023.webp' logo='/assets/img/soliditySurvey2023.webp'
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
@ -122,55 +122,55 @@ export class RemixGuidePlugin extends ViewPlugin {
pinned={true} pinned={true}
tagList={['L2', 'plugins']} tagList={['L2', 'plugins']}
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> <RemixUIGridCell </RemixUIGridCell> <RemixUIGridCell
plugin={this} plugin={this}
title="something" title="something"
pinned={false} pinned={false}
tagList={['solidity', 'plugins']} tagList={['solidity', 'plugins']}
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
tagList={['solidity']} tagList={['solidity']}
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> <RemixUIGridCell </RemixUIGridCell> <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="Something very very long" title="Something very very long"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> <RemixUIGridCell </RemixUIGridCell> <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
</RemixUIGridSection> </RemixUIGridSection>
<RemixUIGridSection <RemixUIGridSection
@ -183,58 +183,58 @@ export class RemixGuidePlugin extends ViewPlugin {
title="first item" title="first item"
logo='/assets/img/soliditySurvey2023.webp' logo='/assets/img/soliditySurvey2023.webp'
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="next" title="next"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> <RemixUIGridCell </RemixUIGridCell> <RemixUIGridCell
plugin={this} plugin={this}
title="something" title="something"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> <RemixUIGridCell </RemixUIGridCell> <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> <RemixUIGridCell </RemixUIGridCell> <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
<RemixUIGridCell <RemixUIGridCell
plugin={this} plugin={this}
title="1" title="1"
> >
<img src={'/assets/img/soliditySurvey2023.webp'} style={{height: '70px', width: '70px'}} alt=""></img> <img src={'/assets/img/soliditySurvey2023.webp'} style={{ height: '70px', width: '70px' }} alt=""></img>
</RemixUIGridCell> </RemixUIGridCell>
</RemixUIGridSection> </RemixUIGridSection>
</RemixUIGridView> </RemixUIGridView>

@ -1,13 +1,13 @@
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
import React, {useRef, useState, useEffect} from 'react' // eslint-disable-line import React, {useRef, useState, useEffect} from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import {WebsocketPlugin} from '@remixproject/engine-web' import { WebsocketPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries // eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import {version as remixdVersion} from '../../../../../libs/remixd/package.json' import { version as remixdVersion } from '../../../../../libs/remixd/package.json'
import {PluginManager} from '@remixproject/engine' import { PluginManager } from '@remixproject/engine'
import {AppModal, AlertModal, appPlatformTypes} from '@remix-ui/app' import { AppModal, AlertModal, appPlatformTypes } from '@remix-ui/app'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
const LOCALHOST = ' - connect to localhost - ' const LOCALHOST = ' - connect to localhost - '
@ -85,7 +85,7 @@ export class RemixdHandle extends WebsocketPlugin {
console.log(error) console.log(error)
const alert: AlertModal = { const alert: AlertModal = {
id: 'connectionAlert', id: 'connectionAlert',
message: window._intl.formatMessage({id: 'remixd.connectionAlert1'}), message: window._intl.formatMessage({ id: 'remixd.connectionAlert1' }),
} }
this.call('notification', 'alert', alert) this.call('notification', 'alert', alert)
this.canceled() this.canceled()
@ -96,14 +96,14 @@ export class RemixdHandle extends WebsocketPlugin {
clearInterval(intervalId) clearInterval(intervalId)
const alert: AlertModal = { const alert: AlertModal = {
id: 'connectionAlert', id: 'connectionAlert',
message: window._intl.formatMessage({id: 'remixd.connectionAlert2'}), message: window._intl.formatMessage({ id: 'remixd.connectionAlert2' }),
} }
this.call('notification', 'alert', alert) this.call('notification', 'alert', alert)
this.canceled() this.canceled()
} }
}, 3000) }, 3000)
this.localhostProvider.init(() => { this.localhostProvider.init(() => {
this.call('filePanel', 'setWorkspace', {name: LOCALHOST, isLocalhost: true}, true) this.call('filePanel', 'setWorkspace', { name: LOCALHOST, isLocalhost: true }, true)
}) })
for (const plugin of this.dependentPlugins) { for (const plugin of this.dependentPlugins) {
await this.appManager.activatePlugin(plugin) await this.appManager.activatePlugin(plugin)
@ -116,10 +116,10 @@ export class RemixdHandle extends WebsocketPlugin {
// warn the user only if he/she is in the browser context // warn the user only if he/she is in the browser context
const mod: AppModal = { const mod: AppModal = {
id: 'remixdConnect', id: 'remixdConnect',
title: window._intl.formatMessage({id: 'remixd.remixdConnect'}), title: window._intl.formatMessage({ id: 'remixd.remixdConnect' }),
message: remixdDialog(), message: remixdDialog(),
okLabel: window._intl.formatMessage({id: 'remixd.connect'}), okLabel: window._intl.formatMessage({ id: 'remixd.connect' }),
cancelLabel: window._intl.formatMessage({id: 'remixd.cancel'}), cancelLabel: window._intl.formatMessage({ id: 'remixd.cancel' }),
} }
const result = await this.call('notification', 'modal', mod) const result = await this.call('notification', 'modal', mod)
if (result) { if (result) {

@ -41,7 +41,7 @@ export class SolCoder extends Plugin {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data":[prompt, "code_completion", "", false,1000,0.9,0.92,50]}), body: JSON.stringify({ "data":[prompt, "code_completion", "", false,1000,0.9,0.92,50]}),
}) })
).json() ).json()
if ("error" in result){ if ("error" in result){
@ -52,7 +52,7 @@ export class SolCoder extends Plugin {
} catch (e) { } catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` }) this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return return
}finally { } finally {
this.emit("aiInferingDone") this.emit("aiInferingDone")
} }
} }
@ -69,18 +69,18 @@ export class SolCoder extends Plugin {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data":[prompt, "solidity_answer", false,1000,0.9,0.8,50]}), body: JSON.stringify({ "data":[prompt, "solidity_answer", false,1000,0.9,0.8,50]}),
}) })
).json() ).json()
} catch (e) { } catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` }) this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return return
}finally { } finally {
this.emit("aiInferingDone") this.emit("aiInferingDone")
} }
if (result) { if (result) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0]}) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0] })
} else if (result.error) { } else if (result.error) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "Error on request" }) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "Error on request" })
} }
@ -98,17 +98,17 @@ export class SolCoder extends Plugin {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data":[prompt, "code_explaining", false,2000,0.9,0.8,50, context]}), body: JSON.stringify({ "data":[prompt, "code_explaining", false,2000,0.9,0.8,50, context]}),
}) })
).json() ).json()
if (result) { if (result) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0]}) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0] })
} }
return result.data[0] return result.data[0]
} catch (e) { } catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` }) this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return return
}finally { } finally {
this.emit("aiInferingDone") this.emit("aiInferingDone")
} }
} }
@ -124,7 +124,7 @@ export class SolCoder extends Plugin {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data": !options? [ body: JSON.stringify({ "data": !options? [
prompt, // string in 'context_code' Textbox component prompt, // string in 'context_code' Textbox component
"code_completion", "code_completion",
"", // string in 'comment' Textbox component "", // string in 'comment' Textbox component
@ -170,7 +170,7 @@ export class SolCoder extends Plugin {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data":[ body: JSON.stringify({ "data":[
msg_pfx, // Text before current cursor line msg_pfx, // Text before current cursor line
"code_insertion", "code_insertion",
msg_sfx, // Text after current cursor line msg_sfx, // Text after current cursor line
@ -178,7 +178,7 @@ export class SolCoder extends Plugin {
0.5, 0.5,
0.92, 0.92,
50 50
] }), ]}),
}) })
).json() ).json()
@ -195,6 +195,4 @@ export class SolCoder extends Plugin {
} }
} }
} }

@ -1,8 +1,8 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {format} from 'util' import { format } from 'util'
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {compile} from '@remix-project/remix-solidity' import { compile } from '@remix-project/remix-solidity'
import {Transaction} from 'web3-types' import { Transaction } from 'web3-types'
const _paq = (window._paq = window._paq || []) //eslint-disable-line const _paq = (window._paq = window._paq || []) //eslint-disable-line
const profile = { const profile = {
@ -37,7 +37,7 @@ export class SolidityScript extends Plugin {
${functionName}(); ${functionName}();
} }
}` }`
const targets = {'script.sol': {content}} const targets = { 'script.sol': { content } }
// compile // compile
const compilation = await compile(targets, params, async (url, cb) => { const compilation = await compile(targets, params, async (url, cb) => {

@ -1,17 +1,17 @@
/* eslint-disable @nrwl/nx/enforce-module-boundaries */ /* eslint-disable @nrwl/nx/enforce-module-boundaries */
import {ViewPlugin} from '@remixproject/engine-web' import { ViewPlugin } from '@remixproject/engine-web'
import React from 'react' import React from 'react'
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries // eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import {RemixUiSolidityUmlGen} from '@remix-ui/solidity-uml-gen' import { RemixUiSolidityUmlGen } from '@remix-ui/solidity-uml-gen'
import {ISolidityUmlGen, ThemeQualityType, ThemeSummary} from 'libs/remix-ui/solidity-uml-gen/src/types' import { ISolidityUmlGen, ThemeQualityType, ThemeSummary } from 'libs/remix-ui/solidity-uml-gen/src/types'
import {RemixAppManager} from 'libs/remix-ui/plugin-manager/src/types' import { RemixAppManager } from 'libs/remix-ui/plugin-manager/src/types'
import {normalizeContractPath} from 'libs/remix-ui/solidity-compiler/src/lib/logic/flattenerUtilities' import { normalizeContractPath } from 'libs/remix-ui/solidity-compiler/src/lib/logic/flattenerUtilities'
import {convertAST2UmlClasses} from 'sol2uml/lib/converterAST2Classes' import { convertAST2UmlClasses } from 'sol2uml/lib/converterAST2Classes'
import vizRenderStringSync from '@aduh95/viz.js/sync' import vizRenderStringSync from '@aduh95/viz.js/sync'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
import {customAction} from '@remixproject/plugin-api' import { customAction } from '@remixproject/plugin-api'
import {ClassOptions} from 'sol2uml/lib/converterClass2Dot' import { ClassOptions } from 'sol2uml/lib/converterClass2Dot'
import type {CompilerInput} from '@remix-project/remix-solidity' import type { CompilerInput } from '@remix-project/remix-solidity'
const parser = (window as any).SolidityParser const parser = (window as any).SolidityParser
const _paq = (window._paq = window._paq || []) const _paq = (window._paq = window._paq || [])
@ -207,10 +207,10 @@ interface Sol2umlClassOptions extends ClassOptions {
textColor?: string textColor?: string
} }
import {dirname} from 'path' import { dirname } from 'path'
import {convertClass2Dot} from 'sol2uml/lib/converterClass2Dot' import { convertClass2Dot } from 'sol2uml/lib/converterClass2Dot'
import {Association, ClassStereotype, ReferenceType, UmlClass} from 'sol2uml/lib/umlClass' import { Association, ClassStereotype, ReferenceType, UmlClass } from 'sol2uml/lib/umlClass'
import {findAssociatedClass} from 'sol2uml/lib/associations' import { findAssociatedClass } from 'sol2uml/lib/associations'
// const debug = require('debug')('sol2uml') // const debug = require('debug')('sol2uml')

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { ViewPlugin } from '@remixproject/engine-web' import { ViewPlugin } from '@remixproject/engine-web'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
import { RemixAppManager } from '../../remixAppManager' import { RemixAppManager } from '../../remixAppManager'
import { RemixUiVyperCompileDetails } from '@remix-ui/vyper-compile-details' import { RemixUiVyperCompileDetails } from '@remix-ui/vyper-compile-details'
import { ThemeKeys, ThemeObject } from '@microlink/react-json-view' import { ThemeKeys, ThemeObject } from '@microlink/react-json-view'
@ -49,13 +49,13 @@ export class VyperCompilationDetailsPlugin extends ViewPlugin {
} }
async showDetails(sentPayload: any) { async showDetails(sentPayload: any) {
const contractName = Object.entries(sentPayload).find(([key, value]) => key ) const contractName = Object.entries(sentPayload).find(([key, value]) => key )
await this.call('tabs', 'focus', 'vyperCompilationDetails') await this.call('tabs', 'focus', 'vyperCompilationDetails')
this.profile.displayName = `${contractName[0]}` this.profile.displayName = `${contractName[0]}`
this.payload = sentPayload this.payload = sentPayload
const active = await this.call('theme', 'currentTheme') const active = await this.call('theme', 'currentTheme')
if (active.quality === 'dark') { if (active.quality === 'dark') {
switch(active.name) { switch (active.name) {
case 'HackerOwl': case 'HackerOwl':
this.theme = 'harmonic' this.theme = 'harmonic'
this.themeStyle = { backgroundColor: active.backgroundColor } this.themeStyle = { backgroundColor: active.backgroundColor }
@ -78,7 +78,7 @@ export class VyperCompilationDetailsPlugin extends ViewPlugin {
break break
} }
} else { } else {
switch(active.name) { switch (active.name) {
case 'Candy': case 'Candy':
this.theme = 'apathy:inverted' this.theme = 'apathy:inverted'
this.themeStyle = { backgroundColor: active.backgroundColor } this.themeStyle = { backgroundColor: active.backgroundColor }
@ -106,7 +106,7 @@ export class VyperCompilationDetailsPlugin extends ViewPlugin {
private handleThemeChange() { private handleThemeChange() {
this.on('theme', 'themeChanged', (theme: any) => { this.on('theme', 'themeChanged', (theme: any) => {
if (theme.quality === 'dark') { if (theme.quality === 'dark') {
switch(theme.name) { switch (theme.name) {
case 'HackerOwl': case 'HackerOwl':
this.theme = 'solarized' this.theme = 'solarized'
this.themeStyle = { backgroundColor: theme.backgroundColor } this.themeStyle = { backgroundColor: theme.backgroundColor }

@ -1,7 +1,7 @@
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {AppModal, AlertModal, ModalTypes} from '@remix-ui/app' import { AppModal, AlertModal, ModalTypes } from '@remix-ui/app'
import {Blockchain} from '../../blockchain/blockchain' import { Blockchain } from '../../blockchain/blockchain'
import {ethers} from 'ethers' import { ethers } from 'ethers'
export type JsonDataRequest = { export type JsonDataRequest = {
id: number id: number
@ -66,7 +66,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
okLabel: 'OK', okLabel: 'OK',
cancelLabel: 'Cancel', cancelLabel: 'Cancel',
validationFn: (value) => { validationFn: (value) => {
if (!value) return {valid: false, message: 'value is empty'} if (!value) return { valid: false, message: 'value is empty' }
if (value.startsWith('https://') || value.startsWith('http://')) { if (value.startsWith('https://') || value.startsWith('http://')) {
return { return {
valid: true, valid: true,
@ -102,7 +102,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
sendAsync(data: JsonDataRequest): Promise<JsonDataResult> { sendAsync(data: JsonDataRequest): Promise<JsonDataResult> {
// eslint-disable-next-line no-async-promise-executor // eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
if (!this.provider) return reject({jsonrpc: '2.0', id: data.id, error: { message: 'provider node set', code: -32603 } } as JsonDataResult) if (!this.provider) return reject({ jsonrpc: '2.0', id: data.id, error: { message: 'provider node set', code: -32603 } } as JsonDataResult)
this.sendAsyncInternal(data, resolve, reject) this.sendAsyncInternal(data, resolve, reject)
}) })
} }
@ -119,7 +119,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
} }
this.call('notification', 'alert', modalContent) this.call('notification', 'alert', modalContent)
} }
await this.call('udapp', 'setEnvironmentMode', {context: 'vm-cancun'}) await this.call('udapp', 'setEnvironmentMode', { context: 'vm-cancun' })
return return
} }
@ -127,17 +127,17 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
if (this.provider) { if (this.provider) {
try { try {
const result = await this.provider.send(data.method, data.params) const result = await this.provider.send(data.method, data.params)
resolve({jsonrpc: '2.0', result, id: data.id}) resolve({ jsonrpc: '2.0', result, id: data.id })
} catch (error) { } catch (error) {
if (error && error.message && error.message.includes('net_version') && error.message.includes('SERVER_ERROR')) { if (error && error.message && error.message.includes('net_version') && error.message.includes('SERVER_ERROR')) {
this.switchAway(true) this.switchAway(true)
} }
error.code = -32603 error.code = -32603
reject({jsonrpc: '2.0', error, id: data.id}) reject({ jsonrpc: '2.0', error, id: data.id })
} }
} else { } else {
const result = data.method === 'net_listening' ? 'canceled' : [] const result = data.method === 'net_listening' ? 'canceled' : []
resolve({jsonrpc: '2.0', result: result, id: data.id}) resolve({ jsonrpc: '2.0', result: result, id: data.id })
} }
} }
} }

@ -1,9 +1,9 @@
import React, {useRef} from 'react' // eslint-disable-line import React, {useRef} from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {AppModal, ModalTypes} from '@remix-ui/app' import { AppModal, ModalTypes } from '@remix-ui/app'
import {BasicVMProvider} from './vm-provider' import { BasicVMProvider } from './vm-provider'
import {Hardfork} from '@ethereumjs/common' import { Hardfork } from '@ethereumjs/common'
export class CustomForkVMProvider extends BasicVMProvider { export class CustomForkVMProvider extends BasicVMProvider {
nodeUrl: string nodeUrl: string

@ -1,7 +1,7 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import {AbstractProvider} from './abstract-provider' import { AbstractProvider } from './abstract-provider'
const profile = { const profile = {
name: 'basic-http-provider', name: 'basic-http-provider',
@ -49,7 +49,7 @@ export class ExternalHttpProvider extends AbstractProvider {
</div> </div>
<br /> <br />
<br /> <br />
<FormattedMessage id="udapp.externalHttpProviderText3" values={{b: (chunks) => <b><>{chunks}</></b>}} /> <FormattedMessage id="udapp.externalHttpProviderText3" values={{ b: (chunks) => <b><>{chunks}</></b> }} />
<br /> <br />
<br /> <br />
<FormattedMessage <FormattedMessage

@ -1,7 +1,7 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import {AbstractProvider} from './abstract-provider' import { AbstractProvider } from './abstract-provider'
const profile = { const profile = {
name: 'foundry-provider', name: 'foundry-provider',

@ -1,7 +1,7 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import {AbstractProvider} from './abstract-provider' import { AbstractProvider } from './abstract-provider'
const profile = { const profile = {
name: 'ganache-provider', name: 'ganache-provider',

@ -1,5 +1,5 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {BasicVMProvider} from './vm-provider' import { BasicVMProvider } from './vm-provider'
export class GoerliForkVMProvider extends BasicVMProvider { export class GoerliForkVMProvider extends BasicVMProvider {
nodeUrl: string nodeUrl: string

@ -1,7 +1,7 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {FormattedMessage} from 'react-intl' import { FormattedMessage } from 'react-intl'
import {AbstractProvider} from './abstract-provider' import { AbstractProvider } from './abstract-provider'
const profile = { const profile = {
name: 'hardhat-provider', name: 'hardhat-provider',

@ -1,5 +1,5 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {InjectedCustomProvider} from './injected-custom-provider' import { InjectedCustomProvider } from './injected-custom-provider'
const profile = { const profile = {
name: 'injected-arbitrum-one-provider', name: 'injected-arbitrum-one-provider',

@ -1,5 +1,5 @@
import Web3 from 'web3' import Web3 from 'web3'
import {InjectedProviderDefault} from './injected-provider-default' import { InjectedProviderDefault } from './injected-provider-default'
export class InjectedCustomProvider extends InjectedProviderDefault { export class InjectedCustomProvider extends InjectedProviderDefault {
chainName: string chainName: string
@ -32,7 +32,7 @@ export const setCustomNetwork = async (chainName: string, chainId: string, rpcUr
try { try {
await (window as any).ethereum.request({ await (window as any).ethereum.request({
method: 'wallet_switchEthereumChain', method: 'wallet_switchEthereumChain',
params: [{chainId: chainId}] params: [{ chainId: chainId }]
}) })
} catch (switchError) { } catch (switchError) {
// This error code indicates that the chain has not been added to MetaMask. // This error code indicates that the chain has not been added to MetaMask.
@ -48,12 +48,12 @@ export const setCustomNetwork = async (chainName: string, chainId: string, rpcUr
if (blockExplorerUrls) paramsObj.blockExplorerUrls = blockExplorerUrls if (blockExplorerUrls) paramsObj.blockExplorerUrls = blockExplorerUrls
await (window as any).ethereum.request({ await (window as any).ethereum.request({
method: 'wallet_addEthereumChain', method: 'wallet_addEthereumChain',
params: [ paramsObj ] params: [paramsObj]
}) })
await (window as any).ethereum.request({ await (window as any).ethereum.request({
method: 'wallet_switchEthereumChain', method: 'wallet_switchEthereumChain',
params: [{chainId: chainId}] params: [{ chainId: chainId }]
}) })
} }
} catch (addError) { } catch (addError) {

@ -1,5 +1,5 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {InjectedCustomProvider} from './injected-custom-provider' import { InjectedCustomProvider } from './injected-custom-provider'
import Web3 from 'web3' import Web3 from 'web3'
const profile = { const profile = {

@ -1,5 +1,5 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {InjectedCustomProvider} from './injected-custom-provider' import { InjectedCustomProvider } from './injected-custom-provider'
const profile = { const profile = {
name: 'injected-optimism-provider', name: 'injected-optimism-provider',

@ -1,6 +1,6 @@
/* global ethereum */ /* global ethereum */
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {InjectedProvider} from './injected-provider' import { InjectedProvider } from './injected-provider'
export class InjectedProviderDefaultBase extends InjectedProvider { export class InjectedProviderDefaultBase extends InjectedProvider {
constructor(profile) { constructor(profile) {

@ -1,6 +1,6 @@
/* global ethereum */ /* global ethereum */
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {InjectedProvider} from './injected-provider' import { InjectedProvider } from './injected-provider'
const profile = { const profile = {
name: 'injected-trustwallet', name: 'injected-trustwallet',

@ -1,8 +1,8 @@
/* global ethereum */ /* global ethereum */
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {JsonDataRequest, RejectRequest, SuccessRequest} from '../providers/abstract-provider' import { JsonDataRequest, RejectRequest, SuccessRequest } from '../providers/abstract-provider'
import {IProvider} from './abstract-provider' import { IProvider } from './abstract-provider'
export abstract class InjectedProvider extends Plugin implements IProvider { export abstract class InjectedProvider extends Plugin implements IProvider {
options: {[id: string]: any} = {} options: {[id: string]: any} = {}
@ -45,7 +45,7 @@ export abstract class InjectedProvider extends Plugin implements IProvider {
askPermission(throwIfNoInjectedProvider) { askPermission(throwIfNoInjectedProvider) {
const web3Provider = this.getInjectedProvider() const web3Provider = this.getInjectedProvider()
if (typeof web3Provider !== 'undefined' && typeof web3Provider.request === 'function') { if (typeof web3Provider !== 'undefined' && typeof web3Provider.request === 'function') {
web3Provider.request({method: 'eth_requestAccounts'}) web3Provider.request({ method: 'eth_requestAccounts' })
} else if (throwIfNoInjectedProvider) { } else if (throwIfNoInjectedProvider) {
throw new Error(this.notFound()) throw new Error(this.notFound())
} }
@ -86,19 +86,19 @@ export abstract class InjectedProvider extends Plugin implements IProvider {
} }
try { try {
let resultData let resultData
if (web3Provider.request) resultData = await web3Provider.request({method: data.method, params: data.params}) if (web3Provider.request) resultData = await web3Provider.request({ method: data.method, params: data.params })
else if (web3Provider.send) resultData = await web3Provider.send(data.method, data.params) else if (web3Provider.send) resultData = await web3Provider.send(data.method, data.params)
else { else {
resolve({jsonrpc: '2.0', error: { message: 'provider not valid', code: -32603 }, id: data.id}) resolve({ jsonrpc: '2.0', error: { message: 'provider not valid', code: -32603 }, id: data.id })
return return
} }
if (resultData) { if (resultData) {
if (resultData.jsonrpc && resultData.jsonrpc === '2.0') { if (resultData.jsonrpc && resultData.jsonrpc === '2.0') {
resultData = resultData.result resultData = resultData.result
} }
resolve({jsonrpc: '2.0', result: resultData, id: data.id}) resolve({ jsonrpc: '2.0', result: resultData, id: data.id })
} else { } else {
resolve({jsonrpc: '2.0', result: null, id: data.id}) resolve({ jsonrpc: '2.0', result: null, id: data.id })
} }
} catch (error) { } catch (error) {
if (error.data && error.data.originalError && error.data.originalError.data) { if (error.data && error.data.originalError && error.data.originalError.data) {

@ -1,5 +1,5 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {BasicVMProvider} from './vm-provider' import { BasicVMProvider } from './vm-provider'
export class MainnetForkVMProvider extends BasicVMProvider { export class MainnetForkVMProvider extends BasicVMProvider {
nodeUrl: string nodeUrl: string

@ -1,5 +1,5 @@
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {BasicVMProvider} from './vm-provider' import { BasicVMProvider } from './vm-provider'
export class SepoliaForkVMProvider extends BasicVMProvider { export class SepoliaForkVMProvider extends BasicVMProvider {
nodeUrl: string nodeUrl: string

@ -1,8 +1,8 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {JsonDataRequest, RejectRequest, SuccessRequest} from '../providers/abstract-provider' import { JsonDataRequest, RejectRequest, SuccessRequest } from '../providers/abstract-provider'
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {IProvider} from './abstract-provider' import { IProvider } from './abstract-provider'
export class BasicVMProvider extends Plugin implements IProvider { export class BasicVMProvider extends Plugin implements IProvider {
blockchain blockchain
@ -33,7 +33,7 @@ export class BasicVMProvider extends Plugin implements IProvider {
await this.blockchain.providers.vm.provider.sendAsync(data, (error, result) => { await this.blockchain.providers.vm.provider.sendAsync(data, (error, result) => {
if (error) return reject(error) if (error) return reject(error)
else { else {
resolve({jsonrpc: '2.0', result, id: data.id}) resolve({ jsonrpc: '2.0', result, id: data.id })
} }
}) })
} catch (error) { } catch (error) {

@ -51,7 +51,7 @@ export class CompileAndRun extends Plugin {
} }
async runScript (fileName, clearAllInstances) { async runScript (fileName, clearAllInstances) {
await this.call('terminal', 'log', { value: `running ${fileName} ...`, type: 'info' }) await this.call('terminal', 'log', { value: `running ${fileName} ...`, type: 'info' })
try { try {
const exists = await this.call('fileManager', 'exists', fileName) const exists = await this.call('fileManager', 'exists', fileName)
if (!exists) { if (!exists) {

@ -1,7 +1,7 @@
import {ViewPlugin} from '@remixproject/engine-web' import { ViewPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {SearchTab} from '@remix-ui/search' import { SearchTab } from '@remix-ui/search'
const profile = { const profile = {
name: 'search', name: 'search',
displayName: 'Search in files', displayName: 'Search in files',

@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {ViewPlugin} from '@remixproject/engine-web' import { ViewPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
import {RemixUiSettings} from '@remix-ui/settings' //eslint-disable-line import {RemixUiSettings} from '@remix-ui/settings' //eslint-disable-line
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
import {PluginViewWrapper} from '@remix-ui/helper' import { PluginViewWrapper } from '@remix-ui/helper'
declare global { declare global {
interface Window { interface Window {
_paq: any _paq: any

@ -1,20 +1,20 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import {fromWei, toBigInt, toWei} from 'web3-utils' import { fromWei, toBigInt, toWei } from 'web3-utils'
import {Plugin} from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import {toBytes, addHexPrefix} from '@ethereumjs/util' import { toBytes, addHexPrefix } from '@ethereumjs/util'
import {EventEmitter} from 'events' import { EventEmitter } from 'events'
import {format} from 'util' import { format } from 'util'
import {ExecutionContext} from './execution-context' import { ExecutionContext } from './execution-context'
import Config from '../config' import Config from '../config'
import {VMProvider} from './providers/vm' import { VMProvider } from './providers/vm'
import {InjectedProvider} from './providers/injected' import { InjectedProvider } from './providers/injected'
import {NodeProvider} from './providers/node' import { NodeProvider } from './providers/node'
import {execution, EventManager, helpers} from '@remix-project/remix-lib' import { execution, EventManager, helpers } from '@remix-project/remix-lib'
import {etherScanLink} from './helper' import { etherScanLink } from './helper'
import {logBuilder, cancelUpgradeMsg, cancelProxyMsg, addressToString} from '@remix-ui/helper' import { logBuilder, cancelUpgradeMsg, cancelProxyMsg, addressToString } from '@remix-ui/helper'
const {txFormat, txExecution, typeConversion, txListener: Txlistener, TxRunner, TxRunnerWeb3, txHelper} = execution const { txFormat, txExecution, typeConversion, txListener: Txlistener, TxRunner, TxRunnerWeb3, txHelper } = execution
const {txResultHelper} = helpers const { txResultHelper } = helpers
const {resultToRemixTx} = txResultHelper const { resultToRemixTx } = txResultHelper
import * as packageJson from '../../../../package.json' import * as packageJson from '../../../../package.json'
const _paq = (window._paq = window._paq || []) //eslint-disable-line const _paq = (window._paq = window._paq || []) //eslint-disable-line
@ -91,7 +91,7 @@ export class Blockchain extends Plugin {
this.txRunner = new TxRunner(web3Runner, {}) this.txRunner = new TxRunner(web3Runner, {})
this.networkcallid = 0 this.networkcallid = 0
this.networkStatus = {network: {name: ' - ', id: ' - '}} this.networkStatus = { network: { name: ' - ', id: ' - ' } }
this.registeredPluginEvents = [] this.registeredPluginEvents = []
this.setupEvents() this.setupEvents()
this.setupProviders() this.setupProviders()
@ -110,7 +110,7 @@ export class Blockchain extends Plugin {
this.registeredPluginEvents.push(plugin.name) this.registeredPluginEvents.push(plugin.name)
this.on(plugin.name, 'chainChanged', () => { this.on(plugin.name, 'chainChanged', () => {
this.detectNetwork((error, network) => { this.detectNetwork((error, network) => {
this.networkStatus = {network, error} this.networkStatus = { network, error }
this._triggerEvent('networkStatus', [this.networkStatus]) this._triggerEvent('networkStatus', [this.networkStatus])
}) })
}) })
@ -131,7 +131,7 @@ export class Blockchain extends Plugin {
await this.loadContext(context) await this.loadContext(context)
this._triggerEvent('contextChanged', [context]) this._triggerEvent('contextChanged', [context])
this.detectNetwork((error, network) => { this.detectNetwork((error, network) => {
this.networkStatus = {network, error} this.networkStatus = { network, error }
this._triggerEvent('networkStatus', [this.networkStatus]) this._triggerEvent('networkStatus', [this.networkStatus])
}) })
}) })
@ -146,7 +146,7 @@ export class Blockchain extends Plugin {
setInterval(() => { setInterval(() => {
this.detectNetwork((error, network) => { this.detectNetwork((error, network) => {
this.networkStatus = {network, error} this.networkStatus = { network, error }
this._triggerEvent('networkStatus', [this.networkStatus]) this._triggerEvent('networkStatus', [this.networkStatus])
}) })
}, 30000) }, 30000)
@ -189,7 +189,7 @@ export class Blockchain extends Plugin {
} }
deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) { deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) {
const {continueCb, promptCb, statusCb, finalCb} = callbacks const { continueCb, promptCb, statusCb, finalCb } = callbacks
const constructor = selectedContract.getConstructorInterface() const constructor = selectedContract.getConstructorInterface()
txFormat.buildData( txFormat.buildData(
selectedContract.name, selectedContract.name,
@ -215,7 +215,7 @@ export class Blockchain extends Plugin {
} }
deployContractWithLibrary(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) { deployContractWithLibrary(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) {
const {continueCb, promptCb, statusCb, finalCb} = callbacks const { continueCb, promptCb, statusCb, finalCb } = callbacks
const constructor = selectedContract.getConstructorInterface() const constructor = selectedContract.getConstructorInterface()
txFormat.encodeConstructorCallAndLinkLibraries( txFormat.encodeConstructorCallAndLinkLibraries(
selectedContract.object, selectedContract.object,
@ -257,7 +257,7 @@ export class Blockchain extends Plugin {
} }
async runProxyTx(proxyData, implementationContractObject) { async runProxyTx(proxyData, implementationContractObject) {
const args = {useCall: false, data: proxyData} const args = { useCall: false, data: proxyData }
let networkInfo let networkInfo
const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelCb) => { const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelCb) => {
networkInfo = network networkInfo = network
@ -308,7 +308,7 @@ export class Blockchain extends Plugin {
} }
async runUpgradeTx(proxyAddress, data, newImplementationContractObject) { async runUpgradeTx(proxyAddress, data, newImplementationContractObject) {
const args = {useCall: false, data, to: proxyAddress} const args = { useCall: false, data, to: proxyAddress }
let networkInfo let networkInfo
const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelCb) => { const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelCb) => {
// continue using original authorization given by user // continue using original authorization given by user
@ -336,7 +336,7 @@ export class Blockchain extends Plugin {
} }
async saveDeployedContractStorageLayout(contractObject, proxyAddress, networkInfo) { async saveDeployedContractStorageLayout(contractObject, proxyAddress, networkInfo) {
const {contractName, implementationAddress} = contractObject const { contractName, implementationAddress } = contractObject
const networkName = networkInfo.name === 'custom' ? networkInfo.name + '-' + networkInfo.id : networkInfo.name const networkName = networkInfo.name === 'custom' ? networkInfo.name + '-' + networkInfo.id : networkInfo.name
const hasPreviousDeploys = await this.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${networkName}/UUPS.json`) const hasPreviousDeploys = await this.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${networkName}/UUPS.json`)
// TODO: make deploys folder read only. // TODO: make deploys folder read only.
@ -436,7 +436,7 @@ export class Blockchain extends Plugin {
data.contractABI = selectedContract.abi data.contractABI = selectedContract.abi
} }
this.runTx({data: data, useCall: false}, confirmationCb, continueCb, promptCb, (error, txResult, address) => { this.runTx({ data: data, useCall: false }, confirmationCb, continueCb, promptCb, (error, txResult, address) => {
if (error) { if (error) {
return finalCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`) return finalCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`)
} }
@ -578,7 +578,7 @@ export class Blockchain extends Plugin {
data.contract = contract data.contract = contract
} }
const useCall = funABI.stateMutability === 'view' || funABI.stateMutability === 'pure' const useCall = funABI.stateMutability === 'view' || funABI.stateMutability === 'pure'
this.runTx({to: address, data, useCall}, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => { this.runTx({ to: address, data, useCall }, confirmationCb, continueCb, promptCb, (error, txResult, _address, returnValue) => {
if (error) { if (error) {
return logCallback(`${logMsg} errored: ${error.message ? error.message : error}`) return logCallback(`${logMsg} errored: ${error.message ? error.message : error}`)
} }
@ -866,7 +866,7 @@ export class Blockchain extends Plugin {
const eventName = tx.useCall ? 'callExecuted' : 'transactionExecuted' const eventName = tx.useCall ? 'callExecuted' : 'transactionExecuted'
this._triggerEvent(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad]) this._triggerEvent(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad])
return resolve({result, tx}) return resolve({ result, tx })
}) })
} catch (err) { } catch (err) {
return reject(err) return reject(err)

@ -102,7 +102,6 @@ export class VMProvider {
}) })
} }
// TODO: is still here because of the plugin API // TODO: is still here because of the plugin API
// can be removed later when we update the API // can be removed later when we update the API
createVMAccount (newAccount) { createVMAccount (newAccount) {

@ -6,7 +6,7 @@ self.onmessage = (e: MessageEvent) => {
switch (data.cmd) { switch (data.cmd) {
case 'init': case 'init':
{ {
provider = new Provider({ fork: data.fork, nodeUrl: data.nodeUrl, blockNumber: data.blockNumber, stateDb: data.stateDb, blocks: data.blocks}) provider = new Provider({ fork: data.fork, nodeUrl: data.nodeUrl, blockNumber: data.blockNumber, stateDb: data.stateDb, blocks: data.blocks })
provider.init().then(() => { provider.init().then(() => {
self.postMessage({ self.postMessage({
cmd: 'initiateResult', cmd: 'initiateResult',

@ -1,11 +1,11 @@
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
import React from 'react' import React from 'react'
import './index.css' import './index.css'
import {ThemeModule} from './app/tabs/theme-module' import { ThemeModule } from './app/tabs/theme-module'
import {Preload} from './app/components/preload' import { Preload } from './app/components/preload'
import Config from './config' import Config from './config'
import {Registry} from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
import {Storage} from '@remix-project/remix-lib' import { Storage } from '@remix-project/remix-lib'
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client'
@ -13,7 +13,7 @@ import { createRoot } from 'react-dom/client'
try { try {
const configStorage = new Storage('config-v0.8:') const configStorage = new Storage('config-v0.8:')
const config = new Config(configStorage) const config = new Config(configStorage)
Registry.getInstance().put({api: config, name: 'config'}) Registry.getInstance().put({ api: config, name: 'config' })
} catch (e) {} } catch (e) {}
const theme = new ThemeModule() const theme = new ThemeModule()
theme.initTheme() theme.initTheme()

Loading…
Cancel
Save