Skip to content

Commit 35d8091

Browse files
authored
Merge pull request #217 from Uniswap/dev-oz
dev-oz audit diff
2 parents a78617e + 6866de3 commit 35d8091

File tree

91 files changed

+2927
-932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2927
-932
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Minimal Delegation
1+
# Calibur
22

33
a minimal, non-upgradeable implementation contract that can be set on an EIP-7702 delegation txn
44

@@ -37,22 +37,22 @@ forge test
3737

3838
```mermaid
3939
classDiagram
40-
MinimalDelegation --|> ERC7821
41-
MinimalDelegation --|> ERC1271
42-
MinimalDelegation --|> EIP712
43-
MinimalDelegation --|> ERC4337Account
44-
MinimalDelegation --|> Receiver
45-
MinimalDelegation --|> KeyManagement
46-
MinimalDelegation --|> NonceManager
47-
MinimalDelegation --|> ERC7914
48-
MinimalDelegation --|> ERC7201
49-
MinimalDelegation --|> ERC7739
50-
MinimalDelegation --|> Multicall
40+
Calibur --|> ERC7821
41+
Calibur --|> ERC1271
42+
Calibur --|> EIP712
43+
Calibur --|> ERC4337Account
44+
Calibur --|> Receiver
45+
Calibur --|> KeyManagement
46+
Calibur --|> NonceManager
47+
Calibur --|> ERC7914
48+
Calibur --|> ERC7201
49+
Calibur --|> ERC7739
50+
Calibur --|> Multicall
5151
5252
EIP712 --|> IERC5267
5353
ERC4337Account --|> IAccount
5454
55-
class MinimalDelegation {
55+
class Calibur {
5656
+execute(BatchedCall batchedCall)
5757
+execute(SignedBatchedCall signedBatchedCall, bytes wrappedSignature)
5858
+execute(bytes32 mode, bytes executionData)
@@ -68,12 +68,12 @@ classDiagram
6868

6969
```mermaid
7070
sequenceDiagram
71-
participant SignerAccount as EOA (delegated to MinimalDelegation)
72-
participant Account as MinimalDelegation
71+
participant SignerAccount as EOA (delegated to Calibur)
72+
participant Account as Calibur
7373
participant Hook
7474
participant Target
7575
76-
Note over SignerAccount, Account: EOA is delegated to MinimalDelegation via EIP-7702
76+
Note over SignerAccount, Account: EOA is delegated to Calibur via EIP-7702
7777
SignerAccount->>Account: execute(BatchedCall batchedCall)
7878
Account->>Account: Check if sender keyHash is owner or admin
7979
Account->>Account: _processBatch(batchedCall, keyHash)
@@ -106,7 +106,7 @@ sequenceDiagram
106106
sequenceDiagram
107107
actor Signer
108108
participant Relayer
109-
participant Account as MinimalDelegation
109+
participant Account as Calibur
110110
participant Hook
111111
participant Target
112112
@@ -164,12 +164,12 @@ sequenceDiagram
164164

165165
```mermaid
166166
sequenceDiagram
167-
participant SignerAccount as EOA (delegated to MinimalDelegation)
168-
participant Account as MinimalDelegation
167+
participant SignerAccount as EOA (delegated to Calibur)
168+
participant Account as Calibur
169169
participant Hook
170170
participant Target
171171
172-
Note over SignerAccount, Account: EOA is delegated to MinimalDelegation via EIP-7702
172+
Note over SignerAccount, Account: EOA is delegated to Calibur via EIP-7702
173173
SignerAccount->>Account: execute(bytes32 mode, bytes executionData)
174174
Account->>Account: mode.isBatchedCall()
175175
opt If !mode.isBatchedCall()
@@ -214,7 +214,7 @@ sequenceDiagram
214214
actor Signer
215215
participant Bundler
216216
participant EntryPoint
217-
participant Account as MinimalDelegation
217+
participant Account as Calibur
218218
participant Hook
219219
participant Target
220220
@@ -274,7 +274,7 @@ sequenceDiagram
274274
```mermaid
275275
sequenceDiagram
276276
participant VerifyingContract
277-
participant Account as MinimalDelegation
277+
participant Account as Calibur
278278
participant Hook
279279
280280
VerifyingContract->>+Account: isValidSignature(bytes32 digest, bytes wrappedSignature)
@@ -314,7 +314,7 @@ sequenceDiagram
314314
```mermaid
315315
sequenceDiagram
316316
participant Caller
317-
participant Account as MinimalDelegation
317+
participant Account as Calibur
318318
participant Spender
319319
320320
Caller->>+Account: approveNative(spender, amount)

foundry.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ remappings = [
1414
additional_compiler_profiles = [{ name = "via_ir", optimizer_runs = 10000, via_ir = true }]
1515

1616
compilation_restrictions = [
17-
{ paths = "src/MinimalDelegationEntry.sol", via_ir = true },
18-
{ paths = "src/MinimalDelegation.sol", via_ir = true }
17+
{ paths = "src/CaliburEntry.sol", via_ir = true },
18+
{ paths = "src/Calibur.sol", via_ir = true },
19+
{ paths = "test/ERC7739.t.sol", via_ir = true }
1920
]
2021

2122
[profile.default.invariant]

script/DeployCaliburEntry.s.sol

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity ^0.8.23;
3+
4+
import "forge-std/console2.sol";
5+
import "forge-std/Script.sol";
6+
import {CaliburEntry} from "../src/CaliburEntry.sol";
7+
8+
contract DeployCaliburEntry is Script {
9+
function setUp() public {}
10+
11+
function run() public returns (CaliburEntry entry) {
12+
vm.startBroadcast();
13+
14+
entry = new CaliburEntry{salt: bytes32(0)}();
15+
console2.log("CaliburEntry", address(entry));
16+
17+
vm.stopBroadcast();
18+
}
19+
}

script/DeployMinimalDelegationEntry.s.sol

Lines changed: 0 additions & 19 deletions
This file was deleted.

snapshots/Calibur4337Test.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"hanldeOps_BATCHED_CALL_singleCall_P256": "208852",
3+
"hanldeOps_BATCHED_CALL_singleCall_eoaSigner": "183119"
4+
}

snapshots/CaliburExecuteTest.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"execute_empty": "23124",
3+
"execute_invalidMode_reverts": "22940",
4+
"execute_native_singleCall": "59809",
5+
"execute_singleCall": "59522",
6+
"execute_twoCalls": "95374",
7+
"execute_withSignature_P256_singleCall": "122462",
8+
"execute_withSignature_executor_singleCall": "96979",
9+
"execute_withSignature_singleCall": "96703",
10+
"execute_withSignature_singleCall_native": "97511",
11+
"execute_withSignature_twoCalls": "134205",
12+
"multicall": "184914"
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"isValidSignature_P256_wrappedSignature___typedDataSign": "42450",
3+
"isValidSignature_P256_wrappedSignature___typedDataSign_withHook": "48459",
4+
"isValidSignature_P256_wrappedSignature__nestedPersonalSign": "35044",
5+
"isValidSignature_WebAuthnP256_wrappedSignature___typedDataSign": "48785",
6+
"isValidSignature_WebAuthnP256_wrappedSignature__nestedPersonalSign": "41347",
7+
"isValidSignature_rootKey_compactSignature": "4670",
8+
"isValidSignature_rootKey_rawSignature": "4647",
9+
"isValidSignature_rootKey_wrappedSignature___typedDataSign": "17535",
10+
"isValidSignature_rootKey_wrappedSignature__nestedPersonalSign": "10129",
11+
"isValidSignature_secp256k1_wrappedSignature___typedDataSign": "38344",
12+
"isValidSignature_secp256k1_wrappedSignature__nestedPersonalSign": "12938"
13+
}

snapshots/CaliburTest.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"caliburEntry bytecode size": "24504",
3+
"entrypoint": "2786",
4+
"register": "184872",
5+
"revoke": "54555",
6+
"validateUserOp_invalidSignature": "33250",
7+
"validateUserOp_missingAccountFunds": "63882",
8+
"validateUserOp_no_missingAccountFunds": "33244",
9+
"validateUserOp_withHook_invalidSignature": "317995",
10+
"validateUserOp_withHook_validSignature": "65930"
11+
}

snapshots/ERC7914Test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"approveNative": "45970",
33
"approveNativeTransient": "24010",
4-
"transferFromNative": "31950"
4+
"transferFromNative": "33350"
55
}

snapshots/MinimalDelegation4337Test.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)