2021-03-04 15:10:39 +00:00
|
|
|
import { Contract } from 'ethers';
|
2021-01-15 15:48:54 +00:00
|
|
|
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
|
|
|
import { DRE } from './misc-utils';
|
|
|
|
|
|
|
|
export const usingTenderly = () =>
|
|
|
|
DRE &&
|
|
|
|
((DRE as HardhatRuntimeEnvironment).network.name.includes('tenderly') ||
|
|
|
|
process.env.TENDERLY === 'true');
|
2021-03-04 15:10:39 +00:00
|
|
|
|
|
|
|
export const verifyAtTenderly = async (id: string, instance: Contract) => {
|
2021-05-12 07:50:24 +00:00
|
|
|
console.log('\n- Doing Tenderly contract verification of', id);
|
2021-03-04 15:10:39 +00:00
|
|
|
await (DRE as any).tenderlyRPC.verify({
|
|
|
|
name: id,
|
|
|
|
address: instance.address,
|
|
|
|
});
|
2021-05-12 07:50:24 +00:00
|
|
|
console.log(` - Verified ${id} at Tenderly!`);
|
2021-03-04 15:10:39 +00:00
|
|
|
};
|