Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #570 from godwokenrises/get-code-zero-address
Browse files Browse the repository at this point in the history
fix: Return 0x when eth_getCode with zero address
  • Loading branch information
RetricSu authored Nov 16, 2022
2 parents 8c1c75d + b3fbb57 commit 02d08fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/api-server/src/methods/modules/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,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(
Expand Down

0 comments on commit 02d08fe

Please sign in to comment.