Skip to content

Commit 8cabf39

Browse files
ioedeveloperAniket-Engg
authored andcommitted
Load vm states based on forks
1 parent ae97a2e commit 8cabf39

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export class Blockchain extends Plugin {
378378

379379
async saveDeployedContractStorageLayout(contractObject, proxyAddress, networkInfo) {
380380
const { contractName, implementationAddress } = contractObject
381-
const networkName = networkInfo.name === 'custom' ? networkInfo.name + '-' + networkInfo.id : networkInfo.name
381+
const networkName = networkInfo.name === 'custom' ? networkInfo.name + '-' + networkInfo.id : networkInfo.name === 'VM' ? networkInfo.name.toLowerCase() + '-' + this.getCurrentFork() : networkInfo.name
382382
const hasPreviousDeploys = await this.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${networkName}/UUPS.json`)
383383
// TODO: make deploys folder read only.
384384
if (hasPreviousDeploys) {

libs/remix-ui/run-tab/src/lib/actions/deploy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,15 @@ export const isValidContractAddress = async (plugin: RunTab, address: string) =>
375375

376376
export const getNetworkProxyAddresses = async (plugin: RunTab, dispatch: React.Dispatch<any>) => {
377377
const network = plugin.blockchain.networkStatus.network
378-
const identifier = network.name.startsWith('vm') ? 'VM' : network.name === 'custom' ? network.name + '-' + network.id : network.name
378+
const identifier = network.name === 'custom' ? network.name + '-' + network.id : network.name
379379
const networkDeploymentsExists = await plugin.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${identifier}/UUPS.json`)
380380

381381
if (networkDeploymentsExists) {
382382
const networkFile: string = await plugin.call('fileManager', 'readFile', `.deploys/upgradeable-contracts/${identifier}/UUPS.json`)
383383
const parsedNetworkFile: NetworkDeploymentFile = JSON.parse(networkFile)
384384
const deployments = []
385385

386-
for (const proxyAddress of Object.keys(parsedNetworkFile.deployments)) {
386+
for (const proxyAddress in Object.keys(parsedNetworkFile.deployments)) {
387387
if (parsedNetworkFile.deployments[proxyAddress] && parsedNetworkFile.deployments[proxyAddress].implementationAddress) {
388388
const solcBuildExists = await plugin.call('fileManager', 'exists', `.deploys/upgradeable-contracts/${identifier}/solc-${parsedNetworkFile.deployments[proxyAddress].implementationAddress}.json`)
389389

0 commit comments

Comments
 (0)