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

Difference between encoding empty user states and abi.encode(0) #654

@dmaretskyi

Description

@dmaretskyi

Encoding a StateLeaf struct with all zeros produces a different output then abi.encode(0). We've noticed that abi.encode(0) is used to represent a vacant state leaf.

An example where this differences may be exploited is a TRANSFER transaction where receiver is an empty state leaf.

The disputer would have to provide a witness for the receiver state leaf in:

keccak256(proof.state.encode()),

But that's impossible to do since the witness leaf value is passed as a struct and it would be impossible to pass a struct which would have the same leaf hash as abi.encode(0).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions