Skip to content

Commit 266fcde

Browse files
make modifiers virtual and return result from internal _call function
1 parent 7825602 commit 266fcde

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

contracts/smart-wallet/non-upgradeable/Account.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ contract Account is
7373
}
7474

7575
/// @notice Checks whether the caller is the EntryPoint contract or the admin.
76-
modifier onlyAdminOrEntrypoint() {
76+
modifier onlyAdminOrEntrypoint() virtual {
7777
require(
7878
msg.sender == address(entryPoint()) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
7979
"Account: not admin or EntryPoint."
@@ -170,8 +170,9 @@ contract Account is
170170
address _target,
171171
uint256 value,
172172
bytes memory _calldata
173-
) internal virtual {
174-
(bool success, bytes memory result) = _target.call{ value: value }(_calldata);
173+
) internal virtual returns (bytes memory result) {
174+
bool success;
175+
(success, result) = _target.call{ value: value }(_calldata);
175176
if (!success) {
176177
assembly {
177178
revert(add(result, 32), mload(result))

contracts/smart-wallet/utils/AccountExtension.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ contract AccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Hold
5353
}
5454

5555
/// @notice Checks whether the caller is the EntryPoint contract or the admin.
56-
modifier onlyAdminOrEntrypoint() {
56+
modifier onlyAdminOrEntrypoint() virtual {
5757
require(
5858
msg.sender == entrypointContract || hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
5959
"Account: not admin or EntryPoint."
@@ -107,8 +107,9 @@ contract AccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Hold
107107
address _target,
108108
uint256 value,
109109
bytes memory _calldata
110-
) internal {
111-
(bool success, bytes memory result) = _target.call{ value: value }(_calldata);
110+
) internal virtual returns (bytes memory result) {
111+
bool success;
112+
(success, result) = _target.call{ value: value }(_calldata);
112113
if (!success) {
113114
assembly {
114115
revert(add(result, 32), mload(result))

0 commit comments

Comments
 (0)