feature: verify bridge (#525)

* add: initial attempt at contract verification

* fix: hardhat config networks

* fix: pass hre

* test: try inside typechain folder

* refactor: move verification to optics-xapps folder

* add: new deploy of core and bridge contracts, successful BridgeRouter verification

* fix: bad merge, compile typechain

* add: new core deploy

* add: generate typechain

* refactor: revert old verification code in typescript folder

* fix: file path, typechain gen in optics-xapps not working

* fix: bridge deploy, verify bridge, beacon and proxy

* refactor: create typescript/optics-deploy/verification

* clean: delete console.log

* fix: add ETH Helper to verification input

* fix: bridge deploy after merge

* delete: bridge deploy

* restore: bridge deploy and solidity lint diff

* add: UpgradeBeacon import

* Remove unused imports & regen typescript

Co-authored-by: anna-caroll <anna.s.carroll@gmail.com>
buddies-main-deployment
Erin Hales 3 years ago committed by GitHub
parent 8de3d1ff0f
commit 57bef4e2b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      README.md
  2. 2
      rust/config/1624582061323/alfajores_contracts.json
  3. 2
      rust/config/1624582061323/kovan_contracts.json
  4. 2
      rust/config/1625070416983/alfajores_contracts.json
  5. 2
      rust/config/1625070416983/kovan_contracts.json
  6. 2
      rust/config/1625169020727/alfajores_contracts.json
  7. 2
      rust/config/1625169020727/kovan_contracts.json
  8. 2
      rust/config/1625570709419/alfajores_contracts.json
  9. 2
      rust/config/1625570709419/kovan_contracts.json
  10. 2
      rust/config/1626446356788/alfajores_contracts.json
  11. 2
      rust/config/1626446356788/kovan_contracts.json
  12. 6
      solidity/optics-core/hardhat.config.ts
  13. 6310
      solidity/optics-core/package-lock.json
  14. 6
      solidity/optics-core/package.json
  15. 107
      solidity/optics-core/ts/readDeployConfig.ts
  16. 81
      solidity/optics-core/ts/verifyLatestDeploy.ts
  17. 19
      solidity/optics-xapps/hardhat.config.ts
  18. 546
      solidity/optics-xapps/package-lock.json
  19. 6
      solidity/optics-xapps/package.json
  20. 2
      typescript/optics-deploy/scripts/bridgeAlfajoresKovan.ts
  21. 2
      typescript/optics-deploy/src/bridge/BridgeDeploy.ts
  22. 2
      typescript/optics-deploy/src/bridge/TestBridgeDeploy.ts
  23. 8
      typescript/optics-deploy/src/bridge/index.ts
  24. 2
      typescript/optics-deploy/src/chain.ts
  25. 8
      typescript/optics-deploy/src/core/index.ts
  26. 37
      typescript/optics-deploy/src/verification/readDeployOutput.ts
  27. 91
      typescript/optics-deploy/src/verification/verifyLatestDeploy.ts
  28. 2
      typescript/optics-tests/hardhat.config.ts
  29. 1170
      typescript/optics-tests/package-lock.json
  30. 2
      typescript/typechain/optics-core/factories/GovernanceRouter__factory.ts
  31. 2
      typescript/typechain/optics-core/factories/Home__factory.ts
  32. 2
      typescript/typechain/optics-core/factories/TestGovernanceRouter__factory.ts
  33. 2
      typescript/typechain/optics-core/factories/TestHome__factory.ts
  34. 2
      typescript/typechain/optics-core/factories/TestXAppConnectionManager__factory.ts
  35. 2
      typescript/typechain/optics-core/factories/UpdaterManager__factory.ts
  36. 2
      typescript/typechain/optics-core/factories/XAppConnectionManager__factory.ts

@ -99,9 +99,9 @@ Note: In the event you need to bypass the pre-commit hooks, pass the
2. Setup your `.env` files
```bash
cd typescript/optics-deploy
touch .env && cat .env.example > .env'
touch .env && cat .env.example > .env
cd ../../solidity/optics-core
touch .env && cat .env.example > .env'
touch .env && cat .env.example > .env
```
Then, add values to the keys in the newly created `.env` files.

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x06c0CC70d5201ac0393baafb754ec9AC60811f5D",
"xappConnectionManager": "0xc2aA9111F5DaA5F4B4DAEb1fEa6B86b118331D5f",
"xAppConnectionManager": "0xc2aA9111F5DaA5F4B4DAEb1fEa6B86b118331D5f",
"updaterManager": "0x24906e49cb5d1177eD4695120e29aB6FF8e24c4e",
"governance": {
"implementation": "0x070A8949d1674b208bBdFAf24295852Da50cFAc5",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x7a539d7B7f4Acab1d7ce8b3681c3e286511ee444",
"xappConnectionManager": "0x1BFf8f7f2dDB6c300Eae4DbCF2dD9706d20eC3Be",
"xAppConnectionManager": "0x1BFf8f7f2dDB6c300Eae4DbCF2dD9706d20eC3Be",
"updaterManager": "0x9cB3F2BA6B824C3fEf60E0ef8972DB2B28C26d23",
"governance": {
"implementation": "0x7F0Ee81930DdaeDB77cA2FF569Fe0A9963D95627",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x0b1d23e4D3c8991396b13F47264000ED89A77Bf3",
"xappConnectionManager": "0xd8ee8F0E99b882Acf0901B672D238219F5D65fA1",
"xAppConnectionManager": "0xd8ee8F0E99b882Acf0901B672D238219F5D65fA1",
"updaterManager": "0x285033FDF2E5eF224D4396AE185Adf469664CE81",
"governance": {
"implementation": "0xe9c062412669198649358dbFBe2699ebe19ce8f8",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x7C80bd16deb375D833E992Ad3c2DE9E956a11071",
"xappConnectionManager": "0xbdf5227e9D80C400cFB294864b7d068BdeE4e4ed",
"xAppConnectionManager": "0xbdf5227e9D80C400cFB294864b7d068BdeE4e4ed",
"updaterManager": "0x89a4cccC3d6708F16f40c873812091765B3f2884",
"governance": {
"implementation": "0x2e5C23D579a08Ce5D40E4Fd4c82dD3B0DD3AE7df",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0xE1d471D89f07324d0e6757b47ACf6ED452B69B46",
"xappConnectionManager": "0xCD1E1BC9BAEf4B75dBAfB3F43c9a91d78A28Cf58",
"xAppConnectionManager": "0xCD1E1BC9BAEf4B75dBAfB3F43c9a91d78A28Cf58",
"updaterManager": "0x80F143Fa079A67E99408Aa4EDB673efBdcD5F31b",
"governance": {
"implementation": "0x773DB597b468eA6d832D60CFe496B761FDa50277",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x32ea430C414DC7c08B6C40EEA495F358404dA03e",
"xappConnectionManager": "0x8FbEA25D0bFDbff68F2B920df180e9498E9c856A",
"xAppConnectionManager": "0x8FbEA25D0bFDbff68F2B920df180e9498E9c856A",
"updaterManager": "0xef357E74a084E7571f2FB7220953b7C7E876eA4a",
"governance": {
"implementation": "0xf5364400B6180d03e295F99A2D8AFc2dE5968133",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x8c97afEa73f5Ad438c74E1d3258bF074C5b505fA",
"xappConnectionManager": "0xf87d5Ae60b953F7bd8c9995B062dc2Db6684E4b9",
"xAppConnectionManager": "0xf87d5Ae60b953F7bd8c9995B062dc2Db6684E4b9",
"updaterManager": "0xf38dD5AB6072BabB9B68BB7aeCcA066deb58b4C3",
"governance": {
"implementation": "0x418246b2AD31584223e0a83F45aeF979e5531E64",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x7f41a2A1D97DD5F75B6FF6E1b012f686fE8121E4",
"xappConnectionManager": "0x19202526767DA87b526b451Be02B500513829f9b",
"xAppConnectionManager": "0x19202526767DA87b526b451Be02B500513829f9b",
"updaterManager": "0xD9516288726feC4DBffC35fFB7A763CB2B9C10c7",
"governance": {
"implementation": "0xFaE0a2F3603616063bb291cA57Bd9d397AD02e72",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0xB2C0Cfcb1FaFa1ca07d96e1590166D77971D8cdb",
"xappConnectionManager": "0x7D7E7271d9c8A8cD006101e594D0888537df3951",
"xAppConnectionManager": "0x7D7E7271d9c8A8cD006101e594D0888537df3951",
"updaterManager": "0x6776ef96A04a40a4dCB835D42bF59649aA9daFeA",
"governance": {
"implementation": "0x071ca8eA9a8e9268597B8B28Cb6382636fbe4f0f",

@ -1,6 +1,6 @@
{
"upgradeBeaconController": "0x739DEDfC80635E699cfe5D5c36E770d01aDf0Fcf",
"xappConnectionManager": "0x1e0b2AE65BA1D0a2f6f8418D64ABEF927014Bde4",
"xAppConnectionManager": "0x1e0b2AE65BA1D0a2f6f8418D64ABEF927014Bde4",
"updaterManager": "0x8f78e7487C9D46899a3068dD1ba75d90665a23d7",
"governance": {
"implementation": "0xC272D7F3c6b87F73360503e0E4BaF5D281D1D1C4",

@ -3,14 +3,16 @@ import "solidity-coverage";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-etherscan";
import { task } from "hardhat/config";
const {verifyLatestCoreDeploy} = require("./ts/verifyLatestDeploy");
const { verifyLatestCoreDeploy } = require("../../typescript/optics-deploy/src/verification/verifyLatestDeploy");
import * as dotenv from "dotenv";
dotenv.config();
task(
"verify-latest-deploy",
"Verifies the source code of the latest contract deploy"
).setAction(verifyLatestCoreDeploy);
).setAction(async(args: any, hre: any) => {
await verifyLatestCoreDeploy(hre);
});
/**
* @type import('hardhat/config').HardhatUserConfig

File diff suppressed because it is too large Load Diff

@ -33,9 +33,9 @@
"test": "./test.sh",
"lint": "solhint 'contracts/*.sol' && solhint 'contracts/**/*.sol'",
"lint:fix": "solhint --fix 'contracts/*.sol' && solhint --fix 'contracts/**/*.sol'",
"verify-core": "hardhat --network kovan verify-latest-deploy",
"deploy-core": "npm run compile && cd ../../typescript/optics-deploy && npm run deploy-core",
"deploy-verify-core": "npm run deploy-core && npm run verify-core"
"deploy": "npm run compile && cd ../../typescript/optics-deploy && npm run deploy-core",
"verify": "hardhat --network kovan verify-latest-deploy",
"deploy-verify": "npm run deploy && npm run verify"
},
"author": "James Prestwich",
"license": "MIT OR Apache-2.0",

@ -1,107 +0,0 @@
import fs from 'fs';
/*
* @notice Get the list of networks included in the contract deploy at path
* @param path relative path to core system deploy
* @return list of networks deployed as strings
* */
export function getNetworksFromDeploy(path: string): string[] {
const targetFileSuffix = `_contracts.json`;
const deployOutputFileNames = fs
.readdirSync(path, { withFileTypes: true })
.map((dirEntry: fs.Dirent) => dirEntry.name)
.filter((fileName: string) => fileName.includes(targetFileSuffix));
let chainNames: string[] = [];
for (let deployOutputFileName of deployOutputFileNames) {
const tokens: string[] = deployOutputFileName.split('_');
const chainName: string = tokens[0];
chainNames.push(chainName);
}
return chainNames;
}
/*
* @notice Return the path to the folder with the greatest name
* within the folder at configPath,
* (excluding any folders within ignoreFolders)
* @param configPath relative path to top directory
* @param ignoreFolders names of folders to exclude within configPath
* @return path to folder
* */
function getPathToLatestConfig(configPath: string, ignoreFolders: string[] = []) {
// get the names of all non-default config directories within the relative configPath
let configFolders: string[] = fs
.readdirSync(configPath, {withFileTypes: true})
.filter(
(dirEntry: fs.Dirent) =>
dirEntry.isDirectory() && !ignoreFolders.includes(dirEntry.name),
)
.map((dirEntry: fs.Dirent) => dirEntry.name);
// if no non-default config folders are found, return
if (configFolders.length == 0) {
throw new Error('No config folders found');
}
// get path to newest generated config folder
// (config folder names are UTC strings of the date they were generated - the greatest string is newest folder)
const newestConfigFolder: string = configFolders.reduce((a, b) => {
return a > b ? a : b;
});
return `${configPath}/${newestConfigFolder}`;
}
/*
* @notice Return the path to the *most recent* bridge deploy configs
* from the *most recent* core contract deploy
* @return path to folder
* */
export function getPathToLatestBridgeDeploy(): string {
const latestCoreDeployPath = getPathToLatestDeploy();
return getPathToLatestConfig(latestCoreDeployPath);
}
/*
* @notice Return the path to the *most recent* contract deploy configs
* @return path to folder
* */
export function getPathToLatestDeploy(): string {
const configPath = '../../rust/config';
const ignoreFolders = ["default"];
return getPathToLatestConfig(configPath, ignoreFolders);
}
/*
* @notice Return the JSON-parsed file specified
* for the contract deploy at path
* for the network & filetype
* Throw if the file is not found
* @param path relative path to core system deploy
* @param network target network to parse ("alfajores", "kovan"")
* @param fileSuffix target file suffix to parse ("config", "contracts", "verification")
* */
export function parseFileFromDeploy(
path: string,
network: string,
fileSuffix: string,
): any {
const targetFileName = `${network}_${fileSuffix}.json`;
const file = fs
.readdirSync(path, { withFileTypes: true })
.find((dirEntry: fs.Dirent) => dirEntry.name == targetFileName);
if (!file) {
throw new Error(
`No ${fileSuffix} files found for ${network} at ${path}/${targetFileName}`,
);
}
const fileString: string = fs
.readFileSync(`${path}/${targetFileName}`)
.toString();
return JSON.parse(fileString);
}

@ -1,81 +0,0 @@
import { parseFileFromDeploy, getPathToLatestDeploy } from "./readDeployConfig";
const envError = (network: string) =>
`pass --network tag to hardhat task (current network=${network})`;
// list of networks supported by Etherscan
const etherscanNetworks = ["mainnet", "kovan", "goerli", "ropsten", "rinkeby"];
/*
* Generate link to Etherscan for an address on the given network
* */
function etherscanLink(network: string, address: string) {
const prefix = network == "mainnet" ? "" : `${network}.`;
return `https://${prefix}etherscan.io/address/${address}`;
}
/*
* Parse the contract verification inputs
* that were output by the latest contract deploy
* for the network that hardhat is configured to
* and attempt to verify those contracts' source code on Etherscan
* */
export async function verifyLatestCoreDeploy() {
const path = getPathToLatestDeploy();
return verifyDeploy(path);
}
/*
* Parse the contract verification inputs
* that were output by the given contract deploy
* for the network that hardhat is configured to
* and attempt to verify those contracts' source code on Etherscan
* */
export async function verifyDeploy(path: string) {
// @ts-ignore
const network = hre.network.name;
// assert that network from .env is supported by Etherscan
if (!etherscanNetworks.includes(network)) {
throw new Error(`Network not supported by Etherscan; ${envError(network)}`);
}
console.log(`VERIFY ${network}`);
// get the JSON verification inputs for the given network
// from the latest contract deploy; throw if not found
const verificationInputs = parseFileFromDeploy(path, network, "verification",);
// loop through each verification input for each contract in the file
for (let verificationInput of verificationInputs) {
// attempt to verify contract on etherscan
// (await one-by-one so that Etherscan doesn't rate limit)
await verifyContract(network, verificationInput);
}
}
/*
* Given one contract verification input,
* attempt to verify the contracts' source code on Etherscan
* */
export async function verifyContract(
network: string,
verificationInput: any
) {
const { name, address, constructorArguments } = verificationInput;
try {
console.log(
` Attempt to verify ${name} - ${etherscanLink(network, address)}`
);
// @ts-ignore
await hre.run("verify:verify", {
network,
address,
constructorArguments,
});
console.log(` SUCCESS verifying ${name}`);
} catch (e) {
console.log(` ERROR verifying ${name}`);
console.error(e);
}
console.log("\n\n"); // add space after each attempt
}

@ -1,7 +1,15 @@
import "hardhat-gas-reporter";
import "solidity-coverage";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-etherscan";
import "@typechain/hardhat";
const { task } = require("hardhat/config");
const { verifyLatestBridgeDeploy } = require("../../typescript/optics-deploy/src/verification/verifyLatestDeploy");
task("verify-latest-deploy", "Verifies the source code of the latest contract deploy")
.setAction(async(args: any, hre: any) => {
await verifyLatestBridgeDeploy(hre);
});
/**
* @type import('hardhat/config').HardhatUserConfig
@ -25,6 +33,13 @@ module.exports = {
localhost: {
url: "http://localhost:8545",
},
goerli: {
url: "https://goerli.infura.io/v3/5c456d7844fa40a683e934df60534c60",
},
kovan: {
url: "https://kovan.infura.io/v3/5c456d7844fa40a683e934df60534c60",
},
// TODO: add Ropsten, Rinkeby, Mainnet
},
typechain: {
@ -32,4 +47,8 @@ module.exports = {
target: "ethers-v5",
alwaysGenerateOverloads: false, // should overloads with full signatures like deposit(uint256) be generated always, even if there are no overloads?
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
};

File diff suppressed because it is too large Load Diff

@ -30,7 +30,11 @@
"coverage": "npm run compile && hardhat coverage",
"test": "npm run compile",
"lint": "solhint contracts/*.sol",
"lint:fix": "solhint --fix contracts/*.sol"
"lint:fix": "solhint --fix contracts/*.sol",
"clean": "hardhat clean",
"deploy": "npm run compile && cd ../../typescript/optics-deploy && npm run deploy-bridge",
"verify": "hardhat --network kovan verify-latest-deploy",
"deploy-verify": "npm run deploy && npm run verify"
},
"author": "James Prestwich",
"license": "MIT OR Apache-2.0",

@ -1,4 +1,4 @@
import { getPathToLatestDeploy } from '../src/readDeployOutput';
import { getPathToLatestDeploy } from '../src/verification/readDeployOutput';
import { deployBridges } from '../src/bridge';
import * as alfajores from '../config/alfajores';
import * as kovan from '../config/kovan';

@ -1,6 +1,6 @@
import { Chain, ChainJson, CoreContractDeployOutput, toChain } from '../chain';
import { BridgeContracts } from './BridgeContracts';
import { parseFileFromDeploy } from '../readDeployOutput';
import { parseFileFromDeploy } from '../verification/readDeployOutput';
import { Deploy } from '../deploy';
export type BridgeConfig = {

@ -72,7 +72,7 @@ export default class TestBridgeDeploy {
get coreContractAddresses() {
return {
xappConnectionManager: this.mockCore.address,
xAppConnectionManager: this.mockCore.address,
home: { proxy: this.mockCore.address },
governance: { proxy: this.mockCore.address },
};

@ -91,7 +91,7 @@ export async function deployBridgeRouter(deploy: Deploy) {
'initialize',
[
deploy.contracts.bridgeToken!.beacon.address,
deploy.coreContractAddresses.xappConnectionManager,
deploy.coreContractAddresses.xAppConnectionManager,
],
);
@ -133,6 +133,12 @@ export async function deployEthHelper(deploy: Deploy) {
deploy.contracts.bridgeRouter?.proxy.address!,
);
await deploy.contracts.ethHelper.deployTransaction.wait(5);
deploy.verificationInput.push({
name: `ETH Helper`,
address: deploy.contracts.ethHelper.address,
constructorArguments: [deploy.config.weth!,
deploy.contracts.bridgeRouter?.proxy.address!],
});
}
/**

@ -5,7 +5,7 @@ import { ProxyAddresses } from './proxyUtils';
export type CoreContractDeployOutput = {
upgradeBeaconController: string;
xappConnectionManager: string;
xAppConnectionManager: string;
updaterManager: string;
governance: ProxyAddresses;
home: ProxyAddresses;

@ -5,7 +5,7 @@ import * as ethers from 'ethers';
import fs from 'fs';
import * as proxyUtils from '../proxyUtils';
import { CoreDeploy } from '../deploy';
import { CoreDeploy } from './CoreDeploy';
import { toBytes32 } from '../../../optics-tests/lib/utils';
import * as contracts from '../../../typechain/optics-core';
@ -80,17 +80,17 @@ export async function deployUpdaterManager(deploy: CoreDeploy) {
*/
export async function deployXAppConnectionManager(deploy: CoreDeploy) {
let factory = new contracts.XAppConnectionManager__factory(deploy.deployer);
deploy.contracts.xappConnectionManager = await factory.deploy(
deploy.contracts.xAppConnectionManager = await factory.deploy(
deploy.overrides,
);
await deploy.contracts.xappConnectionManager.deployTransaction.wait(
await deploy.contracts.xAppConnectionManager.deployTransaction.wait(
deploy.chain.confirmations,
);
// add contract information to Etherscan verification array
deploy.verificationInput.push({
name: 'XAppConnectionManager',
address: deploy.contracts.xappConnectionManager!.address,
address: deploy.contracts.xAppConnectionManager!.address,
constructorArguments: [],
});
}

@ -22,6 +22,27 @@ export function getNetworksFromDeploy(path: string): string[] {
return chainNames;
}
/*
* Get path to *most recent* config folder
* of Bridge deploys for the
* most recent Optics core system deploy
* */
export function getPathToLatestBridgeConfig() {
const configPath = getPathToLatestDeployConfig();
const bridgeConfigPath = `${configPath}/bridge`;
return getPathToLatestConfig(bridgeConfigPath);
}
/*
* Get path to *most recent* config folder
* of Optics core system deploys
* */
export function getPathToLatestDeployConfig() {
const configPath = '../../rust/config';
const ignoreFolders = ["default"];
return getPathToLatestConfig(configPath, ignoreFolders);
}
/*
* @notice Return the path to the folder with the greatest name
* within the folder at configPath,
@ -45,7 +66,7 @@ function getPathToLatestConfig(
// if no non-default config folders are found, return
if (configFolders.length == 0) {
throw new Error('No config folders found');
throw new Error(`No config folders found at ${configPath}`);
}
// get path to newest generated config folder
@ -56,6 +77,20 @@ function getPathToLatestConfig(
return `${configPath}/${newestConfigFolder}`;
}
/*
* @notice
* Given a path to a contract deploy config,
* get the verification input file from that deploy
* for the given network
* Parse contents of file as JSON & return them
* Throw if the file is not found
* @param path relative path to deploy config folder ("../../rust/config/1625570709419")
* @param network target network to parse ("alfajores", "kovan")
* */
export function getVerificationInputFromDeploy(path: any, network: any) {
return parseFileFromDeploy(path, network, "verification");
}
/*
* @notice Return the path to the *most recent* bridge deploy configs
* from the *most recent* core contract deploy

@ -0,0 +1,91 @@
const {
getPathToLatestDeployConfig,
getPathToLatestBridgeConfig,
getVerificationInputFromDeploy,
} = require('./readDeployOutput.ts');
const envError = (network: string) =>
`pass --network tag to hardhat task (current network=${network})`;
// list of networks supported by Etherscan
const etherscanNetworks = ['mainnet', 'kovan', 'goerli', 'ropsten', 'rinkeby'];
/*
* Generate link to Etherscan for an address on the given network
* */
function etherscanLink(network: string, address: string) {
const prefix = network == 'mainnet' ? '' : `${network}.`;
return `https://${prefix}etherscan.io/address/${address}`;
}
/*
* Parse the contract verification inputs
* that were output by the latest contract deploy
* for the network that hardhat is configured to
* and attempt to verify those contracts' source code on Etherscan
* */
export async function verifyLatestBridgeDeploy(hre: any) {
const path = getPathToLatestBridgeConfig();
return verifyDeploy(path, hre);
}
/*
* Parse the contract verification inputs
* that were output by the latest contract deploy
* for the network that hardhat is configured to
* and attempt to verify those contracts' source code on Etherscan
* */
export async function verifyLatestCoreDeploy(hre: any) {
const path = getPathToLatestDeployConfig();
return verifyDeploy(path, hre);
}
/*
* Parse the contract verification inputs
* that were output by the given contract deploy
* for the network that hardhat is configured to
* and attempt to verify those contracts' source code on Etherscan
* */
async function verifyDeploy(path: string, hre: any) {
const network = hre.network.name;
// assert that network from .env is supported by Etherscan
if (!etherscanNetworks.includes(network)) {
throw new Error(`Network not supported by Etherscan; ${envError(network)}`);
}
console.log(`VERIFY ${network}`);
// get the JSON verification inputs for the given network
// from the latest contract deploy; throw if not found
const verificationInputs = getVerificationInputFromDeploy(path, network);
// loop through each verification input for each contract in the file
for (let verificationInput of verificationInputs) {
// attempt to verify contract on etherscan
// (await one-by-one so that Etherscan doesn't rate limit)
await verifyContract(network, verificationInput, hre);
}
}
/*
* Given one contract verification input,
* attempt to verify the contracts' source code on Etherscan
* */
async function verifyContract(network: string, verificationInput: any, hre: any) {
const { name, address, constructorArguments } = verificationInput;
try {
console.log(
` Attempt to verify ${name} - ${etherscanLink(network, address)}`,
);
await hre.run('verify:verify', {
network,
address,
constructorArguments,
});
console.log(` SUCCESS verifying ${name}`);
} catch (e) {
console.log(` ERROR verifying ${name}`);
console.error(e);
}
console.log('\n\n'); // add space after each attempt
}

@ -5,5 +5,5 @@ import './lib/index';
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: '0.7.3',
solidity: "0.7.6",
};

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -147,7 +147,7 @@ const _abi = [
];
const _bytecode =
"0x608060405260405161091d38038061091d8339818101604052602081101561002657600080fd5b505160006100326100a1565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b0319166001600160a01b03929092169190911790556100a5565b3390565b610869806100b46000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100f25780639d54f41914610123578063df034cd014610156578063f2fde38b1461015e5761007d565b80635b3c2cbf146100825780636ef0f37f146100b7578063715018a6146100ea575b600080fd5b6100b56004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610191565b005b6100b5600480360360208110156100cd57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661021a565b6100b56103af565b6100fa6104c6565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100b56004803603602081101561013957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104e2565b6100fa610646565b6100b56004803603602081101561017457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610662565b60025473ffffffffffffffffffffffffffffffffffffffff16331461021757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f21686f6d65000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50565b610222610803565b73ffffffffffffffffffffffffffffffffffffffff166102406104c6565b73ffffffffffffffffffffffffffffffffffffffff16146102c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6102cb81610807565b61033657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f21636f6e747261637420686f6d65000000000000000000000000000000000000604482015290519081900360640190fd5b6002805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fa6c230e5615262e310dcb42eaf014e813e5d8580abf5b00d2186ca8e9833de219181900360200190a150565b6103b7610803565b73ffffffffffffffffffffffffffffffffffffffff166103d56104c6565b73ffffffffffffffffffffffffffffffffffffffff161461045757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6104ea610803565b73ffffffffffffffffffffffffffffffffffffffff166105086104c6565b73ffffffffffffffffffffffffffffffffffffffff161461058a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604080517f9d54f419000000000000000000000000000000000000000000000000000000008152600481019390935251921691639d54f4199160248082019260009290919082900301818387803b15801561062b57600080fd5b505af115801561063f573d6000803e3d6000fd5b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b61066a610803565b73ffffffffffffffffffffffffffffffffffffffff166106886104c6565b73ffffffffffffffffffffffffffffffffffffffff161461070a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061080e6026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220c7f95edf91da0799f11b43c0ec8aac28e2d2f2b50803214748d566d88908579764736f6c63430007060033";
"0x608060405260405161091d38038061091d8339818101604052602081101561002657600080fd5b505160006100326100a1565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b0319166001600160a01b03929092169190911790556100a5565b3390565b610869806100b46000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100f25780639d54f41914610123578063df034cd014610156578063f2fde38b1461015e5761007d565b80635b3c2cbf146100825780636ef0f37f146100b7578063715018a6146100ea575b600080fd5b6100b56004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610191565b005b6100b5600480360360208110156100cd57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661021a565b6100b56103af565b6100fa6104c6565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100b56004803603602081101561013957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104e2565b6100fa610646565b6100b56004803603602081101561017457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610662565b60025473ffffffffffffffffffffffffffffffffffffffff16331461021757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f21686f6d65000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50565b610222610803565b73ffffffffffffffffffffffffffffffffffffffff166102406104c6565b73ffffffffffffffffffffffffffffffffffffffff16146102c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6102cb81610807565b61033657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f21636f6e747261637420686f6d65000000000000000000000000000000000000604482015290519081900360640190fd5b6002805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fa6c230e5615262e310dcb42eaf014e813e5d8580abf5b00d2186ca8e9833de219181900360200190a150565b6103b7610803565b73ffffffffffffffffffffffffffffffffffffffff166103d56104c6565b73ffffffffffffffffffffffffffffffffffffffff161461045757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6104ea610803565b73ffffffffffffffffffffffffffffffffffffffff166105086104c6565b73ffffffffffffffffffffffffffffffffffffffff161461058a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600254604080517f9d54f419000000000000000000000000000000000000000000000000000000008152600481019390935251921691639d54f4199160248082019260009290919082900301818387803b15801561062b57600080fd5b505af115801561063f573d6000803e3d6000fd5b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b61066a610803565b73ffffffffffffffffffffffffffffffffffffffff166106886104c6565b73ffffffffffffffffffffffffffffffffffffffff161461070a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061080e6026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122007e4ee1b6b2b53e3973a54ed17321cab0ec4412f972f40bf60c372ff5f530ea664736f6c63430007060033";
export class UpdaterManager__factory extends ContractFactory {
constructor(signer?: Signer) {

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save