MUD Framework Basics
Eve Frontier's Smart Assembly system is built on MUD — an open-source framework for building on-chain applications. Understanding MUD is the foundation for all Smart Assembly development.
Core Concepts
World
The World is the top-level container. Eve Frontier runs a single World contract that holds all game state. Every Smart Assembly, player, and resource exists within this World.
Systems
Systems are the logic layer. They're Solidity contracts that read and write state. A System is like a function — it takes input, processes it, and modifies tables.solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import { System } from "@latticexyz/world/src/System.sol";
import { Counter } from "../codegen/tables/Counter.sol";
contract IncrementSystem is System {
function increment() public returns (uint32) {
uint32 counter = Counter.get();
uint32 newValue = counter + 1;
Counter.set(newValue);
return newValue;
}
}Tables
Tables are the storage layer. They define structured on-chain data with typed columns. MUD generates Solidity libraries for reading and writing each table.solidity
// mud.config.ts — Table definition
export default mudConfig({
tables: {
Counter: {
keySchema: {},
valueSchema: {
value: "uint32",
},
},
},
});How MUD Differs From Standard Solidity
| Feature | Standard Solidity | MUD |
| Storage | Contract state variables | Typed tables |
| Logic | Contract functions | Systems |
| Upgrades | Proxy patterns | Namespace permissions |
| Events | Custom events | Auto-generated from tables |
Setting Up Your Environment
To develop Smart Assemblies locally, you'll need:
pnpm create mud)bash
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Create a new MUD project
pnpm create mud my-smart-assembly
cd my-smart-assembly
pnpm installIn the next chapter, we'll write our first system from scratch.
Sign in to track your progress.