Merge branch 'master' into contract-verification-i18n

pull/5591/head
Joseph Izang 4 weeks ago committed by GitHub
commit b3e181b60a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      CONTRIBUTING.md
  2. 4
      apps/circuit-compiler/src/app/services/circomPluginClient.ts
  3. 19
      apps/contract-verification/README.md
  4. 2
      apps/debugger/webpack.config.js
  5. 2
      apps/doc-viewer/webpack.config.js
  6. 2
      apps/remix-dapp/src/locales/en/udapp.json
  7. 2
      apps/remix-ide-e2e/src/tests/layout.test.ts
  8. 4
      apps/remix-ide-e2e/src/tests/migrateFileSystem.test.ts
  9. 2
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  10. 69
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  11. 154
      apps/remix-ide-e2e/src/tests/vm_state.test.ts
  12. 6
      apps/remix-ide-e2e/src/tests/workspace_git.test.ts
  13. 12
      apps/remix-ide/release-process.md
  14. 1
      apps/remix-ide/src/app/editor/editor.js
  15. 5
      apps/remix-ide/src/app/udapp/run-tab.tsx
  16. BIN
      apps/remix-ide/src/assets/img/linea_chain.png
  17. 4
      apps/remixdesktop/README.md
  18. 6
      apps/remixdesktop/src/lib/InferenceServerManager.ts
  19. 4
      apps/vyper/.browserslistrc
  20. 6
      apps/vyper/src/app/utils/compiler.tsx
  21. 6
      libs/remix-ai-core/src/helpers/streamHandler.ts
  22. 2
      libs/remix-analyzer/src/solidity-analyzer/modules/functionCallGraph.ts
  23. 6
      libs/remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
  24. 2
      libs/remix-astwalker/src/sourceMappings.ts
  25. 2
      libs/remix-core-plugin/src/lib/compiler-artefacts.ts
  26. 2
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  27. 2
      libs/remix-debug/src/solidity-decoder/types/util.ts
  28. 16
      libs/remix-lib/src/execution/logsManager.ts
  29. 2
      libs/remix-lib/src/hash.ts
  30. 17
      libs/remix-simulator/test/events.ts
  31. 6
      libs/remix-ui/environment-explorer/src/lib/components/environment-explorer-ui.tsx
  32. 2
      libs/remix-ui/plugin-manager/src/types.d.ts
  33. 1
      libs/remix-ui/run-tab/src/lib/actions/deploy.ts
  34. 8
      libs/remix-ui/run-tab/src/lib/components/environment.tsx
  35. 4
      libs/remix-ws-templates/src/templates/rln/templates/groth16_verifier.sol.ejs
  36. 2
      libs/remix-ws-templates/src/templates/rln/templates/plonk_verifier.sol.ejs

@ -1,6 +1,6 @@
# Contributing
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.gg/mh9hFCKkEq).
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.com/invite/nfv6ZYjAeP).
## Development
Remix libraries work closely with [Remix IDE](https://remix.ethereum.org). Each library has a README to explain its application.
@ -72,7 +72,7 @@ import panelJson from './panel.json';
import enJson from '../en';
// There may have some untranslated content. Always fill in the gaps with EN JSON.
// No need for a defaultMessage prop when render a FormattedMessage component.
// No need for a defaultMessage prop when rendering a FormattedMessage component.
export default Object.assign({}, enJson, {
...panelJson,
})

@ -502,9 +502,9 @@ export class CircomPluginClient extends PluginClient {
const exists = await this.call('fileManager', 'exists', path)
if (exists) return path
else throw new Error(`Report path ${path} do no exist in the Remix FileSystem`)
else throw new Error(`Report path ${path} does not exist in the Remix FileSystem`)
} else {
throw new Error(`Report path ${path} do no exist in the Remix FileSystem`)
throw new Error(`Report path ${path} does not exist in the Remix FileSystem`)
}
}
}

