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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mahaxyz/contracts

v1.18.0

Published

[![Foundry Build](https://github.com/mahaxyz/contracts/actions/workflows/foundry.yml/badge.svg)](https://github.com/mahaxyz/contracts/actions/workflows/foundry.yml) [![codecov](https://codecov.io/gh/mahaxyz/contracts/graph/badge.svg?token=N2WZ1HFD9P)](htt

Downloads

733

Readme

MAHA Contracts

Foundry Build codecov NPM Version

This repo contains all the smart contracts code that is used for the MAHA.xyz protocol. The MAHA protocol governs ZAI. A decentralized stablecoin that allows users to execute leverage on assets within the ethersphere.

To use the contracts in your solidity project or integrate with your frontend (using ethers v6), you can use the following npm package.

yarn add --dev @mahaxyz/contracts

or

npm install --save-dev @mahaxyz/contracts

Tests

There are two test suites that this repository uses.

  • Foundry - Foundry is used to conduct various fuzzing and invariant tests.
  • Certora - Certora is used to conduct all kinds of formal verification tests. This is more in-depth than the foundry tests but run a lot slower.

To compile and run the unit tests, simply run the following commands.

yarn
yarn compile
yarn test

Unit test coverages for foundry can be found here.

Deploy Instructions

To deploy the contracts, we use hardat-deploy to deploy the various contracts. Deployments are saved in the deployments folder and synced with our npm repository. Open the deploy folder to view the scripts that can be executed.

The below command is an example of how to execute the deploy-zai.ts script.

npx hardhat deploy --tags ZAIStablecoin --network mainnet

Documentation

data-flow

The ZAI stablecoin is incredibly minimal. With the core modules written in less than 400 lines of code. At the crux of the stablecoin is the Peg-stability Module and the Direct Deposit Module. These module control the stability and the growth of ZAI.

incentive-flow

The incentive model is designed in such a way that there's a postive feedback loop for the growth of ZAI based on how much borrowing demand and interest fees ZAI generates.

The following links give more information about the various components and go more in-depth.

  • docs.maha.xyz - Contains a high level overview of the entire protocol including architecture documentation.
  • wiki pages - The wiki pages contains the technical documentation for each contract and what they do.
  • test folders - The unit tests for the protocol are also documented and can be browsed through for insights about how each test works.

For any questions or queries, feel free to reach out to us on Discord