blockchain.lucas.zip

Subject: a community treasury

Governance. Rules that no administrator can override. · Updated 26 August 2026

A group of people pool money for a shared purpose — a club, an open-source project, a student association, a co-working space — and need to decide, together, how to spend it. Today, someone holds the bank account and the vote is advisory. Build the version where the vote is the spending: money leaves the treasury only when a proposal passes under rules that were public before it was made, and nobody has a key to the account that bypasses this.

Why the chain is load-bearing

The treasury is a contract. It holds funds. It has no owner. The only way funds leave is the execution of a proposal that has passed a vote, and anyone can trigger that execution once the conditions are met. Members can read the rules — who can vote, how much a vote weighs, what quorum is required, how long voting lasts, how long the delay before execution is — and those rules apply to every proposal, including the ones to change the rules. A treasurer who disagrees with the outcome has no override, because there is no treasurer.

What is still trusted: whoever decides who is a member. Make that explicit. A membership controlled by a single admin makes the admin the treasurer by another name; a membership controlled by the members through the same proposal mechanism closes the loop, and has its own failure modes — a majority can vote to expel a minority. Your roles table has to pick a position and defend it.

Actors

RoleDoes
MemberHolds voting power, creates proposals, votes
AnyoneSends funds to the treasury, executes passed proposals after the delay
Proposal targetThe address that receives funds or gets called when a proposal executes
DeployerSets the initial rules and members, and then — ideally — has no further power

Voting power can be one-member-one-vote (a membership NFT or an allowlist) or token-weighted (an ERC-20 where balance is weight). Both are fine. Both have different attacks. Choose one and say why.

Core features

A proposal's lifecycle. Every transition is decided by the contract.

A proposal's lifecycle. Every transition is decided by the contract.

Extensions

Traps

What the demo should show

Three browser profiles as members, on Base Sepolia. One creates a proposal to pay a fourth address. Two vote in favour, one against; the tally updates on screen and on the explorer. The voting period ends — you will have deployed with a short period for the demo, and say so — the proposal is queued, the delay passes, and a non-member profile executes it. The recipient’s balance changes. Then the failures: a non-member tries to vote and is reverted; a member tries to vote twice and is reverted; someone tries to execute before the delay and is reverted, each with a readable reason in the UI. Finally, the rules change: show a proposal that changed the quorum, already executed, and the new quorum in effect.