@ -0,0 +1,19 @@
# Contract Verification Plugin
With this plugin, contracts written and compiled in Remix can be verified at Sourcify, Etherscan, Blockscout and Routescan at the same time. Besides that, the source code of any address can be fetched from the verifiers and added to the file editor.
## Adding a new verification service
Currently, the plugin supports Sourcify, Etherscan, Blockscout and Routescan. To add a new verifier, you need to make the following changes:
In `./src/app/types/VerificationTypes.ts`, add the new verifier to the `VerifierIdentifier` type and the`VERIFIERS` array.
In order to interact with the API of the verification service, you need to create a new class that extends the `AbstractVerifier` class. If your API is based on the Etherscan API, you can simply extend the `EtherscanVerifier` class. In this case, see the `RoutescanVerifier` and the `BlockscoutVerifier` for reference. All related classes are located in the `./src/app/Verifiers` directory.
In `./src/app/Verifiers/index.ts`, add your new verifier to the `getVerifier` function. Validate any settings properties that are required by your verifier.
In `./src/app/utils/default-apis.json`, you need to add default settings for your new verifier. If you can, simply add your defaults in the form of `{ [VerifierIdentifier]: { [chainId]: { apiUrl: [value], explorerUrl: [value] } } }`. If you need more flexibility, you might also want to change the `src/app/utils/default-settings.ts` file. See Routescan there for reference.
Your new verifier will automatically be shown in the `VerifyView` and the `LookupView` since we added it to the `VERIFIERS` array. You only need to make a change to the `SettingsView` because the required settings depend on the verifier. There, add a new div block in the same format as the other verifiers. Only add the `ConfigInput` elements for the settings that your verifier needs to the div block.
That's it! Your verification service should be able to verify contracts through Remix now.

@ -48,7 +48,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)
// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],

@ -28,7 +28,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
new webpack.DefinePlugin({})
)
// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],

@ -133,7 +133,7 @@
"udapp.contractCreation": "Contract Creation",
"udapp.transactionFee": "Transaction is invalid. Max fee should not be less than Base fee",
"udapp.title1": "Represents the part of the tx fee that goes to the miner.",
"udapp.title2": "Represents the maximum amount of fee that you will pay for this transaction. The minimun needs to be set to base fee.",
"udapp.title2": "Represents the maximum amount of fee that you will pay for this transaction. The minimum needs to be set to base fee.",
"udapp.gasPrice": "Gas price",
"udapp.gweiText": "visit {a} for current gas price info.",
"udapp.maxTransactionFee": "Max transaction fee",

@ -26,7 +26,7 @@ module.exports = {
.assert.containsText('.sidepanel h6[data-id="sidePanelSwapitTitle"]', 'SOLIDITY COMPILER')
.waitForElementNotVisible('.pinned-panel h6[data-id="sidePanelSwapitTitle"]')
},
'Should pin a plugin while a another plugin is already pinned': function (browser: NightwatchBrowser) {
'Should pin a plugin while an another plugin is already pinned': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('[data-id="movePluginToRight"]')
.click('[data-id="movePluginToRight"]')
.waitForElementVisible('[data-id="movePluginToLeft"]')

@ -101,7 +101,7 @@ module.exports = {
browser.assert.equal(content, 'testing')
})
},
'Should have a artifacts file with JSON test data #group1 #group3 #group5 #group7': function (browser: NightwatchBrowser) {
'Should have an artifacts file with JSON test data #group1 #group3 #group5 #group7': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 5000)
.click('*[data-id="treeViewLitreeViewItemtest_contracts/artifacts"]')
.openFile('test_contracts/artifacts/Storage_metadata.json')
@ -111,7 +111,7 @@ module.exports = {
browser.assert.equal(metadata.test, 'data')
})
},
'Should have a empty workspace #group1 #group3 #group5 #group7': function (browser: NightwatchBrowser) {
'Should have an empty workspace #group1 #group3 #group5 #group7': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 5000)
.switchWorkspace('emptyspace')
},

