Conversation
8d95f2d to
e96988e
Compare
e96988e to
7b36611
Compare
|
@cburgdorf There are some codegen issues that need to be worked through to make this work still, but I think it's in a good state for merging. |
There was a problem hiding this comment.
Pull request overview
This PR implements "contract lowering" - a major feature that adds ABI encoding/decoding infrastructure and an effect system to support contract-based smart contract development in Fe. The changes enable:
- Solidity-compatible ABI encoding/decoding via new
std::abiandcore::abimodules - Effect system with effect references (
EffectRef,EffectRefMut) and provider kinds (Memory, Storage, Calldata) - Contract lowering that desugars high-level
contractitems into runtime dispatch functions - Shorthand
withexpressions that infer effect keys from bound values - Updated
MsgVarianttrait to support generic ABI specifications
Reviewed changes
Copilot reviewed 135 out of 135 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| library/std/src/lib.fe | Exports new abi module |
| library/std/src/evm/memory_input.fe | Implements ByteInput trait for memory-backed byte streams |
| library/std/src/evm/calldata.fe | Implements ByteInput trait for calldata |
| library/std/src/evm.fe | Exports calldata and memory_input modules |
| library/std/src/abi/sol.fe | Implements Solidity ABI encoder/decoder |
| library/std/src/abi.fe | Exports sol ABI implementation |
| library/core/src/storage_map.fe | Adds StorageKey impl for 2-tuples |
| library/core/src/ptr.fe | Adds STRIDE constant to Ptr trait and updates documentation |
| library/core/src/num.fe | Adds __u256_as_usize and __u256_as_isize intrinsics |
| library/core/src/message.fe | Updates MsgVariant trait to be generic over ABI and adds Args type |
| library/core/src/lib.fe | Exports new abi and effect_ref modules, adds new intrinsics |
| library/core/src/intrinsic.fe | Adds intrinsics for ABI/effect system support |
| library/core/src/effect_ref.fe | Defines effect reference traits and pointer types |
| library/core/src/abi.fe | Implements core ABI traits and type-level encoding/decoding |
| crates/mir/src/monomorphize.rs | Updates monomorphization to track effect provider kinds |
| crates/mir/src/lower/*.rs | Adds effect system support to MIR lowering |
| crates/mir/src/ir.rs | Adds EffectProviderKind and updates value origins |
| crates/mir/src/hash.rs | Updates hashing to include effect kinds |
| crates/mir/src/core_lib.rs | Adds effect pointer helper types |
| crates/hir/src/core/lower/*.rs | Adds contract and message lowering |
| crates/hir/src/core/semantic/mod.rs | Adds contract effect system support |
| crates/hir/src/core/span/*.rs | Adds contract lowering span tracking |
| crates/hir/src/core/hir_def/*.rs | Updates HIR definitions for effects |
| crates/parser/src/parser/*.rs | Implements shorthand with expression parsing |
| crates/parser/test_files/syntax_node/exprs/with.* | Tests for shorthand with syntax |
| test_files/** | Numerous test files for contract lowering and effects |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| /// Best-effort slot size computation for types in storage. | ||
| fn ty_storage_slots(&self, ty: TyId<'db>) -> Option<u64> { |
There was a problem hiding this comment.
I think this method should handle enum and probably tuple types as well (even though tuples will be rewritten as structs so I'm not entirely sure if it is needed here)
| expression: output | ||
| input_file: tests/fixtures/effect_ptr_domains.fe | ||
| --- | ||
| function bump(foo) { |
There was a problem hiding this comment.
I believe this should be named bump_eff_stor .
cburgdorf
left a comment
There was a problem hiding this comment.
Looks great. I left two comments inline.
No description provided.