Skip to content

Commit f273256

Browse files
authored
chore(signDelegation): improve legibility of signatures (#1405)
improve legibility
1 parent 9b76f84 commit f273256

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

src/cheatcodes/sign-delegation.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,40 @@
33
### Signature
44

55
```solidity
6-
/// Holds a signed EIP-7702 authorization for an authority account to delegate to an implementation.
7-
struct SignedDelegation {
8-
// The y-parity of the recovered secp256k1 signature (0 or 1).
9-
uint8 v;
10-
// First 32 bytes of the signature.
11-
bytes32 r;
12-
// Second 32 bytes of the signature.
13-
bytes32 s;
14-
// The current nonce of the authority account at signing time.
15-
// Used to ensure signature can't be replayed after account nonce changes.
16-
uint64 nonce;
17-
// Address of the contract implementation that will be delegated to.
18-
// Gets encoded into delegation code: 0xef0100 || implementation.
19-
address implementation;
20-
}
6+
/// Holds a signed EIP-7702 authorization for an authority account to delegate to an implementation.
7+
struct SignedDelegation {
8+
// The y-parity of the recovered secp256k1 signature (0 or 1).
9+
uint8 v;
10+
// First 32 bytes of the signature.
11+
bytes32 r;
12+
// Second 32 bytes of the signature.
13+
bytes32 s;
14+
// The current nonce of the authority account at signing time.
15+
// Used to ensure signature can't be replayed after account nonce changes.
16+
uint64 nonce;
17+
// Address of the contract implementation that will be delegated to.
18+
// Gets encoded into delegation code: 0xef0100 || implementation.
19+
address implementation;
20+
}
21+
```
2122

22-
/// Sign an EIP-7702 authorization for delegation.
23-
function signDelegation(address implementation, uint256 privateKey)
24-
external
25-
returns (SignedDelegation memory signedDelegation);
23+
```solidity
24+
/// Sign an EIP-7702 authorization for delegation.
25+
function signDelegation(address implementation, uint256 privateKey)
26+
external
27+
returns (SignedDelegation memory signedDelegation);
28+
```
2629

27-
/// Designate the next call as an EIP-7702 transaction.
28-
function attachDelegation(SignedDelegation calldata signedDelegation) external;
30+
```solidity
31+
/// Designate the next call as an EIP-7702 transaction.
32+
function attachDelegation(SignedDelegation calldata signedDelegation) external;
33+
```
2934

30-
/// Sign an EIP-7702 authorization and designate the next call as an EIP-7702 transaction.
31-
function signAndAttachDelegation(address implementation, uint256 privateKey)
32-
external
33-
returns (SignedDelegation memory signedDelegation);
35+
```solidity
36+
/// Sign an EIP-7702 authorization and designate the next call as an EIP-7702 transaction.
37+
function signAndAttachDelegation(address implementation, uint256 privateKey)
38+
external
39+
returns (SignedDelegation memory signedDelegation);
3440
```
3541

3642
### Description

0 commit comments

Comments
 (0)