Skip to content

Commit ac92bb4

Browse files
committed
up
1 parent 608e3cd commit ac92bb4

File tree

4 files changed

+1
-19
lines changed

4 files changed

+1
-19
lines changed

contracts/access/manager/AuthorityUtils.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
pragma solidity ^0.8.20;
55

66
import {IAuthority} from "./IAuthority.sol";
7-
import {Memory} from "../../utils/Memory.sol";
87

98
library AuthorityUtils {
109
/**
@@ -18,7 +17,6 @@ library AuthorityUtils {
1817
address target,
1918
bytes4 selector
2019
) internal view returns (bool immediate, uint32 delay) {
21-
Memory.Pointer ptr = Memory.getFreePointer();
2220
bytes memory data = abi.encodeCall(IAuthority.canCall, (caller, target, selector));
2321

2422
assembly ("memory-safe") {
@@ -34,7 +32,5 @@ library AuthorityUtils {
3432
delay := mul(delay, iszero(shr(32, delay)))
3533
}
3634
}
37-
38-
Memory.setFreePointer(ptr);
3935
}
4036
}

contracts/token/ERC20/extensions/ERC4626.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {IERC20, IERC20Metadata, ERC20} from "../ERC20.sol";
77
import {SafeERC20} from "../utils/SafeERC20.sol";
88
import {IERC4626} from "../../../interfaces/IERC4626.sol";
99
import {Math} from "../../../utils/math/Math.sol";
10-
import {Memory} from "../../../utils/Memory.sol";
1110

1211
/**
1312
* @dev Implementation of the ERC-4626 "Tokenized Vault Standard" as defined in
@@ -85,7 +84,6 @@ abstract contract ERC4626 is ERC20, IERC4626 {
8584
* @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.
8685
*/
8786
function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool ok, uint8 assetDecimals) {
88-
Memory.Pointer ptr = Memory.getFreePointer();
8987
(bool success, bytes memory encodedDecimals) = address(asset_).staticcall(
9088
abi.encodeCall(IERC20Metadata.decimals, ())
9189
);
@@ -95,7 +93,6 @@ abstract contract ERC4626 is ERC20, IERC4626 {
9593
return (true, uint8(returnedDecimals));
9694
}
9795
}
98-
Memory.setFreePointer(ptr);
9996
return (false, 0);
10097
}
10198

contracts/token/ERC20/utils/SafeERC20.sol

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pragma solidity ^0.8.20;
55

66
import {IERC20} from "../IERC20.sol";
77
import {IERC1363} from "../../../interfaces/IERC1363.sol";
8-
import {Memory} from "../../../utils/Memory.sol";
98

109
/**
1110
* @title SafeERC20
@@ -32,19 +31,15 @@ library SafeERC20 {
3231
* non-reverting calls are assumed to be successful.
3332
*/
3433
function safeTransfer(IERC20 token, address to, uint256 value) internal {
35-
Memory.Pointer ptr = Memory.getFreePointer();
3634
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
37-
Memory.setFreePointer(ptr);
3835
}
3936

4037
/**
4138
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
4239
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
4340
*/
4441
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
45-
Memory.Pointer ptr = Memory.getFreePointer();
4642
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
47-
Memory.setFreePointer(ptr);
4843
}
4944

5045
/**
@@ -104,14 +99,12 @@ library SafeERC20 {
10499
* set here.
105100
*/
106101
function forceApprove(IERC20 token, address spender, uint256 value) internal {
107-
Memory.Pointer ptr = Memory.getFreePointer();
108102
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
109103

110104
if (!_callOptionalReturnBool(token, approvalCall)) {
111105
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
112106
_callOptionalReturn(token, approvalCall);
113107
}
114-
Memory.setFreePointer(ptr);
115108
}
116109

117110
/**

contracts/utils/cryptography/SignatureChecker.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pragma solidity ^0.8.24;
55

66
import {ECDSA} from "./ECDSA.sol";
77
import {IERC1271} from "../../interfaces/IERC1271.sol";
8-
import {Memory} from "../Memory.sol";
98
import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol";
109
import {Bytes} from "../../utils/Bytes.sol";
1110

@@ -51,15 +50,12 @@ library SignatureChecker {
5150
bytes32 hash,
5251
bytes memory signature
5352
) internal view returns (bool) {
54-
Memory.Pointer ptr = Memory.getFreePointer();
5553
(bool success, bytes memory result) = signer.staticcall(
5654
abi.encodeCall(IERC1271.isValidSignature, (hash, signature))
5755
);
58-
bool valid = (success &&
56+
return (success &&
5957
result.length >= 32 &&
6058
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
61-
Memory.setFreePointer(ptr);
62-
return valid;
6359
}
6460

6561
/**

0 commit comments

Comments
 (0)