add shanghai vm

pull/3631/head
yann300 2 years ago
parent b5eeaa10f7
commit e8345f1c14
  1. 4
      apps/remix-ide/src/app.js
  2. 15
      apps/remix-ide/src/app/providers/vm-provider.tsx
  3. 1
      apps/remix-ide/src/app/udapp/run-tab.js
  4. 6
      apps/remix-ide/src/blockchain/execution-context.js

@ -28,7 +28,7 @@ import { StoragePlugin } from './app/plugins/storage'
import { Layout } from './app/panels/layout' import { Layout } from './app/panels/layout'
import { NotificationPlugin } from './app/plugins/notification' import { NotificationPlugin } from './app/plugins/notification'
import { Blockchain } from './blockchain/blockchain' import { Blockchain } from './blockchain/blockchain'
import { MergeVMProvider, LondonVMProvider, BerlinVMProvider} from './app/providers/vm-provider' import { MergeVMProvider, LondonVMProvider, BerlinVMProvider, ShanghaiVMProvider } from './app/providers/vm-provider'
import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider' import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider'
import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider' import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider'
import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider' import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider'
@ -211,6 +211,7 @@ class AppComponent {
const vmProviderMainnetFork = new MainnetForkVMProvider(blockchain) const vmProviderMainnetFork = new MainnetForkVMProvider(blockchain)
const vmProviderSepoliaFork = new SepoliaForkVMProvider(blockchain) const vmProviderSepoliaFork = new SepoliaForkVMProvider(blockchain)
const vmProviderGoerliFork = new GoerliForkVMProvider(blockchain) const vmProviderGoerliFork = new GoerliForkVMProvider(blockchain)
const vmProviderShanghai = new ShanghaiVMProvider(blockchain)
const vmProviderMerge = new MergeVMProvider(blockchain) const vmProviderMerge = new MergeVMProvider(blockchain)
const vmProviderBerlin = new BerlinVMProvider(blockchain) const vmProviderBerlin = new BerlinVMProvider(blockchain)
const vmProviderLondon = new LondonVMProvider(blockchain) const vmProviderLondon = new LondonVMProvider(blockchain)
@ -281,6 +282,7 @@ class AppComponent {
fetchAndCompile, fetchAndCompile,
dGitProvider, dGitProvider,
storagePlugin, storagePlugin,
vmProviderShanghai,
vmProviderMerge, vmProviderMerge,
vmProviderBerlin, vmProviderBerlin,
vmProviderLondon, vmProviderLondon,

@ -86,3 +86,18 @@ export class BerlinVMProvider extends BasicVMProvider {
this.fork = 'berlin' this.fork = 'berlin'
} }
} }
export class ShanghaiVMProvider extends BasicVMProvider {
constructor (blockchain) {
super({
name: 'vm-shanghai',
displayName: 'Remix VM (Shanghai)',
kind: 'provider',
description: 'Remix VM (Shanghai)',
methods: ['sendAsync', 'init'],
version: packageJson.version
}, blockchain)
this.blockchain = blockchain
this.fork = 'shanghai'
}
}

@ -151,6 +151,7 @@ export class RunTab extends ViewPlugin {
// VM // VM
const titleVM = 'Execution environment is local to Remix. Data is only saved to browser memory and will vanish upon reload.' const titleVM = 'Execution environment is local to Remix. Data is only saved to browser memory and will vanish upon reload.'
await addProvider('vm-shanghai', 'Remix VM (Shanghai)', false, true, 'shanghai', 'settingsVMShanghaiMode', titleVM)
await addProvider('vm-merge', 'Remix VM (Merge)', false, true, 'merge', 'settingsVMMergeMode', titleVM) await addProvider('vm-merge', 'Remix VM (Merge)', false, true, 'merge', 'settingsVMMergeMode', titleVM)
await addProvider('vm-london', 'Remix VM (London)', false, true, 'london', 'settingsVMLondonMode', titleVM) await addProvider('vm-london', 'Remix VM (London)', false, true, 'london', 'settingsVMLondonMode', titleVM)
await addProvider('vm-berlin', 'Remix VM (Berlin)', false, true, 'berlin', 'settingsVMBerlinMode', titleVM) await addProvider('vm-berlin', 'Remix VM (Berlin)', false, true, 'berlin', 'settingsVMBerlinMode', titleVM)

@ -20,11 +20,11 @@ if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') {
export class ExecutionContext { export class ExecutionContext {
constructor () { constructor () {
this.event = new EventManager() this.event = new EventManager()
this.executionContext = 'vm-merge' this.executionContext = 'vm-shanghai'
this.lastBlock = null this.lastBlock = null
this.blockGasLimitDefault = 4300000 this.blockGasLimitDefault = 4300000
this.blockGasLimit = this.blockGasLimitDefault this.blockGasLimit = this.blockGasLimitDefault
this.currentFork = 'merge' this.currentFork = 'shanghai'
this.mainNetGenesisHash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' this.mainNetGenesisHash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3'
this.customNetWorks = {} this.customNetWorks = {}
this.blocks = {} this.blocks = {}
@ -34,7 +34,7 @@ export class ExecutionContext {
} }
init (config) { init (config) {
this.executionContext = 'vm-merge' this.executionContext = 'vm-shanghai'
this.event.trigger('contextChanged', [this.executionContext]) this.event.trigger('contextChanged', [this.executionContext])
} }

Loading…
Cancel
Save