pull/5370/head
aniket-engg 4 years ago
commit 5e45998b58
  1. 13
      .editorconfig
  2. 3
      .env
  3. 41
      .eslintrc
  4. 4
      .prettierignore
  5. 3
      .prettierrc
  6. 6
      .vscode/extensions.json
  7. 1
      apps/.gitkeep
  8. 193
      apps/remix-ide/.circleci/config.yml
  9. 3
      apps/remix-ide/.env
  10. 315
      apps/remix-ide/.eslintrc
  11. 14
      apps/remix-ide/.gitignore
  12. 7
      apps/remix-ide/.npmignore
  13. 1
      apps/remix-ide/.nvmrc
  14. 37
      apps/remix-ide/.travis.yml
  15. 21
      apps/remix-ide/LICENSE.md
  16. 137
      apps/remix-ide/README.md
  17. 1
      apps/remix-ide/_config.yml
  18. 0
      apps/remix-ide/assets/css/font-awesome.min.css
  19. 69
      apps/remix-ide/assets/css/pygment_trac.css
  20. BIN
      apps/remix-ide/assets/fonts/FontAwesome.otf
  21. BIN
      apps/remix-ide/assets/fonts/fontawesome-webfont.eot
  22. 2671
      apps/remix-ide/assets/fonts/fontawesome-webfont.svg
  23. BIN
      apps/remix-ide/assets/fonts/fontawesome-webfont.ttf
  24. BIN
      apps/remix-ide/assets/fonts/fontawesome-webfont.woff
  25. BIN
      apps/remix-ide/assets/fonts/fontawesome-webfont.woff2
  26. BIN
      apps/remix-ide/assets/img/debuggerLogo.webp
  27. BIN
      apps/remix-ide/assets/img/gasStation_50.png
  28. BIN
      apps/remix-ide/assets/img/hexagon-remix-greengrey-texture.png
  29. BIN
      apps/remix-ide/assets/img/homeStickers.png
  30. BIN
      apps/remix-ide/assets/img/moreLogo.webp
  31. BIN
      apps/remix-ide/assets/img/mythxLogo.webp
  32. BIN
      apps/remix-ide/assets/img/pipelineLogo.webp
  33. BIN
      apps/remix-ide/assets/img/sleepingRemiCroped.webp
  34. BIN
      apps/remix-ide/assets/img/solidityLogo.webp
  35. BIN
      apps/remix-ide/assets/img/sourceVerifyLogo.webp
  36. BIN
      apps/remix-ide/assets/img/vyperLogo.webp
  37. BIN
      apps/remix-ide/assets/img/workshopLogo.webp
  38. 271121
      apps/remix-ide/assets/js/0.7.7/app.js
  39. 8
      apps/remix-ide/assets/js/browserfs.min.js
  40. 10
      apps/remix-ide/background.js
  41. 153
      apps/remix-ide/best-practices.md
  42. 21
      apps/remix-ide/bin/remix-ide
  43. 31
      apps/remix-ide/ci/browser_tests.sh
  44. 31
      apps/remix-ide/ci/browser_tests_chrome.sh
  45. 31
      apps/remix-ide/ci/browser_tests_firefox.sh
  46. 30
      apps/remix-ide/ci/browser_tests_run_deploy.sh
  47. 20
      apps/remix-ide/ci/deploy_from_travis_remix-alpha.sh
  48. 20
      apps/remix-ide/ci/deploy_from_travis_remix-live.sh
  49. BIN
      apps/remix-ide/ci/deploy_key_remix-live-alpha.enc
  50. BIN
      apps/remix-ide/ci/deploy_key_remix-live.enc
  51. 88
      apps/remix-ide/ci/makeMockCompiler.js
  52. 2
      apps/remix-ide/ci/sauceDisconnect.js
  53. 6
      apps/remix-ide/contracts/app/ethereum/constitution.sol
  54. 6
      apps/remix-ide/contracts/app/solidity/mode.sol
  55. 143
      apps/remix-ide/contracts/ballot.sol
  56. 1
      apps/remix-ide/contracts/contract1.sol
  57. 1
      apps/remix-ide/contracts/contract2.sol
  58. 1
      apps/remix-ide/contracts/folder1/contract1.sol
  59. 1
      apps/remix-ide/contracts/folder1/contract2.sol
  60. 1
      apps/remix-ide/contracts/folder1/contract_chrome.sol
  61. 1
      apps/remix-ide/contracts/folder1/contract_chrome_toremove.sol
  62. 1
      apps/remix-ide/contracts/folder1/contract_firefox.sol
  63. 1
      apps/remix-ide/contracts/folder1/contract_firefox_toremove.sol
  64. 156
      apps/remix-ide/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol
  65. 1
      apps/remix-ide/contracts/node_modules/openzeppelin-solidity/contracts/sample.sol
  66. 8
      apps/remix-ide/contracts/src/gmbh/company.sol
  67. 6
      apps/remix-ide/contracts/src/gmbh/contract.sol
  68. 6
      apps/remix-ide/contracts/src/gmbh/test.sol
  69. 14
      apps/remix-ide/contracts/src/leasing.sol
  70. 6
      apps/remix-ide/contracts/src/ug/finance.sol
  71. 6
      apps/remix-ide/contracts/src/voting.sol
  72. 21
      apps/remix-ide/contracts/test/client/credit.sol
  73. 4
      apps/remix-ide/css/font-awesome.min.css~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  74. 4
      apps/remix-ide/css/font-awesome.min.css~HEAD
  75. 69
      apps/remix-ide/css/pygment_trac.css~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  76. 69
      apps/remix-ide/css/pygment_trac.css~HEAD
  77. 87
      apps/remix-ide/docs/FAQ.md
  78. 0
      apps/remix-ide/docs/Makefile
  79. 95
      apps/remix-ide/docs/assert_library.md
  80. 11
      apps/remix-ide/docs/code_contribution_guide.md
  81. 14
      apps/remix-ide/docs/community.md
  82. 34
      apps/remix-ide/docs/compile.md
  83. 12
      apps/remix-ide/docs/conf.py
  84. 183
      apps/remix-ide/docs/contract_metadata.md
  85. 107
      apps/remix-ide/docs/create_deploy.md
  86. 14
      apps/remix-ide/docs/debugger.md
  87. 59
      apps/remix-ide/docs/file_explorer.md
  88. BIN
      apps/remix-ide/docs/images/a-Runtab-deploy-atAddress.png
  89. BIN
      apps/remix-ide/docs/images/a-contract-inputs.png
  90. BIN
      apps/remix-ide/docs/images/a-debug1-deploy.png
  91. BIN
      apps/remix-ide/docs/images/a-debug2-udapp1.png
  92. BIN
      apps/remix-ide/docs/images/a-debug2-udapp1a.png
  93. BIN
      apps/remix-ide/docs/images/a-debug3-udapp2.png
  94. BIN
      apps/remix-ide/docs/images/a-debug4-value-loc.png
  95. BIN
      apps/remix-ide/docs/images/a-debug5-term-debug-but.png
  96. BIN
      apps/remix-ide/docs/images/a-debug6-term-txn-hash.png
  97. BIN
      apps/remix-ide/docs/images/a-debug7-debugger.png
  98. BIN
      apps/remix-ide/docs/images/a-debug8-top3.png
  99. BIN
      apps/remix-ide/docs/images/a-debug9-buttons.png
  100. BIN
      apps/remix-ide/docs/images/a-debugger.png
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false

@ -0,0 +1,3 @@
gist_token = <token>
account_passphrase = <passphrase>
account_password = <password>

@ -0,0 +1,41 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
},
"ignorePatterns": ["**/*"],
"plugins": ["@typescript-eslint", "@nrwl/nx"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
]
}
]
},
"overrides": [
{
"files": ["*.tsx"],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}

@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage

@ -0,0 +1,3 @@
{
"singleQuote": true
}

@ -0,0 +1,6 @@
{
"recommendations": [
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode"
]
}

@ -0,0 +1,193 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
remix-ide-chrome:
docker:
# specify the version you desire here
- image: circleci/node:10.18.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide
parallelism: 20
steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --config=../remix-ide/seleniumConfig.js
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-ide/seleniumConfig.js
background: true
- run: ./ci/browser_tests_chrome.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-firefox:
docker:
# specify the version you desire here
- image: circleci/node:10.18.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide
parallelism: 20
steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --config=../remix-ide/seleniumConfig.js
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-ide/seleniumConfig.js
background: true
- run:
name: Download Latest Firefox
command: sudo apt-get purge -y firefox && wget https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb
- run:
name: Install Firefox
command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb
- run: ./ci/browser_tests_firefox.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots
remix-ide-run-deploy:
docker:
# specify the version you desire here
- image: circleci/node:10.18.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide
steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --config=../remix-ide/seleniumConfig.js
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-ide/seleniumConfig.js
background: true
- run: ./ci/browser_tests_run_deploy.sh
- store_artifacts:
path: ./reports/screenshots
deploy-remix-live:
docker:
# specify the version you desire here
- image: circleci/node:10.18.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
resource_class: xlarge
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide
steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Deploy
command: |
if [ "${CIRCLE_BRANCH}" == "remix_live" ]; then
./ci/deploy_from_travis_remix-live.sh;
fi
- store_artifacts:
path: ./reports/screenshots
deploy-remix-alpha:
docker:
# specify the version you desire here
- image: circleci/node:10.18.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
resource_class: xlarge
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide
steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Deploy
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
./ci/deploy_from_travis_remix-alpha.sh;
fi
- store_artifacts:
path: ./reports/screenshots
workflows:
version: 2
build_all:
jobs:
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
- deploy-remix-live:
requires:
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
filters:
branches:
only: remix_live
- deploy-remix-alpha:
requires:
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
filters:
branches:
only: master

@ -0,0 +1,3 @@
gist_token = <token>
account_passphrase = <passphrase>
account_password = <password>

@ -0,0 +1,315 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "off",
"array-bracket-spacing": [
"off",
"never"
],
"array-callback-return": "off",
"array-element-newline": "off",
"arrow-body-style": "off",
"arrow-parens": [
"off",
"always"
],
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"block-scoped-var": "off",
"block-spacing": "error",
"brace-style": [
"off",
"1tbs"
],
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "off",
"comma-dangle": "off",
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"off",
"never"
],
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "error",
"default-case-last": "off",
"default-param-last": "off",
"dot-location": "off",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": [
"off",
"declaration"
],
"function-call-argument-newline": [
"off",
"consistent"
],
"function-paren-newline": "off",
"generator-star-spacing": "error",
"global-require": "off",
"grouped-accessor-pairs": "error",
"guard-for-in": "off",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": [
"off",
"beside"
],
"indent": "off",
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": [
"error",
{
"after": true,
"before": true
}
],
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": [
"off",
"always"
],
"max-classes-per-file": "off",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": [
"off",
"separate-lines"
],
"new-cap": "off",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "off",
"no-console": "off",
"no-constructor-return": "error",
"no-continue": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "off",
"no-eq-null": "off",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-coercion": "off",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "off",
"no-lonely-if": "off",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-proto": "error",
"no-restricted-exports": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "off",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-spaced-func": "error",
"no-sync": "off",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"no-useless-backreference": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "off",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "off",
"no-var": "off",
"no-void": "off",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": "off",
"operator-linebreak": "error",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-exponentiation-operator": "error",
"prefer-named-capture-group": "off",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "off",
"prefer-reflect": "off",
"prefer-regex-literals": "error",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-atomic-updates": "off",
"require-await": "off",
"require-jsdoc": "off",
"require-unicode-regexp": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "error",
"semi-style": "off",
"sort-keys": [
"off",
"asc"
],
"sort-vars": "off",
"space-before-blocks": "error",
"space-before-function-paren": "error",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": [
"off",
"always"
],
"strict": "off",
"switch-colon-spacing": "off",
"symbol-description": "error",
"template-curly-spacing": [
"error",
"never"
],
"template-tag-spacing": [
"off",
"never"
],
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
],
"no-unused-vars": "off",
"no-redeclare": "off",
"no-empty": "off",
"no-constant-condition": "off",
"no-async-promise-executor": "off",
"no-useless-catch": "off",
"no-extra-semi": "off",
"no-undef": "off"
}
}

@ -0,0 +1,14 @@
.idea
.vscode
build
node_modules
docs/_build
reports
soljson.js
soljson.js.*
npm-debug.log*
remix
.DS_Store
contracts
TODO
.tern-port

@ -0,0 +1,7 @@
.vscode
node_modules
reports
npm-debug.log*
package-lock.json
remix
.DS_Store

