Skip to content

Commit

Permalink
chore: isolate contracts in single directory (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored Oct 10, 2024
1 parent 787564f commit 56639cb
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "chapter1/contracts/lib/forge-std"]
path = chapter1/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
3 changes: 0 additions & 3 deletions chapter1/.gitmodules

This file was deleted.

9 changes: 9 additions & 0 deletions chapter1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Chapter 1

## Structure

- [contracts](./contracts): Solidity smart contracts powering the examples
- [bls-multisig](./bls-multisig): Multisig based on BLS signatures verified through precompiles from EIP-2537
- [eof](./eof): Introduction to EOF
- [simple-7702](./simple-7702): Demo of full EIP-7702 flow with cast and forge
- [delegate-p256](./delegate-p256): Account controlled by a P256 key through EIP-7702 and EIP-7212
1 change: 0 additions & 1 deletion chapter1/.gitignore → chapter1/contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
cache/
out/
*.pem
1 change: 1 addition & 0 deletions chapter1/contracts/lib/forge-std
Submodule forge-std added at 8f24d6
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.23;

import {Test, console} from "forge-std/Test.sol";
import {Secp256r1} from "../contracts/Secp256r1.sol";
import {Secp256r1} from "../src/Secp256r1.sol";

/// @notice A simple test demonstrating P256 signature verification.
contract BLSTest is Test {
Expand Down
8 changes: 5 additions & 3 deletions chapter1/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[profile.default]
src = "contracts"
out = "out"
libs = ["lib"]
src = "contracts/src"
test = "contracts/test"
out = "contracts/out"
cache_path = "contracts/cache"
libs = ["contracts/lib"]

eof = true
odyssey = true
2 changes: 1 addition & 1 deletion chapter1/simple-7702/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export BOB_PK="0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365
- Deploy a contract which delegates calls from the user and executes on their behalf. The contract itself is very basic, it will delegate the call and emit an `Executed` event for debugging purposes:

```bash
forge create contracts/SimpleDelegateContract.sol:SimpleDelegateContract --private-key $BOB_PK
forge create SimpleDelegateContract --private-key $BOB_PK

export SIMPLE_DELEGATE_ADDRESS="<enter-contract-address>"
```
Expand Down

0 comments on commit 56639cb

Please sign in to comment.