fix conflicts and rebase

pull/5370/head
Omkara 7 years ago
commit 478560e160
  1. 42
      .circleci/config.yml
  2. 3
      .gitignore
  3. 3
      .travis.yml
  4. 7
      README.md
  5. 2
      docs/index.rst
  6. 2
      docs/run_tab.md
  7. 5
      lerna.json
  8. 5
      remix-analyzer/index.js
  9. 41
      remix-analyzer/package.json
  10. 0
      remix-analyzer/src/solidity-analyzer/index.js
  11. 0
      remix-analyzer/src/solidity-analyzer/modules/abstractAstView.js
  12. 0
      remix-analyzer/src/solidity-analyzer/modules/assignAndCompare.js
  13. 0
      remix-analyzer/src/solidity-analyzer/modules/blockBlockhash.js
  14. 0
      remix-analyzer/src/solidity-analyzer/modules/blockTimestamp.js
  15. 0
      remix-analyzer/src/solidity-analyzer/modules/categories.js
  16. 0
      remix-analyzer/src/solidity-analyzer/modules/checksEffectsInteraction.js
  17. 0
      remix-analyzer/src/solidity-analyzer/modules/constantFunctions.js
  18. 0
      remix-analyzer/src/solidity-analyzer/modules/deleteDynamicArrays.js
  19. 0
      remix-analyzer/src/solidity-analyzer/modules/functionCallGraph.js
  20. 0
      remix-analyzer/src/solidity-analyzer/modules/gasCosts.js
  21. 0
      remix-analyzer/src/solidity-analyzer/modules/guardConditions.js
  22. 0
      remix-analyzer/src/solidity-analyzer/modules/inlineAssembly.js
  23. 0
      remix-analyzer/src/solidity-analyzer/modules/intDivisionTruncate.js
  24. 0
      remix-analyzer/src/solidity-analyzer/modules/list.js
  25. 0
      remix-analyzer/src/solidity-analyzer/modules/lowLevelCalls.js
  26. 0
      remix-analyzer/src/solidity-analyzer/modules/noReturn.js
  27. 0
      remix-analyzer/src/solidity-analyzer/modules/selfdestruct.js
  28. 0
      remix-analyzer/src/solidity-analyzer/modules/similarVariableNames.js
  29. 0
      remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.js
  30. 0
      remix-analyzer/src/solidity-analyzer/modules/thisLocal.js
  31. 0
      remix-analyzer/src/solidity-analyzer/modules/txOrigin.js
  32. 2
      remix-analyzer/test/analysis/staticAnalysisCommon-test.js
  33. 36
      remix-analyzer/test/analysis/staticAnalysisIntegration-test.js
  34. 4
      remix-analyzer/test/analysis/staticAnalysisIssues-test.js
  35. 0
      remix-analyzer/test/analysis/test-contracts/KingOfTheEtherThrone.sol
  36. 0
      remix-analyzer/test/analysis/test-contracts/assembly.sol
  37. 0
      remix-analyzer/test/analysis/test-contracts/ballot.sol
  38. 0
      remix-analyzer/test/analysis/test-contracts/ballot_reentrant.sol
  39. 0
      remix-analyzer/test/analysis/test-contracts/ballot_withoutWarnings.sol
  40. 0
      remix-analyzer/test/analysis/test-contracts/blockLevelCompare.sol
  41. 0
      remix-analyzer/test/analysis/test-contracts/cross_contract.sol
  42. 0
      remix-analyzer/test/analysis/test-contracts/ctor.sol
  43. 0
      remix-analyzer/test/analysis/test-contracts/deleteDynamicArray.sol
  44. 0
      remix-analyzer/test/analysis/test-contracts/forgottenReturn.sol
  45. 0
      remix-analyzer/test/analysis/test-contracts/functionParameters.sol
  46. 0
      remix-analyzer/test/analysis/test-contracts/globals.sol
  47. 0
      remix-analyzer/test/analysis/test-contracts/inheritance.sol
  48. 0
      remix-analyzer/test/analysis/test-contracts/intDivisionTruncate.sol
  49. 0
      remix-analyzer/test/analysis/test-contracts/library.sol
  50. 0
      remix-analyzer/test/analysis/test-contracts/modifier1.sol
  51. 0
      remix-analyzer/test/analysis/test-contracts/modifier2.sol
  52. 0
      remix-analyzer/test/analysis/test-contracts/notReentrant.sol
  53. 0
      remix-analyzer/test/analysis/test-contracts/reentrant.sol
  54. 0
      remix-analyzer/test/analysis/test-contracts/selfdestruct.sol
  55. 0
      remix-analyzer/test/analysis/test-contracts/structReentrant.sol
  56. 0
      remix-analyzer/test/analysis/test-contracts/thisLocal.sol
  57. 0
      remix-analyzer/test/analysis/test-contracts/transfer.sol
  58. 4
      remix-analyzer/test/tests.js
  59. 165
      remix-core/README.md
  60. 19
      remix-core/index.js
  61. 79
      remix-core/package.json
  62. 3
      remix-core/test/tests.js
  63. 167
      remix-debug/README.md
  64. 29
      remix-debug/index.js
  65. 65
      remix-debug/package.json
  66. 22
      remix-debug/src/Ethdebugger.js
  67. 0
      remix-debug/src/solidity-decoder/astHelper.js
  68. 0
      remix-debug/src/solidity-decoder/decodeInfo.js
  69. 11
      remix-debug/src/solidity-decoder/index.js
  70. 0
      remix-debug/src/solidity-decoder/internalCallTree.js
  71. 0
      remix-debug/src/solidity-decoder/localDecoder.js
  72. 0
      remix-debug/src/solidity-decoder/solidityProxy.js
  73. 0
      remix-debug/src/solidity-decoder/stateDecoder.js
  74. 0
      remix-debug/src/solidity-decoder/types/Address.js
  75. 0
      remix-debug/src/solidity-decoder/types/ArrayType.js
  76. 0
      remix-debug/src/solidity-decoder/types/Bool.js
  77. 0
      remix-debug/src/solidity-decoder/types/DynamicByteArray.js
  78. 0
      remix-debug/src/solidity-decoder/types/Enum.js
  79. 0
      remix-debug/src/solidity-decoder/types/FixedByteArray.js
  80. 0
      remix-debug/src/solidity-decoder/types/Int.js
  81. 0
      remix-debug/src/solidity-decoder/types/Mapping.js
  82. 0
      remix-debug/src/solidity-decoder/types/RefType.js
  83. 0
      remix-debug/src/solidity-decoder/types/StringType.js
  84. 0
      remix-debug/src/solidity-decoder/types/Struct.js
  85. 0
      remix-debug/src/solidity-decoder/types/Uint.js
  86. 0
      remix-debug/src/solidity-decoder/types/ValueType.js
  87. 0
      remix-debug/src/solidity-decoder/types/util.js
  88. 0
      remix-debug/src/storage/mappingPreimages.js
  89. 0
      remix-debug/src/storage/storageResolver.js
  90. 0
      remix-debug/src/storage/storageViewer.js
  91. 0
      remix-debug/test/decoder/contracts/byteStorage.js
  92. 0
      remix-debug/test/decoder/contracts/intLocal.js
  93. 0
      remix-debug/test/decoder/contracts/intStorage.js
  94. 0
      remix-debug/test/decoder/contracts/mappingStorage.js
  95. 0
      remix-debug/test/decoder/contracts/miscContracts.js
  96. 0
      remix-debug/test/decoder/contracts/miscLocal.js
  97. 0
      remix-debug/test/decoder/contracts/simpleContract.js
  98. 0
      remix-debug/test/decoder/contracts/structArrayLocal.js
  99. 0
      remix-debug/test/decoder/contracts/structArrayStorage.js
  100. 8
      remix-debug/test/decoder/decodeInfo.js
  101. Some files were not shown because too many files have changed in this diff Show More

