9ffa9bb5a9
* Check existing L1 contracts deployment * Rename volume used for generated L2 config * Check for existing L2 geth data directory * Cross check existing L2 config against L1 deployment config * Verify sequencer key in existing L2 geth data directory * Add instructions to troubleshoot corrupt L2 geth dir * Separate out instructions to run L2 with external L1 * Update docs
31 lines
940 B
TypeScript
31 lines
940 B
TypeScript
import { task } from 'hardhat/config'
|
|
import '@nomiclabs/hardhat-ethers'
|
|
|
|
task(
|
|
'verify-contract-deployment',
|
|
'Verifies the given contract deployment transaction'
|
|
)
|
|
.addParam('contract', 'Address of the contract deployed')
|
|
.addParam('transactionHash', 'Hash of the deployment transaction')
|
|
.setAction(async ({ contract, transactionHash }, { ethers }) => {
|
|
const provider = new ethers.providers.JsonRpcProvider(
|
|
`${process.env.L1_RPC}`
|
|
)
|
|
|
|
// Get the deployment tx receipt
|
|
const receipt = await provider.getTransactionReceipt(transactionHash)
|
|
if (
|
|
receipt &&
|
|
receipt.contractAddress &&
|
|
receipt.contractAddress === contract
|
|
) {
|
|
console.log(
|
|
`Deployment for contract ${contract} in transaction ${transactionHash} verified`
|
|
)
|
|
process.exit(0)
|
|
} else {
|
|
console.log(`Contract ${contract} deployment verification failed`)
|
|
process.exit(1)
|
|
}
|
|
})
|