betterERC
All posts
DesignApril 15, 20266 min read

Installed, not active

A token with the fee module installed and its rate at zero still declares a fee. That is the useful answer rather than a sloppy one, and the reason is what makes the word cacheable.

A flag is set when the extension is installed, not when it happens to be switched on. It looks like over-reporting until you ask what the alternative would cost.

If the word tracked live configuration it would change whenever an authority moved a parameter. Every integrator holding a cached copy would be holding a stale answer with nothing to tell them so, and the only safe response would be to re-read it before every interaction — a per-call read, to save a per-call read.

Tracking installation instead makes the word fixed for the life of the deployment. That is the property, and it is the only one that makes caching safe rather than merely convenient.

The asymmetry that settles it

A false positive costs an integrator one defensive branch. A false negative costs them funds.

The counterpart discipline

A permanent, coarse answer is only useful if the precise answers are honest about being precise. So the fee ceiling reports zero while the rate is zero, rather than the number it would become if the rate were raised. That keeps it a tight bound on the current fee instead of a figure that is merely never exceeded, and a tight bound is the only kind worth reading.

The division is the whole point. One word that never moves and can be cached forever, and beside it a set of numbers that do move, emit events when they do, and are documented as things to watch. What a specification owes an integrator is not fewer moving parts. It is a clear line between the parts that move and the parts that cannot.

The same logic settles the exemption case. Exempt a pool and the fee on that pool's transfers really is zero, yet the token keeps declaring it, because the authority can revoke the exemption whenever it likes. An exemption is configuration. It is not a change of nature.