diff --git a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts index 1ce727c076..00f9512814 100644 --- a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts @@ -26,11 +26,11 @@ function testConstantFunction (browser: NightwatchBrowser, address: string, fnFu done() }) }) - .click('.instance button[title="' + fnFullName + '"]') + .click(`#instance${address} button[title="${fnFullName}"]`) .pause(1000) .waitForElementPresent('#instance' + address + ' .udapp_contractActionsContainer .udapp_value') .scrollInto('#instance' + address + ' .udapp_contractActionsContainer .udapp_value') - .assert.containsText('#instance' + address + ' .udapp_contractActionsContainer .udapp_value', expectedOutput).perform(() => { + .assert.containsText('#instance' + address + ' .udapp_contractActionsContainer', expectedOutput).perform(() => { cb() }) } diff --git a/apps/remix-ide-e2e/src/tests/proxy.test.ts b/apps/remix-ide-e2e/src/tests/proxy.test.ts new file mode 100644 index 0000000000..e4992c0a20 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/proxy.test.ts @@ -0,0 +1,287 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +let firstProxyAddress: string +let lastProxyAddress: string +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done) + }, + + '@sources': function () { + return sources + }, + + 'Should show deploy proxy option for UUPS upgradeable contract': function (browser: NightwatchBrowser) { + browser + .addFile('myTokenV1.sol', sources[0]['myTokenV1.sol']) + .clickLaunchIcon('solidity') + .pause(2000) + .click('[data-id="compilerContainerCompileBtn"]') + .waitForElementPresent('select[id="compiledContracts"] option[value=MyToken]', 60000) + .clickLaunchIcon('udapp') + .click('select.udapp_contractNames') + .click('select.udapp_contractNames option[value=MyToken]') + .waitForElementPresent('[data-id="contractGUIDeployWithProxyLabel"]') + .waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]') + }, + + 'Should show upgrade proxy option for child contract inheriting UUPS parent contract': function (browser: NightwatchBrowser) { + browser + .addFile('myTokenV2.sol', sources[1]['myTokenV2.sol']) + .clickLaunchIcon('solidity') + .pause(2000) + .click('[data-id="compilerContainerCompileBtn"]') + .waitForElementPresent('select[id="compiledContracts"] option[value=MyTokenV2]', 60000) + .clickLaunchIcon('udapp') + .click('select.udapp_contractNames') + .click('select.udapp_contractNames option[value=MyTokenV2]') + .waitForElementPresent('[data-id="contractGUIDeployWithProxyLabel"]') + .waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]') + }, + + 'Should deploy proxy without initialize parameters': function (browser: NightwatchBrowser) { + browser + .openFile('myTokenV1.sol') + .clickLaunchIcon('solidity') + .pause(2000) + .click('[data-id="compilerContainerCompileBtn"]') + .waitForElementPresent('select[id="compiledContracts"] option[value=MyToken]', 60000) + .clickLaunchIcon('udapp') + .click('select.udapp_contractNames') + .click('select.udapp_contractNames option[value=MyToken]') + .waitForElementPresent('[data-id="contractGUIDeployWithProxyLabel"]') + .click('[data-id="contractGUIDeployWithProxyLabel"]') + .createContract('') + .waitForElementContainsText('[data-id="udappNotifyModalDialogModalTitle-react"]', 'Deploy Implementation & Proxy (ERC1967)') + .waitForElementVisible('[data-id="udappNotify-modal-footer-ok-react"]') + .click('[data-id="udappNotify-modal-footer-ok-react"]') + .waitForElementContainsText('[data-id="confirmProxyDeploymentModalDialogModalTitle-react"]', 'Confirm Deploy Proxy (ERC1967)') + .waitForElementVisible('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .click('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander0"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') + }, + + 'Should interact with deployed contract via ERC1967 (proxy)': function (browser: NightwatchBrowser) { + browser + .getAddressAtPosition(1, (address) => { + firstProxyAddress = address + }) + .clickInstance(1) + .perform((done) => { + browser.testConstantFunction(firstProxyAddress, 'name - call', null, '0:\nstring: MyToken').perform(() => { + done() + }) + }) + .perform((done) => { + browser.testConstantFunction(firstProxyAddress, 'symbol - call', null, '0:\nstring: MTK').perform(() => { + done() + }) + }) + }, + + 'Should deploy proxy with initialize parameters': function (browser: NightwatchBrowser) { + browser + .waitForElementPresent('[data-id="deployAndRunClearInstances"]') + .click('[data-id="deployAndRunClearInstances"]') + .addFile('initializeProxy.sol', sources[2]['initializeProxy.sol']) + .clickLaunchIcon('solidity') + .pause(2000) + .click('[data-id="compilerContainerCompileBtn"]') + .waitForElementPresent('select[id="compiledContracts"] option[value=MyInitializedToken]', 60000) + .clickLaunchIcon('udapp') + .click('select.udapp_contractNames') + .click('select.udapp_contractNames option[value=MyInitializedToken]') + .waitForElementPresent('[data-id="contractGUIDeployWithProxyLabel"]') + .click('[data-id="contractGUIDeployWithProxyLabel"]') + .waitForElementPresent('input[title="tokenName"]') + .waitForElementPresent('input[title="tokenSymbol"]') + .setValue('input[title="tokenName"]', 'Remix') + .setValue('input[title="tokenSymbol"]', "R") + .createContract('') + .waitForElementContainsText('[data-id="udappNotifyModalDialogModalTitle-react"]', 'Deploy Implementation & Proxy (ERC1967)') + .waitForElementVisible('[data-id="udappNotify-modal-footer-ok-react"]') + .click('[data-id="udappNotify-modal-footer-ok-react"]') + .waitForElementContainsText('[data-id="confirmProxyDeploymentModalDialogModalTitle-react"]', 'Confirm Deploy Proxy (ERC1967)') + .waitForElementVisible('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .click('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander0"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') + }, + + 'Should interact with initialized contract to verify parameters': function (browser: NightwatchBrowser) { + browser + .getAddressAtPosition(1, (address) => { + lastProxyAddress = address + }) + .clickInstance(1) + .perform((done) => { + browser.testConstantFunction(lastProxyAddress, 'name - call', null, '0:\nstring: Remix').perform(() => { + done() + }) + }) + .perform((done) => { + browser.testConstantFunction(lastProxyAddress, 'symbol - call', null, '0:\nstring: R').perform(() => { + done() + }) + }) + }, + + 'Should upgrade contract using last deployed proxy address (MyTokenV1 to MyTokenV2)': function (browser: NightwatchBrowser) { + browser + .waitForElementPresent('[data-id="deployAndRunClearInstances"]') + .click('[data-id="deployAndRunClearInstances"]') + .openFile('myTokenV2.sol') + .clickLaunchIcon('solidity') + .pause(2000) + .click('[data-id="compilerContainerCompileBtn"]') + .waitForElementPresent('select[id="compiledContracts"] option[value=MyTokenV2]', 60000) + .clickLaunchIcon('udapp') + .click('select.udapp_contractNames') + .click('select.udapp_contractNames option[value=MyTokenV2]') + .waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]') + .click('[data-id="contractGUIUpgradeImplementationLabel"]') + .waitForElementPresent('[data-id="contractGUIProxyAddressLabel"]') + .click('[data-id="contractGUIProxyAddressLabel"]') + .waitForElementPresent('[data-id="lastDeployedERC1967Address"]') + .assert.containsText('[data-id="lastDeployedERC1967Address"]', lastProxyAddress) + .createContract('') + .waitForElementContainsText('[data-id="udappNotifyModalDialogModalTitle-react"]', 'Deploy Implementation & Update Proxy') + .waitForElementVisible('[data-id="udappNotify-modal-footer-ok-react"]') + .click('[data-id="udappNotify-modal-footer-ok-react"]') + .waitForElementContainsText('[data-id="confirmProxyDeploymentModalDialogModalTitle-react"]', 'Confirm Update Proxy (ERC1967)') + .waitForElementVisible('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .click('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander0"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') + }, + + 'Should interact with upgraded function in contract MyTokenV2': function (browser: NightwatchBrowser) { + browser + .clickInstance(1) + .perform((done) => { + browser.testConstantFunction(lastProxyAddress, 'version - call', null, '0:\nstring: MyTokenV2!').perform(() => { + done() + }) + }) + }, + + 'Should upgrade contract by providing proxy address in input field (MyTokenV1 to MyTokenV2)': function (browser: NightwatchBrowser) { + browser + .waitForElementPresent('[data-id="deployAndRunClearInstances"]') + .click('[data-id="deployAndRunClearInstances"]') + .openFile('myTokenV2.sol') + .clickLaunchIcon('solidity') + .pause(2000) + .click('[data-id="compilerContainerCompileBtn"]') + .waitForElementPresent('select[id="compiledContracts"] option[value=MyTokenV2]', 60000) + .clickLaunchIcon('udapp') + .click('select.udapp_contractNames') + .click('select.udapp_contractNames option[value=MyTokenV2]') + .waitForElementPresent('[data-id="contractGUIUpgradeImplementationLabel"]') + .waitForElementPresent('[data-id="contractGUIProxyAddressLabel"]') + .click('[data-id="contractGUIProxyAddressLabel"]') + .waitForElementPresent('[data-id="ERC1967AddressInput"]') + .setValue('[data-id="ERC1967AddressInput"]', firstProxyAddress) + .createContract('') + .waitForElementContainsText('[data-id="udappNotifyModalDialogModalTitle-react"]', 'Deploy Implementation & Update Proxy') + .waitForElementVisible('[data-id="udappNotify-modal-footer-ok-react"]') + .click('[data-id="udappNotify-modal-footer-ok-react"]') + .waitForElementContainsText('[data-id="confirmProxyDeploymentModalDialogModalTitle-react"]', 'Confirm Update Proxy (ERC1967)') + .waitForElementVisible('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .click('[data-id="confirmProxyDeployment-modal-footer-ok-react"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander0"]') + .waitForElementPresent('[data-id="universalDappUiTitleExpander1"]') + }, + + 'Should interact with upgraded contract through provided proxy address': function (browser: NightwatchBrowser) { + browser + .clickInstance(1) + .perform((done) => { + browser.testConstantFunction(firstProxyAddress, 'version - call', null, '0:\nstring: MyTokenV2!').perform(() => { + done() + }) + }) + .end() + } +} + +const sources = [ + { + 'myTokenV1.sol': { + content: ` + // SPDX-License-Identifier: MIT + pragma solidity ^0.8.4; + + import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; + import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; + import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + + contract MyToken is Initializable, ERC721Upgradeable, OwnableUpgradeable, UUPSUpgradeable { + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + + function initialize() initializer public { + __ERC721_init("MyToken", "MTK"); + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + function _authorizeUpgrade(address newImplementation) + internal + onlyOwner + override + {} + } + ` + } + }, { + 'myTokenV2.sol': { + content: ` + import "./myTokenV1.sol"; + + contract MyTokenV2 is MyToken { + function version () public view returns (string memory) { + return "MyTokenV2!"; + } + } + ` + } + }, { + 'initializeProxy.sol': { + content: ` + // SPDX-License-Identifier: MIT + pragma solidity ^0.8.4; + + import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; + import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; + import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + + contract MyInitializedToken is Initializable, ERC721Upgradeable, OwnableUpgradeable, UUPSUpgradeable { + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + + function initialize(string memory tokenName, string memory tokenSymbol) initializer public { + __ERC721_init(tokenName, tokenSymbol); + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + function _authorizeUpgrade(address newImplementation) + internal + onlyOwner + override + {} + } + ` + } + } +] \ No newline at end of file diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 5ba54ed30f..b06a8e4dce 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -17,7 +17,7 @@ const profile = { kind: 'compiler', permission: true, location: 'sidePanel', - documentation: 'https://remix-ide.readthedocs.io/en/latest/solidity_editor.html', + documentation: 'https://remix-ide.readthedocs.io/en/latest/compile.html', version: packageJson.version, maintainedBy: 'Remix', methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile', 'getCompilerState'] diff --git a/apps/remix-ide/src/app/tabs/foundry-provider.tsx b/apps/remix-ide/src/app/tabs/foundry-provider.tsx index 3c1fbb6256..4d1df70715 100644 --- a/apps/remix-ide/src/app/tabs/foundry-provider.tsx +++ b/apps/remix-ide/src/app/tabs/foundry-provider.tsx @@ -1,9 +1,5 @@ import * as packageJson from '../../../../../package.json' -import { Plugin } from '@remixproject/engine' -import { AppModal, AlertModal, ModalTypes } from '@remix-ui/app' import React from 'react' // eslint-disable-line -import { Blockchain } from '../../blockchain/blockchain' -import { ethers } from 'ethers' import { AbstractProvider } from './abstract-provider' const profile = { @@ -22,10 +18,12 @@ export class FoundryProvider extends AbstractProvider { body (): JSX.Element { return ( -
Note: To run Anvil on your system, run -
curl -L https://foundry.paradigm.xyz | bash
-
anvil
- For more info, visit: Foundry Documentation +
Note: To run Anvil on your system, run: +
curl -L https://foundry.paradigm.xyz | bash
+
anvil
+
+ For more info, visit: Foundry Documentation +
Anvil JSON-RPC Endpoint:
) diff --git a/apps/remix-ide/src/app/tabs/ganache-provider.tsx b/apps/remix-ide/src/app/tabs/ganache-provider.tsx index 97adac1574..597f2b4015 100644 --- a/apps/remix-ide/src/app/tabs/ganache-provider.tsx +++ b/apps/remix-ide/src/app/tabs/ganache-provider.tsx @@ -22,10 +22,12 @@ export class GanacheProvider extends AbstractProvider { body (): JSX.Element { return ( -
Note: To run Ganache on your system, run -
yarn global add ganache
-
ganache
- For more info, visit: Ganache Documentation +
Note: To run Ganache on your system, run: +
yarn global add ganache
+
ganache
+
+ For more info, visit: Ganache Documentation +
Ganache JSON-RPC Endpoint:
) diff --git a/apps/remix-ide/src/app/tabs/hardhat-provider.tsx b/apps/remix-ide/src/app/tabs/hardhat-provider.tsx index 89a2156e82..bc4c20e768 100644 --- a/apps/remix-ide/src/app/tabs/hardhat-provider.tsx +++ b/apps/remix-ide/src/app/tabs/hardhat-provider.tsx @@ -23,8 +23,10 @@ export class HardhatProvider extends AbstractProvider { body (): JSX.Element { return (
Note: To run Hardhat network node on your system, go to hardhat project folder and run command: -
npx hardhat node
- For more info, visit: Hardhat Documentation +
npx hardhat node
+
+ For more info, visit: Hardhat Documentation +
Hardhat JSON-RPC Endpoint:
) diff --git a/apps/remix-ide/src/assets/css/themes/bootstrap-flatly.min.css b/apps/remix-ide/src/assets/css/themes/bootstrap-flatly.min.css index 0dcc6e3c22..c62ab28e0f 100644 --- a/apps/remix-ide/src/assets/css/themes/bootstrap-flatly.min.css +++ b/apps/remix-ide/src/assets/css/themes/bootstrap-flatly.min.css @@ -34,6 +34,7 @@ --dark:#7b8a8b; --body-bg: #fff; --text-bg-mark: #fcf8e3; + --custom-select: #fff; --breakpoint-xs:0; --breakpoint-sm:576px; --breakpoint-md:768px; diff --git a/apps/remix-ide/src/assets/css/themes/bootstrap-spacelab.min.css b/apps/remix-ide/src/assets/css/themes/bootstrap-spacelab.min.css index 3868f5c619..9550195a4e 100644 --- a/apps/remix-ide/src/assets/css/themes/bootstrap-spacelab.min.css +++ b/apps/remix-ide/src/assets/css/themes/bootstrap-spacelab.min.css @@ -35,6 +35,7 @@ --dark:#333; --body-bg:#fff; --text-bg-mark: #fcf8e3; + --custom-select: #fff; --breakpoint-xs:0; --breakpoint-sm:576px; --breakpoint-md:768px; diff --git a/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css b/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css index 0ac9167c47..67542ec5ed 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css +++ b/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css @@ -23,6 +23,7 @@ --dark: #1a1a1a; --text: #babbcc; --body-bg: #1a1a1a; + --custom-select: #252525; --text-bg-mark: #a5a5a5; --breakpoint-xs: 0; --breakpoint-sm: 576px; @@ -3639,7 +3640,7 @@ input[type="submit"].btn-block { .nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active { color: #d5d5d5; - background-color: #252525; + background-color: #var(--custom-select); border-color: #37373B; font-weight: bolder; } diff --git a/apps/remix-ide/src/assets/css/themes/remix-candy_ikhg4m.css b/apps/remix-ide/src/assets/css/themes/remix-candy_ikhg4m.css index 97cc70e002..14764f2994 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-candy_ikhg4m.css +++ b/apps/remix-ide/src/assets/css/themes/remix-candy_ikhg4m.css @@ -23,6 +23,7 @@ --text: #11556c; --body-bg: #d5efff; --text-bg-mark: #fcf8e3; + --custom-select: #ffffff; --breakpoint-xs: 0; --breakpoint-sm: 576px; --breakpoint-md: 768px; @@ -3652,7 +3653,7 @@ input[type="button"].btn-block { line-height: 1.5; color: #495057; vertical-align: middle; - background-color: #fffff6; + background-color: var(--custom-select); background-image: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.02426 9.48731C7.18128 9.29086 7.04141 9 6.78992 9L1.21005 9C0.958559 9 0.818689 9.29086 0.975709 9.48731L3.76564 12.9778C3.88574 13.1281 4.11423 13.1281 4.23433 12.9778L7.02426 9.48731Z' fill='%238A93B0'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.02426 4.51269C7.18128 4.70914 7.04141 5 6.78992 5L1.21005 5C0.958559 5 0.818689 4.70914 0.975709 4.51269L3.76564 1.02218C3.88574 0.871926 4.11423 0.871926 4.23433 1.02218L7.02426 4.51269Z' fill='%238A93B0'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; background-size: 8px; diff --git a/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css b/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css index 2f74f6bcc8..e039facfec 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css +++ b/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css @@ -24,6 +24,7 @@ --text: #babbcc; --text-background: #222336; --text-bg-mark: #8388b2; + --custom-select: #35384c; --body-bg: #222336; --breakpoint-xs: 0; --breakpoint-sm: 576px; @@ -1619,7 +1620,8 @@ pre code { font-weight: 400; line-height: 1.25; color: #dfe1ea !important; - background-color: #35384C !important; + background-color: var(--custom-select) + !important; background-clip: padding-box; border: none !important; border-radius: 2px !important; @@ -1638,7 +1640,8 @@ pre code { } .form-control:focus { color: #dfe1ea; - background-color: #35384c; + background-color: var(--custom-select) +; border-color: #27c6ff; outline: 0; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), @@ -1655,7 +1658,8 @@ pre code { } select.form-control:focus::-ms-value { color: #dfe1ea; - background-color: #35384c; + background-color: var(--custom-select) +; } .form-control-file, .form-control-range { @@ -3357,7 +3361,8 @@ input[type="submit"].btn-block { } .custom-select:focus::-ms-value { color: #dfe1ea; - background-color: #35384c; + background-color: var(--custom-select) +; } .custom-select[multiple], .custom-select[size]:not([size="1"]) { @@ -3425,7 +3430,8 @@ input[type="submit"].btn-block { font-weight: 400; line-height: 1.25; color: #dfe1ea; - background-color: #35384c; + background-color: var(--custom-select) +; border: 1px solid transparent; border-radius: 2px; } diff --git a/apps/remix-ide/src/assets/css/themes/remix-light_powaqg.css b/apps/remix-ide/src/assets/css/themes/remix-light_powaqg.css index 32e91f835f..68296af7fc 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-light_powaqg.css +++ b/apps/remix-ide/src/assets/css/themes/remix-light_powaqg.css @@ -23,6 +23,7 @@ --text: #3b445e; --body-bg: #eef1f6; --text-bg-mark: #fcf8e3; + --custom-select: #fff; --breakpoint-xs: 0; --breakpoint-sm: 576px; --breakpoint-md: 768px; diff --git a/apps/remix-ide/src/assets/css/themes/remix-midcentury_hrzph3.css b/apps/remix-ide/src/assets/css/themes/remix-midcentury_hrzph3.css index 676216ec30..c2501b8496 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-midcentury_hrzph3.css +++ b/apps/remix-ide/src/assets/css/themes/remix-midcentury_hrzph3.css @@ -23,6 +23,7 @@ --text: #11556c; --body-bg: #DBE2E0; --text-bg-mark: #fcf8e3; + --custom-select: #eeede9; --breakpoint-xs: 0; --breakpoint-sm: 576px; --breakpoint-md: 768px; @@ -1790,7 +1791,7 @@ pre code { font-weight: 400; line-height: 1.5; color: #495057; - background-color: #dddddd; + background-color: #var(--custom-select); background-clip: padding-box; border: 1px solid #ced4da; border-radius: 2px !important; @@ -3654,7 +3655,7 @@ input[type="button"].btn-block { line-height: 1.5; color: #495057; vertical-align: middle; - background-color: #dddddd; + background-color: #var(--custom-select); background-image: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.02426 9.48731C7.18128 9.29086 7.04141 9 6.78992 9L1.21005 9C0.958559 9 0.818689 9.29086 0.975709 9.48731L3.76564 12.9778C3.88574 13.1281 4.11423 13.1281 4.23433 12.9778L7.02426 9.48731Z' fill='%238A93B0'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.02426 4.51269C7.18128 4.70914 7.04141 5 6.78992 5L1.21005 5C0.958559 5 0.818689 4.70914 0.975709 4.51269L3.76564 1.02218C3.88574 0.871926 4.11423 0.871926 4.23433 1.02218L7.02426 4.51269Z' fill='%238A93B0'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; background-size: 8px; @@ -3775,13 +3776,13 @@ input[type="button"].btn-block { outline: none; } .custom-range:focus::-webkit-slider-thumb { - box-shadow: 0 0 0 1px #dddddd, 0px 0px 5px #00bbff; + box-shadow: 0 0 0 1px #var(--custom-select), 0px 0px 5px #00bbff; } .custom-range:focus::-moz-range-thumb { - box-shadow: 0 0 0 1px #dddddd, 0px 0px 5px #00bbff; + box-shadow: 0 0 0 1px #var(--custom-select), 0px 0px 5px #00bbff; } .custom-range:focus::-ms-thumb { - box-shadow: 0 0 0 1px #dddddd, 0px 0px 5px #00bbff; + box-shadow: 0 0 0 1px #var(--custom-select), 0px 0px 5px #00bbff; } .custom-range::-moz-focus-outer { border: 0; diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 47ece52eb2..16e42c5cdf 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -617,30 +617,43 @@ export class Blockchain extends Plugin { const timestamp = tx.timestamp this.event.trigger('initiatingTransaction', [timestamp, tx, payLoad]) - this.txRunner.rawRun(tx, confirmationCb, continueCb, promptCb, - async (error, result) => { - if (error) return reject(error) - - const isVM = this.executionContext.isVM() - if (isVM && tx.useCall) { - try { - result.transactionHash = await this.web3().eth.getHashFromTagBySimulator(timestamp) - } catch (e) { - console.log('unable to retrieve back the "call" hash', e) + try { + this.txRunner.rawRun(tx, confirmationCb, continueCb, promptCb, + async (error, result) => { + if (error) { + if (typeof (error) !== 'string') { + if (error.message) error = error.message + else { + try { error = 'error: ' + JSON.stringify(error) } catch (e) { console.log(e) } + } + } + return reject(error) } - } - const eventName = (tx.useCall ? 'callExecuted' : 'transactionExecuted') - this.event.trigger(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad]) - - if (error && (typeof (error) !== 'string')) { - if (error.message) error = error.message - else { - try { error = 'error: ' + JSON.stringify(error) } catch (e) { console.log(e) } + + const isVM = this.executionContext.isVM() + if (isVM && tx.useCall) { + try { + result.transactionHash = await this.web3().eth.getHashFromTagBySimulator(timestamp) + } catch (e) { + console.log('unable to retrieve back the "call" hash', e) + } } + const eventName = (tx.useCall ? 'callExecuted' : 'transactionExecuted') + + this.event.trigger(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad]) + return resolve({ result, tx }) + } + ) + } catch (err) { + let error = err + if (error && (typeof (error) !== 'string')) { + if (error.message) error = error.message + else { + try { error = 'error: ' + JSON.stringify(error) } catch (e) { console.log(e) } } - return resolve({ result, tx }) } - ) + return reject(error) + } }) } try { diff --git a/apps/solidity-compiler/src/app/compiler-api.ts b/apps/solidity-compiler/src/app/compiler-api.ts index d877a1c9bf..4e755f211d 100644 --- a/apps/solidity-compiler/src/app/compiler-api.ts +++ b/apps/solidity-compiler/src/app/compiler-api.ts @@ -299,7 +299,7 @@ export const CompilerApiMixin = (Base) => class extends Base { this.compilationDetails = { contractMap: {}, contractsDetails: {}, - target: source.target + target: source ? source.target : null } } if (this.onCompilationFinished) this.onCompilationFinished(this.compilationDetails) diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 22d8646744..e37d1e1ea2 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.23", + "version": "0.5.24", "description": "Tool to perform static analysis on Solidity smart contracts", "main": "src/index.js", "types": "src/index.d.ts", @@ -22,8 +22,8 @@ "@ethereumjs/block": "^3.5.1", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-astwalker": "^0.0.44", - "@remix-project/remix-lib": "^0.5.14", + "@remix-project/remix-astwalker": "^0.0.45", + "@remix-project/remix-lib": "^0.5.15", "async": "^2.6.2", "ethereumjs-util": "^7.0.10", "ethers": "^5.4.2", @@ -52,5 +52,5 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 60e7f14374..fee4705da6 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.44", + "version": "0.0.45", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/block": "^3.5.1", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.14", + "@remix-project/remix-lib": "^0.5.15", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethereumjs-util": "^7.0.10", @@ -54,5 +54,5 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-core-plugin/src/lib/constants/uups.ts b/libs/remix-core-plugin/src/lib/constants/uups.ts index 977d3769a8..606d62dd77 100644 --- a/libs/remix-core-plugin/src/lib/constants/uups.ts +++ b/libs/remix-core-plugin/src/lib/constants/uups.ts @@ -1,4 +1,4 @@ -export const UUPS = 'UUPSUpgradeable.sol' +export const UUPS = 'UUPSUpgradeable' export const UUPSBytecode = '608060405260405162000d8638038062000d86833981810160405281019062000029919062000467565b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd60001c6200005b9190620006a5565b60001b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b146200009357620000926200078a565b5b620000a782826000620000af60201b60201c565b5050620008f4565b620000c083620000f260201b60201c565b600082511180620000ce5750805b15620000ed57620000eb83836200014960201b620000371760201c565b505b505050565b62000103816200017f60201b60201c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b606062000177838360405180606001604052806027815260200162000d5f602791396200025560201b60201c565b905092915050565b62000195816200033960201b620000641760201c565b620001d7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001ce90620005d0565b60405180910390fd5b80620002117f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b6200035c60201b620000871760201c565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606062000268846200033960201b60201c565b620002aa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002a190620005f2565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051620002d4919062000593565b600060405180830381855af49150503d806000811462000311576040519150601f19603f3d011682016040523d82523d6000602084013e62000316565b606091505b50915091506200032e8282866200036660201b60201c565b925050509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b606083156200037857829050620003cb565b6000835111156200038c5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003c29190620005ac565b60405180910390fd5b9392505050565b6000620003e9620003e3846200063d565b62000614565b9050828152602081018484840111156200040857620004076200081c565b5b620004158482856200071e565b509392505050565b6000815190506200042e81620008da565b92915050565b600082601f8301126200044c576200044b62000817565b5b81516200045e848260208601620003d2565b91505092915050565b6000806040838503121562000481576200048062000826565b5b600062000491858286016200041d565b925050602083015167ffffffffffffffff811115620004b557620004b462000821565b5b620004c38582860162000434565b9150509250929050565b6000620004da8262000673565b620004e6818562000689565b9350620004f88185602086016200071e565b80840191505092915050565b600062000511826200067e565b6200051d818562000694565b93506200052f8185602086016200071e565b6200053a816200082b565b840191505092915050565b600062000554602d8362000694565b915062000561826200083c565b604082019050919050565b60006200057b60268362000694565b915062000588826200088b565b604082019050919050565b6000620005a18284620004cd565b915081905092915050565b60006020820190508181036000830152620005c8818462000504565b905092915050565b60006020820190508181036000830152620005eb8162000545565b9050919050565b600060208201905081810360008301526200060d816200056c565b9050919050565b60006200062062000633565b90506200062e828262000754565b919050565b6000604051905090565b600067ffffffffffffffff8211156200065b576200065a620007e8565b5b62000666826200082b565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000620006b28262000714565b9150620006bf8362000714565b925082821015620006d557620006d4620007b9565b5b828203905092915050565b6000620006ed82620006f4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156200073e57808201518184015260208101905062000721565b838111156200074e576000848401525b50505050565b6200075f826200082b565b810181811067ffffffffffffffff82111715620007815762000780620007e8565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e74726163740000000000000000000000000000000000000000000000000000602082015250565b620008e581620006e0565b8114620008f157600080fd5b50565b61045b80620009046000396000f3fe6080604052366100135761001161001d565b005b61001b61001d565b005b610025610091565b610035610030610093565b6100a2565b565b606061005c83836040518060600160405280602781526020016103ff602791396100c8565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000819050919050565b565b600061009d610195565b905090565b3660008037600080366000845af43d6000803e80600081146100c3573d6000f35b3d6000fd5b60606100d384610064565b610112576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161010990610319565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161013a91906102e0565b600060405180830381855af49150503d8060008114610175576040519150601f19603f3d011682016040523d82523d6000602084013e61017a565b606091505b509150915061018a8282866101ec565b925050509392505050565b60006101c37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b610087565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606083156101fc5782905061024c565b60008351111561020f5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024391906102f7565b60405180910390fd5b9392505050565b600061025e82610339565b610268818561034f565b935061027881856020860161036b565b80840191505092915050565b600061028f82610344565b610299818561035a565b93506102a981856020860161036b565b6102b28161039e565b840191505092915050565b60006102ca60268361035a565b91506102d5826103af565b604082019050919050565b60006102ec8284610253565b915081905092915050565b600060208201905081810360008301526103118184610284565b905092915050565b60006020820190508181036000830152610332816102bd565b9050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60005b8381101561038957808201518184015260208101905061036e565b83811115610398576000848401525b50505050565b6000601f19601f8301169050919050565b7f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60008201527f6e7472616374000000000000000000000000000000000000000000000000000060208201525056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201fbb70b81fbc37a0d465e50bdaf6c661d6411918ae96ccedacef32b393f9533964736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564' export const UUPSABI = [ { diff --git a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts index bf3302f625..ef03092cb8 100644 --- a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts +++ b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts @@ -1,5 +1,5 @@ import { Plugin } from '@remixproject/engine' -import { ContractABI, ContractAST, ContractSources, DeployOptions } from '../types/contract' +import { ContractAST, ContractSources, DeployOptions } from '../types/contract' import { UUPS, UUPSABI, UUPSBytecode, UUPSfunAbi, UUPSupgradeAbi } from './constants/uups' const proxyProfile = { @@ -18,7 +18,9 @@ export class OpenZeppelinProxy extends Plugin { async isConcerned(ast: ContractAST = {} as ContractAST): Promise { // check in the AST if it's an upgradable contract - if (ast.nodes && ast.nodes.find(node => node.absolutePath && node.absolutePath.includes(UUPS))) { + const UUPSSymbol = ast.exportedSymbols && ast.exportedSymbols[UUPS] ? ast.exportedSymbols[UUPS][0] : null + + if (UUPSSymbol) { this.kind = 'UUPS' return true } @@ -36,7 +38,7 @@ export class OpenZeppelinProxy extends Plugin { if (this.kind === 'UUPS') { Object.keys(contracts).map(name => { if (ast) { - const UUPSSymbol = ast.exportedSymbols['UUPSUpgradeable'] ? ast.exportedSymbols['UUPSUpgradeable'][0] : null + const UUPSSymbol = ast.exportedSymbols[UUPS] ? ast.exportedSymbols[UUPS][0] : null ast.absolutePath === file && ast.nodes.map((node) => { if (node.name === name && node.linearizedBaseContracts.includes(UUPSSymbol)) { diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index e70aba4523..72b5094c94 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.14", + "version": "0.5.15", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -22,9 +22,9 @@ "@ethereumjs/common": "^2.5.0", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-astwalker": "^0.0.44", - "@remix-project/remix-lib": "^0.5.14", - "@remix-project/remix-simulator": "^0.2.14", + "@remix-project/remix-astwalker": "^0.0.45", + "@remix-project/remix-lib": "^0.5.15", + "@remix-project/remix-simulator": "^0.2.15", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -68,5 +68,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index 1a26aee068..26eecdd353 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.14", + "version": "0.5.15", "description": "Library to various Remix tools", "contributors": [ { @@ -54,5 +54,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index edebf864e9..78b00a772c 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.14", + "version": "0.2.15", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -18,7 +18,7 @@ "@ethereumjs/common": "^2.5.0", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.14", + "@remix-project/remix-lib": "^0.5.15", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,5 +67,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index bc1038ded4..1e9fffc7ff 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.0", + "version": "0.5.1", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -18,7 +18,7 @@ "@ethereumjs/block": "^3.5.1", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.14", + "@remix-project/remix-lib": "^0.5.15", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethereumjs-util": "^7.0.10", @@ -61,5 +61,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 2029b0ed7e..c4a02aef60 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.14", + "version": "0.2.15", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -39,9 +39,9 @@ "@ethereumjs/common": "^2.5.0", "@ethereumjs/tx": "^3.3.2", "@ethereumjs/vm": "^5.5.3", - "@remix-project/remix-lib": "^0.5.14", - "@remix-project/remix-simulator": "^0.2.14", - "@remix-project/remix-solidity": "^0.5.0", + "@remix-project/remix-lib": "^0.5.15", + "@remix-project/remix-simulator": "^0.2.15", + "@remix-project/remix-solidity": "^0.5.1", "ansi-gray": "^0.1.1", "async": "^2.6.0", "axios": ">=0.21.1", @@ -79,5 +79,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "3f311aaf25f5796f70711006bb783ee4087ffc71" + "gitHead": "714a13ef29c4c5b018e25b49270809f2ea456b08" } \ No newline at end of file diff --git a/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx b/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx index b76a17859b..4bffb2565f 100644 --- a/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx +++ b/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx @@ -11,6 +11,7 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => { const [toggleExpander, setToggleExpander] = useState(false) useEffect(() => { + setToggleExpander(false) if (props.plugins) { const p = Object.values(props.plugins).find((pluginRecord) => { return pluginRecord.active === true @@ -25,19 +26,18 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => { return (
-
-
{plugin?.profile.displayName || plugin?.profile.name}
-
+
+
{plugin?.profile.displayName || plugin?.profile.name}
+
- {plugin?.profile?.maintainedBy?.toLowerCase() === "remix" && ()} - {plugin?.profile.documentation && ()} + {plugin?.profile?.maintainedBy?.toLowerCase() === "remix" && ()}
- +
-
+
{plugin?.profile?.author && { plugin?.profile.author } @@ -49,7 +49,7 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => { {plugin?.profile?.documentation && - + } {plugin?.profile?.description && diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index a5352c02fb..7fe409e511 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -348,9 +348,9 @@ export function ContractGUI (props: ContractGUIProps) { !useLastProxy ?
- +
: - { proxyAddress || 'No proxy address available' } + { proxyAddress || 'No proxy address available' } }
diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 48e8fa04f0..8cbb9ef0de 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -17,7 +17,7 @@ export function RecorderUI (props: RecorderProps) { } useEffect(() => { - if (props.currentFile.endsWith('.json')) setEnableRunButton(false) + if (props.currentFile && props.currentFile.endsWith('.json')) setEnableRunButton(false) else setEnableRunButton(true) }, [props.currentFile]) diff --git a/libs/remix-ui/search/src/lib/components/Search.tsx b/libs/remix-ui/search/src/lib/components/Search.tsx index 8fa6053c34..3c002f1963 100644 --- a/libs/remix-ui/search/src/lib/components/Search.tsx +++ b/libs/remix-ui/search/src/lib/components/Search.tsx @@ -13,7 +13,7 @@ export const SearchTab = props => { return ( <> -
+
diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index cb27b4d122..80d5e88e9f 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -375,6 +375,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => { const compilerToLoad = semver.maxSatisfying(releasedVersions, pragma) const compilerPath = state.allversions.filter(obj => !obj.prerelease && obj.version === compilerToLoad)[0].path if (state.selectedVersion !== compilerPath) { + // @ts-ignore + api.call('notification', 'toast', `Updating compiler version to match current contract file pragma i.e ${_retrieveVersion(compilerPath)}`) setState((prevState) => { return { ...prevState, selectedVersion: compilerPath } }) @@ -725,7 +727,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { - Learn how to use Hardhat Compilation + Learn how to use Hardhat Compilation }> @@ -741,7 +743,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { - Learn how to use Truffle Compilation + Learn how to use Truffle Compilation }> diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index f1b7401a5b..cdce6d95d6 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -490,7 +490,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { - Learn how to use Slither Analysis + Learn how to use Slither Analysis }> diff --git a/libs/remix-ui/terminal/src/lib/components/RenderUnknownTransactions.tsx b/libs/remix-ui/terminal/src/lib/components/RenderUnknownTransactions.tsx index 448e77b40e..9400d83b4a 100644 --- a/libs/remix-ui/terminal/src/lib/components/RenderUnknownTransactions.tsx +++ b/libs/remix-ui/terminal/src/lib/components/RenderUnknownTransactions.tsx @@ -33,7 +33,7 @@ const RenderUnKnownTransactions = ({ tx, receipt, index, plugin, showTableHash,
{showTableHash.includes(tx.hash) ? showTable({ hash: tx.hash, - status: receipt !== null ? receipt.status : null, + status: receipt ? receipt.status : null, isCall: tx.isCall, contractAddress: tx.contractAddress, data: tx, diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index 4e31b8fcf8..37533c87c6 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -245,9 +245,9 @@ export const switchToWorkspace = async (name: string) => { dispatch(setMode('localhost')) plugin.emit('setWorkspace', { name: null, isLocalhost: true }) } else if (name === NO_WORKSPACE) { - await plugin.fileProviders.workspace.clearWorkspace() - await plugin.setWorkspace({ name: null, isLocalhost: false }) - dispatch(setCurrentWorkspace(null)) + // if there is no other workspace, create remix default workspace + plugin.call('notification', 'toast', `No workspace found! Creating default workspace ....`) + await createWorkspace('default_workspace', 'remixDefault') } else { const isActive = await plugin.call('manager', 'isActive', 'remixd') diff --git a/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css b/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css index dab352564a..6ddf87c81c 100644 --- a/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css +++ b/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css @@ -88,7 +88,7 @@ .custom-dropdown-items { padding: 0.25rem 0.25rem; border-radius: .25rem; - background: var(--light); + background: var(--custom-select); } .custom-dropdown-items a { border-radius: .25rem; diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index a7696bfb2a..353e4ccf91 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -188,7 +188,7 @@ export function Workspace () { } return ( -
+
@@ -253,6 +253,7 @@ export function Workspace () { title='Restore Workspaces Backup'>