Skip to content

Commit 68eee81

Browse files
MiloTruckMiloTruck
andauthored
Update EIP-7702 behavior for sign-delegation cheatcode (foundry-rs#1474)
Co-authored-by: MiloTruck <[email protected]>
1 parent 7b7f254 commit 68eee81

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cheatcodes/sign-delegation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To use the cheatcodes you need to set your `evm_version` to at least the `prague
4949
evm_version = "prague"
5050
```
5151

52-
EIP-7702 sets the account code of an Externally Owned Account (EOA) temporarily during a transaction. This enables EOAs to behave like smart contracts for the duration of a transaction without permanently modifying their code.
52+
EIP-7702 sets the account code of an Externally Owned Account (EOA) through a delegation transaction, enabling EOAs to behave like smart contracts.
5353

5454
The `signDelegation` cheatcode generates a signed authorization for an implementation contract to be delegated to, ensuring that only authorized implementations can execute transactions on behalf of the authority account. The signature includes the authority account's nonce to prevent replay attacks.
5555

@@ -151,11 +151,11 @@ contract SignDelegationTest is Test {
151151
vm.broadcast(BOB_PK);
152152
vm.attachDelegation(signedDelegation);
153153
154-
// Verify that Alice's account now temporarily behaves as a smart contract.
154+
// Verify that Alice's account now behaves as a smart contract.
155155
bytes memory code = address(ALICE_ADDRESS).code;
156156
require(code.length > 0, "no code written to Alice");
157157
158-
// As Bob, execute the transaction via Alice's temporarily assigned contract.
158+
// As Bob, execute the transaction via Alice's assigned contract.
159159
SimpleDelegateContract(ALICE_ADDRESS).execute(calls);
160160
161161
// Verify Bob successfully received 100 tokens.
@@ -171,11 +171,11 @@ contract SignDelegationTest is Test {
171171
// Alice signs and attaches the delegation in one step (eliminating the need for separate signing).
172172
vm.signAndAttachDelegation(address(implementation), ALICE_PK);
173173
174-
// Verify that Alice's account now temporarily behaves as a smart contract.
174+
// Verify that Alice's account now behaves as a smart contract.
175175
bytes memory code = address(ALICE_ADDRESS).code;
176176
require(code.length > 0, "no code written to Alice");
177177
178-
// As Bob, execute the transaction via Alice's temporarily assigned contract.
178+
// As Bob, execute the transaction via Alice's assigned contract.
179179
vm.broadcast(BOB_PK);
180180
SimpleDelegateContract(ALICE_ADDRESS).execute(calls);
181181
@@ -234,7 +234,7 @@ contract SignDelegationScript is Script {
234234
vm.broadcast(BOB_PK);
235235
vm.attachDelegation(signedDelegation);
236236
237-
// As Bob, execute the transaction via Alice's temporarily assigned contract.
237+
// As Bob, execute the transaction via Alice's assigned contract.
238238
SimpleDelegateContract(ALICE_ADDRESS).execute(calls);
239239
240240
// Verify balance

0 commit comments

Comments
 (0)