File tree Expand file tree Collapse file tree
packages/cli/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,6 +268,34 @@ export default class DeployCommand extends Command {
268268 const dataSourcesAndTemplates = await DataSourcesExtractor . fromFilePath ( manifest ) ;
269269
270270 protocol = Protocol . fromDataSources ( dataSourcesAndTemplates ) ;
271+ for ( const ds of dataSourcesAndTemplates . dataSources ) {
272+ const address = ds . source . address ;
273+ if ( ! address ) continue ;
274+
275+ try {
276+ await client . request (
277+ 'eth_getTransactionCount' ,
278+ [ address , 'latest' ] ,
279+ ( requestError , jsonRpcError , res ) => {
280+ if ( jsonRpcError ) {
281+ const message = jsonRpcError ?. message ;
282+ deployDebugger ( 'message: %O' , message ) ;
283+ } else if ( requestError ) {
284+ deployDebugger ( 'HTTP requestError: %O' , requestError ) ;
285+ } else {
286+ if ( res === '0x0' ) {
287+ print . warning (
288+ `Warning: Contract ${ address } does not appear to exist on network ${ ds . network } . ` +
289+ `Subgraph may index no events.` ,
290+ ) ;
291+ }
292+ }
293+ } ,
294+ ) ;
295+ } catch ( e ) {
296+ print . warning ( `Could not check contract ${ address } : ${ e } ` ) ;
297+ }
298+ }
271299 } catch ( e ) {
272300 this . error ( e , { exit : 1 } ) ;
273301 }
You can’t perform that action at this time.
0 commit comments