@ -7,7 +7,7 @@ module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
// this test suite also contribute testing https://github.com/ethereum/remix/pull/1497 and https://github.com/ethereum/remix-ide/pull/2898
// quick explanation:
// the goal of https://github.com/ethereum/remix-ide/pull/2898 is to keep track of all the compiled contracts an not only the last one.
// the goal of https://github.com/ethereum/remix-ide/pull/2898 is to keep track of all the compiled contracts a not only the last one.
// this introduce an issue: if 2 compiled contracts have the same name, the second one override the first which is not wanted.
// fix's delivered by https://github.com/ethereum/remix/pull/1497: instead of getting contract by name,
// which result in name clashing we process the whole contract object (which contain bytecode, deployedbytecode, ...)

File diff suppressed because one or more lines are too long

@ -0,0 +1,154 @@
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
declare global {
interface Window { testplugin: { name: string, url: string }; }
}
const tests = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, null)
},
'Should show fork and delete VM state icons #group1': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('udapp')
.waitForElementVisible('*[data-id="selected-provider-vm-cancun"]')
.waitForElementVisible('*[data-id="fork-state-icon"]')
.waitForElementVisible('*[data-id="delete-state-icon"]')
},
'Should show toaster while trying fork and delete VM state without state #group1': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="fork-state-icon"]')
.click('*[data-id="fork-state-icon"]')
.waitForElementVisible(
{
selector: "//*[@data-shared='tooltipPopup' and contains(.,'State not available to fork')]",
locateStrategy: 'xpath'
}
)
.waitForElementVisible('*[data-id="delete-state-icon"]')
.click('*[data-id="delete-state-icon"]')
.waitForElementVisible(
{
selector: "//*[@data-shared='tooltipPopup' and contains(.,'State not available to delete')]",
locateStrategy: 'xpath'
}
)
},
'Should fork state successfully #group1': function (browser: NightwatchBrowser) {
browser
.openFile('contracts')
.openFile('contracts/1_Storage.sol')
.verifyContracts(['Storage'])
.clickLaunchIcon('udapp')
.click('[data-id="Deploy - transact (not payable)"]')
.clickInstance(0)
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '"55"' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
'decoded input': { 'uint256 num': '55' }
})
.clickFunction('retrieve - call')
.testFunction('last',
{
'decoded output': { '0': 'uint256: 55' }
})
.click('*[data-id="fork-state-icon"]')
.waitForElementVisible('*[data-id="udappNotifyModalDialogModalTitle-react"]')
.click('input[data-id="modalDialogForkState"]')
.setValue('input[data-id="modalDialogForkState"]', 'forkedState_1')
.modalFooterOKClick('udappNotify')
// check toaster for forked state
.waitForElementVisible(
{
selector: '//*[@data-shared="tooltipPopup" and contains(.,"VM state \'forkedState_1\' forked")]',
locateStrategy: 'xpath'
}
)
// check if forked state is selected as current envionment
.assert.elementPresent('*[data-id="selected-provider-vm-fs-forkedState_1"]')
// check if forked state file is created with expected details
.openFile('.states/forked_states/forkedState_1.json')
.getEditorValue((content) => {
browser.assert.ok(content.indexOf(`"latestBlockNumber": "0x2"`) !== -1)
browser.assert.ok(content.indexOf(`"stateName": "forkedState_1"`) !== -1)
browser.assert.ok(content.indexOf(`"forkName": "cancun"`) !== -1)
browser.assert.ok(content.indexOf(`"savingTimestamp":`) !== -1)
browser.assert.ok(content.indexOf(`"db":`) !== -1)
browser.assert.ok(content.indexOf(`"blocks":`) !== -1)
})
},
'Should show fork states provider in environment explorer & make txs using forked state #group1': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('udapp')
.waitForElementVisible('[data-id="settingsSelectEnvOptions"]')
.click('[data-id="settingsSelectEnvOptions"] button')
.waitForElementVisible(`[data-id="dropdown-item-another-chain"]`)
.click(`[data-id="dropdown-item-another-chain"]`)
.assert.visible('[data-id="remixUIGSDeploy to an In-browser Forked State."]')
.assert.elementPresent('[data-id="remixUIGSforkedState_1"]')
.assert.elementPresent('[data-id="vm-fs-forkedState_1-pinned"]')
.assert.textContains('[data-id="vm-fs-forkedState_1desc"]', 'Latest Block: 2')
.assert.not.elementPresent('[data-id="remixUIGSforkedState_2"]')
.switchEnvironment('vm-cancun')
.openFile('contracts/1_Storage.sol')
.verifyContracts(['Storage'])
.clickLaunchIcon('udapp')
.click('*[data-id="Deploy - transact (not payable)"]')
.click('*[data-id="fork-state-icon"]')
.waitForElementVisible('*[data-id="udappNotifyModalDialogModalTitle-react"]')
.click('input[data-id="modalDialogForkState"]')
.setValue('input[data-id="modalDialogForkState"]', 'forkedState_2')
.modalFooterOKClick('udappNotify')
.waitForElementVisible('*[data-shared="tooltipPopup"]', 10000)
.assert.textContains('*[data-shared="tooltipPopup"]', `VM state 'forkedState_2' forked and selected as current envionment.`)
// check if 'forkedState_2' is selected as current envionment
.assert.elementPresent('*[data-id="selected-provider-vm-fs-forkedState_2"]')
// check if 'forkedState_2' is present in envionment explorer
.assert.elementPresent('[data-id="remixUIGSforkedState_2"]')
// check if 'forkedState_2' is pinned in envionment explorer
.assert.elementPresent('[data-id="vm-fs-forkedState_2-pinned"]')
// 'forkedState_2' should have 3 blocks
.assert.textContains('[data-id="vm-fs-forkedState_2desc"]', 'Latest Block: 3')
.click('*[data-id="Deploy - transact (not payable)"]')
.clickInstance(0)
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '"555"' })
// block number should be 5 after 2 txs
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
'block number': '5',
'decoded input': { 'uint256 num': '555' }
})
},
'Should delete state successfully #group1': function (browser: NightwatchBrowser) {
browser
.switchEnvironment('vm-cancun')
.openFile('contracts/1_Storage.sol')
.verifyContracts(['Storage'])
.clickLaunchIcon('udapp')
.click('*[data-id="Deploy - transact (not payable)"]')
.pause(10000)
.assert.textContains('*[data-id="deployedContractsBadge"]', '1')
.click(('*[data-id="delete-state-icon"]'))
.waitForElementVisible('*[data-id="udappNotifyModalDialogModalTitle-react"]')
.waitForElementVisible('*[data-id="deleteVmStateModal"]')
.modalFooterOKClick('udappNotify')
.waitForElementVisible('*[data-shared="tooltipPopup"]', 10000)
// check if toaster is shown
.assert.textContains('*[data-shared="tooltipPopup"]', `VM state deleted successfully.`)
// check that there are no instances
.assert.textContains('*[data-id="deployedContractsBadge"]', '0')
// check if state file is deleted
.openFile('.states/vm-cancun')
.assert.not.elementPresent('*[data-id="treeViewDivDraggableItem.states/vm-cancun/state.json"]')
}
}
module.exports = {
...tests
};

@ -434,7 +434,7 @@ module.exports = {
.click('*[data-id="saveGitHubCredentials"]')
.modalFooterOKClick('github-credentials-error')
},
'check source controle panel #group5': function (browser: NightwatchBrowser) {
'check source control panel #group5': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="sourcecontrol-panel"]')
.click('*[data-id="sourcecontrol-panel"]')
@ -448,7 +448,7 @@ module.exports = {
.clickLaunchIcon('filePanel')
.switchWorkspace('default_workspace')
},
'check source controle panel again #group5': function (browser: NightwatchBrowser) {
'check source control panel again #group5': function (browser: NightwatchBrowser) {
browser
.pause(1000)
.clickLaunchIcon('dgit')
@ -485,7 +485,7 @@ module.exports = {
'Incorrect content')
})
},
'check source controle panel for uniswap #group5': function (browser: NightwatchBrowser) {
'check source control panel for uniswap #group5': function (browser: NightwatchBrowser) {
browser
.pause(5000)
.clickLaunchIcon('dgit')

@ -1,9 +1,9 @@
This document includes:
This document describes:
- how to update remix.ethereum.org.
- how to update remix-alpha.ethereum.org.
- how to release remix IDE.
# remix IDE release
# Remix IDE Release
- git fetch origin master
- git checkout origin/master
@ -12,7 +12,7 @@ This document includes:
- merge PR
- git fetch origin master
- git checkout origin/master
- git tag v(version-number)
- git tag v<version-number>
- git push --tags
- github-changes -o ethereum -r remix-ide -a --only-pulls --use-commit-body --only-merges --between-tags previous_version...next_version
- publish a release in github using the changelog
@ -23,7 +23,7 @@ This document includes:
- npm publish
- after remix_live is updated, drop the zip (from https://github.com/ethereum/remix-live/) to the release.
# remix-ide beta release
# Remix IDE Beta Release
- git fetch origin master
- git checkout origin/master
- git checkout -b bumpVersion
@ -31,7 +31,7 @@ This document includes:
- merge PR
- git fetch origin master
- git checkout origin/master
- git tag v(version-number) (with "vx.x.x-beta.1")
- git tag v<version-number> (with "vx.x.x-beta.1")
- git push --tags
- github-changes -o ethereum -r remix-ide -a --only-pulls --use-commit-body --only-merges --between-tags previous_version...next_version
- publish a beta release in github using the changelog
@ -41,7 +41,7 @@ This document includes:
This is not strictly speaking a release. Updating the remix site is done through the Travis build:
- git co -b remix_live origin/remix_live
- git checkout -b remix_live origin/remix_live
- git reset --hard -master-commit-hash-
- git push -f origin remix_live

@ -5,7 +5,6 @@ import { EditorUI } from '@remix-ui/editor' // eslint-disable-line
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
import { PluginViewWrapper } from '@remix-ui/helper'
import { commitChange } from '@remix-ui/git'
const EventManager = require('../../lib/events')

@ -160,13 +160,15 @@ export class RunTab extends ViewPlugin {
'injected-metamask-gnosis': 'Deploy to Gnosis through the Metamask browser extension.',
'injected-metamask-arbitrum': 'Deploy to Arbitrum through the Metamask browser extension.',
'injected-metamask-sepolia': 'Deploy to the Sepolia testnet through the Metamask browser extension.',
'injected-metamask-ephemery': 'Deploy to the Ephemery testnet through the Metamask browser extension.'
'injected-metamask-ephemery': 'Deploy to the Ephemery testnet through the Metamask browser extension.',
'injected-metamask-linea': 'Deploy to Linea through the Metamask browser extension.'
}
const logos = {
'injected-metamask-optimism': ['assets/img/optimism-ethereum-op-logo.png', 'assets/img/metamask.png'],
'injected-metamask-arbitrum': ['assets/img/arbitrum-arb-logo.png', 'assets/img/metamask.png'],
'injected-metamask-gnosis': ['assets/img/gnosis_chain.png', 'assets/img/metamask.png'],
'injected-metamask-linea': ['assets/img/linea_chain.png', 'assets/img/metamask.png'],
'injected-metamask-sepolia': ['assets/img/metamask.png'],
'injected-metamask-ephemery': ['assets/img/metamask.png'],
'injected-MetaMask': ['assets/img/metamask.png'],
@ -243,6 +245,7 @@ export class RunTab extends ViewPlugin {
"decimals": 18
})
*/
await addCustomInjectedProvider(11, event, 'injected-metamask-linea', 'L2 - Linea', '0xe708', ['https://rpc.linea.build'])
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

@ -4,13 +4,13 @@
### Running the app locally
In the main repo yarn, then run yarn serve
In the main repo run yarn, then run yarn serve
In this directory apps/remixdesktop, yarn, then run: yarn start:dev to boot the electron app
Then, the app will be started in live reload mode, and anything you do in Remix IDE will be reloaded.
It will not however reload electron code. You need to rerun yarn start:dev every time.
If you run into issues with yarn when native node modules are being rebuilt you need
If you run into issues with yarn when native node modules are being rebuilt, you need
- Windows: install Visual Studio Tools with Desktop Development C++ enabled in the Workloads
- MacOS: install Xcode or Xcode Command Line Tools. Also make sure the compilers (clang++ | g++) target the right sdk includes, ```export SDKROOT="xcrun --show-sdk-path"```
- Linux: unknown, probably a C++ compiler

@ -149,8 +149,8 @@ export class InferenceManager implements ICompletions {
} else {
// Server is running with successful request
// console.log('Inference server is running')
// console.log('completion is runnig', state.data?.completion)
// console.log('general is runnig', state.data?.general)
// console.log('completion is running', state.data?.completion)
// console.log('general is running', state.data?.general)
}
// this._handleResources()
}
@ -176,7 +176,7 @@ export class InferenceManager implements ICompletions {
}
if (model.modelReqs.GPURequired) {
if (gpu_available.length < 1) {
if (logger)console.warn('GPU requiredfor desktop inference but not available')
if (logger)console.warn('GPU required for desktop inference but not available')
}
}
}

@ -10,7 +10,7 @@
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
not IE 9-11 # For IE 9-11 support, remove 'not'.

@ -31,8 +31,6 @@ const compileReturnType = (output, contract): VyperCompilationResult => {
const normal = normalizeContractPath(contract)[2]
const abi = temp[normal]['abi']
const evm = _.merge(temp[normal]['evm'])
const depByteCode = evm.deployedBytecode
const runtimeBytecode = evm.bytecode
const methodIdentifiers = evm.methodIdentifiers
// TODO: verify this is correct
const version = output.version || '0.4.0'
@ -52,8 +50,8 @@ const compileReturnType = (output, contract): VyperCompilationResult => {
} = {
contractName: normal,
abi,
bytecode: depByteCode,
runtimeBytecode,
bytecode: evm.bytecode,
runtimeBytecode: evm.deployedBytecode,
ir: '',
methodIdentifiers,
version,

@ -58,6 +58,6 @@ export const HandleStreamResponse = async (streamResponse,
}
}
export const UpdtateChatHistory = (userPromptprompt: string, AIAnswer: string) => {
ChatHistory.pushHistory(userPromptprompt, AIAnswer)
}
export const UpdateChatHistory = (userPrompt: string, AIAnswer: string) => {
ChatHistory.pushHistory(userPrompt, AIAnswer)
}

@ -33,7 +33,7 @@ function buildLocalFuncCallGraphInternal (functions: FunctionHLAst[], nodeFilter
* "functions": {
* "KingOfTheEtherThrone.claimThrone(string memory)": { // function in KingOfEtherThrone
* "node": {...}, // function node as defined in abstractAstView.js
* "calls": { // list of full qualified function names which are called form this function
* "calls": { // list of full qualified function names which are called from this function
* }
* }
* }

@ -179,7 +179,7 @@ function getFunctionCallType (func: FunctionCallAstNode): string {
}
/**
* Get the variable name written to by a effect node, except for inline assembly because there is no information to find out where we write to. Trows if not a effect node or is inlineassmbly.
* Get the variable name written to by a effect node, except for inline assembly because there is no information to find out where we write to. Throws if not a effect node or is inline assembly.
* Example: x = 10; => x
* @effectNode {ASTNode} Assignment node
* @return {string} variable name written to
@ -409,7 +409,7 @@ function getLibraryCallContractName (node: FunctionCallAstNode): string | undefi
* library set{...}
* contract foo {
* ...
* function () { set.union() => uinion}
* function () { set.union() => union}
* @func {ASTNode} function call node
* @return {string} name of function called on the library
*/
@ -1040,7 +1040,7 @@ function matches (...fnArgs: any[]): string {
/**
* Finds first node of a certain type under a specific node.
* @node {AstNode} node to start form
* @node {AstNode} node to start from
* @type {String} Type the ast node should have
* @return {AstNode} null or node found
* Note: developed keeping identifier node search in mind to get first identifier node from left in subscope

@ -8,7 +8,7 @@ export declare interface SourceMappings {
}
/**
* Turn an character offset into a "LineColPosition".
* Turn a character offset into a "LineColPosition".
*
* @param offset The character offset to convert.
*/

@ -101,7 +101,7 @@ export class CompilerArtefacts extends Plugin {
* Get a particular contract output/artefacts from a compiler output of a Solidity file compilation
* @param compilerOutput compiler output
* @param contractName contract name
* @returns arefacts object, with fully qualified name (e.g; contracts/1_Storage.sol:Storage) as key
* @returns artefacts object, with fully qualified name (e.g; contracts/1_Storage.sol:Storage) as key
*/
_getAllContractArtefactsfromOutput(compilerOutput, contractName) {
const contractArtefacts = {}

@ -19,7 +19,7 @@ export class OpenZeppelinProxy extends Plugin {
}
async isConcerned(ast: ContractAST = {} as ContractAST): Promise<boolean> {
// check in the AST if it's an upgradable contract
// check in the AST if it's an upgradeable contract
const UUPSSymbol = ast.exportedSymbols && ast.exportedSymbols[UUPS] ? ast.exportedSymbols[UUPS][0] : null
if (UUPSSymbol) {

@ -38,7 +38,7 @@ export function extractHexByteSlice (slotValue, byteLength, offsetFromLSB) {
}
/**
* @returns a hex encoded storage content at the given @arg location. it does not have Ox prefix but always has the full length.
* @returns a hex encoded storage content at the given @arg location. it does not have 0x prefix but always has the full length.
*
* @param {Object} location - object containing the slot and offset of the data to extract.
* @param {Object} storageResolver - storage resolver

@ -52,7 +52,21 @@ export class LogsManager {
}
eventMatchesFilter (changeEvent, queryType, queryFilter) {
if (queryFilter.topics.filter((logTopic) => changeEvent.log.topics.indexOf(logTopic) >= 0).length === 0) return false
// topics should match
let noMatch = false
for (let i = 0; i < queryFilter.topics.length; i++) {
if (!queryFilter.topics[i]) {
continue // if the topic isn't defined, we consider it a match.
}
if (Array.isArray(queryFilter.topics[i])) {
if (queryFilter.topics[i].indexOf(changeEvent.log.topics[i]) === -1) {
noMatch = true
}
continue
}
if (queryFilter.topics[i] !== changeEvent.log.topics[i]) noMatch = true
}
if (noMatch) return false
if (queryType === 'logs') {
const fromBlock = parseInt(queryFilter.fromBlock || '0x0')

@ -37,7 +37,7 @@ export const keccak256 = function(a: Buffer): Uint8Array {
}
/**
* Creates Keccak hash of a utf-8 string input
* Creates Keccak hash of an utf-8 string input
* @param a The input data (String)
* @param bits (number = 256) The Keccak width
*/

@ -38,14 +38,14 @@ describe('Events', () => {
address: receiptTest.contractAddress,
fromBlock: 3,
toBlock: 'latest',
topics: ['0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc', '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735']
topics: ['0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
})
let ownerLogs = await web3.eth.getPastLogs({
address: receiptOwner.contractAddress,
fromBlock: 3,
toBlock: 'latest',
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735']
})
// this should include the event triggered by the "set" transaction call.
@ -56,7 +56,7 @@ describe('Events', () => {
address: receiptOwner.contractAddress,
fromBlock: 2,
toBlock: 'latest',
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735']
})
// this should include the event triggered from the ctor.
assert.equal(ownerLogs.length, 2, '3) ownerLogs length should be equal to 2')
@ -65,10 +65,19 @@ describe('Events', () => {
address: receiptOwner.contractAddress,
fromBlock: 1,
toBlock: 2,
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735']
})
// this should only include the event triggered from the ctor.
assert.equal(ownerLogs.length, 1, '4) ownerLogs length should be equal to 1')
ownerLogs = await web3.eth.getPastLogs({
address: receiptOwner.contractAddress,
fromBlock: 1,
toBlock: 2,
topics: [['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']]
})
// 0xdcd9c7fa0342f01013b is a topic from a event emitted by the other contract and should not be take into account.
assert.equal(ownerLogs.length, 1, '5) ownerLogs length should be equal to 1')
})
})
})

@ -15,7 +15,7 @@ const defaultSections: environmentExplorerUIGridSections = {
title: 'Deploy to an In-browser Virtual Machine.',
keywords: ['Remix VMs'],
providers: [],
filterFn: (provider) => provider.isVM
filterFn: (provider) => provider.isVM && !provider.isForkedVM
},
'Forked States': {
title: 'Deploy to an In-browser Forked State.',
@ -101,7 +101,7 @@ export const EnvironmentExplorerUI = (props: environmentExplorerUIProps) => {
await pinStateCallback(provider, pinned)
}}
>
<div>{(section.descriptionFn && section.descriptionFn(provider)) || provider.description}</div>
<div data-id={`${provider.name}desc`}>{(section.descriptionFn && section.descriptionFn(provider)) || provider.description}</div>
</RemixUIGridCell>
))}
</RemixUIGridSection>
@ -110,4 +110,4 @@ export const EnvironmentExplorerUI = (props: environmentExplorerUIProps) => {
</RemixUIGridView>
</>
)
}
}

