Skip to content

Commit e65523b

Browse files
committed
Merge branch 'main' of https://github.com/safe-global/safe-contracts into test-checknsigs
2 parents 8088750 + 54baed6 commit e65523b

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

contracts/test/4337/Test4337ModuleAndHandler.sol

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
pragma solidity >=0.7.0 <0.9.0;
33
pragma abicoder v2;
44

5-
import "../../libraries/SafeStorage.sol";
6-
75
struct UserOperation {
86
address sender;
97
uint256 nonce;
@@ -19,14 +17,16 @@ struct UserOperation {
1917
}
2018

2119
interface ISafe {
20+
function enableModule(address module) external;
21+
2222
function execTransactionFromModule(address to, uint256 value, bytes memory data, uint8 operation) external returns (bool success);
2323
}
2424

2525
/// @dev A Dummy 4337 Module/Handler for testing purposes
2626
/// ⚠️ ⚠️ ⚠️ DO NOT USE IN PRODUCTION ⚠️ ⚠️ ⚠️
2727
/// The module does not perform ANY validation, it just executes validateUserOp and execTransaction
2828
/// to perform the opcode level compliance by the bundler.
29-
contract Test4337ModuleAndHandler is SafeStorage {
29+
contract Test4337ModuleAndHandler {
3030
address public immutable myAddress;
3131
address public immutable entryPoint;
3232

@@ -55,11 +55,6 @@ contract Test4337ModuleAndHandler is SafeStorage {
5555
}
5656

5757
function enableMyself() public {
58-
require(myAddress != address(this), "You need to DELEGATECALL, sir");
59-
60-
// Module cannot be added twice.
61-
require(modules[myAddress] == address(0), "GS102");
62-
modules[myAddress] = modules[SENTINEL_MODULES];
63-
modules[SENTINEL_MODULES] = myAddress;
58+
ISafe(address(this)).enableModule(myAddress);
6459
}
6560
}

docs/safe_tx_gas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This also results in the `nonce` of this transaction being used, so it is not po
2626

2727
#### Without gas refund
2828

29-
If `gasPrice` is set to `0` then the Safe contracts will **not** issue a refund after the Safe transaction exection.
29+
If `gasPrice` is set to `0` then the Safe contracts will **not** issue a refund after the Safe transaction execution.
3030

3131
Therefore it is not necessary to be as strict on the gas being passed along with the execution of the Safe transaction. As no refund is triggered the Safe will not pay for the execution costs, based on this the Safe contracts will send along all available case when no refund is used.
3232

0 commit comments

Comments
 (0)