@metalyth/storage-manager
v0.0.4
Published
This package contains the smart contracts for the Storage System, built using Foundry and MUD (Mutable Universe Design).
Readme
Contracts Package
This package contains the smart contracts for the Storage System, built using Foundry and MUD (Mutable Universe Design).
Features
- Foundry: A fast, portable and modular toolkit for Ethereum application development.
- MUD: A framework for building decentralized, autonomous worlds.
- Solidity: The primary language for writing smart contracts on Ethereum.
Getting Started
Prerequisites
Installation
pnpm installRunning Tests
forge testProject Structure
src/
├── codegen/ # Autogenerated code from MUD
├── systems/
│ ├── StorageSystem/
│ │ └── Constants.sol # Constants for the Storage System
│ │ └── StorageSystem.sol # Main system contract governing the usage of storage in the game
│ │ └── Errors.sol # Outlines errors for the Storage System
│ ├── StoreProxySystem/
│ │ └── StoreProxySystem.sol # System contract acting as an immutable proxy on top of item inventory
│ └── StringPacker/
│ └── StringPacker.sol # System contract that packs and unpacks strings for use in creating buckets.
script/ # Deployment scripts
test/ # Test contracts
mud.config.ts # MUD configuration file
foundry.toml # Foundry configuration fileConfiguration
Environment Variables
The following environment variables are used to configure the contracts:
WORLD_ADDRESS: The address of the MUD World contract.CHAIN_ID: The ID of the Ethereum chain.PRIVATE_KEY: The private key of the deployer account.RPC_URL: The URL of the Ethereum RPC endpoint.
These variables can be set in the .env, .env.local, and .env.pyrope files.
Scripts
The following scripts are defined in package.json:
build: Builds the contracts usingmud build.clean: Cleans the build artifacts and autogenerated code.deploy:local: Deploys the contracts to a local development network.deploy:pyrope: Deploys the contracts to the Pyrope testnet.lint: Runs the code linters.prettier: Formats the Solidity code.solhint: Lints the Solidity code.test: Runs the tests using Forge.coverage: Generates code coverage reports.
