Skip verification when having errors. Update ReserveFactorTreasureAddress for Matic.

This commit is contained in:
David Racero 2021-03-12 16:28:05 +01:00
parent 264385a839
commit fe4d5cee02
2 changed files with 21 additions and 12 deletions

View File

@ -82,17 +82,17 @@ export const verifyAtPolygon = async (
*/ */
const network = (DRE as HardhatRuntimeEnvironment).network.name; const network = (DRE as HardhatRuntimeEnvironment).network.name;
const net = network === EthereumNetworkNames.matic ? 'mainnet' : network; const net = network === EthereumNetworkNames.matic ? 'mainnet' : network;
try { const filePath = await findPath(id);
const filePath = await findPath(id); const encodedConstructorParams = encodeDeployParams(instance, args);
const encodedConstructorParams = encodeDeployParams(instance, args); const flattenSourceCode = await hardhatFlattener(filePath);
const flattenSourceCode = await hardhatFlattener(filePath);
// Remove pragmas and license identifier after first match, required by block explorers like explorer-mainnet.maticgivil.com or Etherscan // Remove pragmas and license identifier after first match, required by block explorers like explorer-mainnet.maticgivil.com or Etherscan
const cleanedSourceCode = removeLines( const cleanedSourceCode = removeLines(
removeLines(removeLines(flattenSourceCode, LICENSE_IDENTIFIER, 1), SOLIDITY_PRAGMA, 1), removeLines(removeLines(flattenSourceCode, LICENSE_IDENTIFIER, 1), SOLIDITY_PRAGMA, 1),
EXPERIMENTAL_ABIENCODER, EXPERIMENTAL_ABIENCODER,
1 1
); );
try {
console.log( console.log(
`[Polygon Verify] Verifying ${id} with address ${instance.address} at Matic ${net} network` `[Polygon Verify] Verifying ${id} with address ${instance.address} at Matic ${net} network`
); );
@ -134,6 +134,15 @@ export const verifyAtPolygon = async (
return; return;
} }
console.error('[Polygon Verify] Error:', error.toString()); console.error('[Polygon Verify] Error:', error.toString());
throw error; console.log(
`[Polygon Verify] Skipping verification for ${id} with ${instance.address} due an unknown error.`
);
console.log(
`Please proceed with manual verification at https://explorer-${net}.maticvigil.com/address/${instance.address}/contracts`
);
console.log(`- Use the following as encoded constructor params`);
console.log(encodedConstructorParams);
console.log(`- Flattened and cleaned source code`);
console.log(cleanedSourceCode);
} }
}; };

View File

@ -145,6 +145,6 @@ export const CommonsConfig: ICommonConfiguration = {
}, },
ReserveFactorTreasuryAddress: { ReserveFactorTreasuryAddress: {
[ePolygonNetwork.mumbai]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', // TEMP [ePolygonNetwork.mumbai]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', // TEMP
[ePolygonNetwork.matic]: '0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c', // TEMP [ePolygonNetwork.matic]: '0x7734280A4337F37Fbf4651073Db7c28C80B339e9',
}, },
}; };