Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function "tstore" not found #14821

Closed
filmakarov opened this issue Jan 29, 2024 · 2 comments
Closed

Function "tstore" not found #14821

filmakarov opened this issue Jan 29, 2024 · 2 comments
Labels

Comments

@filmakarov
Copy link

Description

tstore/tload seem to be not found in the latest solc in macOs

Environment

  • Compiler version: 0.8.24
  • Target EVM version (as per compiler settings): Cancun
  • Framework/IDE: Foundry / Hardhat
  • Operating system: Mac OS

Steps to Reproduce

mkdir try-tstore && cd try-tstore
forge init

Open Counter.sol

    function setNumber(uint256 newNumber) public {
        assembly {
            tstore(0, newNumber)
        }
    }

forge build

results in

[⠊] Compiling...
[⠔] Compiling 24 files with 0.8.24
[⠒] Solc 0.8.24 finished in 393.75ms
Error: 
Compiler run failed:
Error (4619): Function "tstore" not found.
  --> src/Counter.sol:10:13:
   |
10 |             tstore(0, newNumber)
   |             ^^^^^^

tried to download solc from here and build using forge build --use bin/solc
Still doesn't work

Using Hardhat (on other contracts) results in

npx hardhat compile
Solidity 0.8.24 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.

Learn more at https://hardhat.org/hardhat-runner/docs/reference/solidity-support

DeclarationError: Function "tstore" not found.
   --> contracts/smart-account/SmartAccount.sol:143:13:
    |
143 |             tstore(0, validationModule)
    |             ^^^^^^

Error HH600: Compilation failed
@filmakarov
Copy link
Author

Same for Remix
Screenshot 2024-01-29 at 14 30 20

@filmakarov
Copy link
Author

Closing this. Had to explicitly specify EVM version.
For those who will be looking for the solution:

Hardhat:

settings: {
          evmVersion: "cancun",
}

Foundry:

solc_version = "0.8.24"
evm_version = "cancun"

solves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant