The first thing that surprises people coming to Solana from web development is that a program has no storage of its own. All state lives in accounts. Every account has a fixed size in bytes, somebody pays rent for those bytes, and the program must decide who is allowed to change them. "Add a row to a table" becomes "derive an address, allocate exactly enough bytes, pay for them, and check the signer".
A counter and a to-do list are the smallest programs that force you through all of that, so that is what I built. counter-todo is two small Anchor programs in one crate.
Before anything else, the warning from the README: not audited, devnet / localnet only. This is a learning project. Do not deploy it to mainnet or use it with real funds.
What it does
Counter. One PDA per user, derived from ["counter", authority] , with increment and decrement using checked arithmetic. An overflow or underflow is an error, not a silent wrap-around.
To-do list.…