Skip to content

Commit

Permalink
update verify script to support proxy contract verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket-Engg committed Jun 8, 2023
1 parent 9831297 commit c9617ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/etherscan/src/app/utils/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ export const verifyScript = `
* @param {string} contractName - Name of the contract
* @param {string} contractFile - File where the contract is located
* @param {number | string} chainRef - Network chain id or API URL
* @param {boolean} isProxyContract - true, if contract is a proxy contract
* @param {string} expectedImplAddress - Implementation contract address, in case of proxy contract verification
* @returns {{ guid, status, message, succeed }} verification result
*/
export const verify = async (apikey: string, contractAddress: string, contractArguments: string, contractName: string, contractFile: string, chainRef: number | string) => {
export const verify = async (apikey: string, contractAddress: string, contractArguments: string, contractName: string, contractFile: string, chainRef: number | string, isProxyContract: boolean, expectedImplAddress: string) => {
const compilationResultParam = await remix.call('compilerArtefacts' as any, 'getCompilerAbstract', contractFile)
console.log('verifying.. ' + contractName)
// update apiKey and chainRef to verify contract on multiple networks
return await remix.call('etherscan' as any, 'verify', apikey, contractAddress, contractArguments, contractName, compilationResultParam, chainRef)
return await remix.call('etherscan' as any, 'verify', apikey, contractAddress, contractArguments, contractName, compilationResultParam, chainRef, isProxyContract, expectedImplAddress)
}`

export const receiptGuidScript = `
Expand Down

0 comments on commit c9617ae

Please sign in to comment.