@ -6,50 +6,38 @@ version: 2
jobs: jobs:
remix-lib: remix-lib:
docker: docker:
- image: circleci/node:7.10 - image: circleci/node:9.11.2
environment: environment:
working_directory: ~/repo working_directory: ~/repo
steps: steps:
- checkout - checkout
- run: npm install && npm run bootstrap - run: npm install && npm run bootstrap
- run: cd remix-lib && npm test - run: cd remix-lib && npm test
remix-core:
docker:
- image: circleci/node:7.10
environment:
working_directory: ~/repo
steps:
- checkout
- run: npm install && npm run bootstrap
- run: cd remix-core && npm test
remix-solidity:
docker:
- image: circleci/node:7.10
environment:
working_directory: ~/repo
steps:
- checkout
- run: npm install && npm run bootstrap
- run: cd remix-solidity && npm test
remix-debug: remix-debug:
docker: docker:
- image: circleci/node:7.10 - image: circleci/node:9.11.2
environment: environment:
working_directory: ~/repo working_directory: ~/repo
steps: steps:
- checkout - checkout
- run: npm install && npm run bootstrap - run: npm install && npm run bootstrap
- run: cd remix-debug && npm test - run: cd remix-debug && npm test
remix-analyzer:
docker:
- image: circleci/node:9.11.2
environment:
working_directory: ~/repo
steps:
- checkout
- run: npm install && npm run bootstrap
- run: cd remix-analyzer && npm test
workflows: workflows:
version: 2 version: 2
build_all: build_all:
jobs: jobs:
- remix-lib - remix-lib
- remix-core
- remix-solidity
- remix-debug - remix-debug
- remix-analyzer

3
.gitignore vendored

