Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit ac22b6e

Browse files
committed
Remove stateRoot check for Account.isEmpty() to make emptiness check EIP-161 compliant
1 parent c1787c1 commit ac22b6e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/account.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,12 @@ export class Account {
108108
}
109109

110110
/**
111-
* Returns a `Boolean` determining if the account is empty.
112-
* For more details about account emptiness see [EIP-161](https://eips.ethereum.org/EIPS/eip-161).
113-
* Note: The stateRoot is also checked to be empty since in Frontier it was possible to create a contract with no code where nonce remained 0 but some values were written to storage in the constructor (thus stateRoot is not KECCAK256_RLP).
111+
* Returns a `Boolean` determining if the account is empty complying to the definition of
112+
* account emptiness in [EIP-161](https://eips.ethereum.org/EIPS/eip-161):
113+
* "An account is considered empty when it has no code and zero nonce and zero balance."
114114
*/
115115
isEmpty(): boolean {
116-
return (
117-
this.balance.isZero() &&
118-
this.nonce.isZero() &&
119-
this.stateRoot.equals(KECCAK256_RLP) &&
120-
this.codeHash.equals(KECCAK256_NULL)
121-
)
116+
return this.balance.isZero() && this.nonce.isZero() && this.codeHash.equals(KECCAK256_NULL)
122117
}
123118
}
124119

0 commit comments

Comments
 (0)