forge-std icon indicating copy to clipboard operation
forge-std copied to clipboard

forge-std/Test.sol incompatible with solidity version 0.6.12

Open sdajklfw389 opened this issue 3 months ago • 1 comments

I do see a similar error was fixed in here : https://github.com/foundry-rs/forge-std/pull/217

My forge-std is the latest

My forge version:

forge Version: 1.4.4-stable
Commit SHA: 05794498bf47257b144e2e2789a1d5bf8566be0e
Build Timestamp: 2025-11-03T23:44:21.031788094Z (1762213461)
Build Profile: maxperf

My forge-std version:

{
  "name": "forge-std",
  "version": "1.11.0",
  "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
  "homepage": "https://book.getfoundry.sh/forge/forge-std",
  "bugs": "https://github.com/foundry-rs/forge-std/issues",
  "license": "(Apache-2.0 OR MIT)",
  "author": "Contributors to Forge Standard Library",
  "files": [
    "src/**/*"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/foundry-rs/forge-std.git"
  }
}

My computer OS:

Ubuntu 22.04

Project here:

https://github.com/sdajklfw389/ForgeStdError/blob/master/test/TestError.t.sol

My code is only one test file without code, just inherit test from Test.sol.

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

import {Test} from "forge-std/Test.sol";

contract TestError is Test {
    function testExample() public {
    }
}

and when i run forge test it has this error:

[⠊] Compiling...
[⠑] Compiling 20 files with Solc 0.6.12
[⠘] Solc 0.6.12 finished in 645.45ms
Error: Compiler run failed:
Error: Unimplemented feature (/solidity/libsolidity/codegen/CompilerUtils.cpp:420):Encoding type "struct StdInvariant.FuzzInterface memory[] memory" not yet implemented.

But forge-std/Test.sol has these lines:

// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.9.0;

pragma experimental ABIEncoderV2;

sdajklfw389 avatar Nov 07 '25 07:11 sdajklfw389

Hi @sdajklfw389 thanks for raising this, I am able to reproduce the issue and I'll look for a workaround

zerosnacks avatar Nov 24 '25 12:11 zerosnacks