Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/DelegateContractV0.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ contract DelegateContractV0Test is Test {
calls[0] = DelegateContractV0.Call({data: "", to: bob.addr, value: alice.addr.balance});

vm.signAndAttachDelegation(address(delegateContract), alice.privateKey);
(bool success,) = address(0).call(""); // execute a call to submit the delegation tx
require(success);

assertGt(alice.addr.code.length, 0);

Expand Down
1 change: 0 additions & 1 deletion test/DelegateContractV1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ contract DelegateContractV1Test is Test {
function test_noGuardiansInAccounts() public {
vm.signAndAttachDelegation(address(delegateContract), alice.privateKey);
vm.signAndAttachDelegation(address(delegateContract), bob.privateKey);
address(0).call(""); // by design, anyone with the signed authorizations can attach and submit the tx

assertGt(alice.addr.code.length, 0);
assertGt(bob.addr.code.length, 0);
Expand Down
2 changes: 0 additions & 2 deletions test/DelegateContractV2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ contract DelegateContractV2Test is Test {
vm.deal(alice.addr, 1 ether);

vm.signAndAttachDelegation(address(delegateContract), alice.privateKey);
vm.prank(alice.addr); // not needed to be alice herself - by design, anyone with the signed authorization can attach and submit
address(0).call("");

assertGt(alice.addr.code.length, 0);

Expand Down
43 changes: 21 additions & 22 deletions test/DelegateContractV4.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,37 @@ contract DelegateContractV4Test is Test {

/**
* The storage layout of DelegateContractV3 is as follows:
*
*
* forge inspect DelegateContractV3 storageLayout
╭-----------+--------------------------+------+--------+-------+-----------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+==============================================================================================================+
| _status | uint256 | 0 | 0 | 32 | src/DelegateContractV3.sol:DelegateContractV3 |
|-----------+--------------------------+------+--------+-------+-----------------------------------------------|
| init | bool | 1 | 0 | 1 | src/DelegateContractV3.sol:DelegateContractV3 |
|-----------+--------------------------+------+--------+-------+-----------------------------------------------|
| guardians | mapping(address => bool) | 2 | 0 | 32 | src/DelegateContractV3.sol:DelegateContractV3 |
╰-----------+--------------------------+------+--------+-------+-----------------------------------------------╯
* ╭-----------+--------------------------+------+--------+-------+-----------------------------------------------╮
* | Name | Type | Slot | Offset | Bytes | Contract |
* +==============================================================================================================+
* | _status | uint256 | 0 | 0 | 32 | src/DelegateContractV3.sol:DelegateContractV3 |
* |-----------+--------------------------+------+--------+-------+-----------------------------------------------|
* | init | bool | 1 | 0 | 1 | src/DelegateContractV3.sol:DelegateContractV3 |
* |-----------+--------------------------+------+--------+-------+-----------------------------------------------|
* | guardians | mapping(address => bool) | 2 | 0 | 32 | src/DelegateContractV3.sol:DelegateContractV3 |
* ╰-----------+--------------------------+------+--------+-------+-----------------------------------------------╯
*/

// Alice moves to V4
vm.signAndAttachDelegation(address(delegateContractV4), alice.privateKey);
address(0).call("");

/**
* The storage layout of DelegateContractV4 is as follows:

*
* forge inspect DelegateContractV4 storageLayout
╭-----------+--------------------------+------+--------+-------+-----------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+==============================================================================================================+
| _status | uint256 | 0 | 0 | 32 | src/DelegateContractV4.sol:DelegateContractV4 |
|-----------+--------------------------+------+--------+-------+-----------------------------------------------|
| paused | bool | 1 | 0 | 1 | src/DelegateContractV4.sol:DelegateContractV4 |
|-----------+--------------------------+------+--------+-------+-----------------------------------------------|
| guardians | mapping(address => bool) | 2 | 0 | 32 | src/DelegateContractV4.sol:DelegateContractV4 |
╰-----------+--------------------------+------+--------+-------+-----------------------------------------------╯
* ╭-----------+--------------------------+------+--------+-------+-----------------------------------------------╮
* | Name | Type | Slot | Offset | Bytes | Contract |
* +==============================================================================================================+
* | _status | uint256 | 0 | 0 | 32 | src/DelegateContractV4.sol:DelegateContractV4 |
* |-----------+--------------------------+------+--------+-------+-----------------------------------------------|
* | paused | bool | 1 | 0 | 1 | src/DelegateContractV4.sol:DelegateContractV4 |
* |-----------+--------------------------+------+--------+-------+-----------------------------------------------|
* | guardians | mapping(address => bool) | 2 | 0 | 32 | src/DelegateContractV4.sol:DelegateContractV4 |
* ╰-----------+--------------------------+------+--------+-------+-----------------------------------------------╯
*/

// Slot 0 continues to be ReentrancyGuard::_status
assertEq(vm.load(alice.addr, 0), bytes32(0));

Expand Down