Radar · Solidity · Archive · Week 19 · May 5 – 11, 2025
SMTChecker no longer treats loop conditions as constant-condition verification targets
Nice to knowtooling
- What changed
- The SMTChecker now ignores loop conditions when looking for constant-condition verification targets, preventing incorrect reports and internal compiler errors.
- Production impact
- The source does not say.
- Try it
- Run the SMTChecker on a contract with a loop that has a non-constant condition and observe that no false error is reported.
- Source
- github.com/argotorg/solidity/releases/tag/v0.8.30
Understand it, then run it
Solidity’s SMTChecker is a tool that checks smart contracts for potential bugs. In earlier releases it sometimes treated the condition of a loop as a “constant‑condition” check, which could lead to false warnings or even crashes in the compiler. With Solidity 0.8.30 this behaviour was removed. Now the checker ignores loop conditions when looking for constant‑condition problems, so you no longer see spurious errors for loops that use a fixed condition.
Run it now
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.37;
// This contract demonstrates that SMTChecker no longer treats loop conditions
// as constant-condition verification targets. The loop condition is a
// constant (true), but the compiler accepts it without reporting an error.
contract LoopExample {
uint public counter;
constructor() {
// A loop with a constant condition that will execute exactly 5 times.
for (uint i = 0; i < 5; i++) {
counter += i;
}
}
}
Tests
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.37;
import "./main.sol";
contract LoopExampleTest {
LoopExample example;
constructor() {
example = new LoopExample();
}
function test_counterValue() public {
require(example.counter() == 10, "Counter should be 10");
}
}
The test report when we ran it on Solidity 0.8.37 (solc)
1 of 1 tests passed.
- test_counterValue28,459 gas
- LoopExampleTest: 657 bytes of bytecode, deployed for 230,315 gas
solc 0.8.37 · prague
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed