@@ -366,11 +366,16 @@ export class EthImpl implements Eth {
366
366
const contract = EthImpl . prune0x ( call . to ) ;
367
367
const callData = EthImpl . prune0x ( call . data ) ;
368
368
this . logger . debug ( 'Making eth_call on contract %o with gas %d and call data "%s"' , contract , gas , callData ) ;
369
- const contractCallResponse = await ( new ContractCallQuery ( )
370
- . setContractId ( ContractId . fromEvmAddress ( 0 , 0 , contract ) )
369
+
370
+ let contractCallQuery = new ContractCallQuery ( )
371
371
. setFunctionParameters ( Buffer . from ( callData , 'hex' ) )
372
- . setGas ( gas ) )
373
- . execute ( this . clientMain ) ;
372
+ . setGas ( gas ) ;
373
+ if ( contract . startsWith ( '00000000000000' ) ) {
374
+ contractCallQuery = contractCallQuery . setContractId ( ContractId . fromSolidityAddress ( contract ) ) ;
375
+ } else {
376
+ contractCallQuery = contractCallQuery . setContractId ( ContractId . fromEvmAddress ( 0 , 0 , contract ) ) ;
377
+ }
378
+ const contractCallResponse = await contractCallQuery . execute ( this . clientMain ) ;
374
379
375
380
// FIXME Is this right? Maybe so?
376
381
return '0x' + Buffer . from ( contractCallResponse . asBytes ( ) ) . toString ( 'hex' ) ;
@@ -428,6 +433,6 @@ export class EthImpl implements Eth {
428
433
* @private
429
434
*/
430
435
private static toAccountId ( ethAddress :string ) {
431
- return AccountId . fromEvmAddress ( 0 , 0 , EthImpl . prune0x ( ethAddress ) ) ;
436
+ return new AccountId ( 0 , 0 , 0 , EthImpl . prune0x ( ethAddress ) ) ;
432
437
}
433
438
}
0 commit comments