@ -7,4 +7,5 @@ test-browser/reports/*
babelify-src babelify-src
docs/_build docs/_build
package-lock.json package-lock.json
.DS_Store .DS_Store
.tern-port

@ -2,10 +2,9 @@ language: node_js
node_js: node_js:
- stable - stable
env: env:
- TEST_DIR=remix-core
- TEST_DIR=remix-lib - TEST_DIR=remix-lib
- TEST_DIR=remix-solidity - TEST_DIR=remix-solidity
- TEST_DIR=remix-debugger - TEST_DIR=remix-debug
script: script:
- cd $TEST_DIR && npm install && npm test - cd $TEST_DIR && npm install && npm test
deploy: deploy:

@ -35,14 +35,15 @@ Those commands will run the RPC server on `localhost:8545`, which is the default
See [here](remix-debugger/README.md) how to install, run and use the debugger locally. See [here](remix-debugger/README.md) how to install, run and use the debugger locally.
The debugger itself contains several controls that allow stepping over the trace and seeing the current state of a selected step.
## <a name="modules"></a>Remix Modules ## <a name="modules"></a>Remix Modules
Remix is built out of 4 different modules: Remix is built out of 3 different modules:
+ [`remix-solidity`](remix-solidity/README.md) provides Solidity analysis and decoding functions. + [`remix-solidity`](remix-solidity/README.md) provides Solidity analysis and decoding functions.
+ [`remix-lib`](remix-lib/README.md) + [`remix-lib`](remix-lib/README.md)
+ [`remix-core`](remix-core/README.md) is a utility package, providing high-level abstractions to work with the Ethereum VM. + [`remix-debug`](remix-debugger/README.md) contains the debugger.
+ [`remix-debugger`](remix-debugger/README.md) contains the **debugging webapp**.
## Contributing ## Contributing

@ -9,7 +9,7 @@ Remix also supports testing, debugging and deploying of smart contracts and much
Our Remix project with all its features is available Our Remix project with all its features is available
at `remix.ethereum.org <http://remix.ethereum.org>`__ and more information can be found in these at `remix.ethereum.org <http://remix.ethereum.org>`__ and more information can be found in these
docs. Our tool is available at `our GitHub repository docs. Our tool is available at `our GitHub repository
<https://github.com/ethereum/remix-id>`__. <https://github.com/ethereum/remix-ide>`__.
This set of documents covers instructions on how to use Remix and some tutorials to help you get started. This set of documents covers instructions on how to use Remix and some tutorials to help you get started.

@ -112,7 +112,7 @@ In that case we use the addres of the previously created library :
`created{1512830014773}`. the number is the id (timestamp) of the `created{1512830014773}`. the number is the id (timestamp) of the
transaction that leads to the creation of the library. transaction that leads to the creation of the library.
The third parameter corresponds to the call to te function `set` of the The third parameter corresponds to the call to the function `set` of the
contract `test` (the property to is set to: `created{1512830015080}`) . contract `test` (the property to is set to: `created{1512830015080}`) .
Input parameters are `1` and Input parameters are `1` and
`0xca35b7d915458ef540ade6068dfe2f44e8fa733c` `0xca35b7d915458ef540ade6068dfe2f44e8fa733c`

@ -1,11 +1,10 @@
{ {
"lerna": "2.10.2", "lerna": "2.10.2",
"packages": [ "packages": [
"remix-core",
"remix-debug", "remix-debug",
"remix-debugger",
"remix-lib", "remix-lib",
"remix-solidity" "remix-solidity",
"remix-analyzer"
], ],
"version": "independent" "version": "independent"
} }

@ -0,0 +1,5 @@
var CodeAnalysis = require('./src/solidity-analyzer')
module.exports = {
CodeAnalysis: CodeAnalysis
}

@ -0,0 +1,41 @@
{
"name": "remix-analyzer",
"version": "0.2.0",
"description": "Remix Analyzer",
"main": "./index.js",
"contributors": [
{
"name": "Alex Beregszaszi",
"email": "alex@rtfs.hu"
},
{
"name": "Iuri Matias",
"email": "iuri@ethereum.org"
},
{
"name": "Yann Levreau",
"email": "yann@ethdev.com"
}
],
"dependencies": {
"babel-eslint": "^7.1.1",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-es2015": "^6.24.0",
"remix-lib": "^0.3.0",
"solc": "^0.4.24",
"standard": "^7.0.1",
"tape": "^4.6.0"
},
"scripts": {
"test": "standard && tape ./test/tests.js"
},
"standard": {
"ignore": [
"node_modules/*"
],
"parser": "babel-eslint"
},
"author": "Remix Team",
"license": "MIT",
"homepage": "https://github.com/ethereum/remix#readme"
}

@ -1,6 +1,6 @@
var test = require('tape') var test = require('tape')
var common = require('../../src/analysis/modules/staticAnalysisCommon') var common = require('../../src/solidity-analyzer/modules/staticAnalysisCommon')
function escapeRegExp (str) { function escapeRegExp (str) {
return str.replace(/[-[\]/{}()+?.\\^$|]/g, '\\$&') return str.replace(/[-[\]/{}()+?.\\^$|]/g, '\\$&')

@ -1,7 +1,7 @@
var test = require('tape') var test = require('tape')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var StatRunner = require('../../src/analysis/staticAnalysisRunner') var StatRunner = require('../../src/solidity-analyzer')
var compilerInput = remixLib.helpers.compiler.compilerInput var compilerInput = remixLib.helpers.compiler.compilerInput
var compiler = require('solc') var compiler = require('solc')
@ -43,7 +43,7 @@ testFiles.forEach((fileName) => {
test('Integration test thisLocal.js', function (t) { test('Integration test thisLocal.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/thisLocal') var module = require('../../src/solidity-analyzer/modules/thisLocal')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -77,7 +77,7 @@ test('Integration test thisLocal.js', function (t) {
test('Integration test checksEffectsInteraction.js', function (t) { test('Integration test checksEffectsInteraction.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/checksEffectsInteraction') var module = require('../../src/solidity-analyzer/modules/checksEffectsInteraction')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 1, 'KingOfTheEtherThrone.sol': 1,
@ -111,7 +111,7 @@ test('Integration test checksEffectsInteraction.js', function (t) {
test('Integration test constantFunctions.js', function (t) { test('Integration test constantFunctions.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/constantFunctions') var module = require('../../src/solidity-analyzer/modules/constantFunctions')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -145,7 +145,7 @@ test('Integration test constantFunctions.js', function (t) {
test('Integration test inlineAssembly.js', function (t) { test('Integration test inlineAssembly.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/inlineAssembly') var module = require('../../src/solidity-analyzer/modules/inlineAssembly')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -179,7 +179,7 @@ test('Integration test inlineAssembly.js', function (t) {
test('Integration test txOrigin.js', function (t) { test('Integration test txOrigin.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/txOrigin') var module = require('../../src/solidity-analyzer/modules/txOrigin')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -213,7 +213,7 @@ test('Integration test txOrigin.js', function (t) {
test('Integration test gasCosts.js', function (t) { test('Integration test gasCosts.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/gasCosts') var module = require('../../src/solidity-analyzer/modules/gasCosts')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 2, 'KingOfTheEtherThrone.sol': 2,
@ -247,7 +247,7 @@ test('Integration test gasCosts.js', function (t) {
test('Integration test similarVariableNames.js', function (t) { test('Integration test similarVariableNames.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/similarVariableNames') var module = require('../../src/solidity-analyzer/modules/similarVariableNames')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -281,7 +281,7 @@ test('Integration test similarVariableNames.js', function (t) {
test('Integration test inlineAssembly.js', function (t) { test('Integration test inlineAssembly.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/inlineAssembly') var module = require('../../src/solidity-analyzer/modules/inlineAssembly')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -315,7 +315,7 @@ test('Integration test inlineAssembly.js', function (t) {
test('Integration test blockTimestamp.js', function (t) { test('Integration test blockTimestamp.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/blockTimestamp') var module = require('../../src/solidity-analyzer/modules/blockTimestamp')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 1, 'KingOfTheEtherThrone.sol': 1,
@ -349,7 +349,7 @@ test('Integration test blockTimestamp.js', function (t) {
test('Integration test lowLevelCalls.js', function (t) { test('Integration test lowLevelCalls.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/lowLevelCalls') var module = require('../../src/solidity-analyzer/modules/lowLevelCalls')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 1, 'KingOfTheEtherThrone.sol': 1,
@ -383,7 +383,7 @@ test('Integration test lowLevelCalls.js', function (t) {
test('Integration test blockBlockhash.js', function (t) { test('Integration test blockBlockhash.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/blockBlockhash') var module = require('../../src/solidity-analyzer/modules/blockBlockhash')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -417,7 +417,7 @@ test('Integration test blockBlockhash.js', function (t) {
test('Integration test noReturn.js', function (t) { test('Integration test noReturn.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/noReturn') var module = require('../../src/solidity-analyzer/modules/noReturn')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -451,7 +451,7 @@ test('Integration test noReturn.js', function (t) {
test('Integration test selfdestruct.js', function (t) { test('Integration test selfdestruct.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/selfdestruct') var module = require('../../src/solidity-analyzer/modules/selfdestruct')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -485,7 +485,7 @@ test('Integration test selfdestruct.js', function (t) {
test('Integration test guardConditions.js', function (t) { test('Integration test guardConditions.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/guardConditions') var module = require('../../src/solidity-analyzer/modules/guardConditions')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -519,7 +519,7 @@ test('Integration test guardConditions.js', function (t) {
test('Integration test deleteDynamicArrays.js', function (t) { test('Integration test deleteDynamicArrays.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/deleteDynamicArrays') var module = require('../../src/solidity-analyzer/modules/deleteDynamicArrays')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -553,7 +553,7 @@ test('Integration test deleteDynamicArrays.js', function (t) {
test('Integration test assignAndCompare.js', function (t) { test('Integration test assignAndCompare.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/assignAndCompare') var module = require('../../src/solidity-analyzer/modules/assignAndCompare')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,
@ -587,7 +587,7 @@ test('Integration test assignAndCompare.js', function (t) {
test('Integration test intDivisionTruncate.js', function (t) { test('Integration test intDivisionTruncate.js', function (t) {
t.plan(testFiles.length) t.plan(testFiles.length)
var module = require('../../src/analysis/modules/intDivisionTruncate') var module = require('../../src/solidity-analyzer/modules/intDivisionTruncate')
var lengthCheck = { var lengthCheck = {
'KingOfTheEtherThrone.sol': 0, 'KingOfTheEtherThrone.sol': 0,

@ -1,7 +1,7 @@
var test = require('tape') var test = require('tape')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var StatRunner = require('../../src/analysis/staticAnalysisRunner') var StatRunner = require('../../src/solidity-analyzer')
var compilerInput = remixLib.helpers.compiler.compilerInput var compilerInput = remixLib.helpers.compiler.compilerInput
var compiler = require('solc') var compiler = require('solc')
@ -19,7 +19,7 @@ test('staticAnalysisIssues.functionParameterPassingError', function (t) {
t.plan(2) t.plan(2)
var res = compile('functionParameters.sol') var res = compile('functionParameters.sol')
var module = require('../../src/analysis/modules/checksEffectsInteraction') var module = require('../../src/solidity-analyzer/modules/checksEffectsInteraction')
var statRunner = new StatRunner() var statRunner = new StatRunner()

@ -1,7 +1,3 @@
require('./decoder/decodeInfo.js')
require('./decoder/storageLocation.js')
require('./decoder/storageDecoder.js')
require('./decoder/localDecoder.js')
require('./analysis/staticAnalysisCommon-test.js') require('./analysis/staticAnalysisCommon-test.js')
require('./analysis/staticAnalysisIntegration-test.js') require('./analysis/staticAnalysisIntegration-test.js')

@ -1,165 +0,0 @@
# `remix-core`
Provides:
```javascript
{
code: {
CodeManager: CodeManager,
BreakpointManager: BreakpointManager
},
storage: {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
},
trace: {
TraceManager: TraceManager
}
}
```
TraceManager is a convenient way to access a VM Trace and resolve some value from it.
`TraceManager()` :
`function resolveTrace(stepIndex, tx)`
`function init(stepIndex, tx)`
`function inRange(stepIndex, tx)`
`function isLoaded(stepIndex, tx)`
`function getLength(stepIndex, tx)`
`function accumulateStorageChanges(stepIndex, tx)`
`function getAddresses(stepIndex, tx)`
`function getCallDataAt(stepIndex, tx)`
`function getCallStackAt(stepIndex, tx)`
`function getStackAt(stepIndex, tx)`
`function getLastCallChangeSince(stepIndex, tx)`
`function getCurrentCalledAddressAt(stepIndex, tx)`
`function getContractCreationCode(stepIndex, tx)`
`function getMemoryAt(stepIndex, tx)`
`function getCurrentPC(stepIndex, tx)`
`function getReturnValue(stepIndex, tx)`
`function getCurrentStep(stepIndex, tx)`
`function getMemExpand(stepIndex, tx)`
`function getStepCost(stepIndex, tx)`
`function getRemainingGas(stepIndex, tx)`
`function getStepCost(stepIndex, tx)`
`function isCreationStep(stepIndex, tx)`
`function findStepOverBack(stepIndex, tx)`
`function findStepOverForward(stepIndex, tx)`
`function findStepOverBack(stepIndex, tx)`
`function findNextCall(stepIndex, tx)`
`function findStepOut(stepIndex, tx)`
`function checkRequestedStep(stepIndex, tx)`
`function waterfall(stepIndex, tx)`
- - - -
`CodeManager(_traceManager)` :
`function getCode(stepIndex, tx)` :
Resolve the code of the given @arg stepIndex and trigger appropriate event
`function resolveStep(address, cb)` :
Retrieve the code located at the given @arg address
`function getFunctionFromStep(stepIndex, sourceMap, ast)` :
Retrieve the called function for the current vm step
`function getInstructionIndex(address, step, callback)` :
Retrieve the instruction index of the given @arg step
`function getFunctionFromPC(address, pc, sourceMap, ast)` :
Retrieve the called function for the given @arg pc and @arg address
- - - -
`BreakpointManager(_ethdebugger, _locationToRowConverter)` :
`function jumpNextBreakpoint(defaultToLimit)` :
start looking for the next breakpoint
`function jumpPreviousBreakpoint(defaultToLimit)` :
start looking for the previous breakpoint
`function jump(direction, defaultToLimit)` :
start looking for the previous or next breakpoint
`function hasBreakpointAtLine((fileIndex, line)` :
check the given pair fileIndex/line against registered breakpoints
`function hasBreakpoint()` :
return true if current manager has breakpoint
`function add(sourceLocation)` :
add a new breakpoint to the manager
`function remove(sourceLocation)` :
remove a breakpoint from the manager
- - - -
`StorageViewer(_context, _storageResolver, _traceManager)` :
`function storageRange(defaultToLimit)` :
return the storage for the current context (address and vm trace index)
`function storageSlot(defaultToLimit)` :
return a slot value for the current context (address and vm trace index)
`function isComplete(direction, defaultToLimit)` :
return True if the storage at @arg address is complete
`function initialMappingsLocation((fileIndex, line)` :
return all the possible mappings locations for the current context (cached) do not return state changes during the current transaction
`function mappingsLocation()` :
return all the possible mappings locations for the current context (cached) and current mapping slot. returns state changes during the current transaction
`function extractMappingsLocationChanges(sourceLocation)` :
retrieve mapping location changes from the storage changes.
- - - -
`StorageResolver()` :
`function storageRange(tx, stepIndex, address, callback)` :
return the storage for the current context (address and vm trace index)
`function initialPreimagesMappings(tx, stepIndex, address, callback)` :
return a slot value for the current context (address and vm trace index)
`function storageSlot(slot, tx, stepIndex, address, callback)` :
return True if the storage at @arg address is complete
`function isComplete(address)` :
return all the possible mappings locations for the current context (cached) do not return state changes during the current transaction

@ -1,19 +0,0 @@
var CodeManager = require('./src/code/codeManager')
var BreakpointManager = require('./src/code/breakpointManager')
var StorageViewer = require('./src/storage/storageViewer')
var StorageResolver = require('./src/storage/storageResolver')
var TraceManager = require('./src/trace/traceManager')
module.exports = {
code: {
CodeManager: CodeManager,
BreakpointManager: BreakpointManager
},
storage: {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
},
trace: {
TraceManager: TraceManager
}
}

@ -1,79 +0,0 @@
{
"name": "remix-core",
"version": "0.0.15",
"description": "Ethereum IDE and tools for the web",
"contributors": [
{
"name": "Yann Levreau",
"email": "yann@ethereum.com"
},
{
"name": "Liana Husikyan",
"email": "liana@ethereum.com"
}
],
"main": "./index.js",
"dependencies": {
"babel-eslint": "^7.1.1",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-es2015": "^6.24.0",
"babelify": "^7.3.0",
"fast-async": "^6.1.2",
"remix-lib": "^0.2.9",
"standard": "^7.0.1",
"tape": "^4.6.0"
},
"scripts": {
"test": "standard && tape ./test/tests.js"
},
"standard": {
"ignore": [
"node_modules/*",
"build/*",
"test/resources/*"
],
"parser": "babel-eslint"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ethereum/remix.git"
},
"author": "cpp-ethereum team",
"license": "MIT",
"bugs": {
"url": "https://github.com/ethereum/remix/issues"
},
"homepage": "https://github.com/ethereum/remix#readme",
"browserify": {
"transform": [
[
"babelify",
{
"plugins": [
[
"fast-async",
{
"runtimePatten": null,
"compiler": {
"promises": true,
"es7": true,
"noRuntime": true,
"wrapAwait": true
}
}
],
"transform-object-assign"
]
}
],
[
"babelify",
{
"presets": [
"es2015"
]
}
]
]
}
}

@ -1,3 +0,0 @@
require('./traceManager.js')
require('./codeManager.js')
require('./disassembler.js')

@ -63,3 +63,170 @@ debugger.callTree.register('callTreeReady', () => {
}) })
``` ```
## Library
Provides:
```javascript
{
code: {
CodeManager: CodeManager,
BreakpointManager: BreakpointManager
},
storage: {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
},
trace: {
TraceManager: TraceManager
}
}
```
TraceManager is a convenient way to access a VM Trace and resolve some value from it.
`TraceManager()` :
`function resolveTrace(stepIndex, tx)`
`function init(stepIndex, tx)`
`function inRange(stepIndex, tx)`
`function isLoaded(stepIndex, tx)`
`function getLength(stepIndex, tx)`
`function accumulateStorageChanges(stepIndex, tx)`
`function getAddresses(stepIndex, tx)`
`function getCallDataAt(stepIndex, tx)`
`function getCallStackAt(stepIndex, tx)`
`function getStackAt(stepIndex, tx)`
`function getLastCallChangeSince(stepIndex, tx)`
`function getCurrentCalledAddressAt(stepIndex, tx)`
`function getContractCreationCode(stepIndex, tx)`
`function getMemoryAt(stepIndex, tx)`
`function getCurrentPC(stepIndex, tx)`
`function getReturnValue(stepIndex, tx)`
`function getCurrentStep(stepIndex, tx)`
`function getMemExpand(stepIndex, tx)`
`function getStepCost(stepIndex, tx)`
`function getRemainingGas(stepIndex, tx)`
`function getStepCost(stepIndex, tx)`
`function isCreationStep(stepIndex, tx)`
`function findStepOverBack(stepIndex, tx)`
`function findStepOverForward(stepIndex, tx)`
`function findStepOverBack(stepIndex, tx)`
`function findNextCall(stepIndex, tx)`
`function findStepOut(stepIndex, tx)`
`function checkRequestedStep(stepIndex, tx)`
`function waterfall(stepIndex, tx)`
- - - -
`CodeManager(_traceManager)` :
`function getCode(stepIndex, tx)` :
Resolve the code of the given @arg stepIndex and trigger appropriate event
`function resolveStep(address, cb)` :
Retrieve the code located at the given @arg address
`function getFunctionFromStep(stepIndex, sourceMap, ast)` :
Retrieve the called function for the current vm step
`function getInstructionIndex(address, step, callback)` :
Retrieve the instruction index of the given @arg step
`function getFunctionFromPC(address, pc, sourceMap, ast)` :
Retrieve the called function for the given @arg pc and @arg address
- - - -
`BreakpointManager(_ethdebugger, _locationToRowConverter)` :
`function jumpNextBreakpoint(defaultToLimit)` :
start looking for the next breakpoint
`function jumpPreviousBreakpoint(defaultToLimit)` :
start looking for the previous breakpoint
`function jump(direction, defaultToLimit)` :
start looking for the previous or next breakpoint
`function hasBreakpointAtLine((fileIndex, line)` :
check the given pair fileIndex/line against registered breakpoints
`function hasBreakpoint()` :
return true if current manager has breakpoint
`function add(sourceLocation)` :
add a new breakpoint to the manager
`function remove(sourceLocation)` :
remove a breakpoint from the manager
- - - -
`StorageViewer(_context, _storageResolver, _traceManager)` :
`function storageRange(defaultToLimit)` :
return the storage for the current context (address and vm trace index)
`function storageSlot(defaultToLimit)` :
return a slot value for the current context (address and vm trace index)
`function isComplete(direction, defaultToLimit)` :
return True if the storage at @arg address is complete
`function initialMappingsLocation((fileIndex, line)` :
return all the possible mappings locations for the current context (cached) do not return state changes during the current transaction
`function mappingsLocation()` :
return all the possible mappings locations for the current context (cached) and current mapping slot. returns state changes during the current transaction
`function extractMappingsLocationChanges(sourceLocation)` :
retrieve mapping location changes from the storage changes.
- - - -
`StorageResolver()` :
`function storageRange(tx, stepIndex, address, callback)` :
return the storage for the current context (address and vm trace index)
`function initialPreimagesMappings(tx, stepIndex, address, callback)` :
return a slot value for the current context (address and vm trace index)
`function storageSlot(slot, tx, stepIndex, address, callback)` :
return True if the storage at @arg address is complete
`function isComplete(address)` :
return all the possible mappings locations for the current context (cached) do not return state changes during the current transaction

@ -1,7 +1,14 @@
'use strict' 'use strict'
var remixCore = require('remix-core')
var EthDebugger = require('./src/Ethdebugger') var EthDebugger = require('./src/Ethdebugger')
var StorageViewer = require('./src/storage/storageViewer')
var StorageResolver = require('./src/storage/storageResolver')
var SolidityDecoder = require('./src/solidity-decoder')
var remixLib = require('remix-lib')
var BreakpointManager = remixLib.code.BreakpointManager
/* /*
Use of breakPointManager : Use of breakPointManager :
@ -12,11 +19,17 @@ var EthDebugger = require('./src/Ethdebugger')
*/ */
module.exports = { module.exports = {
EthDebugger: EthDebugger, EthDebugger: EthDebugger,
/** /**
* constructor * constructor
* *
* @param {Object} _debugger - type of EthDebugger * @param {Object} _debugger - type of EthDebugger
* @return {Function} _locationToRowConverter - function implemented by editor which return a column/line position for a char source location * @return {Function} _locationToRowConverter - function implemented by editor which return a column/line position for a char source location
*/ */
BreakpointManager: remixCore.code.BreakpointManager BreakpointManager: BreakpointManager,
SolidityDecoder: SolidityDecoder,
storage: {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
}
} }

