Solidity REPL
Contracts & calls

Interface call

Cast a deployed contract to an interface and call it.

Solidity 0.8.36REPL mode

Why use this example

Use this pattern to test contract composition, external calls, events, and return values inside one reproducible run. The entry isolates interface call so its input, result, and state changes stay easy to compare.

Solidity to run

interface ICounter { function value() external view returns (uint256); }
contract Counter { uint256 public value = 7; }
Counter counter = new Counter()
ICounter(address(counter)).value()

What to expect

The deployed Counter is cast to ICounter and its generated value getter returns 7.

Continue the investigation

Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.

Read about calls and logs Reproducible investigation