npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@awar-dev/storage-manager

v0.2.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 install

Running Tests

forge test

To Use

To use the StorageSystem in your MUD project, you need to import the package by installing it in your MUD project repo with the following command:

pnpm add @awar-dev/storage-manager

Then you need to configure the Storage System on your Smart Storage Unit by importing the StorageSystemLib into a script with:

import { storageSystem } from "@awar-dev/storage-manager/codegen/systems/StorageSystemLib";

and create a new bucket with the following function call:

storageSystem.createNestedBuckets(smartStorageId, bucketName);

You can then use the Storage System to manage your storage needs in the game. By default - this created bucket will function like a tribal storage (where anyone in the deployer's tribe can both deposit and withdraw items from it). If you want to create a private bucket, you can will need to create a system that implements one or both of the following methods:

function canDeposit(uint256 smartObjectId, bytes32 bucketId, address sender) public returns (bool)
function canWithdraw(uint256 smartObjectId, bytes32 bucketId, address sender) public returns (bool)

After deploying the access control system with one or both of the above methods, you can set it to be used by the Storage System with the following fn call in a script run by the owner of the bucket:

storageSystem.setAccessSystemId(smartStorageId, bucketId, systemId);

Project 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 allocatable storage
│  │  └── 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 file

Configuration

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 using mud 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.