@@ -6,7 +6,7 @@ import { filesystem, prompt, system } from 'gluegun';
66import  {  Args ,  Command ,  Flags ,  ux  }  from  '@oclif/core' ; 
77import  { 
88  loadAbiFromBlockScout , 
9-   loadAbiFromEtherscan , 
9+   loadAbiFromSourcify , 
1010  loadContractNameForAddress , 
1111  loadStartBlockForContract , 
1212}  from  '../command-helpers/abi' ; 
@@ -292,7 +292,7 @@ export default class InitCommand extends Command {
292292            if  ( network  ===  'poa-core' )  { 
293293              abi  =  await  loadAbiFromBlockScout ( ABI ,  network ,  fromContract ) ; 
294294            }  else  { 
295-               abi  =  await  loadAbiFromEtherscan ( ABI ,  network ,  fromContract ) ; 
295+               abi  =  await  loadAbiFromSourcify ( ABI ,  network ,  fromContract ) ; 
296296            } 
297297          }  catch  ( e )  { 
298298            process . exitCode  =  1 ; 
@@ -544,7 +544,7 @@ async function processInitForm(
544544    } 
545545  |  undefined 
546546>  { 
547-   let  abiFromEtherscan : EthereumABI  |  undefined  =  undefined ; 
547+   let  abiFromSourcify : EthereumABI  |  undefined  =  undefined ; 
548548
549549  try  { 
550550    const  {  protocol }  =  await  prompt . ask < {  protocol : ProtocolName  } > ( { 
@@ -705,17 +705,11 @@ async function processInitForm(
705705
706706          const  ABI  =  protocolInstance . getABI ( ) ; 
707707
708-           // Try loading the ABI from Etherscan , if none was provided 
708+           // Try loading the ABI from Sourcify , if none was provided 
709709          if  ( protocolInstance . hasABIs ( )  &&  ! initAbi )  { 
710-             if  ( network  ===  'poa-core' )  { 
711-               abiFromEtherscan  =  await  retryWithPrompt ( ( )  => 
712-                 loadAbiFromBlockScout ( ABI ,  network ,  value ) , 
713-               ) ; 
714-             }  else  { 
715-               abiFromEtherscan  =  await  retryWithPrompt ( ( )  => 
716-                 loadAbiFromEtherscan ( ABI ,  network ,  value ) , 
717-               ) ; 
718-             } 
710+             abiFromSourcify  =  await  retryWithPrompt ( ( )  => 
711+               loadAbiFromSourcify ( ABI ,  network ,  value ) , 
712+             ) ; 
719713          } 
720714          // If startBlock is not set, try to load it. 
721715          if  ( ! initStartBlock )  { 
@@ -765,11 +759,11 @@ async function processInitForm(
765759        skip : ( )  => 
766760          ! protocolInstance . hasABIs ( )  || 
767761          initFromExample  !==  undefined  || 
768-           abiFromEtherscan  !==  undefined  || 
762+           abiFromSourcify  !==  undefined  || 
769763          isSubstreams  || 
770764          ! ! initAbiPath , 
771765        validate : async  ( value : string )  =>  { 
772-           if  ( initFromExample  ||  abiFromEtherscan  ||  ! protocolInstance . hasABIs ( ) )  { 
766+           if  ( initFromExample  ||  abiFromSourcify  ||  ! protocolInstance . hasABIs ( ) )  { 
773767            return  true ; 
774768          } 
775769
@@ -791,7 +785,7 @@ async function processInitForm(
791785          } 
792786        } , 
793787        result : async  ( value : string )  =>  { 
794-           if  ( initFromExample  ||  abiFromEtherscan  ||  ! protocolInstance . hasABIs ( ) )  { 
788+           if  ( initFromExample  ||  abiFromSourcify  ||  ! protocolInstance . hasABIs ( ) )  { 
795789            return  null ; 
796790          } 
797791          const  ABI  =  protocolInstance . getABI ( ) ; 
@@ -853,7 +847,7 @@ async function processInitForm(
853847    ] ) ; 
854848
855849    return  { 
856-       abi : abiFromEtherscan  ||  abiFromFile , 
850+       abi : abiFromSourcify  ||  abiFromFile , 
857851      protocolInstance, 
858852      subgraphName, 
859853      directory, 
0 commit comments