EmpoorioChain's primary way to add functionality is not a contract; it is a pallet — a Rust module compiled into the runtime. This is the path the repository defines.
Before the first build
./scripts/restaurar_sdk_vendorizado.sh # restores 380 MB of vendored Frontier + polkadot-sdk patches
cargo check -p empoorio-runtime
Skip the script and the build dies on a missing Cargo.toml under patches/. Budget disk: target/ reaches ~50 GB; use CARGO_INCREMENTAL=0.
Where things live
| Area | Path |
|---|---|
| Runtime | runtime/ |
| Node | node/ |
| Pallet suites | crates/emp-core-suite/, emp-defi-suite/, emp-gaming-suite/, emp-ai-engine/, emp-commerce-suite/, emp-governance-suite/, emp-compliance-suite/ |
| Rust SDK / CLI | sdk/rust/empoorio-sdk/, sdk/rust/emp-cli/ |
The ten steps
- Create the crate in the right suite.
- Add it to the workspace
Cargo.toml. - Implement
lib.rs:Config, storage (bounded — every item), events, errors, calls (with explicitcall_index), weights, genesis config if needed. mock.rsandtests.rs.benchmarking.rsfor every call that writes storage, loops over collections or scales with input.- Wire into
runtime/Cargo.toml. impl pallet_x::Config for Runtime.- Add to every applicable
construct_runtime!block (EVM and non-EVM variants) with a new, stable index. - SDK/CLI support if developer-facing.
- Update
PALLET_REFERENCE.md,EIP_COVERAGE.mdif it maps to an Ethereum standard,ARCHITECTURE.mdif it changes the architecture, and the tokenomics rationale if it touches fees, deposits or staking.
Rules that are not optional
- Indexes never move. Pallet indexes and call indexes are addresses in every encoded transaction and event. Reordering breaks decoding of history and storage. Explicit
call_indexexists so you can reorder source freely. - Bounded storage. Enforced since runtime 215; check for
#[pallet::unbounded]as well aswithout_storage_info. - Wire it or retire it. A dispatchable ships with a real, exercised circuit and a mutation test, or it does not ship.
post_upgradeverifies your migration, not the world.- Every account your pallet pays into must exist — the DEX treasury did not, and no swap settled for months.
Testing standard
Success path; permission failure; invalid parameter; storage mutation; emitted event; fee/deposit accounting; bounded limits; replay/nonce protection where signatures are involved.
cargo test -p pallet-example
cargo test -p pallet-example --features runtime-benchmarks
cargo check -p empoorio-runtime
Then try-runtime against a testnet snapshot before any migration reaches a proposal.
Shipping
A runtime upgrade under the policy: class, timelock, manifest with hashes and metadata diff, rollback plan. Runtimes 208–220 are the worked examples.
From Rust to here
If you know Rust, the unfamiliar parts are FRAME's macros and the discipline above. The familiar part is that the compiler is your friend — which is why the ecosystem prefers generated types over dynamic lookups wherever a name can be wrong.
Based on DEVELOPER_GUIDE.md, GETTING_STARTED.md, the runtime 215/217 rules and RUNTIME_UPGRADE_POLICY.md.


