forked from cerc-io/stack-orchestrator
6b62247ef7
* Add an option to pass env file to deploy command * Use env variable mapping in fixturenet-optimism stack * Use default values from checked in env files * Use env variable mapping in mobymask-v2 stack * Update instructions * Add extra hosts in app compose files and update instructions * Add CERC prefix to env variables in fixturenet-optimism stack * Add CERC prefix to env variables in mobymask-v2 stack
31 lines
945 B
TypeScript
31 lines
945 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.CERC_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)
|
|
}
|
|
})
|