@ -1,6 +1,6 @@
{ {
"name": "remix-debug", "name": "remix-debug",
"version": "0.0.9", "version": "0.2.1",
"description": "Ethereum IDE and tools for the web", "description": "Ethereum IDE and tools for the web",
"contributors": [ "contributors": [
{ {
@ -16,20 +16,15 @@
"dependencies": { "dependencies": {
"babel-eslint": "^7.1.1", "babel-eslint": "^7.1.1",
"babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-yo-yoify": "^0.3.3",
"babel-polyfill": "^6.22.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.0", "babel-preset-es2015": "^6.24.0",
"babel-preset-stage-0": "^6.24.1",
"babelify": "^7.3.0", "babelify": "^7.3.0",
"ethereumjs-util": "^4.5.0", "ethereumjs-util": "^4.5.0",
"ethereumjs-vm": "^2.3.3", "ethereumjs-vm": "^2.3.3",
"fast-async": "^6.1.2",
"notify-error": "^1.2.0", "notify-error": "^1.2.0",
"npm-run-all": "^4.1.2", "npm-run-all": "^4.1.2",
"remix-core": "^0.0.15", "remix-lib": "^0.3.0",
"remix-lib": "^0.2.9", "solc": "^0.4.24"
"remix-solidity": "^0.1.11",
"solc": "https://github.com/ethereum/solc-js"
}, },
"devDependencies": { "devDependencies": {
"standard": "^7.0.1", "standard": "^7.0.1",
@ -39,8 +34,7 @@
"scripts": { "scripts": {
"build": "mkdirp build; browserify index.js > build/app.js", "build": "mkdirp build; browserify index.js > build/app.js",
"lint": "standard | notify-error", "lint": "standard | notify-error",
"downloadsolc": "cd node_modules/solc && (test -e soljson.js || wget --no-check-certificate https://solc-bin.ethereum.org/soljson.js) && cd ..", "test": "standard && tape ./test/tests.js"
"test": "standard && npm run downloadsolc && tape ./test/tests.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -57,43 +51,34 @@
"node_modules/*", "node_modules/*",
"build/*", "build/*",
"test/resources/*" "test/resources/*"
] ],
}, "parser": "babel-eslint"
"babel": {
"plugins": [
"transform-es2015-template-literals",
"transform-es2015-literals",
"transform-es2015-function-name",
"transform-es2015-arrow-functions",
"transform-es2015-block-scoped-functions",
"transform-es2015-classes",
"transform-es2015-object-super",
"transform-es2015-shorthand-properties",
"transform-es2015-duplicate-keys",
"transform-es2015-computed-properties",
"transform-es2015-for-of",
"transform-es2015-sticky-regex",
"transform-es2015-unicode-regex",
"check-es2015-constants",
"transform-es2015-spread",
"transform-es2015-parameters",
"transform-es2015-destructuring",
"transform-es2015-block-scoping",
"transform-object-assign"
]
}, },
"browserify": { "browserify": {
"transform": [ "transform": [
[ [
"babelify", "babelify",
{ {
"sourceMapsAbsolute": false,
"sourceMaps": true,
"plugins": [ "plugins": [
[ [
"transform-object-assign" "fast-async",
] {
], "runtimePatten": null,
"compiler": {
"promises": true,
"es7": true,
"noRuntime": true,
"wrapAwait": true
}
}
],
"transform-object-assign"
]
}
],
[
"babelify",
{
"presets": [ "presets": [
"es2015" "es2015"
] ]

@ -1,21 +1,23 @@
'use strict' 'use strict'
var remixCore = require('remix-core')
var TraceManager = remixCore.trace.TraceManager var StorageViewer = require('./storage/storageViewer')
var StorageViewer = remixCore.storage.StorageViewer var StorageResolver = require('./storage/storageResolver')
var SolidityDecoder = require('./solidity-decoder')
var SolidityProxy = SolidityDecoder.SolidityProxy
var stateDecoder = SolidityDecoder.stateDecoder
var localDecoder = SolidityDecoder.localDecoder
var InternalCallTree = SolidityDecoder.InternalCallTree
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var TraceManager = remixLib.trace.TraceManager
var CodeManager = remixLib.code.CodeManager
var traceHelper = remixLib.helpers.trace var traceHelper = remixLib.helpers.trace
var init = remixLib.init var init = remixLib.init
var executionContext = remixLib.execution.executionContext var executionContext = remixLib.execution.executionContext
var EventManager = remixLib.EventManager var EventManager = remixLib.EventManager
var Web3Providers = remixLib.vm.Web3Providers var Web3Providers = remixLib.vm.Web3Providers
var DummyProvider = remixLib.vm.DummyProvider var DummyProvider = remixLib.vm.DummyProvider
var CodeManager = remixCore.code.CodeManager
var remixSolidity = require('remix-solidity')
var SolidityProxy = remixSolidity.SolidityProxy
var stateDecoder = remixSolidity.stateDecoder
var localDecoder = remixSolidity.localDecoder
var InternalCallTree = remixSolidity.InternalCallTree
var StorageResolver = remixCore.storage.StorageResolver
/** /**
* Ethdebugger is a wrapper around a few classes that helps debugging a transaction * Ethdebugger is a wrapper around a few classes that helps debugging a transaction

@ -0,0 +1,11 @@
var SolidityProxy = require('./solidityProxy')
var stateDecoder = require('./stateDecoder')
var localDecoder = require('./localDecoder')
var InternalCallTree = require('./internalCallTree')
module.exports = {
SolidityProxy: SolidityProxy,
stateDecoder: stateDecoder,
localDecoder: localDecoder,
InternalCallTree: InternalCallTree
}

@ -1,14 +1,14 @@
'use strict' 'use strict'
var tape = require('tape') var tape = require('tape')
var compiler = require('solc') var compiler = require('solc')
var astHelper = require('../../src/decoder/astHelper') var astHelper = require('../../src/solidity-decoder/astHelper')
var decodeInfo = require('../../src/decoder/decodeInfo') var decodeInfo = require('../../src/solidity-decoder/decodeInfo')
var stateDecoder = require('../../src/decoder/stateDecoder') var stateDecoder = require('../../src/solidity-decoder/stateDecoder')
var contracts = require('./contracts/miscContracts') var contracts = require('./contracts/miscContracts')
var simplecontracts = require('./contracts/simpleContract') var simplecontracts = require('./contracts/simpleContract')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var compilerInput = remixLib.helpers.compiler.compilerInput var compilerInput = remixLib.helpers.compiler.compilerInput
var util = require('../../src/decoder/types/util') var util = require('../../src/solidity-decoder/types/util')
tape('solidity', function (t) { tape('solidity', function (t) {
t.test('astHelper, decodeInfo', function (st) { t.test('astHelper, decodeInfo', function (st) {

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

Loading…
Cancel
Save