@ -0,0 +1,37 @@
language: node_js
node_js:
- "9"
addons:
chrome: stable
language: java
branches:
only:
- master
- remix_live
script:
- npm install
- npm run lint && npm run test && npm run make-mock-compiler && npm run build
- wget http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar
- wget http://chromedriver.storage.googleapis.com/2.30/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- java -Dwebdriver.chrome.driver="chromedriver" -jar selenium-server-standalone-3.5.3.jar &
- ./ci/browser_tests.sh
deploy:
- provider: script
script: ci/deploy_from_travis_remix-alpha.sh
skip_cleanup: true
on:
branch: master
- provider: script
script: ci/deploy_from_travis_remix-live.sh
skip_cleanup: true
on:
branch: remix_live
env:
global:
- ENCRYPTION_LABEL2="85f76a180658"
- ENCRYPTION_LABEL3="3737d4fd78e9"
- COMMIT_AUTHOR_EMAIL="chris@ethereum.org"
- COMMIT_AUTHOR="Travis CI"
- FILES_TO_PACKAGE="assets background.js build icon.png index.html manifest.json README.md soljson.js"
cache: false

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014, 2015, 2019 the individual contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

@ -0,0 +1,137 @@
[![CircleCI](https://circleci.com/gh/ethereum/remix-ide.svg?style=svg)](https://circleci.com/gh/ethereum/remix-ide)
# Remix
Remix is a browser-based compiler and IDE that enables users to build **Ethereum contracts with Solidity language** and to debug transactions.
To try it out, visit [https://remix.ethereum.org](https://remix.ethereum.org).
https://github.com/ethereum/remix-ide/releases also gives others ways to use Remix locally. Please check it out.
Remix consists of many modules and in this repository you will find the Remix IDE (aka. Browser-Solidity).
![Remix screenshot](https://github.com/ethereum/remix-ide/raw/master/remix_screenshot.png)
## Offline Usage
The `gh-pages` branch has always the latest stable build of Remix. It also contains a ZIP file with the entire build. Download it to use offline.
Note: It contains the latest release of Solidity available at the time of the packaging. No other compiler versions are supported.
## INSTALLATION:
Install **npm** and **node.js** (see https://docs.npmjs.com/getting-started/installing-node), then do:
Remix-ide has been published as an npm module:
```bash
npm install remix-ide -g
remix-ide
```
Or if you want to clone the github repository (`wget` need to be installed first) :
```bash
git clone https://github.com/ethereum/remix-ide.git
git clone https://github.com/ethereum/remix.git # only if you plan to link remix and remix-ide repositories and develop on it.
cd remix # only if you plan to link remix and remix-ide repositories and develop on it.
npm install # only if you plan to link remix and remix-ide repositories and develop on it.
npm run bootstrap # only if you plan to link remix and remix-ide repositories and develop on it.
cd remix-ide
npm install
npm run setupremix # only if you plan to link remix and remix-ide repositories and develop on it.
npm start
```
## DEVELOPING:
Run `npm start` and open `http://127.0.0.1:4200` in your browser.
Then open your `text editor` and start developing.
The browser will automatically refresh when files are saved.
Most of the the time working with other modules (like debugger etc.) hosted in the [Remix repository](https://github.com/ethereum/remix) is not needed.
### Troubleshooting building
Some things to consider if you have trouble building the package:
- Make sure that you have the correct version of `node`, `npm` and `nvm`. You can find the version that is tested on Travis CI by looking at the log in the [build results](https://travis-ci.org/ethereum/remix-ide).
Run:
```bash
node --version
npm --version
nvm --version
```
- In Debian based OS such as Ubuntu 14.04LTS you may need to run `apt-get install build-essential`. After installing `build-essential` run `npm rebuild`.
## Unit Testing
Register new unit test files in `test/index.js`.
The tests are written using [tape](https://www.npmjs.com/package/tape).
Run the unit tests via: `npm test`
For local headless browser tests run `npm run test-browser`
(requires Selenium to be installed - can be done with `npm run selenium-install`)
Running unit tests via `npm test` requires at least node v7.0.0
## Browser Testing
To run the Selenium tests via Nightwatch:
- Build Remix IDE and serve it: `npm run build && npm run serve` # starts web server at localhost:8080
- Make sure Selenium is installed `npm run selenium-install` # don't need to repeat
- Run a selenium server `npm run selenium`
- Run all the tests `npm run nightwatch_local_firefox` or `npm run nightwatch_local_chrome`
- Or run a specific test case:
- npm run nightwatch_local_ballot
- npm run nightwatch_local_libraryDeployment
- npm run nightwatch_local_solidityImport
- npm run nightwatch_local_recorder
- npm run nightwatch_local_transactionExecution
- npm run nightwatch_local_staticAnalysis
- npm run nightwatch_local_signingMessage
- npm run nightwatch_local_console
- npm run nightwatch_local_remixd # remixd needs to be run
**NOTE:**
- **the `ballot` tests suite** requires to run `ganache-cli` locally.
- **the `remixd` tests suite** requires to run `remixd` locally.
- **the `gist` tests suite** requires specifying a github access token in **.env file**.
```
gist_token = <token>
```
**note that this token should have permission to create a gist.**
## Usage as a Chrome Extension
If you would like to use this as a Chrome extension, you must either build it first or pull from the `gh-pages` branch, both described above.
After that, follow these steps:
- Browse to `chrome://extensions/`
- Make sure 'Developer mode' has been checked
- Click 'Load unpacked extension...' to pop up a file-selection dialog
- Select your `remix-ide` folder
## Documentation
To see details about how to use Remix for developing and/or debugging Solidity contracts, please see [our documentation page](https://remix-ide.readthedocs.io/en/latest/)

@ -0,0 +1 @@
theme: jekyll-theme-cayman

@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,10 @@
/* global chrome */
'use strict'
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.storage.sync.set({ 'chrome-app-sync': true })
chrome.tabs.create({ 'url': chrome.extension.getURL('index.html') }, function (tab) {
// tab opened
})
})

@ -0,0 +1,153 @@
# Current "Best Practice" Conventions
- Please use [JS Standard Style](https://standardjs.com/) as a coding style guide.
- `ES6 class` rather than ES5 to create class.
- CSS declaration using `csjs-inject`.
- CSS files:
 **if** the CSS section of an UI component is too important, CSS declarations should be put in a different file and in a different folder.
The folder should be named `styles` and the file should be named with the extension `-styles.css`.
 e.g: `file-explorer.js` being an UI component `file-explorer-styles.css` is created in the `styles` folder right under `file-explorer.js`
**if** the CSS section of an UI component is rather limited it is preferable to put it in the corresponding JS file.
- HTML declaration using `yo-yo`.
- A module trigger events using `event` property:
 `self.event = new EventManager()`.
Events can then be triggered:
 `self.event.trigger('eventName', [param1, param2])`
- `self._view` is the HTML view renderered by `yo-yo` in the `render` function.
- `render()` this function should be called at the first rendering (make sure that the returned node element is put on the DOM), and should *not* by called again from outside the component.
- `update()` call this function to update the DOM when the state of the component has changed (this function must be called after the initial call to `render()`).
- for all functions / properties, prefixing by underscore (`_`) means the scope is private, and they should **not** be accessed not changed from outside the component.
- constructor arguments: There is no fixed rule whether it is preferrable to use multiples arguments or a single option *{}* argument (or both).
We recommend:
- use a specific slot for **obligatory** arguments and/or for complex arguments (meaning not boolean, not string, etc...).
- put arguments in an option *{}* for non critical and for optionnal arguments.
- if a component has more than 4/5 parameters, it is recommended to find a way to group some in one or more *opt* arguments.
- look them up, discuss them, update them.
   
## Module Definition (example)
```js
// user-card.js
var yo = require('yo-yo')
var csjs = require('csjs-inject')
var EventManager = require('remix-lib').EventManager
var css = csjs`
.userCard {
position : relative;
box-sizing : border-box;
display : flex;
flex-direction : column;
align-items : center;
border : 1px solid black;
width : 400px;
padding : 50px;
}
.clearFunds { background-color: lightblue; }
`
class UserCard {
constructor (api, events, opts = {}) {
var self = this
self.event = new EventManager()
self.opts = opts
self._api = api
self._consumedEvents = events
self._view = undefined
events.funds.register('fundsChanged', function (amount) {
if (amount < self.state._funds) self.state.totalSpend += self.state._funds - amount
self.state._funds = amount
self.render()
})
self.event.trigger('eventName', [param1, param2])
}
render () {
var self = this
var view = yo`
<div class=${css.userCard}>
<h1> @${self.state._nickname} </h1>
<h2> Welcome, ${self.state.title || ''} ${self.state.name || 'anonymous'} ${self.state.surname} </h2>
<ul> <li> User Funds: $${self.state._funds} </li> </ul>
<ul> <li> Spent Funds: $${self.state.totalSpend} </li> </ul>
<button class=${css.clearFunds} onclick=${e=>self._spendAll.call(self, e)}> spend all funds </button>
</div>
`
if (!self._view) {
self._view = view
}
return self._view
}
update () {
yo.update(this._view, this.render())
}
setNickname (name) {
this._nickname = name
}
getNickname () {
var self = this
return `@${self.state._nickname}`
}
getFullName () {
var self = this
return `${self.state.title} ${self.state.name} ${self.state.surname}`
}
_spendAll (event) {
var self = this
self._appAPI.clearUserFunds()
}
_constraint (msg) { throw new Error(msg) }
}
module.exports = UserCard
```
## Module Usage (example)
```js
/*****************************************************************************/
// 1. SETUP CONTEXT
var EventManager = require('remix-lib').EventManager
var funds = { event: new EventManager() }
var userfunds = 15
function getUserFunds () { return userfunds }
function clearUserFunds () {
var spent = userfunds
userfunds = 0
console.log(`all funds of ${usercard.getFullName()} were spent.`)
funds.event.trigger('fundsChanged', [userfunds])
return spent
}
setInterval(function () {
userfunds++
funds.event.trigger('fundsChanged', [userfunds])
}, 100)
/*****************************************************************************/
// 2. EXAMPLE USAGE
var UserCard = require('./user-card')
var usercard = new UserCard(
{ getUserFunds, clearUserFunds },
{ funds: funds.event },
{
title: 'Dr.',
name: 'John',
surname: 'Doe',
nickname: 'johndoe99'
})
var el = usercard.render()
document.body.appendChild(el)
setTimeout(function () {
userCard.setNickname('new name')
usercard.update()
}, 5000)
```

@ -0,0 +1,21 @@
#!/usr/bin/env node
var path = require('path')
var httpServer = require('http-server')
var remixd = require('remixd')
var server = httpServer.createServer({
root: path.join(__dirname, '/../')
})
var folder = process.argv.length > 2 ? process.argv[2] : process.cwd()
server.listen(8080, '127.0.0.1', function () {})
var router = new remixd.Router(65520, remixd.services.sharedFolder, { remixIdeUrl: 'http://localhost:8080' }, (webSocket) => {
remixd.services.sharedFolder.setWebSocket(webSocket)
remixd.services.sharedFolder.setupNotifications(folder)
remixd.services.sharedFolder.sharedFolder(folder, false)
})
router.start()
console.log('\x1b[33m%s\x1b[0m', 'Starting Remix IDE at http://localhost:8080 and sharing ' + folder)

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
setupRemixd () {
mkdir remixdSharedfolder
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:4200 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
setupRemixd
sleep 5
npm run nightwatch_parallel || TEST_EXITCODE=1
npm run nightwatch_local_runAndDeploy || TEST_EXITCODE=1
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
setupRemixd () {
mkdir remixdSharedfolder
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:4200 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
setupRemixd
sleep 5
TESTFILES=$(circleci tests glob "./apps/remix-ide/test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
npm run nightwatch_local_chrome $TESTFILES
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
setupRemixd () {
mkdir remixdSharedfolder
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:4200 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
setupRemixd
sleep 5
TESTFILES=$(circleci tests glob "./apps/remix-ide/test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
npm run nightwatch_local_firefox $TESTFILES
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
setupRemixd () {
mkdir remixdSharedfolder
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:4200 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
npm run ganache-cli &
npm run serve &
setupRemixd
sleep 5
npm run nightwatch_local_runAndDeploy || TEST_EXITCODE=1
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -0,0 +1,20 @@
#!/bin/bash
set -e
SHA=`git rev-parse --short --verify HEAD`
git config user.name "$COMMIT_AUTHOR"
git config user.email "$COMMIT_AUTHOR_EMAIL"
git checkout --orphan gh-pages
git rm --cached -r -f .
echo "# Automatic build" > README.md
echo "Built website from \`$SHA\`. See https://github.com/ethereum/remix-ide/ for details." >> README.md
echo "To use an offline copy, download \`remix-$SHA.zip\`." >> README.md
# ZIP the whole directory
zip -r remix-$SHA.zip $FILES_TO_PACKAGE
# -f is needed because "build" is part of .gitignore
git add -f $FILES_TO_PACKAGE remix-$SHA.zip
git commit -m "Built website from {$SHA}."
git push -f git@github.com:ethereum/remix-live-alpha.git gh-pages

@ -0,0 +1,20 @@
#!/bin/bash
set -e
SHA=`git rev-parse --short --verify HEAD`
git config user.name "$COMMIT_AUTHOR"
git config user.email "$COMMIT_AUTHOR_EMAIL"
git checkout --orphan gh-pages
git rm --cached -r -f .
echo "# Automatic build" > README.md
echo "Built website from \`$SHA\`. See https://github.com/ethereum/remix-ide/ for details." >> README.md
echo "To use an offline copy, download \`remix-$SHA.zip\`." >> README.md
# ZIP the whole directory
zip -r remix-$SHA.zip $FILES_TO_PACKAGE
# -f is needed because "build" is part of .gitignore
git add -f $FILES_TO_PACKAGE remix-$SHA.zip
git commit -m "Built website from {$SHA}."
git push -f git@github.com:ethereum/remix-live.git gh-pages

@ -0,0 +1,88 @@
'use strict'
var fs = require('fs')
var compiler = require('solc')
var compilerInput = require('@remix-project/remix-solidity').CompilerInput
var defaultVersion = 'v0.6.6+commit.6c089d02'
const path = require('path')
compiler.loadRemoteVersion(defaultVersion, (error, solcSnapshot) => {
console.log('solcSnapshot: ', solcSnapshot)
if (error) console.log(error)
var compilationResult = {}
const testsFolder = path.resolve(__dirname + '/../test-browser/tests/') + '/' // eslint-disable-line
gatherCompilationResults(testsFolder, compilationResult, solcSnapshot)
replaceSolCompiler(compilationResult, solcSnapshot)
})
function gatherCompilationResults (dir, compilationResult, solcSnapshot) {
var filenames = fs.readdirSync(dir, 'utf8')
filenames.map(function (item, i) {
if (item.endsWith('.js')) {
var testDef = require(dir + item)
if ('@sources' in testDef) {
var sources = testDef['@sources']()
for (var files in sources) {
compile(solcSnapshot, sources[files], true, function (result) {
compilationResult[result.key] = result
})
compile(solcSnapshot, sources[files], false, function (result) {
compilationResult[result.key] = result
})
}
}
}
})
return compilationResult
}
function compile (solcSnapshot, source, optimization, addCompilationResult) {
var missingInputs = []
try {
var input = compilerInput(source, {optimize: optimization})
var result = solcSnapshot.compileStandardWrapper(input, function (path) {
missingInputs.push(path)
})
input = input.replace(/(\t)|(\n)|(\\n)|( )/g, '')
} catch (e) {
console.log(e)
}
if (result && (result.error || (result.errors && result.errors.length > 0))) {
console.log(result.error, result.errors)
}
if (result) {
console.log(result.error, result.errors)
}
var ret = {
key: input,
source: source,
optimization: optimization,
missingInputs: missingInputs,
result: result
}
addCompilationResult(ret)
}
function replaceSolCompiler (results, solcSnapshot) {
const compilerPath = path.resolve(__dirname + '/../test-browser/mockcompiler/compiler.js') // eslint-disable-line
const soljsonPath = path.resolve(__dirname + '/../soljson.js') // eslint-disable-line
fs.readFile(compilerPath, 'utf8', function (error, data) {
if (error) {
console.log(error)
process.exit(1)
return
}
console.log(solcSnapshot.version())
data = data + '\n\nvar mockCompilerVersion = \'' + solcSnapshot.version() + '\''
data = data + '\n\nvar mockData = ' + JSON.stringify(results) + ';\n'
fs.writeFile(soljsonPath, data, 'utf8', function (error) {
if (error) {
console.log(error)
process.exit(1)
return
}
})
})
}

@ -1,3 +1,5 @@
'use strict'
const https = require('https') const https = require('https')
var userName = process.argv[2] var userName = process.argv[2]

@ -0,0 +1,6 @@
contract Constitution {
function Found(uint8 _numProposals) {
proposals.length = _numProposals;
}
}

@ -0,0 +1,6 @@
contract Mode {
function Normal(uint8 _numProposals) {
proposals.length = _numProposals;
}
}

@ -0,0 +1,143 @@
pragma solidity ^0.4.0;
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
}
// This is a type for a single proposal.
struct Proposal {
bytes32 name; // short name (up to 32 bytes)
uint voteCount; // number of accumulated votes
}
address public chairperson;
// This declares a state variable that
// stores a \`Voter\` struct for each possible address.
mapping(address => Voter) public voters;
// A dynamically-sized array of \`Proposal\` structs.
Proposal[] public proposals;
/// Create a new ballot to choose one of \`proposalNames\`.
function Ballot(bytes32[] proposalNames) {
chairperson = msg.sender;
voters[chairperson].weight = 1;
// For each of the provided proposal names,
// create a new proposal object and add it
// to the end of the array.
for (uint i = 0; i < proposalNames.length; i++) {
// \`Proposal({...})\` creates a temporary
// Proposal object and \`proposals.push(...)\`
// appends it to the end of \`proposals\`.
proposals.push(Proposal({
name: proposalNames[i],
voteCount: 0
}));
}
}
// Give \`voter\` the right to vote on this ballot.
// May only be called by \`chairperson\`.
function giveRightToVote(address voter) {
if (msg.sender != chairperson || voters[voter].voted) {
// \`throw\` terminates and reverts all changes to
// the state and to Ether balances. It is often
// a good idea to use this if functions are
// called incorrectly. But watch out, this
// will also consume all provided gas.
throw;
}
voters[voter].weight = 1;
}
/// Delegate your vote to the voter \`to\`.
function delegate(address to) {
// assigns reference
Voter sender = voters[msg.sender];
if (sender.voted)
throw;
// Forward the delegation as long as
// \`to\` also delegated.
// In general, such loops are very dangerous,
// because if they run too long, they might
// need more gas than is available in a block.
// In this case, the delegation will not be executed,
// but in other situations, such loops might
// cause a contract to get "stuck" completely.
while (
voters[to].delegate != address(0) &&
voters[to].delegate != msg.sender
) {
to = voters[to].delegate;
}
// We found a loop in the delegation, not allowed.
if (to == msg.sender) {
throw;
}
// Since \`sender\` is a reference, this
// modifies \`voters[msg.sender].voted\`
sender.voted = true;
sender.delegate = to;
Voter delegate = voters[to];
if (delegate.voted) {
// If the delegate already voted,
// directly add to the number of votes
proposals[delegate.vote].voteCount += sender.weight;
} else {
// If the delegate did not vote yet,
// add to her weight.
delegate.weight += sender.weight;
}
}
/// Give your vote (including votes delegated to you)
/// to proposal \`proposals[proposal].name\`.
function vote(uint proposal) {
Voter sender = voters[msg.sender];
if (sender.voted)
throw;
sender.voted = true;
sender.vote = proposal;
// If \`proposal\` is out of the range of the array,
// this will throw automatically and revert all
// changes.
proposals[proposal].voteCount += sender.weight;
}
/// @dev Computes the winning proposal taking all
/// previous votes into account.
function winningProposal() constant
returns (uint winningProposal)
{
uint winningVoteCount = 0;
for (uint p = 0; p < proposals.length; p++) {
if (proposals[p].voteCount > winningVoteCount) {
winningVoteCount = proposals[p].voteCount;
winningProposal = p;
}
}
}
// Calls winningProposal() function to get the index
// of the winner contained in the proposals array and then
// returns the name of the winner
function winnerName() constant
returns (bytes32 winnerName)
{
winnerName = proposals[winningProposal()].name;
}
}

@ -0,0 +1 @@
contract test1 { function get () returns (uint) { return 8; }}

@ -0,0 +1 @@
contract test2 { function get () returns (uint) { return 9; }}

@ -0,0 +1 @@
contract test1 { function get () returns (uint) { return 10; }}

@ -0,0 +1 @@
contract test2 { function get () returns (uint) { return 11; }}

@ -0,0 +1 @@
contract test2 { function get () returns (uint) { return 11; }}

@ -0,0 +1 @@
contract test2 { function get () returns (uint) { return 11; }}

@ -0,0 +1 @@
contract test2 { function get () returns (uint) { return 11; }}

@ -0,0 +1 @@
contract test2 { function get () returns (uint) { return 11; }}

@ -0,0 +1,156 @@
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}

@ -0,0 +1 @@
import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; contract test11 {}

@ -0,0 +1,8 @@
pragma solidity ^0.5.10;
import "./contract.sol";
contract Assets {
uint[] proposals;
function add(uint8 _numProposals) public {
proposals.length = _numProposals;
}
}

@ -0,0 +1,6 @@
contract gmbh {
uint[] proposals;
function register(uint8 _numProposals) public {
proposals.length = _numProposals;
}
}

@ -0,0 +1,6 @@
contract test {
function Test(uint8 _numProposals) public {
proposals.length = _numProposals;
}
}

@ -0,0 +1,14 @@
contract lease {
function Vote(uint8 _numProposals) {
proposals.length = _numProposals;
}
}
contract borrow {
function Vote(uint8 _numProposals) {
proposals.length = _numProposals;
}
}

@ -0,0 +1,6 @@
contract Finance {
function Loan(uint8 _numProposals) {
proposals.length = _numProposals;
}
}

@ -0,0 +1,6 @@
contract voting {
function Vote(uint8 _numProposals) {
proposals.length = _numProposals;
}
}

@ -0,0 +1,21 @@
contract credit_1 {
struct Proposal {
uint voteCount;
}
function Ballot(uint8 _numProposals) {
proposals.length = _numProposals;
}
}
contract credit_2 {
struct Proposal {
uint voteCount;
}
function Ballot(uint8 _numProposals) {
proposals.length = _numProposals;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }

@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }

@ -0,0 +1,87 @@
FAQ
===
### Solidity compiler
**Q: Error: compiler might be in a non-sane state**
```
error: "Uncaught JavaScript exception: RangeError: Maximum call stack size exceeded.
The compiler might be in a non-sane state, please be careful and do not use further compilation data to deploy to mainnet.
It is heavily recommended to use another browser not affected by this issue (Firefox is known to not be affected)."
```
**A:** Old versions of solidity compiler had this problem with chrome.
Please change the compiler version in Solidity Plugin to the newer one or use another browser.
**Q:** I’m getting an issue with Maximum call stack exceed and various other errors, can't compile.
**A:** Try a different browser or a newer solidity compiler version.
**Q:** How to verify a contract that imports other contracts?
**A:** The verification tool does not recursively go through the import statments in a contract. So can only verify a 'flattened' contract.
There is a plugin called `Flattener` which will stuff all the original code and the imported code into a single file.
### Deploy & Run
**Q:** I am using an Infura endpoint in my app, but when I try to deploy against that endpoint in remix IDE selecting "web3 provider" and putting my endpoint in, it's telling me that it can't connect
**A:** If the endpoint you are using is http, it won't work.
**Q:** Where is deploy button?
**A:** Its in the Deploy & Run module. If you haven't activated that module, you should do that by clicking Deploy & Run module in the Plugin Manager.
You could also activate everything you need to work with solidity on the landing page ( click the remix logo at the top left for the screen) and click the "Solidity" button in the environment section.
**Q:** How to pass a tuple to a public function in Remix?
**A:** Pass it as an array [].
**Q:** How to input a struct as input to a parameter of a function in the Deploy & Run module?
**A:** For inputting a struct, just like a tuple, pass it in as an array []. Also you need to put in the line:
`pragma experimental ABIEncoderV2;` at the top of the solidity file.
For example, here's a solidity file with a struct is an input parameter.
```
pragma solidity >=0.4.22 <0.6.0;
pragma experimental ABIEncoderV2;
contract daPeeps {
struct Peep {uint a; uint b;} // declaration of Peep type
Peep peep; //declaration of an object of Peep type
constructor () public
{
peep.a = 0; // definition/initialisation of object
peep.b = 0; //
}
function initPeepToPeep(Peep memory i) public payable {
peep.a = i.a;
peep.b = i.b;
}
function setPeep(uint a, uint b) public payable {
peep.a = a;
peep.b = b;
}
function getPeep() public view returns(Peep memory)
{
return peep;
}
}
```
The input of initPeepToPeeps takes a struct. If you input
`[1,2]` the transaction will go through.
### General
**Q:** Where do plugin developers go with their questions?
**A:** The Gitter Remix plugin developers room https://gitter.im/ethereum/remix-dev-plugin

@ -0,0 +1,95 @@
Remix Assert Library
====================
* [Assert.ok(value[, message])](#assert-ok-value-message)
* [Assert.equal(actual, expected[, message])](#assert-equal-actual-expected-message)
* [Assert.notEqual(actual, expected[, message])](#assert-notequal-actual-expected-message)
* [Assert.greaterThan(value1, value2[, message])](#assert-greaterthan-value1-value2-message)
* [Assert.lesserThan(value1, value2[, message])](#assert-lesserthan-value1-value2-message)
## Assert
### Assert.ok(value[, message])
* `value`: \<bool\>
* `message`: \<string\>
Tests if value is truthy. `message` is returned in case of failure.
Examples:
```
Assert.ok(true);
// OK
Assert.ok(false, "it\'s false");
// error: it's false
```
### Assert.equal(actual, expected[, message])
* `actual`: \<uint | int | bool | address | bytes32 | string\>
* `expected`: \<uint | int | bool | address | bytes32 | string\>
* `message`: \<string\>
Tests if `actual` & `expected` values are same. `message` is returned in case of failure.
Examples:
```
Assert.equal(string("a"), "a");
// OK
Assert.equal(uint(100), 100);
// OK
foo.set(200)
Assert.equal(foo.get(), 200);
// OK
Assert.equal(foo.get(), 100, "value should be 200");
// error: value should be 200
```
### Assert.notEqual(actual, expected[, message])
* `actual`: \<uint | int | bool | address | bytes32 | string\>
* `expected`: \<uint | int | bool | address | bytes32 | string\>
* `message`: \<string\>
Tests if `actual` & `expected` values are not same. `message` is returned in case of failure.
Examples:
```
Assert.notEqual(string("a"), "b");
// OK
foo.set(200)
Assert.notEqual(foo.get(), 200, "value should not be 200");
// error: value should not be 200
```
### Assert.greaterThan(value1, value2[, message])
* `value1`: \<uint | int\>
* `value2`: \<uint | int\>
* `message`: \<string\>
Tests if `value1` is greater than `value2`. `message` is returned in case of failure.
Examples:
```
Assert.greaterThan(uint(2), uint(1));
// OK
Assert.greaterThan(uint(-2), uint(1));
// OK
Assert.greaterThan(int(2), int(1));
// OK
Assert.greaterThan(int(-2), int(-1), "-2 is not greater than -1");
// error: -2 is not greater than -1
```
### Assert.lesserThan(value1, value2[, message])
* `value1`: \<uint | int\>
* `value2`: \<uint | int\>
* `message`: \<string\>
Tests if `value1` is lesser than `value2`. `message` is returned in case of failure.
Examples:
```
Assert.lesserThan(int(-2), int(-1));
// OK
Assert.lesserThan(int(2), int(1), "2 is not lesser than 1");
// error: 2 is not greater than 1
```

@ -0,0 +1,11 @@
Code Contribution Guide
=======================
Remix is an open source tool and we encourage anyone to help us improve our tool.
You can do that by opening issues, giving feedback or by contributing a pull request
to our codebase.
The Remix application is built with JavaScript and it doesn't use any framework. We only
rely on selected set of npm modules, like `yo-yo`, `csjs-inject` and others. Check out the `package.json` files in the Remix submodules to learn more about the stack.
To learn more, please visit our [GitHub page](https://github.com/ethereum/remix-ide).

@ -0,0 +1,14 @@
Community Support
=======================
We know that blockchain ecosystem is very new and that lots of information is scattered around the web.
That is why we created a community support channel where we and other users try to answer your questions if
you get stuck using Remix. Please, join [the community](https://gitter.im/ethereum/remix) and ask for help.
For anyone who is interested in developing a custom plugin for Remix or who wants to contribute to the codebase,
we opened a [contributors' channel](https://gitter.im/ethereum/remix-dev) especially for developers working on Remix tools.
We would kindly ask you to respect the space and to use it for
getting help with your work and the developers' channel for discussions related to working on Remix codebase. If you have
ideas for collaborations or you want to promote your project, try to find some more appropriate channels to do so. Or you can contact
the main contributors directly on Gitter or Twitter.

@ -0,0 +1,34 @@
Compiler (Solidity)
===================
Clicking the Solidity icon in the icon panel brings you to the Solidty Compiler.
Compiling is triggered when you click the compile button ( **D. in image below**). If you want the file to be compiled each time the file is saved or when another file is selected - check the auto compile checkbox ( **E. in image below**).
Since the Solidity version `0.5.7`, it is possible to compile `Yul` files. Please read the ([solidity documentation about Yul](https://solidity.readthedocs.io/en/latest/yul.html)) which contain some code examples.
You can use the language dropdown ( **B. in image below**) to switch the language. **This dropdown list is only available for versions greater than or equal to `0.5.7`.**
The fork selection dropdown list ( **C. in image below**) allows to compile code against a specific ethereum hard fork.
The `compiler default` corresponds to the default hard fork used by a specific version. Please go to "Compilation Details" ( **G. in image below**) in the settings of `Metadata` section to see the harfork name used for the current compilation.
If the contract has a lot of dependencies it can take a while to compile - so you use autocompilation at your discretion.
![](images/a-sol-compiler.png)
After each compilation, a list is updated with all newly compiled
contracts. A compiled contract can be selected with the Contract pulldown menu ( **F. in the image**). Multiple contracts are compiled when one contract imports other contracts. Selecting a contract will show information about that one.
When the "Compilation Details" button is clicked ( **G. in image**), a modal opens displaying detailed information about the current selected contract.
For those writing your own custom solidity compiler, you can import that by clicking the **+** button (**X. in the image**) to open a modal where you can input the url of the compiler to be loaded.
From the Solidity Compiler module you can also publish your contract to Swarm (only non
abstract contracts can be published) & IPFS.
Published data notably contains the `abi` and the solidity source code.
After a contract is published, you can find its metadata information
using the bzz URL located in the details modal dialog `SWARM LOCATION`.
Compilation Errors and Warning are displayed below the contract section.
At each compilation, the static analysis tab builds a report. It is important to address reported issues even if the compiler doesn't complain. ([see more](static_analysis.html))

@ -30,14 +30,14 @@ import os
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [] extensions = ['recommonmark'] # required for sphinx v3.0.0
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
# The suffix(es) of source filenames. # The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md'] source_suffix = ['.rst', '.md']
# The encoding of source files. # The encoding of source files.
@ -51,7 +51,7 @@ project = u'Remix, Ethereum-IDE'
copyright = u'2019, Remix' copyright = u'2019, Remix'
author = u'Remix team' author = u'Remix team'
github_doc_root = 'https://github.com/ethereum/remix-ide/tree/master/docs/' github_doc_root = 'https://github.com/ethereum/remix/tree/master/docs/'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
@ -289,9 +289,9 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu. # If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False #texinfo_no_detailmenu = False
from recommonmark.parser import CommonMarkParser # Uncomment these two lines with sphinx version 1.0.0
source_suffix = ['.rst', '.md'] # from recommonmark.parser import CommonMarkParser
source_parsers = {'.md': CommonMarkParser} # source_parsers = {'.md': CommonMarkParser}
# app setup hook # app setup hook

File diff suppressed because one or more lines are too long

@ -0,0 +1,107 @@
Creating and Deploying a Contract
================================
There are 3 type of environments Remix can be plugged to:
`Javascript VM`, `Injected provider`, or `Web3 provider`. (for details see [Running transactions](https://remix-ide.readthedocs.io/en/latest/run.html))
Both `Web3 provider` and `Injected provider` require the use of an
external tool.
The external tool for `Web3 provider` is an Ethereum node and for
`Injected provider` Metamask.
The `JavaScript VM` mode is convenient because each execution runs in
your browser and you don't need any other software or Ethereum node to run it.
So, it is the easiest test environment - **no setup required!**
But keep in mind that reloading the browser when you are in the Javascript VM will restart Remix in an empty state.
For performance purposes ( which is to say - for testing in an environment that is closest to the mainnet), it might also be better to use an external node.
Selecting the VM mode
---------------------
Make sure the VM mode is selected. All accounts displayed in `Accounts`
should have 100 ether.
Sample contract
---------------
```
pragma solidity ^0.5.1;
contract testContract {
uint value;
constructor (uint _p) public {
value = _p;
}
function setP(uint _n) payable public {
value = _n;
}
function setNP(uint _n) public {
value = _n;
}
function get () view public returns (uint) {
return value;
}
}
```
This contract is very basic. The goal is to quickly start to create and
to interact with a sample contract.
Deploying an instance
---------------------
The `Compile tab` displays information related to the current contract
(note that there can be more than one) ([see compile](compile.html)).
Moving on, in the `Run tab` select, `JavaScript VM` to specify that you
are going to deploy an instance of the contract in the `JavaScript VM`
state.
![](images/a-jvm.png)
The constructor of `Ballot.sol` needs a parameter (of type `uint8`).
Give any value and click on `Deploy`.
The transaction which deploys the instance of `Ballot` is created.
In a "normal" blockchain, it can take several seconds to execute. This
is the time for the transaction to be mined. However, because we are
using the `JavaScript VM`, our execution is immediate.
The terminal will inform you about the transaction. You can see details
there and start debugging.
The newly created instance is displayed in the `run tab`.
![](images/a-jvm-instance.png)
Interacting with an instance
----------------------------
This new instance contains 3 actions which corresponds to the 3
functions (`setP`, `setPN`, `get`). Clicking on `SetP` or `SetPN` will
create a new transaction.
Note that `SetP` is `payable` (red button) : it is possible to send
value (Ether) to the contract.
`SetPN` is not payable (orange button - depending on the theme) : it is not possible to send
value (Ether) to the contract.
Clicking on `get` will not execute a transaction (usually its a blue button - depending on the theme). It doesn't execute a transaction because a `get` does not modify the state (variable
`value`) of this instance.
As `get` is `view` you can see the return value just below the
action.
![](images/a-jvm-calling-instance.png)

@ -0,0 +1,14 @@
Debugger
========
This module allows you to debug the transaction. It can be used to
deploy transactions created from Remix and already mined transactions.
(debugging works only if the current environment provides the necessary
features).
To get to the debugger - you can click the debug button in the terminal when a successful or failed transaction appears there. You can also load the module from the plugin manager and then click the bug in the icon panel. Or you can get to the debugger by running the debug command in the console.
![](images/a-debugger.png)
To learn more about how to use this tool go to the [debugger tutorial](tutorial_debug.html).

@ -0,0 +1,59 @@
File Explorers
=============
To get to the File Explorers module - click the file explorers icon.
![](images/a-file-explorer1.png)
The basic files explorer lists all the files stored in your browser's **browser storage**.
You can see them in the **browser** folder.
**Important Note:** Clearing the browser storage will **permanently delete** all the
solidity files stored there. This is an inherent limitation of a browser-based IDE. However, if you want to store files outside of the browser and on your computer's filesystem, use [Remixd](remixd.html) or use the [desktop version of Remix-IDE](https://github.com/ethereum/remix-desktop/releases/). RemixD enables you to have access to a selected folder on your hard drive. Remix Desktop is a version of Remix-IDE in an Electron app.
You can rename, remove or
add new files to the file explorer.
![](images/a-file-explorer-buttons.png)
We will start by reviewing the icons in the image above.
The book icon - **A.** is the link to the module's documentation.
The icons to the right of the **browser** file explorer in the image above only appear for browser storage.
Create new File
---------------
The icon marked **B.** above. Creates a new file.
Publish to Gist
---------------
The icon marked **C.** above. Publishes all files from the browser folder to a gist. Only file in the root of **browser** will be published. Files in subfolders will not be publish to the Gist.
Gist API has changed in 2018 and **requires** users to be authenticated to be able to publish a gist.
Click [this link](https://github.com/settings/tokens) to Github tokens setup and select Generate new token. Then check the **Create gists** checkbox and generate a new token.
Take the token and paste it in Remix's **Settings** module in the **Github Access Token** section. And then click Save. Now you should be able to use the feature.
Create a folder
---------------
The icon marked **D.** above. Creates a new folder in **browser** file explorer.
Context Menu (Right Click)
-----------------------------
Right click on a file or a folder and the **context menu** will appear.
![](images/a-file-ex-rt-click.png)
You can rename or delete a selected file or a folder. You can also create a folder.
To create a file with the context menu, right click on a folder to get the **Create File** option. A file will be created inside that folder.
![](images/a-file-ex-rt-click-folder.png)
The functionality of the context menu also works with RemixD (which gives you have access to a folder on your hard drive).
**Note:** When working with RemixD, you need to open and close the **localhost** folder to refresh the view.

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

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

Loading…
Cancel
Save