diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index e814a998c1c..30ead7e4fea 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -130,10 +130,12 @@ 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.showEnter = this.showMatamo && !localStorage.getItem('hadUsageTypeAsked') - this.walkthroughService = new WalkthroughService(appManager, !this.showMatamo || !this.showEnter) + 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) 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 a593eeee29a..e7f288448f7 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/walkthroughService.js b/apps/remix-ide/src/walkthroughService.js index f54d0e28cee..de21208e3f0 100644 --- a/apps/remix-ide/src/walkthroughService.js +++ b/apps/remix-ide/src/walkthroughService.js @@ -11,21 +11,8 @@ 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 () { @@ -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 there is a one or a few 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 605a3bf9717..4cd25f07f9d 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 30903ccc3cf..bff24b90723 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 b1fb029b775..59391d1e099 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 317e505d8db..0feada91e90 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 @@ -48,7 +48,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() { @@ -87,7 +98,6 @@ const RemixApp = (props: IRemixAppUi) => { const value = { settings: props.app.settings, showMatamo: props.app.showMatamo, - showEnter: props.app.showEnter, appManager: props.app.appManager, modal: props.app.notification, layout: props.app.layout @@ -113,7 +123,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 } @@ -135,8 +145,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 0037fd6cb8e..217d6ea5c04 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