# This is a combination of 50 commits.

# This is the 1st commit message:

executors

# This is the commit message #2:

libs

# This is the commit message #3:

remixd

# This is the commit message #4:

add react app

# This is the commit message #5:

debugging

# This is the commit message #6:

debug + sol

# This is the commit message #7:

fixes

# This is the commit message #8:

tsconfig

# This is the commit message #9:

ast walker

# This is the commit message #10:

as walker

# This is the commit message #11:

remixd etc

# This is the commit message #12:

commander

# This is the commit message #13:

remove jest

# This is the commit message #14:

rm ui files

# This is the commit message #15:

rm reserved keywords

# This is the commit message #16:

testrunner

# This is the commit message #17:

compiler

# This is the commit message #18:

production build

# This is the commit message #19:

config

# This is the commit message #20:

config

# This is the commit message #21:

web types

# This is the commit message #22:

update react

# This is the commit message #23:

add vm

# This is the commit message #24:

add workers

# This is the commit message #25:

worker2

# This is the commit message #26:

rm react app

# This is the commit message #27:

remixd

# This is the commit message #28:

worker fix

# This is the commit message #29:

fix detection

# This is the commit message #30:

revert react

# This is the commit message #31:

rename type

# This is the commit message #32:

loading handler

# This is the commit message #33:

remove import

# This is the commit message #34:

rename

# This is the commit message #35:

local plugin

# This is the commit message #36:

etherscan

# This is the commit message #37:

revert react

# This is the commit message #38:

port

# This is the commit message #39:

rm worker

# This is the commit message #40:

publicpath

# This is the commit message #41:

fix test

# This is the commit message #42:

112

# This is the commit message #43:

show version

# This is the commit message #44:

"axios": "1.1.2",

# This is the commit message #45:

config

# This is the commit message #46:

lint

# This is the commit message #47:

fix build

# This is the commit message #48:

lint

# This is the commit message #49:

error on purpose

# This is the commit message #50:

test error
executors2
filip mertens 2 years ago
parent 8a0de8fc1d
commit edaaeebea7
  1. 16
      .circleci/config.yml
  2. 37
      .eslintrc.json
  3. 5
      .gitignore
  4. 3
      ___babel.config.json
  5. 0
      ___workspace.json
  6. 218
      __nx.json
  7. 1680
      _workspace.json
  8. 4
      apps/debugger/.babelrc
  9. 61
      apps/debugger/project.json
  10. 12
      apps/debugger/src/app/debugger-api.ts
  11. 16
      apps/debugger/tsconfig.app.json
  12. 18
      apps/debugger/tsconfig.json
  13. 19
      apps/debugger/webpack.config.js
  14. 62
      apps/etherscan/project.json
  15. 28
      apps/etherscan/webpack.config.js
  16. 62
      apps/remix-ide-e2e/src/local-plugin/project.json
  17. 4
      apps/remix-ide-e2e/tsconfig.json
  18. 9
      apps/remix-ide/.babelrc
  19. 7
      apps/remix-ide/.eslintrc
  20. 19
      apps/remix-ide/ci/lint-targets.js
  21. 1
      apps/remix-ide/ci/lint.sh
  22. 1
      apps/remix-ide/ci/sauceDisconnect.js
  23. 74
      apps/remix-ide/project.json
  24. 4
      apps/remix-ide/src/app/components/panel.ts
  25. 2
      apps/remix-ide/src/app/components/side-panel.tsx
  26. 3
      apps/remix-ide/src/app/files/fileManager.ts
  27. 3
      apps/remix-ide/src/app/panels/terminal.js
  28. 4
      apps/remix-ide/src/app/plugins/notification.tsx
  29. 2
      apps/remix-ide/src/app/plugins/parser/code-parser.tsx
  30. 13
      apps/remix-ide/src/app/plugins/parser/services/antlr-worker.ts
  31. 4
      apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts
  32. 4
      apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx
  33. 1
      apps/remix-ide/src/app/tabs/abstract-provider.tsx
  34. 6
      apps/remix-ide/src/app/tabs/analysis-tab.js
  35. 6
      apps/remix-ide/src/assets/css/themes/bootstrap-cerulean.min.css
  36. 2
      apps/remix-ide/src/assets/css/themes/remix-hacker_owl.css
  37. 0
      apps/remix-ide/src/polyfills.ts
  38. 1
      apps/remix-ide/stats.json
  39. 5
      apps/remix-ide/tsconfig.app.json
  40. 59
      apps/remix-ide/webpack.config.js
  41. 61
      apps/solidity-compiler/project.json
  42. 16
      apps/solidity-compiler/tsconfig.app.json
  43. 18
      apps/solidity-compiler/tsconfig.json
  44. 39
      apps/solidity-compiler/webpack.config.js
  45. 62
      apps/vyper/project.json
  46. 9
      babel.config.js
  47. 6
      jest.config.js
  48. 4
      libs/remix-analyzer/.eslintrc
  49. 8
      libs/remix-analyzer/package.json
  50. 31
      libs/remix-analyzer/project.json
  51. 1
      libs/remix-analyzer/src/index.ts
  52. 4
      libs/remix-analyzer/test/analysis/staticAnalysisCommon-test.ts
  53. 2
      libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.ts
  54. 4
      libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.5.0.ts
  55. 7
      libs/remix-astwalker/.eslintrc
  56. 1
      libs/remix-astwalker/package.json
  57. 30
      libs/remix-astwalker/project.json
  58. 1
      libs/remix-astwalker/src/@types/remix-lib/index.d.ts
  59. 10
      libs/remix-astwalker/tests/newTests.ts
  60. 2
      libs/remix-astwalker/tests/resources/legacyAST.ts
  61. 4
      libs/remix-astwalker/tests/resources/newAST.ts
  62. 14
      libs/remix-core-plugin/.eslintrc
  63. 6
      libs/remix-core-plugin/package.json
  64. 27
      libs/remix-core-plugin/project.json
  65. 1
      libs/remix-core-plugin/src/lib/compiler-content-imports.ts
  66. 4
      libs/remix-debug/bin/rdb
  67. 8
      libs/remix-debug/package.json
  68. 31
      libs/remix-debug/project.json
  69. 2
      libs/remix-debug/src/cmdline/index.ts
  70. 11
      libs/remix-debug/src/index.ts
  71. 24
      libs/remix-debug/test.ts
  72. 2
      libs/remix-debug/test/codeManager.ts
  73. 16
      libs/remix-debug/test/debugger.ts
  74. 14
      libs/remix-debug/test/decoder/decodeInfo.ts
  75. 28
      libs/remix-debug/test/decoder/localDecoder.ts
  76. 12
      libs/remix-debug/test/decoder/localsTests/calldata.ts
  77. 19
      libs/remix-debug/test/decoder/localsTests/int.ts
  78. 11
      libs/remix-debug/test/decoder/localsTests/misc.ts
  79. 11
      libs/remix-debug/test/decoder/localsTests/misc2.ts
  80. 11
      libs/remix-debug/test/decoder/localsTests/structArray.ts
  81. 6
      libs/remix-debug/test/decoder/mockStorageResolver.ts
  82. 12
      libs/remix-debug/test/decoder/stateTests/mapping.ts
  83. 32
      libs/remix-debug/test/decoder/storageDecoder.ts
  84. 12
      libs/remix-debug/test/decoder/storageLocation.ts
  85. 2
      libs/remix-debug/test/init.ts
  86. 6
      libs/remix-debug/test/resources/testWeb3.ts
  87. 4
      libs/remix-debug/test/sourceLocationTracker.ts
  88. 2
      libs/remix-debug/test/sourceMappingDecoder.ts
  89. 8
      libs/remix-debug/test/vmCall.ts
  90. 3
      libs/remix-lib/.eslintrc
  91. 6
      libs/remix-lib/package.json
  92. 27
      libs/remix-lib/project.json
  93. 2
      libs/remix-lib/test/init.ts
  94. 10
      libs/remix-lib/test/txFormat.ts
  95. 8
      libs/remix-lib/test/txResultHelper.ts
  96. 2
      libs/remix-lib/tsconfig.json
  97. 8
      libs/remix-simulator/package.json
  98. 30
      libs/remix-simulator/project.json
  99. 6
      libs/remix-simulator/src/server.ts
  100. 10
      libs/remix-solidity/jest.config.js
  101. Some files were not shown because too many files have changed in this diff Show More

@ -25,7 +25,10 @@ jobs:
paths:
- node_modules
- run: NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js yarn build:production
- run: npx nx build remix-ide-e2e-src-local-plugin & yarn run build:libs
- run: yarn nx build remix-ide-e2e-src-local-plugin & yarn run build:libs
- run: yarn nx run debugger:build:production
- run: yarn nx run solidity-compiler:build:production
- run: yarn nx run remixd:build
- run: mkdir persist && zip -0 -r persist/dist.zip dist
- persist_to_workspace:
root: .
@ -37,16 +40,17 @@ jobs:
resource_class:
xlarge
working_directory: ~/remix-project
parallelism: 35
parallelism: 1
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- run: yarn nx graph --file=./projects.json
- run:
name: Remix Libs Linting
command: ./apps/remix-ide/ci/lint.sh
command: node ./apps/remix-ide/ci/lint-targets.js
remix-libs:
docker:
- image: cimg/node:14.17.6-browsers
@ -64,6 +68,12 @@ jobs:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- run: cd dist/libs/remix-tests && yarn
- run: cd dist/libs/remix-tests && yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver
- run: cd dist/libs/remix-tests && yarn add @remix-project/remix-lib ../../libs/remix-lib
- run: cd dist/libs/remix-tests && yarn add @remix-project/remix-solidity ../../libs/remix-solidity
- run: cd dist/libs/remix-tests && yarn add @remix-project/remix-simulator ../../libs/remix-simulator
- run: cd dist/libs/remix-tests && ./bin/remix-tests ./../../../libs/remix-tests/tests/examples_0/assert_ok_test.sol
- run: node dist/libs/remix-tests/bin/remix-tests ./libs/remix-tests/tests/examples_0/assert_ok_test.sol
- run: yarn run test:libs
remix-ide-browser:

@ -1,10 +1,19 @@
{
"root": true,
"ignorePatterns": [],
"plugins": ["@nrwl/nx"],
"ignorePatterns": [
"**/node_modules/**"
],
"plugins": [
"@nrwl/nx"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
@ -14,7 +23,9 @@
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
"onlyDependOnLibsWithTags": [
"*"
]
}
]
}
@ -22,8 +33,13 @@
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"files": [
"*.ts",
"*.tsx"
],
"extends": [
"plugin:@nrwl/nx/typescript"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-this-alias": "off",
@ -35,8 +51,13 @@
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"files": [
"*.js",
"*.jsx"
],
"extends": [
"plugin:@nrwl/nx/javascript"
],
"rules": {}
}
],

5
.gitignore vendored

