mirror of
https://github.com/paradigmxyz/solidity-lean.git
synced 2026-11-15 19:56:39 +00:00
The top-level deploy/acceptance entry (CheckedProgram.constructContractFrom and constructContractWithContext, plus their Option variants) fetched the contract and constructed it with no creatability check, so deploying an `abstract` contract, an `interface`, or a `library` was wrongly ACCEPTED. solc 0.8.35 emits an empty binary for all three and rejects `new A()` with "Cannot instantiate an abstract contract" / "Invalid use of a library name". Apply the same guard the `new`-expression site already uses (TypeCheck.requireCreatableContractDecl: kind == contract && !abstract) at the deploy entry, keeping the deploy site and the new-site consistent. Concrete contracts (including one implementing an abstract base) still deploy unchanged. Witness: SolidCore/Witness/DeployAbstract.lean (imported from SolidCore.lean) pins that abstract/interface/library programs typecheck but their deploy is rejected, while concrete contracts still deploy. Over-accept -> witness-only, no Forge lane (solc emits no AST/bytecode for a rejected deploy). (cherry picked from commit e9f5a8258ed7feae732b84047ffc4e99d80d55e1)
181 lines
6.6 KiB
181 lines
6.6 KiB