diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 838a2645d9..64531cc490 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -163,12 +163,14 @@ class AppComponent { 'remix.ethereum.org': 23, '6fd22d6fe5549ad4c4d8fd3ca0b7816b.mod': 35 // remix desktop } - this.showMatamo = matomoDomains[window.location.hostname] && !Registry.getInstance().get('config').api.exists('settings/matomo-analytics') + + this.matomoConfAlreadySet = Registry.getInstance().get('config').api.exists('settings/matomo-analytics') + this.matomoCurrentSetting = Registry.getInstance().get('config').api.get('settings/matomo-analytics') + this.showMatamo = matomoDomains[window.location.hostname] && !this.matomoConfAlreadySet + + this.walkthroughService = new WalkthroughService(appManager) this.platform = isElectron() ? 'desktop' : 'web' - this.showEnter = this.showMatamo && !localStorage.getItem('hadUsageTypeAsked') - - this.walkthroughService = new WalkthroughService(appManager, !this.showMatamo || !this.showEnter) const hosts = ['127.0.0.1:8080', '192.168.0.101:8080', 'localhost:8080'] // workaround for Electron support diff --git a/apps/remix-ide/src/app/providers/mainnet-vm-fork-provider.tsx b/apps/remix-ide/src/app/providers/mainnet-vm-fork-provider.tsx index a593eeee29..e7f288448f 100644 --- a/apps/remix-ide/src/app/providers/mainnet-vm-fork-provider.tsx +++ b/apps/remix-ide/src/app/providers/mainnet-vm-fork-provider.tsx @@ -18,7 +18,7 @@ export class MainnetForkVMProvider extends BasicVMProvider { ) this.blockchain = blockchain this.fork = 'shanghai' - this.nodeUrl = 'https://mainnet.infura.io/v3/7eed077ab9ee45eebbb3f053af9ecb29' + this.nodeUrl = 'https://go.getblock.io/56f8bc5187aa4ac696348f67545acf38' this.blockNumber = 'latest' } 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 5c16277d2e..103957dc53 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 @@ -5632,7 +5632,7 @@ a.close.disabled { vertical-align: text-top !important; } .bg-primary { - background-color: #28282D !important; + background-color: var(--primary) !important; } a.bg-primary:focus, a.bg-primary:hover, diff --git a/apps/remix-ide/src/walkthroughService.js b/apps/remix-ide/src/walkthroughService.js index f54d0e28ce..04880bec3b 100644 --- a/apps/remix-ide/src/walkthroughService.js +++ b/apps/remix-ide/src/walkthroughService.js @@ -11,28 +11,15 @@ const profile = { } export class WalkthroughService extends Plugin { - constructor (appManager, showWalkthrough) { + constructor (appManager) { super(profile) - /*let readyToStart = 0; - appManager.event.on('activate', (plugin) => { - if (plugin.name === 'udapp') readyToStart++ - if (readyToStart == 2 && showWalkthrough) { - this.start() - } - }) - appManager.event.on('activate', (plugin) => { - if (plugin.name === 'solidity') readyToStart++ - if (readyToStart == 2 && showWalkthrough) { - this.start() - } - })*/ } startRecorderW () { introJs().setOptions({ steps: [{ title: 'Transactions Recorder', - intro: 'Save transactions (deployed contracts and function executions) and replay them in another environment e.g Transactions created in Remix VM can be replayed in the Injected Provider.Click to launch the Home tab that contains links, tips, and shortcuts..', + intro: 'Save transactions (deployed contracts and function executions) and replay them in another environment e.g Transactions created in Remix VM can be replayed in the Injected Provider. Click to launch the Home tab that contains links, tips, and shortcuts.', element: document.querySelector('#udappRecorderCard'), tooltipClass: 'bg-light text-dark', position: 'right', @@ -41,7 +28,7 @@ export class WalkthroughService extends Plugin { { element: document.querySelector('#udappRecorderUseLatest'), title: 'Transactions Recorder', - intro: 'If set the recorder will run transactions using the latest compilation result.', + intro: 'If selected the recorder will run transactions using the latest compilation result.', tooltipClass: 'bg-light text-dark', position: 'right', highlightClass: 'bg-light border border-warning' @@ -49,7 +36,7 @@ export class WalkthroughService extends Plugin { { element: document.querySelector('#udappRecorderSave'), title: 'Transactions Recorder', - intro: 'Once there is a Once one or a few transactions have been executed from Remix, click this button to save these transactions as a scenario file.', + intro: 'Once one or more transactions have been executed from Remix, click this button to save these transactions as a scenario file.', tooltipClass: 'bg-light text-dark', position: 'right', highlightClass: 'bg-light border border-warning' @@ -89,21 +76,24 @@ export class WalkthroughService extends Plugin { intro: 'Click to launch the Home tab that contains links, tips, and shortcuts..', element: document.querySelector('#verticalIconsHomeIcon'), tooltipClass: 'bg-light text-dark', - position: 'right' + position: 'right', + highlightClass: 'bg-light border border-warning' }, { element: document.querySelector('#verticalIconsKindsolidity'), title: 'Solidity Compiler', intro: 'Having selected a .sol file in the File Explorer (the icon above), compile it with the Solidity Compiler.', tooltipClass: 'bg-light text-dark', - position: 'right' + position: 'right', + highlightClass: 'bg-light border border-warning' }, { title: 'Deploy your contract', element: document.querySelector('#verticalIconsKindudapp'), intro: 'Choose a chain, deploy a contract and play with your functions.', tooltipClass: 'bg-light text-dark', - position: 'right' + position: 'right', + highlightClass: 'bg-light border border-warning' } ] }).onafterchange((targetElement) => { diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts index 605a3bf971..4cd25f07f9 100644 --- a/libs/remix-simulator/src/vm-context.ts +++ b/libs/remix-simulator/src/vm-context.ts @@ -230,10 +230,11 @@ class CustomEthersStateManager extends StateManagerCommonStorageDump { [], this.blockTag, ]) + const codeHash = accountData.codeHash === '0x0000000000000000000000000000000000000000000000000000000000000000' ? '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' : accountData.codeHash const account = Account.fromAccountData({ balance: BigInt(accountData.balance), nonce: BigInt(accountData.nonce), - codeHash: toBuffer(accountData.codeHash) + codeHash: toBuffer(codeHash) // storageRoot: toBuffer([]), // we have to remove this in order to force the creation of the Trie in the local state. }) return account diff --git a/libs/remix-ui/app/src/lib/remix-app/components/modals/enter.tsx b/libs/remix-ui/app/src/lib/remix-app/components/modals/enter.tsx index 30903ccc3c..bff24b9072 100644 --- a/libs/remix-ui/app/src/lib/remix-app/components/modals/enter.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/components/modals/enter.tsx @@ -4,23 +4,16 @@ import {UsageTypes} from '../../types' import { type } from 'os' interface EnterDialogProps { - hide: boolean, handleUserChoice: (userChoice: UsageTypes) => void, } const EnterDialog = (props: EnterDialogProps) => { - const [visibility, setVisibility] = useState(false) - const {showEnter} = useContext(AppContext) - - useEffect(() => { - setVisibility(!props.hide) - }, [props.hide]) const enterAs = async (uType) => { props.handleUserChoice(uType) } - const modalClass = (visibility && showEnter) ? "d-flex" : "d-none" + const modalClass = "d-flex" return (
{

Welcome to Remix IDE

-
- To load the project with the most efficient setup we would like to know your experience type. +
+ In order to understand your needs better, we would like to know how you typically use Remix
-
- - - - +
+ + + +
diff --git a/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx b/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx index b1fb029b77..59391d1e09 100644 --- a/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx @@ -8,7 +8,12 @@ declare global { } const _paq = (window._paq = window._paq || []) -const MatomoDialog = (props) => { +interface MatomoDialogProps { + okFn: () => void, + hide: boolean +} + +const MatomoDialog = (props: MatomoDialogProps) => { const {settings, showMatamo, appManager} = useContext(AppContext) const {modal} = useDialogDispatchers() const [visible, setVisible] = useState(props.hide) @@ -68,6 +73,7 @@ const MatomoDialog = (props) => { _paq.push(['setConsentGiven']); settings.updateMatomoAnalyticsChoice(true) setVisible(false) + props.okFn() } return <> diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx index 050056bb17..a9be16414f 100644 --- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx @@ -50,7 +50,18 @@ const RemixApp = (props: IRemixAppUi) => { activateApp() } const hadUsageTypeAsked = localStorage.getItem('hadUsageTypeAsked') - setShowEnterDialog(!hadUsageTypeAsked) + if (props.app.showMatamo) { + // if matomo dialog is displayed, it will take care of calling "setShowEnterDialog", + // if the user approves matomo tracking. + // so "showEnterDialog" stays false + } else { + // if matomo dialog isn't displayed, we show the "enter dialog" only if: + // - it wasn't already set + // - (and) if user has given consent + if (!hadUsageTypeAsked && props.app.matomoCurrentSetting) { + setShowEnterDialog(true) + } + } }, []) function setListeners() { @@ -93,7 +104,6 @@ const RemixApp = (props: IRemixAppUi) => { const value: appProviderContextType = { settings: props.app.settings, showMatamo: props.app.showMatamo, - showEnter: props.app.showEnter, appManager: props.app.appManager, modal: props.app.notification, layout: props.app.layout, @@ -121,7 +131,7 @@ const RemixApp = (props: IRemixAppUi) => { _paq.push(['trackEvent', 'enterDialog', 'usageType', 'beginner']) break } - case UsageTypes.Tutor: { + case UsageTypes.Advance: { _paq.push(['trackEvent', 'enterDialog', 'usageType', 'tutor']) break } @@ -143,8 +153,8 @@ const RemixApp = (props: IRemixAppUi) => { - {setShowEnterDialog(true)}}> - handleUserChosenType(type)}> + setShowEnterDialog(true)}> + {showEnterDialog && handleUserChosenType(type)}>}
{props.app.menuicons.render()} diff --git a/libs/remix-ui/app/src/lib/remix-app/types/index.ts b/libs/remix-ui/app/src/lib/remix-app/types/index.ts index 0037fd6cb8..217d6ea5c0 100644 --- a/libs/remix-ui/app/src/lib/remix-app/types/index.ts +++ b/libs/remix-ui/app/src/lib/remix-app/types/index.ts @@ -10,7 +10,7 @@ export const enum ModalTypes { export const enum UsageTypes { Beginner = 1, - Tutor, Prototyper, - Production, + Advance, + Production } \ No newline at end of file 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 c83e033136..450bc251d6 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -35,9 +35,9 @@ export function RecorderUI(props: RecorderProps) { return (
-
+
-