@ -14,6 +14,7 @@ soljson.js
*~
*_group*.*.ts
*_group*.ts
stats.json
# compiled output
@ -56,3 +57,7 @@ testem.log
.DS_Store
.vscode/settings.json
.vscode/launch.json
libs/remix-node/
libs/remix-niks/
apps/remix-react

@ -0,0 +1,3 @@
{
"babelrcRoots": ["*"]
}

@ -0,0 +1,218 @@
{
"implicitDependencies": {
"workspace.json": "*",
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
"tsconfig.base.json": "*",
"tslint.json": "*",
".eslintrc.json": "*",
"nx.json": "*"
},
"npmScope": "remix-project",
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/workspace/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e"
]
}
}
},
"projects": {
"remix-lib": {
"tags": []
},
"remix-astwalker": {
"tags": [],
"implicitDependencies": [
"remix-lib"
]
},
"remix-analyzer": {
"tags": [],
"implicitDependencies": [
"remix-astwalker",
"remix-lib"
]
},
"remix-debug": {
"tags": [],
"implicitDependencies": [
"remix-astwalker",
"remix-lib"
]
},
"remix-simulator": {
"tags": [],
"implicitDependencies": [
"remix-lib"
]
},
"remix-solidity": {
"tags": [],
"implicitDependencies": [
"remix-lib"
]
},
"remix-tests": {
"tags": [],
"implicitDependencies": [
"remix-lib",
"remix-simulator",
"remix-solidity"
]
},
"remix-url-resolver": {
"tags": []
},
"remix-ws-templates": {
"tags": []
},
"remix-ide": {
"tags": [],
"implicitDependencies": [
"remix-analyzer",
"remix-debug",
"remix-lib",
"remix-simulator",
"remix-solidity",
"remix-tests",
"remix-astwalker",
"remix-url-resolver",
"remix-ws-templates"
]
},
"remix-ide-e2e": {
"tags": [],
"implicitDependencies": [
"remix-ide"
]
},
"remixd": {
"tags": []
},
"remix-ui-tree-view": {
"tags": []
},
"remix-ui-debugger-ui": {
"tags": []
},
"remix-ui-utils": {
"tags": []
},
"remix-ui-clipboard": {
"tags": []
},
"remix-ui-modal-dialog": {
"tags": []
},
"remix-ui-toaster": {
"tags": []
},
"debugger": {
"tags": []
},
"remix-ui-workspace": {
"tags": []
},
"remix-ui-settings": {
"tags": []
},
"remix-ui-static-analyser": {
"tags": []
},
"remix-ui-checkbox": {
"tags": []
},
"remix-ui-plugin-manager": {
"tags": []
},
"remix-core-plugin": {
"tags": []
},
"remix-ui-solidity-compiler": {
"tags": []
},
"remix-ui-publish-to-storage": {
"tags": []
},
"remix-ui-renderer": {
"tags": []
},
"remix-ui-terminal": {
"tags": []
},
"solidity-compiler": {
"tags": []
},
"remix-ide-e2e-src-local-plugin": {
"tags": []
},
"remix-ui-editor": {
"tags": []
},
"remix-ui-app": {
"tags": []
},
"remix-ui-helper": {
"tags": []
},
"remix-ui-vertical-icons-panel": {
"tags": []
},
"remix-ui-search": {
"tags": []
},
"remix-ui-home-tab": {
"tags": []
},
"remix-ui-tabs": {
"tags": []
},
"remix-ui-panel": {
"tags": []
},
"remix-ui-theme-module": {
"tags": []
},
"solidity-unit-testing": {
"tags": []
},
"remix-ui-run-tab": {
"tags": []
},
"remix-ui-permission-handler": {
"tags": []
},
"remix-ui-file-decorators": {
"tags": []
},
"remix-ui-tooltip-popup": {
"tags": []
},
"vyper": {
"tags": []
},
"etherscan": {
"tags": []
},
"remix-ui-drag-n-drop": {
"tags": []
}
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
}
}

File diff suppressed because it is too large Load Diff

@ -1,4 +0,0 @@
{
"presets": ["@nrwl/react/babel"],
"plugins": []
}

@ -0,0 +1,61 @@
{
"name": "debugger",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/debugger/src",
"projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/debugger",
"index": "apps/debugger/src/index.html",
"baseHref": "/",
"main": "apps/debugger/src/main.tsx",
"polyfills": "apps/debugger/src/polyfills.ts",
"tsConfig": "apps/debugger/tsconfig.app.json",
"assets": [
"apps/debugger/src/favicon.ico",
"apps/debugger/src/assets"
],
"styles": ["apps/debugger/src/styles.css"],
"scripts": [],
"webpackConfig": "apps/debugger/webpack.config.js"
},
"configurations": {
"development": {
},
"production": {
"fileReplacements": [
{
"replace": "apps/debugger/src/environments/environment.ts",
"with": "apps/debugger/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "debugger:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "debugger:build:development"
},
"production": {
"buildTarget": "debugger:build:production"
}
}
}
},
"tags": []
}

@ -1,5 +1,5 @@
import Web3 from 'web3'
import remixDebug, { TransactionDebugger as Debugger } from '@remix-project/remix-debug'
import {init , traceHelper, TransactionDebugger as Debugger } from '@remix-project/remix-debug'
import { CompilationOutput, Sources } from '@remix-ui/debugger-ui'
import type { CompilationResult } from '@remix-project/remix-solidity-ts'
@ -19,7 +19,7 @@ export const DebuggerApiMixin = (Base) => class extends Base {
this._web3 = new Web3(this.web3Provider)
// this._web3 can be overwritten and reset to initial value in 'debug' method
this.initialWeb3 = this._web3
remixDebug.init.extendWeb3(this._web3)
init.extendWeb3(this._web3)
this.offsetToLineColumnConverter = {
async offsetToLineColumn (rawLocation, file, sources, asts) {
@ -78,7 +78,7 @@ export const DebuggerApiMixin = (Base) => class extends Base {
}
async fetchContractAndCompile (address, receipt) {
const target = (address && remixDebug.traceHelper.isContractCreation(address)) ? receipt.contractAddress : address
const target = (address && traceHelper.isContractCreation(address)) ? receipt.contractAddress : address
const targetAddress = target || receipt.contractAddress || receipt.to
const codeAtAddress = await this._web3.eth.getCode(targetAddress)
const output = await this.call('fetchAndCompile', 'resolve', targetAddress, codeAtAddress, '.debug')
@ -97,10 +97,10 @@ export const DebuggerApiMixin = (Base) => class extends Base {
web3 = this.web3()
}
if (!web3) {
const webDebugNode = remixDebug.init.web3DebugNode(network.name)
const webDebugNode = init.web3DebugNode(network.name)
web3 = !webDebugNode ? this.web3() : webDebugNode
}
remixDebug.init.extendWeb3(web3)
init.extendWeb3(web3)
return web3
}
@ -132,7 +132,7 @@ export const DebuggerApiMixin = (Base) => class extends Base {
}
if (web3) this._web3 = web3
else this._web3 = this.initialWeb3
remixDebug.init.extendWeb3(this._web3)
init.extendWeb3(this._web3)
if (this.onDebugRequestedListener) this.onDebugRequestedListener(hash, web3)
}

@ -4,6 +4,20 @@
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx"],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}

@ -1,16 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"types": ["node", "jest"],
"resolveJsonModule": true
"allowSyntheticDefaultImports": true
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
}
]
}

@ -1,17 +1,16 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
const webpackConfig = {
...nxWebpackConfig,
node: {
fs: 'empty',
tls: 'empty',
readline: 'empty',
net: 'empty',
module: 'empty',
child_process: 'empty'
resolve : {
...nxWebpackConfig.resolve,
fallback: {
...nxWebpackConfig.resolve.fallback,
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
},
}
}
@ -20,10 +19,6 @@ module.exports = config => {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig

@ -0,0 +1,62 @@
{
"name": "etherscan",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/etherscan/src",
"projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/etherscan",
"index": "apps/etherscan/src/index.html",
"baseHref": "/",
"main": "apps/etherscan/src/main.tsx",
"polyfills": "apps/etherscan/src/polyfills.ts",
"tsConfig": "apps/etherscan/tsconfig.app.json",
"assets": [
"apps/etherscan/src/favicon.ico",
"apps/etherscan/src/assets"
],
"styles": ["apps/etherscan/src/styles.css"],
"scripts": [],
"webpackConfig": "apps/etherscan/webpack.config.js"
},
"configurations": {
"development": {
},
"production": {
"fileReplacements": [
{
"replace": "apps/etherscan/src/environments/environment.ts",
"with": "apps/etherscan/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "etherscan:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "etherscan:build:development",
"port": 5003
},
"production": {
"buildTarget": "etherscan:build:production"
}
}
}
},
"tags": []
}

@ -0,0 +1,28 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
const webpackConfig = {
...nxWebpackConfig,
resolve : {
...nxWebpackConfig.resolve,
fallback: {
...nxWebpackConfig.resolve.fallback,
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"stream": require.resolve("stream-browserify"),
"zlib": require.resolve("browserify-zlib"),
},
}
}
if (process.env.NODE_ENV === 'production') {
return {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
}
} else {
return webpackConfig
}
}

@ -0,0 +1,62 @@
{
"name": "remix-ide-e2e-src-local-plugin",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/remix-ide-e2e/src/local-plugin/src/",
"projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/remix-ide-e2e-src-local-plugin",
"index": "apps/remix-ide-e2e/src/local-plugin/src/index.html",
"baseHref": "/",
"main": "apps/remix-ide-e2e/src/local-plugin/src/main.tsx",
"polyfills": "apps/remix-ide-e2e/src/local-plugin/src/polyfills.ts",
"tsConfig": "apps/remix-ide-e2e/src/local-plugin/tsconfig.app.json",
"assets": [
],
"styles": [
"apps/remix-ide-e2e/src/local-plugin/src/styles.css"
],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
},
"configurations": {
"development": {
},
"production": {
"fileReplacements": [
{
"replace": "apps/remix-ide-e2e/src/local-plugin/src/environments/environment.ts",
"with": "apps/remix-ide-e2e/src/local-plugin/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "remix-ide-e2e-src-local-plugin:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "remix-ide-e2e-src-local-plugin:build:development",
"port": 2020
},
"production": {
"buildTarget": "remix-ide-e2e-src-local-plugin:build:production"
}
}
}
},
"tags": []
}

@ -3,7 +3,9 @@
"compilerOptions": {
"types": ["node", "nightwatch"],
"esModuleInterop": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"target": "es2015",
"module": "commonjs",
},
"include": ["**/*.ts", "**/*.js"]
}

@ -1,4 +1,9 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime"]
"presets": ["@babel/preset-env", ["@babel/preset-react",
{"runtime": "automatic"}
]],
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime"],
"ignore": [
"**/node_modules/**"
]
}

@ -14,5 +14,10 @@
},
"rules": {
"standard/no-callback-literal": "off"
}
},
"ignorePatterns": [
"**/node_modules/**",
"apps/remix-ide/src/assets/js/**/*.js"
]
}

@ -0,0 +1,19 @@
const { spawnSync } = require('child_process')
const fs = require('fs')
const { exit } = require('process')
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])
if(result.status == 0){
console.log('success')
}else{
console.log(result.stdout.toString())
console.log(result.stderr.toString())
exit(1)
}
}
}

@ -6,6 +6,7 @@ BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npx nx graph --file=projects.json
KEYS=$(jq -r '.projects | keys' workspace.json | tr -d '[],"')
(for row in $KEYS; do

@ -53,6 +53,7 @@ function callSauce (requestPath, type, callback) {
console.log('BODY: ' + chunk)
callback(null, chunk)
})
// eslint-disable-next-line @typescript-eslint/no-empty-function
res.on('end', function onEnd () {})
}

@ -0,0 +1,74 @@
{
"name": "remix-ide",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/remix-ide/src",
"projectType": "application",
"implicitDependencies": [
],
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/remix-ide",
"index": "apps/remix-ide/src/index.html",
"baseHref": "/",
"main": "apps/remix-ide/src/index.tsx",
"polyfills": "apps/remix-ide/src/polyfills.ts",
"tsConfig": "apps/remix-ide/tsconfig.app.json",
"assets": [
"apps/remix-ide/src/assets",
"apps/remix-ide/src/index.html",
"apps/remix-ide/src/404.html",
"apps/remix-ide/src/favicon.ico"
],
"styles": [],
"scripts": [],
"webpackConfig": "apps/remix-ide/webpack.config.js"
},
"configurations": {
"development": {
},
"production": {
"fileReplacements": [
{
"replace": "apps/remix-ide/src/environments/environment.ts",
"with": "apps/remix-ide/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "remix-ide:build",
"watch": true,
"liveReload": true,
"hmr": false
},
"configurations": {
"development": {
"buildTarget": "remix-ide:build:development",
"port": 8080
},
"production": {
"buildTarget": "remix-ide:build:production",
"port": 8080
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/remix-ide/**/*.{ts,tsx,js,jsx}"],
"eslintConfig": "apps/remix-ide/.eslintrc"
}
}
},
"tags": []
}

@ -1,8 +1,8 @@
import React from 'react' // eslint-disable-line
import { EventEmitter } from 'events'
import { HostPlugin } from '@remixproject/engine-web' // eslint-disable-line
import { PluginRecord } from 'libs/remix-ui/panel/src/lib/types'
const EventManager = require('../../lib/events')
import { PluginRecord } from '@remix-ui/panel'
import EventManager from '../../lib/events'
export class AbstractPanel extends HostPlugin {
events: EventEmitter

@ -3,7 +3,7 @@ import React from 'react'
import { AbstractPanel } from './panel'
import { RemixPluginPanel } from '@remix-ui/panel'
import packageJson from '../../../../../package.json'
import RemixUIPanelHeader from 'libs/remix-ui/panel/src/lib/plugins/panel-header'
import { RemixUIPanelHeader } from '@remix-ui/panel'
import { PluginViewWrapper } from '@remix-ui/helper'
// const csjs = require('csjs-inject')

@ -3,7 +3,6 @@ import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
import Registry from '../state/registry'
import { EventEmitter } from 'events'
import { RemixAppManager } from '../../../../../libs/remix-ui/plugin-manager/src/types'
import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper'
import helper from '../../lib/helper.js'
@ -39,7 +38,7 @@ class FileManager extends Plugin {
events: EventEmitter
editor: any
_components: any
appManager: RemixAppManager
appManager: any
_deps: any
getCurrentFile: () => any
getFile: (path: any) => Promise<unknown>

@ -5,7 +5,7 @@ import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
import Registry from '../state/registry'
import { PluginViewWrapper } from '@remix-ui/helper'
const vm = require('vm')
import vm from 'vm'
const EventManager = require('../../lib/events')
import { CompilerImports } from '@remix-project/core-plugin' // eslint-disable-line
@ -121,6 +121,7 @@ class Terminal extends Plugin {
renderComponent () {
const onReady = (api) => { this.terminalApi = api }
console.log(this)
this.dispatch({
plugin: this,
onReady: onReady

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

@ -9,7 +9,7 @@ import CodeParserAntlrService from './services/code-parser-antlr-service'
import CodeParserImports, { CodeParserImportsData } from './services/code-parser-imports'
import React from 'react'
import { Profile } from '@remixproject/plugin-utils'
import { ContractDefinitionAstNode, EventDefinitionAstNode, FunctionCallAstNode, FunctionDefinitionAstNode, IdentifierAstNode, ImportDirectiveAstNode, ModifierDefinitionAstNode, SourceUnitAstNode, StructDefinitionAstNode, VariableDeclarationAstNode } from 'dist/libs/remix-analyzer/src/types'
import { ContractDefinitionAstNode, EventDefinitionAstNode, FunctionCallAstNode, FunctionDefinitionAstNode, IdentifierAstNode, ImportDirectiveAstNode, ModifierDefinitionAstNode, SourceUnitAstNode, StructDefinitionAstNode, VariableDeclarationAstNode } from '@remix-project/remix-analyzer'
import { lastCompilationResult, RemixApi } from '@remixproject/plugin-api'
import { antlr } from './types'
import { ParseResult } from './types/antlr-types'

@ -1,18 +1,10 @@
let parser: any
// 'DedicatedWorkerGlobalScope' object (the Worker global scope) is accessible through the self keyword
// 'dom' and 'webworker' library files can't be included together https://github.com/microsoft/TypeScript/issues/20595
export default function (self) { // eslint-disable-line @typescript-eslint/explicit-module-boundary-types
self.addEventListener('message', (e) => {
self.onmessage = (e: MessageEvent) => {
const data: any = e.data
switch (data.cmd) {
case 'load':
{
delete self.Module
// NOTE: workaround some browsers?
self.Module = undefined
// importScripts() method of synchronously imports one or more scripts into the worker's scope
self.importScripts(e.data.url)
(self as any).importScripts(e.data.url)
// @ts-ignore
parser = SolidityParser as any;
@ -50,5 +42,4 @@ export default function (self) { // eslint-disable-line @typescript-eslint/expli
}
break
}
}, false)
}

@ -3,7 +3,7 @@
import { AstNode } from "@remix-project/remix-solidity-ts"
import { CodeParser } from "../code-parser"
import { antlr } from '../types'
import work from 'webworkify-webpack'
import { pathToFileURL } from 'url'
const SolidityParser = (window as any).SolidityParser = (window as any).SolidityParser || []
@ -42,7 +42,7 @@ export default class CodeParserAntlrService {
}
createWorker() {
this.worker = work(require.resolve('./antlr-worker'));
this.worker = new Worker(new URL('./antlr-worker', import.meta.url))
this.worker.postMessage({
cmd: 'load',
url: document.location.protocol + '//' + document.location.host + '/assets/js/parser/antlr.js',

@ -1,7 +1,7 @@
import React from 'react' // eslint-disable-line
import { Plugin } from '@remixproject/engine'
import { AppModal } from 'libs/remix-ui/app/src'
import { PermissionHandlerDialog, PermissionHandlerValue } from 'libs/remix-ui/permission-handler/src'
import { AppModal } from '@remix-ui/app'
import { PermissionHandlerDialog, PermissionHandlerValue } from '@remix-ui/permission-handler'
import { Profile } from '@remixproject/plugin-utils'
const profile = {

@ -43,6 +43,7 @@ export abstract class AbstractProvider extends Plugin {
}
sendAsync (data: JsonDataRequest): Promise<any> {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => {
if (this.blocked) return reject(new Error('provider unable to connect'))
// If provider is not set, allow to open modal only when provider is trying to connect

@ -40,11 +40,12 @@ class AnalysisTab extends ViewPlugin {
}
async onActivation () {
this.renderComponent()
const isSolidityActive = await this.call('manager', 'isActive', 'solidity')
if (!isSolidityActive) {
await this.call('manager', 'activatePlugin', 'solidity')
}
this.renderComponent()
this.event.register('staticAnaysisWarning', (count) => {
if (count > 0) {
this.emit('statusChanged', { key: count, title: `${count} warning${count === 1 ? '' : 's'}`, type: 'warning' })
@ -59,6 +60,7 @@ class AnalysisTab extends ViewPlugin {
setDispatch (dispatch) {
this.dispatch = dispatch
this.renderComponent()
}
render () {
@ -74,7 +76,7 @@ class AnalysisTab extends ViewPlugin {
}
renderComponent () {
this.dispatch({
this.dispatch && this.dispatch({
registry: this.registry,
analysisModule: this,
event: this.event

@ -1915,10 +1915,10 @@ textarea.form-control {
.form-control.is-valid,.was-validated .form-control:valid {
border-color:#73a839;
padding-right:calc(1.5em + .75rem);
background-image:background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2373a839' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2373a839' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
background-repeat:no-repeat;
background-position:right calc(.375em + .1875rem) center;
background-size:calc(.75em + .375rem) calc(.75em + .375rem)}
background-size:calc(.75em + .375rem) calc(.75em + .375rem)
}
.form-control.is-valid:focus,.was-validated .form-control:valid:focus {
border-color:#73a839;
@ -1932,7 +1932,7 @@ textarea.form-control {
border-color:#73a839;
padding-right:calc(.75em + 2.3125rem);
background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2373a839' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)
}rl("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23c71c22' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23c71c22' stroke='none'/%3e%3c/svg%3e");
}
.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus {
border-color:#73a839;
box-shadow:0 0 0 .2rem rgba(115,168,57,.25)

@ -8910,7 +8910,7 @@ div[data-id="remixIdeSidePanel"] {
}
.custom-dropdown-items {
background: #011627!important; // override --custom-select
background: #011627!important;
}
.remix-ui-tabs {

File diff suppressed because one or more lines are too long

@ -2,8 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": ["node"],
"module": "es2020"
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "./src/assets/**/*"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}

@ -1,8 +1,9 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const CopyPlugin = require("copy-webpack-plugin");
const webpack = require('webpack')
const version = require('../../package.json').version
const fs = require('fs')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const versionData = {
version: version,
@ -18,31 +19,53 @@ module.exports = config => {
...nxWebpackConfig,
resolve: {
...nxWebpackConfig.resolve,
alias: {
path: require.resolve("path-browserify"),
}
fallback: {
...nxWebpackConfig.resolve.fallback,
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"),
"fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'),
},
node: {
fs: 'empty',
tls: 'empty',
readline: 'empty',
net: 'empty',
module: 'empty',
child_process: 'empty'
},
externals: {
...nxWebpackConfig.externals,
solc: 'solc',
},
output: {
...nxWebpackConfig.output,
publicPath: '/',
filename: `[name].${versionData.version}.${versionData.timestamp}.js`,
chunkFilename: `[name].${versionData.version}.${versionData.timestamp}.js`,
},
plugins: [
...nxWebpackConfig.plugins,
new CopyWebpackPlugin({
//new BundleAnalyzerPlugin({
// analyzerMode: 'static'
//}),
new CopyPlugin({
patterns: [
{ from: '../../../node_modules/monaco-editor/dev/vs/', to: 'assets/js/monaco-editor/dev/vs' }
{ from: '../../node_modules/monaco-editor/dev/vs', to: 'assets/js/monaco-editor/dev/vs' }
].filter(Boolean)
})
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
url: ['url', 'URL'],
process: 'process/browser',
}),
]
}
@ -53,10 +76,6 @@ module.exports = config => {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: false,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig

@ -0,0 +1,61 @@
{
"name": "solidity-compiler",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/solidity-compiler/src",
"projectType": "application",
"implicitDependencies": [],
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": [
"{options.outputPath}"
],
"defaultConfiguration": "development",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/solidity-compiler",
"index": "apps/solidity-compiler/src/index.html",
"baseHref": "/",
"main": "apps/solidity-compiler/src/main.tsx",
"polyfills": "apps/solidity-compiler/src/polyfills.ts",
"tsConfig": "apps/solidity-compiler/tsconfig.app.json",
"assets": [
"apps/solidity-compiler/src/favicon.ico",
"apps/solidity-compiler/src/assets"
],
"styles": [
"apps/solidity-compiler/src/styles.css"
],
"scripts": [],
"webpackConfig": "apps/solidity-compiler/webpack.config.js"
},
"configurations": {
"development": {},
"production": {
"fileReplacements": [
{
"replace": "apps/solidity-compiler/src/environments/environment.ts",
"with": "apps/solidity-compiler/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "solidity-compiler:build"
},
"configurations": {
"development": {
"buildTarget": "solidity-compiler:build:development"
},
"production": {
"buildTarget": "solidity-compiler:build:production"
}
}
}
},
"tags": []
}

@ -4,6 +4,20 @@
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx"],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}

@ -1,16 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"types": ["node", "jest"],
"resolveJsonModule": true
"allowSyntheticDefaultImports": true
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
}
]
}

@ -1,18 +1,35 @@
const nxWebpack = require('@nrwl/react/plugins/webpack')
const TerserPlugin = require('terser-webpack-plugin')
const webpack = require('webpack')
module.exports = config => {
const nxWebpackConfig = nxWebpack(config)
const webpackConfig = {
...nxWebpackConfig,
node: {
fs: 'empty',
tls: 'empty',
readline: 'empty',
net: 'empty',
module: 'empty',
child_process: 'empty'
}
resolve: {
...nxWebpackConfig.resolve,
fallback: {
...nxWebpackConfig.resolve.fallback,
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"zlib": require.resolve("browserify-zlib"),
"fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
},
},
plugins: [
...nxWebpackConfig.plugins,
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
}
if (process.env.NODE_ENV === 'production') {
@ -20,10 +37,6 @@ module.exports = config => {
...webpackConfig,
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()]
}
}
} else {
return webpackConfig

@ -0,0 +1,62 @@
{
"name": "vyper",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/vyper/src",
"projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "development",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/vyper",
"index": "apps/vyper/src/index.html",
"baseHref": "/",
"main": "apps/vyper/src/main.tsx",
"polyfills": "apps/vyper/src/polyfills.ts",
"tsConfig": "apps/vyper/tsconfig.app.json",
"assets": [
"apps/vyper/src/favicon.ico",
"apps/vyper/src/assets"
],
"styles": ["apps/vyper/src/styles.css"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
},
"configurations": {
"development": {
},
"production": {
"fileReplacements": [
{
"replace": "apps/vyper/src/environments/environment.ts",
"with": "apps/vyper/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "vyper:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "vyper:build:development",
"port": 5002
},
"production": {
"buildTarget": "vyper:build:production"
}
}
}
},
"tags": []
}

@ -1,4 +1,9 @@
module.exports = {
"presets": ["@babel/preset-react", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-transform-modules-commonjs", "@babel/plugin-proposal-class-properties"]
"presets": ["@babel/preset-typescript", "@babel/preset-env", "@babel/preset-react"],
"plugins": [
"babel-plugin-replace-ts-export-assignment",
"@babel/plugin-transform-modules-commonjs",
"@babel/plugin-proposal-class-properties",
["@babel/plugin-proposal-private-property-in-object", { "loose": false }],
["@babel/plugin-proposal-private-methods", { "loose": false }]]
}

@ -1,7 +1,11 @@
module.exports = {
preset: 'ts-jest/presets/default-esm',
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest'
'^.+\\.(ts|js|html)$': ['ts-jest',
{
useESM: true,
}]
},
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],

@ -7,5 +7,7 @@
"dot-notation": "off",
"no-use-before-define": "off"
},
"ignorePatterns": ["!**/*"]
"ignorePatterns": [
"**/node_modules/**"
]
}

@ -2,7 +2,9 @@
"name": "@remix-project/remix-analyzer",
"version": "0.5.25",
"description": "Tool to perform static analysis on Solidity smart contracts",
"main": "src/index.js",
"scripts": {
"test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"types": "src/index.d.ts",
"contributors": [
{
@ -34,10 +36,6 @@
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"author": "Remix Team",
"license": "MIT",
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-analyzer#readme",

@ -0,0 +1,31 @@
{
"name": "remix-analyzer",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/remix-analyzer/src",
"projectType": "library",
"implicitDependencies": [
"remix-astwalker",
"remix-lib"
],
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/remix-analyzer",
"main": "libs/remix-analyzer/src/index.ts",
"tsConfig": "libs/remix-analyzer/tsconfig.lib.json",
"assets": []
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-analyzer/**/*.ts"]
}
}
},
"tags": []
}

@ -1 +1,2 @@
export { default as CodeAnalysis } from './solidity-analyzer'
export { ContractDefinitionAstNode, EventDefinitionAstNode, FunctionCallAstNode, FunctionDefinitionAstNode, IdentifierAstNode, ImportDirectiveAstNode, ModifierDefinitionAstNode, SourceUnitAstNode, StructDefinitionAstNode, VariableDeclarationAstNode } from './types'

@ -3,9 +3,11 @@ import * as common from '../../src/solidity-analyzer/modules/staticAnalysisCommo
const { localCall, thisLocalCall, libCall, externalDirect, superLocal, assignment, abiNamespaceCallNodes,
inlineAssembly, unaryOperation, nowAst, blockTimestamp, stateVariableContractNode,
functionDefinition, requireCall, selfdestruct, storageVariableNodes, dynamicDeleteUnaryOp,
// eslint-disable-next-line @typescript-eslint/no-var-requires
lowlevelCall, parameterFunction, parameterFunctionCall, inheritance, blockHashAccess, contractDefinition, funcDefForComplexParams } = require('./astBlocks')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const compiledContractObj = require('./compilationDetails/CompiledContractObj.json')
function escapeRegExp (str) {
return str.replace(/[-[\]/{}()+?.\\^$|]/g, '\\$&')
@ -237,7 +239,7 @@ test('staticAnalysisCommon.getInheritsFromName', function (t) {
test('staticAnalysisCommon.getDeclaredVariableName', function (t) {
t.plan(2)
t.ok(common.getDeclaredVariableName(storageVariableNodes.node1) === 'c', 'extract right variable name')
let node1 = JSON.parse(JSON.stringify(storageVariableNodes))
const node1 = JSON.parse(JSON.stringify(storageVariableNodes))
node1.node1.nodeType = 'FunctionCall'
t.throws(() => common.getDeclaredVariableName(node1) === 'x', new RegExp('staticAnalysisCommon.js: not a VariableDeclaration Node'), 'throw if wrong node')
})

@ -815,7 +815,7 @@ function runModuleOnFiles (Module: any, t: test.Test, cb: ((fname: string, repor
const statRunner: StatRunner = new StatRunner()
testFiles.forEach((fileName: string) => {
const reports = statRunner.runWithModuleList(compilationResults[fileName], [{ name: new Module().name, mod: new Module() }])
let report: AnalysisReportObj[] = reports[0].report
const report: AnalysisReportObj[] = reports[0].report
if (report.some((x: AnalysisReportObj) => x.warning.includes('INTERNAL ERROR'))) {
t.comment('Error while executing Module: ' + JSON.stringify(report))
}

@ -38,7 +38,7 @@ const testFiles: string[] = [
'forLoopIteratesOverDynamicArray.sol'
]
let compilationResults: Record<string, CompilationResult> = {}
const compilationResults: Record<string, CompilationResult> = {}
test('setup', function (t) {
solc.loadRemoteVersion('v0.5.0+commit.1d4f565a', (error, compiler) => {
@ -817,7 +817,7 @@ function runModuleOnFiles (Module: any, t: test.Test, cb: ((fname: string, repor
const statRunner: StatRunner = new StatRunner()
testFiles.forEach((fileName: string) => {
const reports = statRunner.runWithModuleList(compilationResults[fileName], [{ name: new Module().name, mod: new Module() }])
let report: AnalysisReportObj[] = reports[0].report
const report: AnalysisReportObj[] = reports[0].report
if (report.some((x: AnalysisReportObj) => x['warning'].includes('INTERNAL ERROR'))) {
t.comment('Error while executing Module: ' + JSON.stringify(report))
}

@ -2,9 +2,12 @@
"extends": "../../.eslintrc",
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/prefer-namespace-keyword": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-unused-vars": "off",
"dot-notation": "off",
"no-use-before-define": "off"
},
"ignorePatterns": ["!**/*"]
"ignorePatterns": [
"**/node_modules/**"
]
}

@ -4,7 +4,6 @@
"description": "Tool to walk through Solidity AST",
"main": "src/index.js",
"scripts": {
"build": "tsc",
"test": "./../../node_modules/.bin/nyc --reporter=lcov --require ts-node/register --require tsconfig-paths/register ./../../node_modules/.bin/tape ./tests/*.ts | ./../../node_modules/.bin/tap-spec; ./../../node_modules/.bin/nyc report ---reporter=text"
},
"publishConfig": {

@ -0,0 +1,30 @@
{
"name": "remix-astwalker",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/remix-astwalker/src",
"projectType": "library",
"implicitDependencies": [
"remix-lib"
],
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/remix-astwalker",
"main": "libs/remix-astwalker/src/index.ts",
"tsConfig": "libs/remix-astwalker/tsconfig.lib.json",
"assets": []
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-astwalker/**/*.ts"]
}
}
},
"tags": []
}

@ -1,6 +1,7 @@
// Type definitions for the things we need from remix-lib
declare module 'remix-lib' {
// eslint-disable-next-line @typescript-eslint/prefer-namespace-keyword
export module util {
export function findLowerBound(target: number, array: Array<number>): number;
}

@ -33,7 +33,7 @@ tape("New ASTWalker", (t: tape.Test) => {
});
// Callback Object
var callback: any = {};
const callback: any = {};
callback.FunctionDefinition = function(node: AstNode): boolean {
st.equal(node.name, "FunctionDefinition");
@ -60,7 +60,7 @@ tape("New ASTWalker", (t: tape.Test) => {
st.plan(26);
st.equal(latestAST.nodeType, 'SourceUnit')
let subNodes1 = astWalker.getASTNodeChildren(latestAST)
const subNodes1 = astWalker.getASTNodeChildren(latestAST)
st.equal(subNodes1.length, 3)
st.equal(subNodes1[0].nodeType, 'PragmaDirective')
@ -95,11 +95,11 @@ tape("New ASTWalker", (t: tape.Test) => {
st.equal(subNodes4.length, 1)
st.equal(subNodes4[0].nodeType, 'ExpressionStatement')
let subNodes5 = astWalker.getASTNodeChildren(subNodes4[0])
const subNodes5 = astWalker.getASTNodeChildren(subNodes4[0])
st.equal(subNodes5.length, 1)
st.equal(subNodes5[0].nodeType, 'Assignment')
let subNodes6 = astWalker.getASTNodeChildren(subNodes5[0])
const subNodes6 = astWalker.getASTNodeChildren(subNodes5[0])
st.equal(subNodes6.length, 2)
st.equal(subNodes6[0].nodeType, 'Identifier')
@ -125,7 +125,7 @@ tape("New ASTWalker", (t: tape.Test) => {
});
st.equal(count, astNodeCount, "traverses all AST nodes");
count = 0;
let badCall = function() {
const badCall = function() {
/* Typescript will keep us from calling walkFull with a legacyAST.
However, for non-typescript uses, we add this test which casts
to an AST to check that there is a run-time check in walkFull.

@ -1,4 +1,4 @@
let node = { "legacyAST": { "children": [{ "attributes": { "literals": ["solidity", ">=", "0.5", ".0", "<", "0.6", ".0"] }, "id": 1, "name": "PragmaDirective", "src": "0:31:0" }, { "attributes": { "SourceUnit": 53, "absolutePath": "mortal.sol", "file": "mortal.sol", "scope": 26, "symbolAliases": [null], "unitAlias": "" }, "id": 2, "name": "ImportDirective", "src": "32:20:0" }, { "attributes": { "contractDependencies": [52], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [25, 52], "name": "Greeter", "scope": 26 }, "children": [{ "attributes": { "arguments": null }, "children": [{ "attributes": { "contractScope": null, "name": "Mortal", "referencedDeclaration": 52, "type": "contract Mortal" }, "id": 3, "name": "UserDefinedTypeName", "src": "74:6:0" }], "id": 4, "name": "InheritanceSpecifier", "src": "74:6:0" }, { "attributes": { "constant": false, "name": "greeting", "scope": 25, "stateVariable": true, "storageLocation": "default", "type": "string", "value": null, "visibility": "internal" }, "children": [{ "attributes": { "name": "string", "type": "string" }, "id": 5, "name": "ElementaryTypeName", "src": "141:6:0" }], "id": 6, "name": "VariableDeclaration", "src": "141:15:0" }, { "attributes": { "documentation": null, "implemented": true, "isConstructor": true, "kind": "constructor", "modifiers": [null], "name": "", "scope": 25, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, "children": [{ "children": [{ "attributes": { "constant": false, "name": "_greeting", "scope": 16, "stateVariable": false, "storageLocation": "memory", "type": "string", "value": null, "visibility": "internal" }, "children": [{ "attributes": { "name": "string", "type": "string" }, "id": 7, "name": "ElementaryTypeName", "src": "225:6:0" }], "id": 8, "name": "VariableDeclaration", "src": "225:23:0" }], "id": 9, "name": "ParameterList", "src": "224:25:0" }, { "attributes": { "parameters": [null] }, "children": [], "id": 10, "name": "ParameterList", "src": "257:0:0" }, { "children": [{ "children": [{ "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "operator": "=", "type": "string storage ref" }, "children": [{ "attributes": { "argumentTypes": null, "overloadedDeclarations": [null], "referencedDeclaration": 6, "type": "string storage ref", "value": "greeting" }, "id": 11, "name": "Identifier", "src": "267:8:0" }, { "attributes": { "argumentTypes": null, "overloadedDeclarations": [null], "referencedDeclaration": 8, "type": "string memory", "value": "_greeting" }, "id": 12, "name": "Identifier", "src": "278:9:0" }], "id": 13, "name": "Assignment", "src": "267:20:0" }], "id": 14, "name": "ExpressionStatement", "src": "267:20:0" }], "id": 15, "name": "Block", "src": "257:37:0" }], "id": 16, "name": "FunctionDefinition", "src": "213:81:0" }, { "attributes": { "documentation": null, "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [null], "name": "greet", "scope": 25, "stateMutability": "view", "superFunction": null, "visibility": "public" }, "children": [{ "attributes": { "parameters": [null] }, "children": [], "id": 17, "name": "ParameterList", "src": "338:2:0" }, { "children": [{ "attributes": { "constant": false, "name": "", "scope": 24, "stateVariable": false, "storageLocation": "memory", "type": "string", "value": null, "visibility": "internal" }, "children": [{ "attributes": { "name": "string", "type": "string" }, "id": 18, "name": "ElementaryTypeName", "src": "362:6:0" }], "id": 19, "name": "VariableDeclaration", "src": "362:13:0" }], "id": 20, "name": "ParameterList", "src": "361:15:0" }, { "children": [{ "attributes": { "functionReturnParameters": 20 }, "children": [{ "attributes": { "argumentTypes": null, "overloadedDeclarations": [null], "referencedDeclaration": 6, "type": "string storage ref", "value": "greeting" }, "id": 21, "name": "Identifier", "src": "394:8:0" }], "id": 22, "name": "Return", "src": "387:15:0" }], "id": 23, "name": "Block", "src": "377:32:0" }], "id": 24, "name": "FunctionDefinition", "src": "324:85:0" }], "id": 25, "name": "ContractDefinition", "src": "54:357:0" }], "name": "SourceUnit", "attributes": { "absolutePath": "greeter.sol", "exportedSymbols": { "Greeter": [25] } }, "id": 26, "src": "0:412:0" } }
const node = { "legacyAST": { "children": [{ "attributes": { "literals": ["solidity", ">=", "0.5", ".0", "<", "0.6", ".0"] }, "id": 1, "name": "PragmaDirective", "src": "0:31:0" }, { "attributes": { "SourceUnit": 53, "absolutePath": "mortal.sol", "file": "mortal.sol", "scope": 26, "symbolAliases": [null], "unitAlias": "" }, "id": 2, "name": "ImportDirective", "src": "32:20:0" }, { "attributes": { "contractDependencies": [52], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [25, 52], "name": "Greeter", "scope": 26 }, "children": [{ "attributes": { "arguments": null }, "children": [{ "attributes": { "contractScope": null, "name": "Mortal", "referencedDeclaration": 52, "type": "contract Mortal" }, "id": 3, "name": "UserDefinedTypeName", "src": "74:6:0" }], "id": 4, "name": "InheritanceSpecifier", "src": "74:6:0" }, { "attributes": { "constant": false, "name": "greeting", "scope": 25, "stateVariable": true, "storageLocation": "default", "type": "string", "value": null, "visibility": "internal" }, "children": [{ "attributes": { "name": "string", "type": "string" }, "id": 5, "name": "ElementaryTypeName", "src": "141:6:0" }], "id": 6, "name": "VariableDeclaration", "src": "141:15:0" }, { "attributes": { "documentation": null, "implemented": true, "isConstructor": true, "kind": "constructor", "modifiers": [null], "name": "", "scope": 25, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, "children": [{ "children": [{ "attributes": { "constant": false, "name": "_greeting", "scope": 16, "stateVariable": false, "storageLocation": "memory", "type": "string", "value": null, "visibility": "internal" }, "children": [{ "attributes": { "name": "string", "type": "string" }, "id": 7, "name": "ElementaryTypeName", "src": "225:6:0" }], "id": 8, "name": "VariableDeclaration", "src": "225:23:0" }], "id": 9, "name": "ParameterList", "src": "224:25:0" }, { "attributes": { "parameters": [null] }, "children": [], "id": 10, "name": "ParameterList", "src": "257:0:0" }, { "children": [{ "children": [{ "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "operator": "=", "type": "string storage ref" }, "children": [{ "attributes": { "argumentTypes": null, "overloadedDeclarations": [null], "referencedDeclaration": 6, "type": "string storage ref", "value": "greeting" }, "id": 11, "name": "Identifier", "src": "267:8:0" }, { "attributes": { "argumentTypes": null, "overloadedDeclarations": [null], "referencedDeclaration": 8, "type": "string memory", "value": "_greeting" }, "id": 12, "name": "Identifier", "src": "278:9:0" }], "id": 13, "name": "Assignment", "src": "267:20:0" }], "id": 14, "name": "ExpressionStatement", "src": "267:20:0" }], "id": 15, "name": "Block", "src": "257:37:0" }], "id": 16, "name": "FunctionDefinition", "src": "213:81:0" }, { "attributes": { "documentation": null, "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [null], "name": "greet", "scope": 25, "stateMutability": "view", "superFunction": null, "visibility": "public" }, "children": [{ "attributes": { "parameters": [null] }, "children": [], "id": 17, "name": "ParameterList", "src": "338:2:0" }, { "children": [{ "attributes": { "constant": false, "name": "", "scope": 24, "stateVariable": false, "storageLocation": "memory", "type": "string", "value": null, "visibility": "internal" }, "children": [{ "attributes": { "name": "string", "type": "string" }, "id": 18, "name": "ElementaryTypeName", "src": "362:6:0" }], "id": 19, "name": "VariableDeclaration", "src": "362:13:0" }], "id": 20, "name": "ParameterList", "src": "361:15:0" }, { "children": [{ "attributes": { "functionReturnParameters": 20 }, "children": [{ "attributes": { "argumentTypes": null, "overloadedDeclarations": [null], "referencedDeclaration": 6, "type": "string storage ref", "value": "greeting" }, "id": 21, "name": "Identifier", "src": "394:8:0" }], "id": 22, "name": "Return", "src": "387:15:0" }], "id": 23, "name": "Block", "src": "377:32:0" }], "id": 24, "name": "FunctionDefinition", "src": "324:85:0" }], "id": 25, "name": "ContractDefinition", "src": "54:357:0" }], "name": "SourceUnit", "attributes": { "absolutePath": "greeter.sol", "exportedSymbols": { "Greeter": [25] } }, "id": 26, "src": "0:412:0" } }
node['source'] = `contract test {
int x;

@ -1,7 +1,5 @@
import { Node } from '../../src/'
let node: Node;
node = {
const node: Node = {
"ast":
{
"absolutePath": "greeter.sol",

@ -1 +1,13 @@
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
{
"extends": "../../.eslintrc",
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-unused-vars": "off",
"dot-notation": "off",
"no-use-before-define": "off"
},
"ignorePatterns": [
"**/node_modules/**"
]
}

@ -2,10 +2,8 @@
"name": "@remix-project/core-plugin",
"version": "0.0.1",
"description": "This library was generated with [Nx](https://nx.dev).",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"main": "src/index.js",
"type": "module",
"author": "Remix Team",
"license": "ISC"
}

@ -0,0 +1,27 @@
{
"name": "remix-core-plugin",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/remix-core-plugin/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/remix-core-plugin",
"main": "libs/remix-core-plugin/src/index.ts",
"tsConfig": "libs/remix-core-plugin/tsconfig.lib.json",
"assets": []
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-core-plugin/**/*.ts"]
}
}
},
"tags": []
}

@ -123,6 +123,7 @@ export class CompilerImports extends Plugin {
* @returns {Promise} - string content
*/
async resolveAndSave (url, targetPath) {
console.log('resolveAndSave', url, targetPath)
try {
if (targetPath && this.currentRequest) {
const canCall = await this.askUserPermission('resolveAndSave', 'This action will update the path ' + targetPath)

@ -1,12 +1,14 @@
#!/usr/bin/env node
import program from 'commander'
import { Command } from 'commander';
import { compileStandardWrapper } from 'solc'
import { readFileSync } from 'fs'
import { start } from 'repl'
import { version } from '../package.json'
import { CmdLine } from '../src/cmdline/index'
const program = new Command();
program
.command('version')
.description("outputs version number")

@ -17,6 +17,9 @@
}
],
"main": "src/index.js",
"scripts": {
"test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"dependencies": {
"@ethereumjs/block": "^3.5.1",
"@ethereumjs/common": "^2.5.0",
@ -28,7 +31,7 @@
"ansi-gray": "^0.1.1",
"async": "^2.6.2",
"color-support": "^1.1.3",
"commander": "^2.19.0",
"commander": "^9.4.1",
"deep-equal": "^1.0.1",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
@ -51,9 +54,6 @@
"solc": "^0.7.4",
"tape": "^4.6.0"
},
"scripts": {
"test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"publishConfig": {
"access": "public"
},

@ -0,0 +1,31 @@
{
"name": "remix-debug",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/remix-debug/src",
"projectType": "library",
"implicitDependencies": [
"remix-lib",
"remix-astwalker"
],
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/remix-debug",
"main": "libs/remix-debug/src/index.ts",
"tsConfig": "libs/remix-debug/tsconfig.lib.json",
"assets": []
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-debug/**/*.ts"]
}
}
},
"tags": []
}

@ -1,5 +1,5 @@
import Web3 from 'web3'
import { Debugger } from '../debugger/debugger.js'
import { Debugger } from '../debugger/debugger'
import { EventEmitter } from 'events'
export class CmdLine {

@ -10,6 +10,10 @@ import { BreakpointManager } from './code/breakpointManager'
import * as sourceMappingDecoder from './source/sourceMappingDecoder'
import * as traceHelper from './trace/traceHelper'
const storage = {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
}
/*
Use of breakPointManager :
@ -18,7 +22,7 @@ import * as traceHelper from './trace/traceHelper'
})
this.debugger.setBreakpointManager(breakPointManager)
*/
export = {
export {
init,
traceHelper,
sourceMappingDecoder,
@ -32,9 +36,6 @@ export = {
*/
BreakpointManager,
SolidityDecoder,
storage: {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
},
storage,
CmdLine
}

@ -1,14 +1,14 @@
// TODO: this file shoudl be removed at some point
var CmdLine = require('./src/cmdline/index')
const CmdLine = require('./src/cmdline/index')
// var compilation = require('./compilation.json')
var solc = require('solc')
var fs = require('fs')
const solc = require('solc')
const fs = require('fs')
var filename = 'test/sol/simple_storage.sol'
var shortFilename = 'simple_storage.sol'
const filename = 'test/sol/simple_storage.sol'
const shortFilename = 'simple_storage.sol'
var inputJson = {
const inputJson = {
language: 'Solidity',
sources: {
},
@ -32,15 +32,15 @@ console.dir(inputJson)
console.log('compiling...')
let compilationData = JSON.parse(solc.compileStandardWrapper(JSON.stringify(inputJson)))
const compilationData = JSON.parse(solc.compileStandardWrapper(JSON.stringify(inputJson)))
console.dir(Object.keys(compilationData))
var compilation = {}
const compilation = {}
compilation['data'] = compilationData
compilation['source'] = { sources: inputJson.sources }
console.dir(compilation)
console.dir(compilation['data'].errors)
var cmdLine = new CmdLine()
const cmdLine = new CmdLine()
cmdLine.connect('http', 'http://localhost:8545')
cmdLine.loadCompilationResult(compilation)
cmdLine.initDebugger()
@ -59,7 +59,7 @@ cmdLine.initDebugger()
// }
// let _web3 = cmdLine.debugger.debugger.web3
var tx = '0xf510c4f0b1d9ee262d7b9e9e87b4262f275fe029c2c733feef7dfa1e2b1e32aa'
const tx = '0xf510c4f0b1d9ee262d7b9e9e87b4262f275fe029c2c733feef7dfa1e2b1e32aa'
// deployContract((err, tx) => {
cmdLine.startDebug(tx, shortFilename)
@ -75,7 +75,7 @@ const repl = require('repl')
repl.start({
prompt: '> ',
eval: (cmd, context, filename, cb) => {
let command = cmd.trim()
const command = cmd.trim()
if (command === 'next' || command === 'n') {
cmdLine.stepOverForward(true)
}
@ -98,7 +98,7 @@ repl.start({
cmdLine.displayGlobals()
}
if (command.split(' ')[0] === 'jump') {
let stepIndex = parseInt(command.split(' ')[1], 10)
const stepIndex = parseInt(command.split(' ')[1], 10)
cmdLine.jumpTo(stepIndex)
}
cb(null, '')

@ -6,7 +6,7 @@ const web3Test = require('./resources/testWeb3.ts')
tape('CodeManager', function (t) {
const traceManager = new TraceManager({web3: web3Test})
let codeManager = new CodeManager(traceManager)
const codeManager = new CodeManager(traceManager)
const contractCode = web3Test.eth.getCode('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
codeManager.codeResolver.cacheExecutingCode('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', contractCode) // so a call to web3 is not necessary
const tx = web3Test.eth.getTransaction('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')

@ -5,10 +5,10 @@ import * as sourceMappingDecoder from '../src/source/sourceMappingDecoder'
import { Ethdebugger as Debugger } from '../src/Ethdebugger'
import { BreakpointManager } from '../src/code/breakpointManager'
var compiler = require('solc')
var vmCall = require('./vmCall')
const compiler = require('solc')
const vmCall = require('./vmCall')
var ballot = `pragma solidity >=0.4.22 <0.8.0;
const ballot = `pragma solidity >=0.4.22 <0.8.0;
/**
* @title Ballot
@ -150,8 +150,8 @@ contract Ballot {
`;
(async () => {
var privateKey = Buffer.from('503f38a9c967ed597e47fe25643985f032b072db8075426a92110f82df48dfcb', 'hex')
var output = compiler.compile(compilerInput(ballot))
const privateKey = Buffer.from('503f38a9c967ed597e47fe25643985f032b072db8075426a92110f82df48dfcb', 'hex')
let output = compiler.compile(compilerInput(ballot))
output = JSON.parse(output)
const param = '0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000148656c6c6f20576f726c64210000000000000000000000000000000000000000'
const web3 = await vmCall.getWeb3()
@ -164,7 +164,7 @@ contract Ballot {
if (error) {
throw error
} else {
var debugManager = new Debugger({
const debugManager = new Debugger({
compilationResult: function () {
return { data: output }
},
@ -224,7 +224,7 @@ function testDebugging (debugManager) {
try {
const address = debugManager.traceManager.getCurrentCalledAddressAt(38)
console.log(address)
var storageView = debugManager.storageViewAt(196, address)
const storageView = debugManager.storageViewAt(196, address)
storageView.storageRange().then((storage) => {
t.equal(JSON.stringify(storage), JSON.stringify({ '0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563': { key: '0x0000000000000000000000000000000000000000000000000000000000000000', value: '0x0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4' } }))
@ -273,7 +273,7 @@ function testDebugging (debugManager) {
tape('breakPointManager', (t) => {
t.plan(2)
const {traceManager, callTree, solidityProxy} = debugManager
var breakPointManager = new BreakpointManager({traceManager, callTree, solidityProxy, locationToRowConverter: async (rawLocation) => {
const breakPointManager = new BreakpointManager({traceManager, callTree, solidityProxy, locationToRowConverter: async (rawLocation) => {
return sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, sourceMappingDecoder.getLinebreakPositions(ballot))
}})

@ -4,20 +4,20 @@ import { compile } from 'solc'
import * as astHelper from '../../src/solidity-decoder/astHelper'
import * as decodeInfo from '../../src/solidity-decoder/decodeInfo'
import * as stateDecoder from '../../src/solidity-decoder/stateDecoder'
var contracts = require('./contracts/miscContracts')
var simplecontracts = require('./contracts/simpleContract')
const contracts = require('./contracts/miscContracts')
const simplecontracts = require('./contracts/simpleContract')
import { compilerInput } from '../helpers/compilerHelper'
import * as util from '../../src/solidity-decoder/types/util'
tape('solidity', function (t) {
t.test('astHelper, decodeInfo', function (st) {
var output = compile(compilerInput(contracts))
let output = compile(compilerInput(contracts))
output = JSON.parse(output)
var state: any = astHelper.extractStateDefinitions('test.sol:contractUint', output.sources, null)
var states = astHelper.extractStatesDefinitions(output.sources, null)
var stateDef = state.stateDefinitions
var parsedType = decodeInfo.parseType(stateDef[0].typeDescriptions.typeString, states, 'contractUint', util.extractLocationFromAstVariable(stateDef[0]))
let state: any = astHelper.extractStateDefinitions('test.sol:contractUint', output.sources, null)
let states = astHelper.extractStatesDefinitions(output.sources, null)
let stateDef = state.stateDefinitions
let parsedType = decodeInfo.parseType(stateDef[0].typeDescriptions.typeString, states, 'contractUint', util.extractLocationFromAstVariable(stateDef[0]))
checkDecodeInfo(st, parsedType, 1, 1, 'uint8')
parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractUint', util.extractLocationFromAstVariable(stateDef[1]))
checkDecodeInfo(st, parsedType, 1, 32, 'uint256')

@ -1,27 +1,27 @@
'use strict'
import tape from 'tape'
var compiler = require('solc')
var intLocal = require('./contracts/intLocal')
var miscLocal = require('./contracts/miscLocal')
var structArrayLocal = require('./contracts/structArrayLocal')
var calldataLocal = require('./contracts/calldata')
var vmCall = require('../vmCall')
var intLocalTest = require('./localsTests/int')
var miscLocalTest = require('./localsTests/misc')
var misc2LocalTest = require('./localsTests/misc2')
var structArrayLocalTest = require('./localsTests/structArray')
var calldataLocalTest = require('./localsTests/calldata')
var compilerInput = require('../helpers/compilerHelper').compilerInput
const compiler = require('solc')
const intLocal = require('./contracts/intLocal')
const miscLocal = require('./contracts/miscLocal')
const structArrayLocal = require('./contracts/structArrayLocal')
const calldataLocal = require('./contracts/calldata')
const vmCall = require('../vmCall')
const intLocalTest = require('./localsTests/int')
const miscLocalTest = require('./localsTests/misc')
const misc2LocalTest = require('./localsTests/misc2')
const structArrayLocalTest = require('./localsTests/structArray')
const calldataLocalTest = require('./localsTests/calldata')
const compilerInput = require('../helpers/compilerHelper').compilerInput
tape('solidity', function (t) {
t.test('local decoder', async function (st) {
var privateKey = Buffer.from('503f38a9c967ed597e47fe25643985f032b072db8075426a92110f82df48dfcb', 'hex')
const privateKey = Buffer.from('503f38a9c967ed597e47fe25643985f032b072db8075426a92110f82df48dfcb', 'hex')
await test(st, privateKey)
})
})
async function test (st, privateKey) {
var output = compiler.compile(compilerInput(intLocal.contract))
let output = compiler.compile(compilerInput(intLocal.contract))
output = JSON.parse(output)
await intLocalTest(st, privateKey, output.contracts['test.sol']['intLocal'].evm.bytecode.object, output)
output = compiler.compile(compilerInput(miscLocal.contract))

@ -14,7 +14,7 @@ module.exports = async function (st, privateKey, contractBytecode, compilationRe
let web3
try {
web3 = await (vmCall as any).getWeb3()
let hash = await (vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode)
const hash = await (vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode)
const receipt = await web3.eth.getTransactionReceipt(hash)
const to = receipt.contractAddress
console.log('to', to)
@ -28,13 +28,13 @@ module.exports = async function (st, privateKey, contractBytecode, compilationRe
if (error) {
return st.fail(error)
}
var traceManager = new TraceManager({ web3 })
var codeManager = new CodeManager(traceManager)
const traceManager = new TraceManager({ web3 })
const codeManager = new CodeManager(traceManager)
codeManager.clear()
var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
const solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
const debuggerEvent = new EventManager()
const callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
callTree.event.register('callTreeBuildFailed', (error) => {
st.fail(error)
})

@ -10,8 +10,9 @@ import { EventManager } from '../../../src/eventManager'
import * as helper from './helper'
module.exports = function (st, privateKey, contractBytecode, compilationResult) {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve) => {
let web3 = await (vmCall as any).getWeb3();
const web3 = await (vmCall as any).getWeb3();
(vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode, function (error, hash) {
if (error) {
return st.fail(error)
@ -21,13 +22,13 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult)
return st.fail(error)
}
tx.to = contractCreationToken('0')
var traceManager = new TraceManager({ web3 })
var codeManager = new CodeManager(traceManager)
const traceManager = new TraceManager({ web3 })
const codeManager = new CodeManager(traceManager)
codeManager.clear()
var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
const solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
const debuggerEvent = new EventManager()
const callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
callTree.event.register('callTreeBuildFailed', (error) => {
st.fail(error)
})
@ -36,9 +37,9 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult)
})
callTree.event.register('callTreeReady', (scopes, scopeStarts) => {
try {
let functions1 = callTree.retrieveFunctionsStack(102)
let functions2 = callTree.retrieveFunctionsStack(115)
let functions3 = callTree.retrieveFunctionsStack(13)
const functions1 = callTree.retrieveFunctionsStack(102)
const functions2 = callTree.retrieveFunctionsStack(115)
const functions3 = callTree.retrieveFunctionsStack(13)
st.equals(functions1.length, 1)
st.equals(functions2.length, 2)

@ -9,6 +9,7 @@ import { TraceManager } from '../../../src/trace/traceManager'
import { CodeManager } from '../../../src/code/codeManager'
module.exports = function (st, privateKey, contractBytecode, compilationResult) {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve) => {
const web3 = await (vmCall as any).getWeb3();
(vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode, function (error, hash) {
@ -20,13 +21,13 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult)
return st.fail(error)
}
tx.to = contractCreationToken('0')
var traceManager = new TraceManager({ web3 })
var codeManager = new CodeManager(traceManager)
const traceManager = new TraceManager({ web3 })
const codeManager = new CodeManager(traceManager)
codeManager.clear()
var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
const solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
const debuggerEvent = new EventManager()
const callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
callTree.event.register('callTreeBuildFailed', (error) => {
st.fail(error)
})

@ -9,6 +9,7 @@ import { TraceManager } from '../../../src/trace/traceManager'
import { CodeManager } from '../../../src/code/codeManager'
module.exports = function (st, privateKey, contractBytecode, compilationResult) {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve) => {
const web3 = await (vmCall as any).getWeb3();
(vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode, function (error, hash) {
@ -20,13 +21,13 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult)
return st.fail(error)
}
tx.to = contractCreationToken('0')
var traceManager = new TraceManager({ web3 })
var codeManager = new CodeManager(traceManager)
const traceManager = new TraceManager({ web3 })
const codeManager = new CodeManager(traceManager)
codeManager.clear()
var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
const solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
const debuggerEvent = new EventManager()
const callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
callTree.event.register('callTreeBuildFailed', (error) => {
st.fail(error)
})

@ -9,6 +9,7 @@ import { TraceManager } from '../../../src/trace/traceManager'
import { CodeManager } from '../../../src/code/codeManager'
module.exports = function (st, privateKey, contractBytecode, compilationResult) {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve) => {
const web3 = await (vmCall as any).getWeb3();
(vmCall as any).sendTx(web3, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode, function (error, hash) {
@ -20,13 +21,13 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult)
return st.fail(error)
}
tx.to = contractCreationToken('0')
var traceManager = new TraceManager({ web3 })
var codeManager = new CodeManager(traceManager)
const traceManager = new TraceManager({ web3 })
const codeManager = new CodeManager(traceManager)
codeManager.clear()
var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
const solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) })
solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
const debuggerEvent = new EventManager()
const callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })
callTree.event.register('callTreeBuildFailed', (error) => {
st.fail(error)
})

@ -7,8 +7,8 @@ export class MockStorageResolver {
constructor (_storage) {
this.storage = {}
for (var k in _storage) {
var hashed = util.sha3_256(k)
for (const k in _storage) {
const hashed = util.sha3_256(k)
this.storage[hashed] = {
hashed: hashed,
key: k,
@ -22,7 +22,7 @@ export class MockStorageResolver {
}
storageSlot (slot, callback) {
var hashed = util.sha3_256(slot)
const hashed = util.sha3_256(slot)
callback(null, this.storage[hashed])
}

@ -8,9 +8,9 @@ import { StorageViewer } from '../../../src/storage/storageViewer'
import { Address, bufferToHex } from 'ethereumjs-util'
module.exports = async function testMappingStorage (st, cb) {
var mappingStorage = require('../contracts/mappingStorage')
var privateKey = Buffer.from('503f38a9c967ed597e47fe25643985f032b072db8075426a92110f82df48dfcb', 'hex')
var output = compile(compilerInput(mappingStorage.contract))
const mappingStorage = require('../contracts/mappingStorage')
const privateKey = Buffer.from('503f38a9c967ed597e47fe25643985f032b072db8075426a92110f82df48dfcb', 'hex')
let output = compile(compilerInput(mappingStorage.contract))
output = JSON.parse(output);
const web3 = await (vmCall as any).getWeb3();
(vmCall as any).sendTx(web3, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['SimpleMappingState'].evm.bytecode.object, function (error, hash) {
@ -46,14 +46,14 @@ function testMapping (st, privateKey, contractAddress, output, web3, cb) {
console.log(error)
st.end(error)
} else {
var traceManager = new TraceManager({web3})
const traceManager = new TraceManager({web3})
traceManager.resolveTrace(tx).then(() => {
var storageViewer = new StorageViewer({
const storageViewer = new StorageViewer({
stepIndex: 268,
tx: tx,
address: contractAddress
}, new StorageResolver({web3}), traceManager)
var stateVars = stateDecoder.extractStateVariables('SimpleMappingState', output.sources)
const stateVars = stateDecoder.extractStateVariables('SimpleMappingState', output.sources)
stateDecoder.decodeState(stateVars, storageViewer).then((result) => {
st.equal(result['_num'].value, '1')
st.equal(result['_num'].type, 'uint256')

@ -4,7 +4,7 @@ import { compile } from 'solc'
import * as stateDecoder from '../../src/solidity-decoder/stateDecoder'
import { MockStorageResolver } from './mockStorageResolver'
import { compilerInput } from '../helpers/compilerHelper'
var testMappingStorage = require('./stateTests/mapping')
const testMappingStorage = require('./stateTests/mapping')
tape('solidity', function (t) {
t.test('storage decoder', function (st) {
@ -21,11 +21,11 @@ tape('solidity', function (t) {
})
function testIntStorage (st, cb) {
var intStorage = require('./contracts/intStorage')
var output = compile(compilerInput(intStorage.contract))
const intStorage = require('./contracts/intStorage')
let output = compile(compilerInput(intStorage.contract))
output = JSON.parse(output)
var mockStorageResolver
for (var storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) {
let mockStorageResolver
for (const storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) {
mockStorageResolver = new MockStorageResolver(storage)
stateDecoder.solidityState(mockStorageResolver, output.sources, 'intStorage').then((decoded) => {
st.equal(decoded['ui8'].value, '130')
@ -68,11 +68,11 @@ function testIntStorage (st, cb) {
}
function testByteStorage (st, cb) {
var byteStorage = require('./contracts/byteStorage')
var output = compile(compilerInput(byteStorage.contract))
const byteStorage = require('./contracts/byteStorage')
let output = compile(compilerInput(byteStorage.contract))
output = JSON.parse(output)
var mockStorageResolver
for (var storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) {
let mockStorageResolver
for (const storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) {
mockStorageResolver = new MockStorageResolver(storage)
stateDecoder.solidityState(mockStorageResolver, output.sources, 'byteStorage').then((decoded) => {
st.equal(decoded['b1'].value, false)
@ -171,20 +171,20 @@ function testByteStorage (st, cb) {
}
function shrinkStorage (storage) {
var shrinkedStorage = {}
var regex = /0x(00)*(..)/
for (var key in storage) {
var value = storage[key]
const shrinkedStorage = {}
const regex = /0x(00)*(..)/
for (const key in storage) {
const value = storage[key]
shrinkedStorage[key.replace(regex, '0x$2')] = value.replace(regex, '0x$2')
}
return shrinkedStorage
}
function testStructArrayStorage (st, cb) {
var structArrayStorage = require('./contracts/structArrayStorage')
var output = compile(compilerInput(structArrayStorage.contract))
const structArrayStorage = require('./contracts/structArrayStorage')
let output = compile(compilerInput(structArrayStorage.contract))
output = JSON.parse(output)
var mockStorageResolver = new MockStorageResolver(structArrayStorage.storage)
const mockStorageResolver = new MockStorageResolver(structArrayStorage.storage)
stateDecoder.solidityState(mockStorageResolver, output.sources, 'structArrayStorage').then((decoded) => {
st.equal(decoded['intStructDec'].value['i8'].value, '32')
st.equal(decoded['intStructDec'].value['i16'].value, '-54')

@ -1,15 +1,15 @@
'use strict'
import tape from 'tape'
var compiler = require('solc')
var stateDecoder = require('../../src/solidity-decoder/stateDecoder')
var contracts = require('./contracts/miscContracts')
var compilerInput = require('../helpers/compilerHelper').compilerInput
const compiler = require('solc')
const stateDecoder = require('../../src/solidity-decoder/stateDecoder')
const contracts = require('./contracts/miscContracts')
const compilerInput = require('../helpers/compilerHelper').compilerInput
tape('solidity', function (t) {
t.test('storage location', function (st) {
var output = compiler.compile(compilerInput(contracts))
let output = compiler.compile(compilerInput(contracts))
output = JSON.parse(output)
var stateDec = stateDecoder.extractStateVariables('contractUint', output.sources)
let stateDec = stateDecoder.extractStateVariables('contractUint', output.sources)
checkLocation(st, stateDec[0].storagelocation, 0, 0)
checkLocation(st, stateDec[1].storagelocation, 1, 0)
checkLocation(st, stateDec[2].storagelocation, 2, 0)

@ -9,7 +9,7 @@ export const init = {
},
readFile: function (filename, callback) {
var fs = require('fs')
const fs = require('fs')
try {
console.log('reading ' + filename)
if (callback) {

@ -1,12 +1,12 @@
'use strict'
import { init } from '../init'
var web3Override: Record<string, Record<string, unknown>> = {}
const web3Override: Record<string, Record<string, unknown>> = {}
web3Override.eth = {}
web3Override.debug = {}
var data = init.readFile(require('path').resolve(__dirname, 'testWeb3.json'), null)
let data = init.readFile(require('path').resolve(__dirname, 'testWeb3.json'), null)
data = JSON.parse(data)
var traceWithABIEncoder = init.readFile(require('path').resolve(__dirname, 'traceWithABIEncoder.json'), null)
let traceWithABIEncoder = init.readFile(require('path').resolve(__dirname, 'traceWithABIEncoder.json'), null)
traceWithABIEncoder =
data.testTraces['0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd53'] = JSON.parse(traceWithABIEncoder)

@ -12,7 +12,7 @@ tape('SourceLocationTracker', function (t) {
t.test('SourceLocationTracker.getSourceLocationFromVMTraceIndex - simple contract', async function (st) {
const traceManager = new TraceManager({web3: web3Test})
let codeManager = new CodeManager(traceManager)
const codeManager = new CodeManager(traceManager)
let output = compiler.compile(compilerInput(contracts))
output = JSON.parse(output)
@ -43,7 +43,7 @@ tape('SourceLocationTracker', function (t) {
t.test('SourceLocationTracker.getSourceLocationFromVMTraceIndex - ABIEncoder V2 contract', async function (st) {
const traceManager = new TraceManager({web3: web3Test})
let codeManager = new CodeManager(traceManager)
const codeManager = new CodeManager(traceManager)
let output = compiler.compile(compilerInput(ABIEncoderV2))
output = JSON.parse(output)

@ -23,7 +23,7 @@ tape('sourceMappingDecoder', function (t) {
t.test('sourceMappingDecoder', function (st) {
st.plan(36)
console.log('test decompressAll')
let result = sourceMappingDecoder.decompressAll(sourceMapping.mapping)
const result = sourceMappingDecoder.decompressAll(sourceMapping.mapping)
st.equal(result[0].start, 0)
st.equal(result[0].length, 205)
st.equal(result[0].file, 4)

@ -4,10 +4,10 @@ import { Transaction } from '@ethereumjs/tx'
import VM from '@ethereumjs/vm'
import { rlp, keccak, bufferToHex } from 'ethereumjs-util'
import { extendWeb3 } from '../src/init'
var utileth = require('ethereumjs-util')
var Tx = require('@ethereumjs/tx').Transaction
var BN = require('ethereumjs-util').BN
var remixLib = require('@remix-project/remix-lib')
const utileth = require('ethereumjs-util')
const Tx = require('@ethereumjs/tx').Transaction
const BN = require('ethereumjs-util').BN
const remixLib = require('@remix-project/remix-lib')
const { Provider, extend } = require('@remix-project/remix-simulator')
const Web3 = require('web3')

@ -4,7 +4,8 @@
"standard/no-callback-literal": "off",
"no-unused-vars": "off",
"dot-notation": "off",
"no-use-before-define": "off"
"no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off"
},
"env": {
"browser": true,

@ -13,6 +13,9 @@
}
],
"main": "src/index.js",
"scripts": {
"test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"dependencies": {
"@ethereumjs/block": "^3.5.1",
"@ethereumjs/tx": "^3.3.2",
@ -37,9 +40,6 @@
"babelify": "^10.0.0",
"tape": "^4.6.0"
},
"scripts": {
"test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"publishConfig": {
"access": "public"
},

@ -0,0 +1,27 @@
{
"name": "remix-lib",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/remix-lib/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/remix-lib",
"main": "libs/remix-lib/src/index.ts",
"tsConfig": "libs/remix-lib/tsconfig.lib.json",
"assets": []
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-lib/**/*.ts"]
}
}
},
"tags": []
}

@ -1,4 +1,4 @@
var init = {
const init = {
overrideWeb3: function (web3, web3Override) {
web3.eth.getCode = web3Override.getCode
web3.debug.traceTransaction = web3Override.traceTransaction

@ -101,7 +101,7 @@ function testWithArrayInput (st, params, expected) {
tape('ContractNestedArrayParameters - (TxFormat.buildData) - format nested array input parameters', function (t) {
let output = compiler.compile(compilerInput(nestedArrayContract))
output = JSON.parse(output)
let contract = output.contracts['test.sol']['nestedArrayContractTest']
const contract = output.contracts['test.sol']['nestedArrayContractTest']
context = { output, contract }
t.test('(TxFormat.buildData)', function (st) {
st.plan(2)
@ -125,9 +125,9 @@ function testWithNestedArrayInput (st, params, expected) {
}
tape('abiEncoderV2InvalidTuple - (TxFormat.buildData) - should throw error for invalid tuple value', function (t) {
let output = compiler.compile(compilerInput(abiEncoderV2InvalidTuple))
var output = compiler.compile(compilerInput(abiEncoderV2InvalidTuple))
output = JSON.parse(output)
let contract = output.contracts['test.sol']['test']
const contract = output.contracts['test.sol']['test']
context = { output, contract }
t.test('(TxFormat.buildData)', function (st) {
st.plan(4)
@ -286,12 +286,12 @@ tape('test abiEncoderV2', function (t) {
st.plan(2)
let output = compiler.compile(compilerInput(abiEncoderV2))
output = JSON.parse(output)
let contract = output.contracts['test.sol']['test']
const contract = output.contracts['test.sol']['test']
txFormat.encodeFunctionCall(decodedData, contract.abi[0], (error, encoded) => {
console.log(error)
st.equal(encoded.dataHex, functionId + encodedData.replace('0x', ''))
})
let decoded = txFormat.decodeResponse(hexToIntArray(encodedData), contract.abi[0])
const decoded = txFormat.decodeResponse(hexToIntArray(encodedData), contract.abi[0])
console.log(decoded)
st.equal(decoded[0], `tuple(uint256,uint256,string): ${value1},${value2},${value3}`)
})

@ -63,7 +63,7 @@ const EXEC_RESULT_ERROR = {
tape('converts node transaction result to RemixTx', function (t) {
// contract creation
let txResult = { ...NODE_TX_RESULT }
const txResult = { ...NODE_TX_RESULT }
let remixTx = resultToRemixTx(txResult, {})
t.equal(remixTx.transactionHash, TRANSACTION_HASH)
@ -82,8 +82,8 @@ tape('converts node transaction result to RemixTx', function (t) {
})
tape('converts node call result to RemixTx', function (t) {
let txResult = { ...NODE_CALL_RESULT }
let remixTx = resultToRemixTx(txResult, {})
const txResult = { ...NODE_CALL_RESULT }
const remixTx = resultToRemixTx(txResult, {})
t.equal(remixTx.transactionHash, undefined)
t.equal(remixTx.createdAddress, undefined)
@ -96,7 +96,7 @@ tape('converts node call result to RemixTx', function (t) {
})
tape('converts VM result to RemixTx', function (t) {
let txResult = { ...VM_RESULT }
const txResult = { ...VM_RESULT }
let remixTx = resultToRemixTx(txResult, EXEC_RESULT)
t.equal(remixTx.transactionHash,

@ -2,7 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "tape"],
"esModuleInterop": true
"esModuleInterop": true,
},
"include": ["**/*.ts"]
}

@ -13,6 +13,9 @@
}
],
"main": "src/index.js",
"scripts": {
"test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/mocha test/*.ts"
},
"dependencies": {
"@ethereumjs/block": "^3.5.1",
"@ethereumjs/common": "^2.5.0",
@ -23,7 +26,7 @@
"async": "^3.1.0",
"body-parser": "^1.18.2",
"color-support": "^1.1.3",
"commander": "^2.19.0",
"commander": "^9.4.1",
"cors": "^2.8.5",
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
@ -46,9 +49,6 @@
"babelify": "^10.0.0",
"mocha": "^5.2.0"
},
"scripts": {
"test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/mocha test/*.ts"
},
"publishConfig": {
"access": "public"
},

@ -0,0 +1,30 @@
{
"name": "remix-simulator",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/remix-simulator/src",
"projectType": "library",
"implicitDependencies": [
"remix-lib"
],
"targets": {
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/remix-simulator",
"main": "libs/remix-simulator/src/index.ts",
"tsConfig": "libs/remix-simulator/tsconfig.lib.json",
"assets": []
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-simulator/**/*.ts"]
}
}
},
"tags": []
}

@ -21,7 +21,7 @@ class Server {
}
start (host, port) {
expressWs(app)
const wsApp = expressWs(app)
app.use(cors())
app.use(bodyParser.urlencoded({ extended: true }))
@ -41,9 +41,9 @@ class Server {
})
})
} else {
app.ws('/', (ws, req) => {
wsApp.app.ws('/', (ws, req) => {
ws.on('message', (msg) => {
this.provider.sendAsync(JSON.parse(msg), (err, jsonResponse) => {
this.provider.sendAsync(JSON.parse(msg.toString()), (err, jsonResponse) => {
if (err) {
return ws.send(JSON.stringify({ error: err }))
}

@ -4,9 +4,12 @@ module.exports = {
verbose: true,
silent: false, // Silent console messages, specially the 'remix-simulator' ones
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': ['ts-jest',
{
useESM: true,
}]
},
transformIgnorePatterns: ["/node_modules/", "/dist/", "\\.pnp\\.[^\\\/]+$"],
transformIgnorePatterns: ["/node_modules/", "/dist/", "\\.pnp\\.[^\\/]+$"],
rootDir: "./",
testTimeout: 40000,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'],
@ -20,5 +23,4 @@ module.exports = {
"!src/logger.ts"
],
coverageDirectory: '../../coverage/libs/remix-solidity'
};
};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save