-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from anton-rs/anna/refactor-adds
README/docs & deprecate huff 🥺
- Loading branch information
Showing
8 changed files
with
25 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,35 @@ | ||
# `eip-3074-foundry` | ||
# EIP-3074 Invokers | ||
|
||
This repository contains patched versions of [`foundry`][foundry] & [the `solidity` compiler][solc], integrated with patches to [`revm`][revm] / [`ethers-rs`][ethers-rs], that support | ||
the [EIP-3074][eip-3074] opcodes (`AUTH` & `AUTHCALL`). | ||
Generalized [EIP-3074](https://eips.ethereum.org/EIPS/eip-3074) Invokers. | ||
|
||
## Patches | ||
- `BaseInvoker` - Invoker template for building arbitrary Invoker logic. | ||
- `BatchInvoker` - Invoker with batch transaction support. | ||
|
||
> **NOTE**: | ||
> These are *patches*, don't spin up a production system with these and expect security. | ||
> [!WARNING] | ||
> WIP. Very experimental, not audited, use with caution. | ||
- `revm` patch: https://github.com/clabby/revm/pull/1 | ||
- See review comments. Incomplete atm, but functionally works as expected. | ||
- `ethers-rs` patch: https://github.com/clabby/ethers-rs/tree/cl/call-type-3074 | ||
- `foundry` patch: https://github.com/clabby/foundry/tree/cl/eip-3074 | ||
- `solc` patch: https://github.com/clabby/solidity/tree/cl/eip-3074 | ||
- `reth` patch: https://github.com/paradigmxyz/reth/tree/cl/eip-3074 | ||
## Patches | ||
|
||
## Usage | ||
This repository contains patches (h/t @clabby) of the following repositories to support EIP-3074 opcodes: | ||
|
||
**Building `forge`** | ||
- [`revm`](https://github.com/jxom/revm/tree/jxom/eip-3074) | ||
- [`foundry`](https://github.com/jxom/foundry/tree/jxom/eip-3074) | ||
- [`solc`](https://github.com/clabby/solidity/tree/cl/eip-3074) | ||
|
||
First, build the patched version of `foundry` (this will take a while): | ||
## Installation | ||
|
||
```sh | ||
git submodule update --init --recursive && \ | ||
make build-forge-patch | ||
``` | ||
git submodule update --init --recursive && make | ||
``` | ||
|
||
This command will place the patched `forge` binary in `bin/forge`. | ||
|
||
**Building `solc`** | ||
|
||
Next, build the patched version of `solc` (this will also take a while): | ||
## Building Contracts | ||
|
||
``` | ||
make build-solc-patch | ||
make build | ||
``` | ||
|
||
This patch supports the following semantics: | ||
```solidity | ||
function example() public { | ||
// AUTHCALL by `address` member access | ||
address(0xbeefbabe).authcall(hex"..."); | ||
assembly { | ||
// AUTH | ||
let authSuccess := auth(<authorized>, <args_offset_mem>, <args_length>) | ||
## Running Tests | ||
|
||
// AUTHCALL | ||
let authCallSuccess := authcall( | ||
<gas>, | ||
<to_addr>, | ||
<value>, // NOTE: This is currently sent from the Invoker contract, NOT the `authorized` account. | ||
<valueExt>, // Must always be `0` per the current 3074 spec, reserved for future use. | ||
<args_offset_mem>, | ||
<args_length>, | ||
<ret_offset_mem>, | ||
<ret_length> | ||
) | ||
} | ||
} | ||
``` | ||
|
||
**Installing `huffc`** | ||
|
||
The [`huff`][huff-rs] version of the `EIP-3074` invoker requires `huffc` to be installed. | ||
|
||
```sh | ||
make install-huff | ||
make test | ||
``` | ||
|
||
**Running Examples** | ||
|
||
To run the examples, interact with the patched `forge` binary as normal. There is a special override for the `Prague` hardfork within the `foundry.toml` which | ||
will enable the `AUTH` & `AUTHCALL` opcodes, and the `foundry.toml` specifies the patched `solc` binary as the compiler. | ||
|
||
[foundry]: https://github.com/foundry-rs/foundry | ||
[revm]: https://github.com/bluealloy/revm | ||
[ethers-rs]: https://github.com/gakonst/ethers-rs | ||
[eip-3074]: https://eips.ethereum.org/EIPS/eip-3074 | ||
[solc]: https://github.com/ethereum/solidity | ||
[huff-rs]: https://github.com/huff-language/huff-rs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.