This repository contains patched versions of foundry & the solidity compiler, integrated with patches to revm / ethers-rs, that support
the EIP-3074 opcodes (AUTH & AUTHCALL).
NOTE: These are patches, don't spin up a production system with these and expect security.
revmpatch: clabby/revm#1- See review comments. Incomplete atm, but functionally works as expected.
ethers-rspatch: https://github.com/clabby/ethers-rs/tree/cl/call-type-3074foundrypatch: https://github.com/clabby/foundry/tree/cl/eip-3074solcpatch: https://github.com/clabby/solidity/tree/cl/eip-3074rethpatch: https://github.com/paradigmxyz/reth/tree/cl/eip-3074
Building forge
First, build the patched version of foundry (this will take a while):
git submodule update --init --recursive && \
make build-forge-patchThis 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):
make build-solc-patch
This patch supports the following semantics:
function example() public {
// AUTHCALL by `address` member access
address(0xbeefbabe).authcall(hex"...");
assembly {
// AUTH
let authSuccess := auth(<authorized>, <args_offset_mem>, <args_length>)
// 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 version of the EIP-3074 invoker requires huffc to be installed.
make install-huffRunning 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.