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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@condodao/v1-core

v1.1.0

Published

🗄️ Core smart contracts of Condo V1

Downloads

15

Readme

Condo DAO

The CondoManager contract is a comprehensive smart contract designed to manage a system of condominiums represented as NFTs (Non-Fungible Tokens). This contract facilitates the creation, sale, and management of apartments within these condominiums, with each condo functioning as a decentralized autonomous organization (DAO).

Here's a detailed breakdown of its functionality:

Imports and Interfaces

The contract imports several dependencies:

  1. NFT.sol - Manages the NFT representation of each condominium.
  2. CondoTimelock.sol - Provides a timelock mechanism for the condominium's DAO.
  3. CondoGovernor.sol - Handles the governance of the condominium's DAO.
  4. CondoVault.sol - Manages the vault for accumulating sales from apartments.
  5. CondoEnums.sol - Defines various statuses for condos.
  6. CondoEvents.sol - Defines events for tracking state changes.
  7. CondoStructs.sol - Defines data structures for condos, apartments, users, ratings, shares, and rents.
  8. CondoErrors.sol - Defines custom error messages for common error scenarios.

State Variables

  • nextCondoId, nextApartId, nextUserId, nextRatingId, nextShareId, nextRentId: Counters for assigning unique IDs.
  • condos, aparts, users, ratings, shares, rents: Mappings to store the details of condos, apartments, users, ratings, shares, and rents.
  • tokenToCondo: Maps token IDs to condo IDs.
  • addressToId: Maps user addresses to user IDs.

Events

The contract defines multiple events to log significant actions:

  • CondoAdded
  • CondoUpdated
  • ApartAdded
  • UserAdded
  • UserUpdated
  • RatingAdded
  • RatingUpdated
  • ShareAdded
  • ShareUpdated
  • RentAdded
  • RentUpdated

Functions

Condo Management

  1. addCondo: Creates a new condominium DAO with the provided name, symbol, and apartment details.
  2. updCondo: Updates the status of an existing condominium. Only the condo creator can update its status.
  3. getCondo: Retrieves the details of a condominium by its ID.
  4. getCondoByToken: Retrieves the details of a condominium by its token ID.

Apartment Management

  1. addApart: Sells an apartment within a condominium. The buyer pays the specified price to the condo's vault, and the apartment NFT is minted to the buyer.
  2. getApart: Retrieves the details of an apartment by its ID.
  3. getApartmentDetails: Retrieves the floor and apartment number of an apartment by its token ID.

User Management

  1. addUser: Adds a new user to the system.
  2. updUser: Updates an existing user's details. Only the user can update their details.
  3. getUser: Retrieves the details of a user by their ID.
  4. getUserByAddress: Retrieves the details of a user by their wallet address.

Rating Management

  1. addRating: Adds a new rating for a user.
  2. updRating: Updates an existing rating. Only the rater can update the rating.
  3. getRating: Retrieves the details of a rating by its ID.

Share Management

  1. addShare: Creates a share for renting out an apartment.
  2. updShare: Updates the details of a share. Only the share creator can update it.
  3. getShare: Retrieves the details of a share by its ID.

Rent Management

  1. addRent: Initiates a rent agreement for a shared apartment.
  2. updRent: Updates the balance of an existing rent agreement. Only the renter can update it.
  3. getRent: Retrieves the details of a rent agreement by its ID.

Internal Functions

  1. condoTimelock: Creates a new CondoTimelock instance with the necessary configurations.
  2. _ensureUserExists: Ensures that a user exists in the system. If not, it creates a new user.
  3. _addUser: Adds a new user internally and emits a UserAdded event.

Error Handling

The contract uses custom errors defined in CondoErrors.sol to handle common error scenarios like unauthorized access, insufficient payment, and non-existent entities (apartments or users).

Key Points

  • DAO Integration: Each condominium functions as a DAO, with its own governance and timelock mechanisms.
  • NFT Representation: Apartments within condos are represented as NFTs, allowing for unique ownership and transferability.
  • User-Rating System: Users can rate each other, providing a trust mechanism within the platform.
  • Share and Rent Mechanisms: Users can share apartments for rent, and renters can manage their rent balances.

This contract offers a comprehensive system for managing condominium DAOs, with robust features for handling apartment sales, user interactions, and rental agreements, all while leveraging the benefits of blockchain technology and NFTs.