|
3 | 3 | ### Signature |
4 | 4 |
|
5 | 5 | ```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 | +``` |
21 | 22 |
|
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 | +``` |
26 | 29 |
|
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 | +``` |
29 | 34 |
|
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); |
34 | 40 | ``` |
35 | 41 |
|
36 | 42 | ### Description |
|
0 commit comments