mirror of
https://github.com/paradigmxyz/solidity-lean.git
synced 2026-11-15 19:56:39 +00:00
`emit I.E()` (an interface-declared event, here emitted from inside a
library function called by the contract) type-checks via
`TypeContext.contractEventSig?`, which resolves an event declared in ANY
named type (library / interface / non-inherited contract), and lowers to
the bare event name `"E"`. But the executable event table
(`ContractDecl.toCoreFromOrders?`) only added LIBRARY events to the runtime
`eventDecls` (`extraLibraryEvents`), so an INTERFACE-declared event was
absent: `Runtime.emitEvent`'s `context.eventDecl?` lookup returned `none`
and dead-ended in `RevertData.typeMismatch` = `Panic(0)`, where solc+EVM
succeed and emit the event with topic0 = keccak256("E()").
Broaden the extra-event collection and the collision-detection set from
`allContracts.filter isLibrary` to `isLibrary d || isInterface d` (both the
regular `toCoreFromOrders?` table and the constructor-body collision pass),
mirroring what the typecheck already accepts, so the interface event's
topic0 is soundly registered under its bare name.
Adds witness SolidCore.Witness.EmitInterfaceEventViaLibrary pinning that
`g()` succeeds and emits exactly one `E()` log with topic0 keccak256("E()")
and empty data. Full `lake build` (all proofs + all witnesses) green.
Co-authored-by: Lean Semantics Review Agent <agent@solidcore.local>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
138 lines
4.8 KiB
138 lines
4.8 KiB