You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Solidity compiler is incorrectly interpreting variable names in inline assembly that end with "_slot" (e.g., "from_slot") as attempts to access storage variables rather than as locally declared assembly variables. This causes compilation error 9467: "Identifier not found. Use '.slot' and '.offset' to access storage or transient storage variables."
When using variable names like "from_slot" or "to_slot" in inline assembly, the compiler mistakenly interprets these as attempts to access storage slot properties. However, when the same variables are renamed to "slot_from" or "slot_to" (moving the word "slot" to the beginning), the code compiles successfully. This suggests the compiler is incorrectly parsing variable names that end with "_slot".
Environment
Compiler version:0.8.28
Steps to Reproduce
// SPDX-License-Identifier: MITpragma solidity0.8.28;
contracttest{
function transfer(address_to, uint256_value)public{
assembly{
let ptr:=mload(0x40)
mstore(ptr,caller())
mstore(add(ptr,0x20),1)
let from_slot:=keccak256(ptr,0x40)
let from_Balance:=sload(from_slot)
}
}
-->
The text was updated successfully, but these errors were encountered:
Description
The Solidity compiler is incorrectly interpreting variable names in inline assembly that end with "_slot" (e.g., "from_slot") as attempts to access storage variables rather than as locally declared assembly variables. This causes compilation
error 9467: "Identifier not found. Use '.slot' and '.offset' to access storage or transient storage variables."
When using variable names like "from_slot" or "to_slot" in inline assembly, the compiler mistakenly interprets these as attempts to access storage slot properties. However, when the same variables are renamed to "slot_from" or "slot_to" (moving the word "slot" to the beginning), the code compiles successfully. This suggests the compiler is incorrectly parsing variable names that end with "_slot".
Environment
Steps to Reproduce
-->
The text was updated successfully, but these errors were encountered: