From 9e2c54d3c04b744067dda9b345cff38905724de8 Mon Sep 17 00:00:00 2001 From: classicalliu Date: Tue, 15 Nov 2022 13:08:05 +0800 Subject: [PATCH] fix: Return 0x when eth_getCode with zero address --- packages/api-server/src/methods/modules/eth.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/api-server/src/methods/modules/eth.ts b/packages/api-server/src/methods/modules/eth.ts index 6e4cdd1e..e9d11f4b 100644 --- a/packages/api-server/src/methods/modules/eth.ts +++ b/packages/api-server/src/methods/modules/eth.ts @@ -421,6 +421,11 @@ export class Eth { const address = args[0]; const blockParameter = args[1]; + + if (address === ZERO_ETH_ADDRESS) { + return defaultResult; + } + const blockNumber: GodwokenBlockParameter = await this.parseBlockParameter(blockParameter); const accountId: number | undefined = await ethAddressToAccountId(