mirror of
https://github.com/paradigmxyz/solidity-lean.git
synced 2026-11-15 19:56:39 +00:00
An event argument is a value-use boundary: EventDecl.encodeFields? ABI-encodes the argument CONTENTS from the field types and cannot read storage. A bare state bytes/string/array/struct lowers to Expr.storage key, whose eval is the HEADER word (the .length convention), so abiEncodeValues? for a dynamic field returned none -> RevertData.typeMismatch = Panic(0). solc+EVM instead implicitly copy the storage value to memory before emitting, so the event carries the full ABI encoding. Both Stmt.emitEvent core-lowering arms (bare ident callee and qualified member callee) now rewrite their lowered args with materializeStorageValueUseCores, mirroring the other value-use boundaries (abi.encode*/keccak256/abi.decode/ tuple-RHS). Bare-storage args load their full contents (Expr.storagePath key []); every other core shape passes through untouched, so non-storage emits stay byte-identical. Witness: SolidCore/Witness/EmitStorageDynamicArray.lean. Co-authored-by: Lean Semantics Review Agent <agent@solidcore.local> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
146 lines
4.9 KiB
146 lines
4.9 KiB