Skip to content

Commit 1b3cea7

Browse files
committed
Fixup Natspec (#966)
Some more natspec fixes that I found when doing the audit review.
1 parent f753ce2 commit 1b3cea7

File tree

4 files changed

+45
-45
lines changed

4 files changed

+45
-45
lines changed

certora/applyHarness.patch

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
diff -druN Safe.sol Safe.sol
2-
--- Safe.sol 2025-07-09 12:21:55.831312348 +0000
3-
+++ Safe.sol 2025-07-09 12:45:47.086078483 +0000
2+
--- Safe.sol 2025-07-10 09:31:37.930159103 +0000
3+
+++ Safe.sol 2025-07-10 09:52:54.506909237 +0000
44
@@ -97,22 +97,25 @@
55
constructor() {
66
// By setting the threshold it is not possible to call setup anymore, so we create a Safe with 0 owners and threshold 1.
77
// This is an unusable Safe, perfect for the singleton
88
- threshold = 1;
99
+ // threshold = 1; MUNGED: remove and add to constructor of the harness
1010
}
11-
11+
1212
/**
1313
* @inheritdoc ISafe
1414
*/
@@ -31,17 +31,17 @@ diff -druN Safe.sol Safe.sol
3131
// Emit the setup event optimistically. This ensures that changes such as `addOwner` and `changeThreshold` that are part
3232
// of the `to.delegatecall(data)` that happen in the `setupModules` call emit events in order relative to the setup
3333
// event, making it easier for off-chain indexers to reliably reconstruct the Safe configuration.
34-
@@ -416,9 +418,6 @@
35-
return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, chainId, this));
34+
@@ -428,9 +431,6 @@
35+
/* solhint-enable no-inline-assembly */
3636
}
37-
37+
3838
- /**
3939
- * @inheritdoc ISafe
4040
- */
4141
function getTransactionHash(
4242
address to,
4343
uint256 value,
44-
@@ -430,7 +429,9 @@
44+
@@ -442,7 +442,9 @@
4545
address gasToken,
4646
address refundReceiver,
4747
uint256 _nonce
@@ -50,9 +50,9 @@ diff -druN Safe.sol Safe.sol
5050
+ // MUNGED: The function was made internal to enable CVL summaries.
5151
+
5252
bytes32 domainHash = domainSeparator();
53-
53+
5454
// We opted for using assembly code here, because the way Solidity compiler we use (0.7.6) allocates memory is
55-
@@ -486,7 +487,8 @@
55+
@@ -498,7 +500,8 @@
5656
// Store the domain separator.
5757
mstore(add(ptr, 32), domainHash)
5858
// Calculate the hash.
@@ -63,8 +63,8 @@ diff -druN Safe.sol Safe.sol
6363
/* solhint-enable no-inline-assembly */
6464
}
6565
diff -druN base/Executor.sol base/Executor.sol
66-
--- base/Executor.sol 2025-04-16 10:56:42.055440517 +0200
67-
+++ base/Executor.sol 2025-04-16 13:11:00.387097140 +0200
66+
--- base/Executor.sol 2025-07-10 09:25:20.305689268 +0000
67+
+++ base/Executor.sol 2025-07-10 09:52:54.507466555 +0000
6868
@@ -27,12 +27,8 @@
6969
uint256 txGas
7070
) internal returns (bool success) {
@@ -81,44 +81,44 @@ diff -druN base/Executor.sol base/Executor.sol
8181
/* solhint-disable no-inline-assembly */
8282
/// @solidity memory-safe-assembly
8383
diff -druN base/FallbackManager.sol base/FallbackManager.sol
84-
--- base/FallbackManager.sol 2025-04-16 10:56:42.056440525 +0200
85-
+++ base/FallbackManager.sol 2025-04-16 13:11:04.608469287 +0200
86-
@@ -68,2 +68,2 @@
84+
--- base/FallbackManager.sol 2025-07-10 09:32:30.275228552 +0000
85+
+++ base/FallbackManager.sol 2025-07-10 09:57:32.580263318 +0000
86+
@@ -61,7 +61,8 @@
8787
// at memory offset 0x40 intact, not going beyond the scratch space, etc).
8888
// See: <https://docs.soliditylang.org/en/latest/assembly.html#memory-safety>
89-
89+
9090
- let handler := sload(FALLBACK_HANDLER_STORAGE_SLOT)
9191
+ // let handler := sload(FALLBACK_HANDLER_STORAGE_SLOT)
9292
+ let handler := and(0xffffffffffffffffffffffffffffffffffffffff, sload(FALLBACK_HANDLER_STORAGE_SLOT))
93-
93+
9494
if iszero(handler) {
9595
return(0, 0)
9696
diff -druN interfaces/ISafe.sol interfaces/ISafe.sol
97-
--- interfaces/ISafe.sol 2025-04-16 10:56:42.087440777 +0200
98-
+++ interfaces/ISafe.sol 2025-04-16 13:11:08.572549089 +0200
99-
@@ -145,7 +145,7 @@
97+
--- interfaces/ISafe.sol 2025-07-10 09:46:05.750311622 +0000
98+
+++ interfaces/ISafe.sol 2025-07-10 11:11:58.751118272 +0000
99+
@@ -149,7 +149,7 @@
100100
*/
101101
function domainSeparator() external view returns (bytes32);
102-
102+
103103
- /**
104104
+ /*
105105
* @notice Returns transaction hash to be signed by owners.
106-
* @param to Destination address.
107-
* @param value Ether value.
108-
@@ -158,7 +158,6 @@
109-
* @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
110-
* @param _nonce Transaction nonce.
111-
* @return Transaction hash.
106+
* @param to Destination address of Safe transaction.
107+
* @param value Native token value of the Safe transaction.
108+
@@ -162,7 +162,6 @@
109+
* @param refundReceiver Address of receiver of the gas payment (or 0 for `tx.origin`).
110+
* @param _nonce Safe transaction nonce.
111+
* @return Safe transaction hash.
112112
- */
113113
function getTransactionHash(
114114
address to,
115115
uint256 value,
116-
@@ -171,3 +170,5 @@
116+
@@ -175,6 +174,8 @@
117117
address refundReceiver,
118118
uint256 _nonce
119119
) external view returns (bytes32);
120120
+ */
121121
+ // MUNGED: The function was made internal to enable CVL summaries.
122-
122+
123123
/**
124124
* @notice Returns a descriptive version of the Safe contract.

contracts/base/ModuleManager.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ abstract contract BaseModuleGuard is IModuleGuard {
5858
* @title Module Manager
5959
* @notice A contract managing Safe modules.
6060
* @dev Modules are extensions with unlimited access to a Safe that can be added to a Safe by its owners.
61-
⚠️⚠️⚠️ WARNING: Modules are a security risk since they can execute arbitrary transactions,
62-
so only trusted and audited modules should be added to a Safe. A malicious module can
63-
completely take over a Safe. ⚠️⚠️⚠️
61+
* ⚠️⚠️⚠️ WARNING: Modules are a security risk since they can execute arbitrary transactions,
62+
* so only trusted and audited modules should be added to a Safe. A malicious module can
63+
* completely take over a Safe. ⚠️⚠️⚠️
6464
* @author Stefan George - @Georgi87
6565
* @author Richard Meissner - @rmeissner
6666
*/

contracts/interfaces/IModuleManager.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {Enum} from "../libraries/Enum.sol";
66
* @title Module Manager Interface
77
* @notice Interface for managing Safe modules.
88
* @dev Modules are extensions with unlimited access to a Safe that can be added to a Safe by its owners.
9-
⚠️⚠️⚠️ WARNING: Modules are a security risk since they can execute arbitrary transactions,
10-
so only trusted and audited modules should be added to a Safe. A malicious module can
11-
completely takeover a Safe. ⚠️⚠️⚠️
9+
* ⚠️⚠️⚠️ WARNING: Modules are a security risk since they can execute arbitrary transactions,
10+
* so only trusted and audited modules should be added to a Safe. A malicious module can
11+
* completely takeover a Safe. ⚠️⚠️⚠️
1212
* @author @safe-global/safe-protocol
1313
*/
1414
interface IModuleManager {

contracts/interfaces/ISafe.sol

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,17 @@ interface ISafe is INativeCurrencyPaymentFallback, IModuleManager, IGuardManager
151151

152152
/**
153153
* @notice Returns transaction hash to be signed by owners.
154-
* @param to Destination address.
155-
* @param value Ether value.
156-
* @param data Data payload.
157-
* @param operation Operation type.
158-
* @param safeTxGas Gas that should be used for the safe transaction.
159-
* @param baseGas Gas costs for data used to trigger the safe transaction.
160-
* @param gasPrice Maximum gas price that should be used for this transaction.
161-
* @param gasToken Token address (or 0 if ETH) that is used for the payment.
162-
* @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
163-
* @param _nonce Transaction nonce.
164-
* @return Transaction hash.
154+
* @param to Destination address of Safe transaction.
155+
* @param value Native token value of the Safe transaction.
156+
* @param data Data payload of the Safe transaction.
157+
* @param operation Operation type of the Safe transaction: 0 for `CALL` and 1 for `DELEGATECALL`.
158+
* @param safeTxGas Gas that should be used for the Safe transaction.
159+
* @param baseGas Base gas costs that are independent of the transaction execution (e.g. base transaction fee, signature check, payment of the refund).
160+
* @param gasPrice Gas price that should be used for the payment calculation.
161+
* @param gasToken Token address (or 0 for the native token) that is used for the payment.
162+
* @param refundReceiver Address of receiver of the gas payment (or 0 for `tx.origin`).
163+
* @param _nonce Safe transaction nonce.
164+
* @return Safe transaction hash.
165165
*/
166166
function getTransactionHash(
167167
address to,

0 commit comments

Comments
 (0)