Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cli/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const migrate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<vo

if (chainId == 1337) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we move the list of contracts to deploy to a config file we won't need this if/case

allContracts = ['EthereumDIDRegistry', ...allContracts]
await (cli.wallet.provider as providers.JsonRpcProvider).send('evm_setAutomine', [true])
await setAutoMine(cli.wallet.provider as providers.JsonRpcProvider, true)
} else if (chainIdIsL2(chainId)) {
allContracts = l2Contracts
}
Expand Down Expand Up @@ -167,7 +167,15 @@ export const migrate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<vo
logger.info(`Sent ${nTx} transaction${nTx === 1 ? '' : 's'} & spent ${EtherSymbol} ${spent}`)

if (chainId == 1337) {
await (cli.wallet.provider as providers.JsonRpcProvider).send('evm_setAutomine', [false])
await setAutoMine(cli.wallet.provider as providers.JsonRpcProvider, false)
}
}

const setAutoMine = async (provider: providers.JsonRpcProvider, automine: boolean) => {
try {
await provider.send('evm_setAutomine', [automine])
} catch (error) {
logger.warn('The method evm_setAutomine does not exist/is not available!')
}
}

Expand Down
2 changes: 1 addition & 1 deletion cli/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { addCustomNetwork } from '@arbitrum/sdk'
import { Contract, Wallet, providers } from 'ethers'

import { loadArtifact } from './artifacts'
Expand All @@ -7,6 +6,7 @@ export const l1ToL2ChainIdMap = {
'1': '42161',
'4': '421611',
'5': '421613',
'1337': '412346',
}

export const l2ChainIds = Object.values(l1ToL2ChainIdMap).map(Number)
Expand Down
2 changes: 1 addition & 1 deletion config/graph.arbitrum-localhost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ contracts:
subgraphAvailabilityOracle: *availabilityOracle
AllocationExchange:
init:
graphToken: "${{GraphToken.address}}"
graphToken: "${{L2GraphToken.address}}"
staking: "${{Staking.address}}"
governor: *allocationExchangeOwner
authority: *authority
Expand Down
8 changes: 8 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ const config: HardhatUserConfig = {
accounts:
process.env.FORK === 'true' ? getAccountsKeys() : { mnemonic: DEFAULT_TEST_MNEMONIC },
},
localnitrol1: {
url: 'http://localhost:8545',
accounts: { mnemonic: DEFAULT_TEST_MNEMONIC },
},
localnitrol2: {
url: 'http://localhost:8547',
accounts: { mnemonic: DEFAULT_TEST_MNEMONIC },
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
Expand Down