Skip to content

Commit

Permalink
7702
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Sep 30, 2024
1 parent 90e8991 commit ec755b1
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ It will pull the docker image on a first run and should print the version of the

After that, make sure that your forge version is up to data (run `foundryup` if needed), and then you should be able to use all usual forge commands —— all contracts will get compiled for EOF.

## EIP-7702 support

### cast support

Foundry has built-in support for [EIP-7702] transactions. `cast send` accepts a `--auth` argument which can accept either an address or an encoded authorization which can be obtained through `cast wallet sign-auth`

Examples:
```shell
# sign delegation via delegator-pk and broadcast via sender-pk
cast send $(cast az) --private-key <sender-pk> --auth $(cast wallet sign-auth <address> --private-key <delegator-pk>)
```

### forge support

To test EIP-7702 features in forge tests, you can use `vm.etch` cheatcode:
```solidity
import {Test} from "forge-std/Test.sol";
import {P256Delegation} from "../src/P256Delegation.sol";
contract DelegationTest is Test {
function test() public {
P256Delegation delegation = new P256Delegation();
// this sets ALICE's EOA code to the deployed contract code
vm.etch(ALICE, address(delegation).code);
}
}
```

## BLS library

Functions and data structures to allow calling each of the BLS precompiles defined in [EIP-2537]
Expand Down Expand Up @@ -116,4 +144,5 @@ Note that we are using a different private key here, this transaction can be sen
[Apple Secure Enclave]: https://support.apple.com/guide/security/secure-enclave-sec59b0b31ff/web
[WebAuthn]: https://webauthn.io/
[Python]: https://www.python.org/
[delegation designation]: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md#delegation-designation
[delegation designation]: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md#delegation-designation
[EIP-7702]: https://eips.ethereum.org/EIPS/eip-7702

0 comments on commit ec755b1

Please sign in to comment.