Address
- Address
- 0xb99ef086c2095e2e8f52b18f21e75eab05dd4252
- Label
- Counter demo contract
- Note
- MidxCounter: Read/Write contract demo; anyone may increment
- Type
- contract
- Balance
- 0 tMIDX (0 wei)
- Nonce
- 1
- Code size
- 826 bytes
Contract
Source code ✓ verified
- Contract
- MidxCounter
- Compiler
- solc 0.8.36+commit.8a079791
- Optimizer
- enabled, 200 runs
- Verified
- 2026-11-28 15:19:07 UTC
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @title MidxCounter
/// @notice Demo target for the explorer's Read / Write contract tabs: anyone can
/// bump the counter, every bump emits an event, and the immutable exercises
/// the verifier's immutable-reference handling.
contract MidxCounter {
uint256 public count;
address public lastCaller;
uint256 public immutable deployedAt;
event Incremented(address indexed by, uint256 newCount, uint256 added);
constructor() {
deployedAt = block.number;
}
function increment() external {
add(1);
}
function add(uint256 n) public {
require(n > 0 && n <= 1000, "add: n must be 1..1000");
count += n;
lastCaller = msg.sender;
emit Incremented(msg.sender, count, n);
}
function greet(string calldata name) external pure returns (string memory) {
return string.concat("hello, ", name);
}
}
ABI
[
{
"type": "constructor",
"inputs": [],
"stateMutability": "nonpayable"
},
{
"name": "Incremented",
"type": "event",
"inputs": [
{
"name": "by",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newCount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "added",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "add",
"type": "function",
"inputs": [
{
"name": "n",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "count",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "deployedAt",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "greet",
"type": "function",
"inputs": [
{
"name": "name",
"type": "string",
"internalType": "string"
}
],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "pure"
},
{
"name": "increment",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "lastCaller",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
}
]Read contract (4)
greet(string name) → string
Write contract (2)
no wallet connected; a browser wallet signs and broadcasts, the explorer only encodes the call
Events (1 total)
Internal transactions (latest 10)
Transactions
None found in the last 250 blocks.
Temporary placeholder infrastructure for chain registration.
Not a production network - state may be reset without notice.