@ -20,7 +20,7 @@ export class RemixEngine extends Engine {
export function isNative(name: any): any
/**
* Checks if plugin caller 'from' is allowed to activate plugin 'to'
* The caller can have 'canActivate' as a optional property in the plugin profile.
* The caller can have 'canActivate' as an optional property in the plugin profile.
* This is an array containing the 'name' property of the plugin it wants to call.
* canActivate = ['plugin1-to-call','plugin2-to-call',....]
* or the plugin is allowed by default because it is native

@ -27,6 +27,7 @@ const loadContractFromAddress = (plugin: RunTab, address, confirmCb, cb) => {
let abi
try {
abi = JSON.parse(plugin.editor.currentContent())
if (!Array.isArray(abi)) return cb('ABI should be an array object.')
} catch (e) {
return cb('Failed to parse the current file as JSON ABI.')
}

@ -30,7 +30,7 @@ export function EnvironmentUI(props: EnvironmentProps) {
const forkStatePrompt = (defaultName: string) => {
return (
<div>
<div data-id="forkVmStateModal">
<label id="stateName" className="form-check-label" style={{ fontWeight: 'bolder' }}>
<FormattedMessage id="udapp.forkStateLabel" />
</label>
@ -47,7 +47,7 @@ export function EnvironmentUI(props: EnvironmentProps) {
const deleteVmStatePrompt = () => {
return (
<div>
<div data-id="deleteVmStateModal">
<ul className='ml-3'>
<li><FormattedMessage id="udapp.deleteVmStateDesc1"/></li>
<li><FormattedMessage id="udapp.deleteVmStateDesc2"/></li>
@ -128,10 +128,10 @@ export function EnvironmentUI(props: EnvironmentProps) {
</a>
</CustomTooltip>
{ currentProvider && currentProvider.isVM && isSaveEvmStateChecked && <CustomTooltip placement={'auto-end'} tooltipClasses="text-wrap" tooltipId="forkStatetooltip" tooltipText={<FormattedMessage id="udapp.forkStateTitle" />}>
<i className="udapp_infoDeployAction ml-2 fas fa-code-branch" style={{ cursor: 'pointer' }} onClick={forkState}></i>
<i className="udapp_infoDeployAction ml-2 fas fa-code-branch" style={{ cursor: 'pointer' }} onClick={forkState} data-id="fork-state-icon"></i>
</CustomTooltip> }
{ currentProvider && currentProvider.isVM && isSaveEvmStateChecked && <CustomTooltip placement={'auto-end'} tooltipClasses="text-wrap" tooltipId="deleteVMStatetooltip" tooltipText={<FormattedMessage id="udapp.deleteVmStateTitle" />}>
<i className="udapp_infoDeployAction ml-2 fas fa-trash" style={{ cursor: 'pointer' }} onClick={deleteVmState}></i>
<i className="udapp_infoDeployAction ml-2 fas fa-trash" style={{ cursor: 'pointer' }} onClick={deleteVmState} data-id="delete-state-icon"></i>
</CustomTooltip> }
</label>
<div className="udapp_environment" data-id={`selected-provider-${currentProvider && currentProvider.name}`}>

@ -4,7 +4,7 @@
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
snarkJS is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -162,4 +162,4 @@ contract Groth16Verifier {
return(0, 0x20)
}
}
}
}

@ -4,7 +4,7 @@
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
snarkJS is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Loading…
Cancel
Save