Contracts and the compliance gate
This page is for people writing contracts on a chain produced by the platform. It does not teach syntax; it tells you what syntax cannot: which rules block your transaction, at which layer, and why the layer you can see is not the only one.
The fundamental difference from an ordinary public chain: here, most of the rules are not in your contract. They sit beneath it, inside the consensus mechanism — the full mechanism is in The 9Chain platform, under Compliance at the protocol layer. What that means for whoever writes the code:
| What you do | Which layer sees it | What to expect |
|---|---|---|
| Submit a transaction | Pre-processing (layer 1) | An unapproved wallet is rejected before the virtual machine runs — there is nothing for your contract to catch |
| Move assets | Treasury module (layer 2) | The fuel token is non-transferable; do not design mechanics that depend on moving it |
| Deploy a contract | EVM hook (layer 3) | Deployment permission is a role, not a default. Child-contract creation patterns are inspected too |
| Receive assets from an outside network | Interchain middleware (layer 4) | An unapproved recipient makes the packet return an error and refund — funds do not stick, but your flow must survive that branch |
| Ask "is this address permitted?" | Precompile (layer 5) | This is the layer you can call from inside a contract, and it is what compensates for layer 1's blind spot |
Figure 26 — Layer one's blind spot, and how a contract covers it itself.
The blind spot you must know about, because this document does not hide it: pre-processing cannot see contract-to-contract calls inside the virtual machine. An already-permitted contract can call another one without layer 1 ever knowing. Layer 5 exists precisely because of that — so if your contract forwards value to an address supplied by a user, asking the precompile is your job, not the protocol's.
The general reading rule, more durable than any table: each layer blocks exactly what it can see. Do not count layers and feel safe; ask what each layer sees.
A customer chain and the shared network are two different places. Your contract runs on the customer chain; the fuel token there has no market price and is not LOVE9. The three token layers, and the easiest confusion between them, are in LOVE9 economics.
In short: on this chain, a carefully written contract is not enough to be compliant, and a carelessly written one is not enough to escape compliance — that is exactly what "compliance at the protocol layer" means.