diff --git a/.env b/.env.local similarity index 65% rename from .env rename to .env.local index 1a2b47f98fc..fb35ddc9730 100644 --- a/.env +++ b/.env.local @@ -2,4 +2,4 @@ gist_token= account_passphrase= account_password= NODE_OPTIONS=--max-old-space-size=2048 -# WALLET_CONNECT_PROJECT_ID= +WALLET_CONNECT_PROJECT_ID= diff --git a/.gitignore b/.gitignore index 7955bf6455c..ab745444262 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ soljson.js *_group*.ts stats.json release +.env # compiled output diff --git a/apps/walletconnect/webpack.config.js b/apps/walletconnect/webpack.config.js index c1ae621262f..8da8a912468 100644 --- a/apps/walletconnect/webpack.config.js +++ b/apps/walletconnect/webpack.config.js @@ -46,7 +46,7 @@ module.exports = composePlugins(withNx(), (config) => { process: 'process/browser' }) ) - + console.log(process.env.WALLET_CONNECT_PROJECT_ID) // set the define plugin to load the WALLET_CONNECT_PROJECT_ID config.plugins.push( new webpack.DefinePlugin({ diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index c6eb716af69..d352347eb94 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -235,6 +235,16 @@ export function RunTabUI(props: RunTabProps) { } }, [runTab.popup]) + useEffect(() => { + if (runTab.selectExEnv.includes('injected') && + Object.entries(runTab.accounts.loadedAccounts).length === 0 && + runTab.accounts.selectedAccount.length > 0) { + // switch to vm-cancum because no account is loaded from injected provider + const context = plugin.blockchain.defaultPinnedProviders[0] // vm-cancun + setExecutionEnvironment({ context, fork: '' }) + } + }, [runTab.accounts.loadedAccounts]) + const setCheckIpfs = (value: boolean) => { dispatch(setIpfsCheckedState(value)) } diff --git a/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts b/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts index 428c782a8e1..d47d0d89f7e 100644 --- a/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts @@ -25,6 +25,7 @@ export class Blockchain extends Plugin { }; setupProviders(): void; providers: any; + defaultPinnedProviders: string[]; getCurrentProvider(): any; /** Return the list of accounts */ getAccounts(cb?: any): any;