Back to explore
Season 1 · DeFi & Open Finance

Counter Contract

This is a simple counter contract that blocks over underflows

Stage 1, ReviewDeFi & Open Finance

by iopnbrennan · submitted May 27, 2026

Community votes

0

Voting opens when this submission reaches the Top 10 stage.

Overall score

/ 100

Weighted average across the 5 judging criteria.

Description

01/03

What the builder said.

Written by the team, rendered as the markdown they typed in the submission wizard.

Counter

A minimal on-chain counter deployed on OPN Chain. It stores a single unsigned integer in contract state and exposes functions to increment, decrement, and reset it. Every change emits an event so the current value can be tracked off-chain without polling state.

What it does

  • Increment raises the stored count by one
  • Decrement lowers it by one, with an underflow guard so it never drops below zero
  • Reset sets the count back to zero (owner only)
  • getCount returns the current value as a read-only call

Why it matters

Counter is intentionally small. It is a clean reference for the full build-to-verify flow on OPN Chain: write the contract, deploy it, verify it on the explorer, and surface its state in a frontend. It is a useful starting point for anyone learning the chain's tooling before tackling something larger.

How it works

State lives in a single uint256 variable. Write functions update that variable and emit a CountChanged event carrying the new value and the caller address. Read access is free through the getCount view function. Reset is gated behind an owner check so the count cannot be wiped by anyone.

Roadmap

02/03

What ships next.

The builder's own next-quarter plan. Use it to gauge follow-through and ambition.

Roadmap

Done

  • Core contract written and deployed on OPN Chain
  • Increment, decrement, and reset functions implemented
  • Underflow guard added so the count cannot go negative
  • CountChanged event emitted on every state change
  • Contract verified on the OPN explorer

Next

  • Add a per-address counter so each wallet tracks its own value
  • Add a configurable step size instead of fixing increments at one
  • Cover edge cases with a full test suite (underflow, owner-only reset, event payloads)

Later

  • Small frontend that reads the live count and lets a connected wallet increment it
  • Optional pausable mode for the owner to freeze writes
  • Gas profiling pass to confirm the read and write paths stay cheap

On-chain proof

03/03

1 contract on OPN Chain.

The chain itself confirmed every deployment is valid, signed by the builder's wallet, and inside the season's window.

  • 01counterPrimary

    0x3609018DD7b41E5667b3A294759815564Fca1472

    tx 0x2bbd02e8e13c857fc2957d331711e5942789e5df664d13b6d85c287b666c572e

    deployed May 25, 2026 · block 8655116