Skip to content

Commit 176192c

Browse files
authored
Merge branch 'master' into issue
2 parents 7ef87a5 + 42da497 commit 176192c

File tree

36 files changed

+246
-226
lines changed

36 files changed

+246
-226
lines changed

.github/workflows/pr-reminder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
with:
1919
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
20-
freeze-date: '2025-03-17T18:00:00Z'
20+
freeze-date: '2025-04-14T18:00:00Z'
2121
- name: Reminder for standup
2222
if: github.event.schedule == '55 9 * * 1-5'
2323
uses: Aniket-Engg/pr-reviews-reminder-action@master

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[![GitHub contributors](https://img.shields.io/github/contributors/ethereum/remix-project?style=flat&logo=github)](https://github.com/ethereum/remix-project/blob/master/CONTRIBUTING.md)
1313
[![Awesome Remix](https://img.shields.io/badge/Awesome--Remix-resources-green?logo=awesomelists)](https://github.com/ethereum/awesome-remix)
1414
[![GitHub](https://img.shields.io/github/license/ethereum/remix-project)](https://github.com/ethereum/remix-project/blob/master/LICENSE)
15-
[![Discord](https://img.shields.io/badge/join-discord-brightgreen.svg?style=flat&logo=discord)](https://discord.gg/mh9hFCKkEq)
15+
[![Discord](https://img.shields.io/badge/join-discord-brightgreen.svg?style=flat&logo=discord)](https://discord.gg/ZFHV7s44Ef)
1616
[![X Follow](https://img.shields.io/twitter/follow/ethereumremix?style=flat&logo=x&color=green)](https://x.com/ethereumremix)
1717

1818
</div>

apps/remix-ide-e2e/src/tests/transactionExecution.test.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ module.exports = {
370370
'decoded output': { '0':'bool: true' }
371371
}).perform(() => done())
372372
})
373-
.click('*[data-id="universalDappUiUdappPin"]') // pin the contract for later use by a forked state.
374373
// Should fork the mainnet VM fork and execute some transaction
375374
.click('*[data-id="fork-state-icon"]')
376375
.waitForElementVisible('*[data-id="udappNotifyModalDialogModalTitle-react"]')
@@ -385,7 +384,15 @@ module.exports = {
385384
}
386385
)
387386
.pause(2000)
387+
.perform((done) => {
388+
browser.createContract((currentBlockNumber) + '')
389+
.waitForElementPresent('*[data-shared="universalDappUiInstance"]')
390+
.perform(() => {
391+
done()
392+
})
393+
})
388394
.clickInstance(0)
395+
.click('*[data-id="universalDappUiUdappPin"]') // pin the contract for later use by a forked state.
389396
.clickFunction('getB - call')
390397
.clickFunction('checkBlockNumberIsAdvancing - transact (not payable)')
391398
.perform((done) => {
@@ -442,20 +449,20 @@ module.exports = {
442449
console.log('Test Fork Mainnet', address)
443450
addressRef = address
444451
})
445-
// from Mainnet fork 2, check that block number is at `currentBlockNumber` + 6
446-
.clickFunction('checkOrigin - transact (not payable)', { types: 'uint256 incr', values: '6'})
452+
// from Mainnet fork 2, check that block number is at `currentBlockNumber` + 4
453+
.clickFunction('checkOrigin - transact (not payable)', { types: 'uint256 incr', values: '3'})
447454
.perform((done) => {
448455
browser.testFunction('last',
449456
{
450457
status: '0x1 Transaction mined and execution succeed',
451458
'decoded output': { '0':'bool: true' }
452459
}).perform(() => done())
453460
})
454-
// switch back to Mainnet fork 1 and check that block number is at `currentBlockNumber` + 4
461+
// switch back to Mainnet fork 1 and check that block number is at `currentBlockNumber` + 2
455462
.switchEnvironment('vm-fs-Mainnet fork 1')
456463
.pause(2000)
457464
.clickInstance(0)
458-
.clickFunction('checkOrigin - transact (not payable)', { types: 'uint256 incr', values: '4'})
465+
.clickFunction('checkOrigin - transact (not payable)', { types: 'uint256 incr', values: '1'})
459466
.perform((done) => {
460467
browser.testFunction('last',
461468
{

apps/remix-ide/src/app/editor/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class Editor extends Plugin {
5353
ts: 'typescript',
5454
move: 'move',
5555
circom: 'circom',
56-
nr: 'noir',
56+
nr: 'move',
5757
toml: 'toml'
5858
}
5959

apps/remix-ide/src/app/plugins/script-runner-bridge.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Engine, Plugin } from '@remixproject/engine'
77
import axios from 'axios'
88
import { AppModal } from '@remix-ui/app'
99
import { isArray } from 'lodash'
10-
import { PluginViewWrapper } from '@remix-ui/helper'
1110
import { CustomRemixApi } from '@remix-api'
1211
import { ScriptRunnerUIPlugin } from '../tabs/script-runner-ui'
1312

apps/remix-ide/src/app/providers/injected-custom-provider.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ export class InjectedCustomProvider extends InjectedProviderDefault {
88
rpcUrls: Array<string>
99
nativeCurrency: Record<string, any>
1010
blockExplorerUrls: Array<string>
11+
parent: string
1112

12-
constructor(provider: any, pluginName: string, chainName: string, chainId: string, rpcUrls: Array<string>, nativeCurrency?: Record<string, any>, blockExplorerUrls?: Array<string>) {
13+
constructor(provider: any, pluginName: string, chainName: string, chainId: string, rpcUrls: Array<string>, nativeCurrency?: Record<string, any>, blockExplorerUrls?: Array<string>, parent?: string) {
1314
super(provider, pluginName)
15+
this.parent = parent
1416
this.pluginName = pluginName
1517
this.chainName = chainName
1618
this.chainId = chainId
1719
this.rpcUrls = rpcUrls
1820
this.nativeCurrency = nativeCurrency
1921
this.blockExplorerUrls = blockExplorerUrls
22+
this.listenerChainChanged = (chainId: number) => {
23+
if (chainId !== parseInt(this.chainId)) {
24+
this.call('blockchain', 'changeExecutionContext', { context: this.parent })
25+
}
26+
}
2027
}
2128

2229
async init() {

apps/remix-ide/src/app/udapp/run-tab.tsx

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@ import { Recorder } from '../tabs/runTab/model/recorder'
1616
import { EnvDropdownLabelStateType } from 'libs/remix-ui/run-tab/src/lib/types'
1717
const _paq = (window._paq = window._paq || [])
1818

19-
const selectedEnvs: EnvDropdownLabelStateType[] = [
20-
{ name: 'Remix VM (Cancun)', value: 'vm-cancun', chainId: 'vm-cancun' },
21-
{ name: 'Gnosis Mainnet - MetaMask', value: 'injected-metamask-gnosis', chainId: 100 },
22-
{ name: 'L2 - Optimism - MetaMask', value: 'injected-metamask-optimism', chainId: 10 },
23-
{ name: 'L2 - Arbitrum - MetaMask', value: 'injected-metamask-arbitrum', chainId: 42161 },
24-
{ name: 'Ephemery Testnet - MetaMask', value: 'injected-metamask-ephemery', chainId: 39438143 },
25-
{ name: 'Sepolia Testnet - MetaMask', value: 'injected-metamask-sepolia', chainId: 11155111 },
26-
{ name: 'L2 - Linea - MetaMask', value: 'injected-metamask-linea', chainId: 59144 },
27-
{ name: 'Injected Provider - MetaMask', value: 'injected-MetaMask' },
28-
{ name: 'WalletConnect', value: 'walletconnect' },
29-
{ name: 'Remix VM - Mainnet fork', value: 'vm-mainnet-fork', chainId: 'vm-mainnet-fork' },
30-
{ name: 'Remix VM - Sepolia fork', value: 'vm-sepolia-fork', chainId: 'vm-sepolia-fork' },
31-
{ name: 'Remix VM - Custom fork', value: 'vm-custom-fork', chainId: 'vm-custom-fork' },
32-
{ name: 'Remix VM (Shanghai)', value: 'vm-shanghai', chainId: 'vm-shanghai' },
33-
{ name: 'Remix VM (Paris)', value: 'vm-paris', chainId: 'vm-paris' },
34-
{ name: 'Remix VM (London)', value: 'vm-london', chainId: 'vm-london' },
35-
{ name: 'Remix VM (Berlin)', value: 'vm-berlin', chainId: 'vm-berlin' },
36-
{ name: 'Custom - External Http Provider', value: 'basic-http-provider', chainId: 1741104841094 },
37-
{ name: 'Dev - Hardhat Provider', value: 'hardhat-provider', chainId: 31337 },
38-
{ name: 'Dev - Foundry Provider', value: 'foundry-provider', chainId: 31337 },
39-
{ name: 'Dev - Ganache Provider', value: 'ganache-provider', chainId: 1741104841094 },
40-
]
41-
4219
const profile = {
4320
name: 'udapp',
4421
displayName: 'Deploy & run transactions',
@@ -61,8 +38,7 @@ const profile = {
6138
'clearAllInstances',
6239
'addInstance',
6340
'resolveContractAndAddInstance',
64-
'showPluginDetails',
65-
'getEnvironmentDropdownLabels'
41+
'showPluginDetails'
6642
]
6743
}
6844

@@ -79,7 +55,6 @@ export class RunTab extends ViewPlugin {
7955
fileProvider: any
8056
recorder: any
8157
REACT_API: any
82-
envDropdownLabelState: EnvDropdownLabelStateType[]
8358
el: any
8459
constructor(blockchain: Blockchain, config: any, fileManager: any, editor: any, filePanel: any, compilersArtefacts: CompilerArtefacts, networkModule: any, fileProvider: any, engine: any) {
8560
super(profile)
@@ -95,7 +70,6 @@ export class RunTab extends ViewPlugin {
9570
this.fileProvider = fileProvider
9671
this.recorder = new Recorder(blockchain)
9772
this.REACT_API = {}
98-
this.setEnvironmentDropdownLabels()
9973
this.setupEvents()
10074
this.el = document.createElement('div')
10175
}
@@ -140,14 +114,6 @@ export class RunTab extends ViewPlugin {
140114
return this.blockchain.createVMAccount(newAccount)
141115
}
142116

143-
setEnvironmentDropdownLabels() {
144-
this.envDropdownLabelState = selectedEnvs
145-
}
146-
147-
getEnvironmentDropdownLabels() {
148-
return this.envDropdownLabelState
149-
}
150-
151117
sendTransaction(tx) {
152118
_paq.push(['trackEvent', 'udapp', 'sendTx', 'udappTransaction'])
153119
return this.blockchain.sendTransaction(tx)
@@ -242,7 +208,8 @@ export class RunTab extends ViewPlugin {
242208

243209
const addCustomInjectedProvider = async (position, event, name, displayName, networkId, urls, nativeCurrency?) => {
244210
// name = `${name} through ${event.detail.info.name}`
245-
await this.engine.register([new InjectedCustomProvider(event.detail.provider, name, displayName, networkId, urls, nativeCurrency)])
211+
const parent = 'injected-' + event.detail.info.name
212+
await this.engine.register([new InjectedCustomProvider(event.detail.provider, name, displayName, networkId, urls, nativeCurrency, [], parent)])
246213
await addProvider(position, name, displayName + ' - ' + event.detail.info.name, { isInjected: true, isVM: false, isRpcForkedState: false, fork: '' })
247214
}
248215
const registerInjectedProvider = async (event) => {

apps/remix-ide/src/app/ui/landing-page/landing-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const profile = {
1010
methods: [],
1111
events: [],
1212
description: 'Remix Home',
13-
icon: 'assets/img/home.webp',
13+
icon: 'assets/img/remix-logo-blue.png',
1414
location: 'mainPanel',
1515
version: packageJson.version
1616
}
-4.11 KB
Binary file not shown.

apps/remix-ide/src/blockchain/blockchain.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const profile = {
2525
name: 'blockchain',
2626
displayName: 'Blockchain',
2727
description: 'Blockchain - Logic',
28-
methods: ['getCode', 'getTransactionReceipt', 'addProvider', 'removeProvider', 'getCurrentFork', 'getAccounts', 'web3VM', 'web3', 'getProvider', 'getCurrentProvider', 'getCurrentNetworkStatus', 'getAllProviders', 'getPinnedProviders'],
28+
methods: ['getCode', 'getTransactionReceipt', 'addProvider', 'removeProvider', 'getCurrentFork', 'getAccounts', 'web3VM', 'web3', 'getProvider', 'getCurrentProvider', 'getCurrentNetworkStatus', 'getAllProviders', 'getPinnedProviders', 'changeExecutionContext', 'getProviderObject'],
2929
version: packageJson.version
3030
}
3131

@@ -545,6 +545,10 @@ export class Blockchain extends Plugin {
545545
}
546546

547547
changeExecutionContext(context, confirmCb, infoCb, cb) {
548+
if (this.currentRequest && this.currentRequest.from && !this.currentRequest.from.startsWith('injected')) {
549+
// only injected provider can update the provider.
550+
return
551+
}
548552
if (context.context === 'item-another-chain') {
549553
this.call('manager', 'activatePlugin', 'environmentExplorer').then(() => this.call('tabs', 'focus', 'environmentExplorer'))
550554
} else {
@@ -565,6 +569,10 @@ export class Blockchain extends Plugin {
565569
return allProviders[name]
566570
}
567571

572+
getProviderObject() {
573+
return this.executionContext.getProviderObject()
574+
}
575+
568576
getInjectedWeb3Address() {
569577
return this.executionContext.getSelectedAddress()
570578
}
@@ -1016,10 +1024,7 @@ export class Blockchain extends Plugin {
10161024
let stateDetails = await this.call('fileManager', 'readFile', provider.config.statePath)
10171025
stateDetails = JSON.parse(stateDetails)
10181026
state = JSON.parse(state)
1019-
state['stateName'] = stateDetails.stateName
1020-
state['forkName'] = stateDetails.forkName
1021-
state['savingTimestamp'] = stateDetails.savingTimestamp
1022-
state = JSON.stringify(state, null, 2)
1027+
state = JSON.stringify({ ...stateDetails, ...(state as any) }, null, 2)
10231028
}
10241029
this.call('fileManager', 'writeFile', provider.config.statePath, state)
10251030
} else if (isBasicVMState && !isForkedRpcState && !isForkedRpcState) {

0 commit comments

Comments
 (0)