igneum/tools/evm-smoke/Counter.sol
igneum-labs 637504a996 Execution layer devnet v3: implementation notes, bench entry, viem smoke test
docs/design/execution-layer.md section 10: what the execution-layer branch implements
(D1 to D10, RPC, differential), the devnet rules fixed there, what is missing, the merge
plan with the finality branch. docs/bench-log.md: the 3-node simnet run with numbers.
tools/evm-smoke: viem 2.57 smoke test (fund, 50 transfers, duplicates in parallel blocks,
contract deploy and call, state roots across nodes, export for igneum-exec-diff) and the
solc build of DeveloperRegistry and the Counter test contract.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 22:05:33 +00:00

29 lines
943 B
Solidity

// SPDX-License-Identifier: ISC
pragma solidity ^0.8.20;
/// Smoke-test contract: a counter with an event, a view, a revert path and a registry call from its constructor.
interface IDeveloperRegistry { function register(address account, address payee) external; }
contract Counter {
uint256 public count;
event Incremented(address indexed by, uint256 newCount);
constructor(address registry, address payee) {
if (registry != address(0)) {
IDeveloperRegistry(registry).register(address(this), payee);
}
}
function increment(uint256 by) external returns (uint256) {
require(by > 0, "Counter: zero");
count += by;
emit Incremented(msg.sender, count);
return count;
}
function hashLoop(uint256 rounds) external pure returns (bytes32 h) {
for (uint256 i = 0; i < rounds; i++) {
h = keccak256(abi.encodePacked(h, i));
}
}
}