From 06f2ab39d48d9c74c88303c51f92fcb63ee72a64 Mon Sep 17 00:00:00 2001 From: cairo Date: Mon, 9 Sep 2024 15:45:21 +0200 Subject: [PATCH] Tag memory safe assembly blocks --- contracts/governance/Governor.sol | 2 +- contracts/metatx/ERC2771Forwarder.sol | 2 +- contracts/utils/introspection/ERC165Checker.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index be2cf79d263..453f2029088 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -769,7 +769,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72 // Extract what would be the `#proposer=0x` marker beginning the suffix bytes12 marker; - assembly { + assembly ("memory-safe") { // - Start of the string contents in memory = description + 32 // - First character of the marker = len - 52 // - Length of "#proposer=0x0000000000000000000000000000000000000000" = 52 diff --git a/contracts/metatx/ERC2771Forwarder.sol b/contracts/metatx/ERC2771Forwarder.sol index b5e943d920c..b66e7894b2c 100644 --- a/contracts/metatx/ERC2771Forwarder.sol +++ b/contracts/metatx/ERC2771Forwarder.sol @@ -286,7 +286,7 @@ contract ERC2771Forwarder is EIP712, Nonces { uint256 gasLeft; - assembly { + assembly ("memory-safe") { success := call(reqGas, to, value, add(data, 0x20), mload(data), 0, 0) gasLeft := gas() } diff --git a/contracts/utils/introspection/ERC165Checker.sol b/contracts/utils/introspection/ERC165Checker.sol index da729caf815..a0ac72c21bf 100644 --- a/contracts/utils/introspection/ERC165Checker.sol +++ b/contracts/utils/introspection/ERC165Checker.sol @@ -113,7 +113,7 @@ library ERC165Checker { bool success; uint256 returnSize; uint256 returnValue; - assembly { + assembly ("memory-safe") { success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) returnSize := returndatasize() returnValue := mload(0x00)