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

@tawf-labs/sharia-capital-standard

v0.1.2

Published

Open infrastructure-grade risk-sharing capital formation primitive implementing AAOIFI standards

Readme

Sharia Capital Standard (SCS)

Open infrastructure-grade risk-sharing capital formation primitive for EVM & SVM networks

License: MIT Solidity Foundry

Overview

SCS provides production-ready smart contract implementations for Sharia-compliant capital formation, implementing AAOIFI standards for:

  • SCS-1: Mudarabah (manager-investor profit-sharing)
  • SCS-2: Musharakah (joint venture capital)
  • SCS-3: Profit-Sharing Vault Engine (NAV calculation, epochs)
  • SCS-4: Non-Guaranteed Return Enforcement Layer
  • SCS-5: AAOIFI Governance & Compliance

AAOIFI Compliance

This project implements standards from the Accounting and Auditing Organization for Islamic Financial Institutions:

Project Structure

Sharia-Capital-Standard/
├── evm/                    # EVM implementation (Solidity)
│   ├── src/
│   │   ├── interfaces/     # Core SCS interfaces
│   │   ├── SCS1/          # Mudarabah ✅
│   │   ├── SCS2/          # Musharakah ✅
│   │   ├── SCS3/          # Vault Engine ✅
│   │   ├── SCS4/          # Enforcement Layer ✅
│   │   ├── SCS5/          # AAOIFI Governance ✅
│   │   └── libraries/     # Shared libraries
│   └── test/              # Comprehensive test suite
└── solana/                # SVM implementation (Anchor)
    └── programs/

Installation

For Foundry Projects (Recommended)

Install as a Foundry dependency:

forge install tawf-labs/Sharia-Capital-Standard

Add to your remappings.txt:

@sharia-capital/=lib/Sharia-Capital-Standard/evm/src/

Import in your contracts:

import "@sharia-capital/SCS1/MudarabahPool.sol";
import "@sharia-capital/SCS2/MusharakahPool.sol";
import "@sharia-capital/SCS3/VaultEngine.sol";
import "@sharia-capital/SCS4/SCSEnforcement.sol";
import "@sharia-capital/SCS5/AAOIFIGovernance.sol";

For Hardhat/npm Projects

Install via npm:

npm install @tawf-labs/sharia-capital-standard
# or
yarn add @tawf-labs/sharia-capital-standard

Import in your contracts (clean style):

import "@tawf-labs/sharia-capital-standard/SCS1/MudarabahPool.sol";
import "@tawf-labs/sharia-capital-standard/interfaces/ISCS1.sol";

Or use direct paths:

import "@tawf-labs/sharia-capital-standard/evm/src/SCS1/MudarabahPool.sol";

Access ABIs in JavaScript/TypeScript:

const MudarabahPoolABI = require('@tawf-labs/sharia-capital-standard/evm/out/MudarabahPool.sol/MudarabahPool.json');

For Development

Clone the repository to contribute or run tests:

git clone https://github.com/tawf-labs/Sharia-Capital-Standard.git
cd Sharia-Capital-Standard

# Install dependencies
forge install

# Build contracts
forge build

# Run tests
forge test

# Run tests with gas report
forge test --gas-report

Usage Example

// Create Mudarabah pool
MudarabahFactory factory = new MudarabahFactory(enforcementAddress);

address pool = factory.createPool(
    usdcAddress,
    managerAddress,
    capitalProviderAddress,
    2000, // 20% manager share (basis points)
    8000, // 80% provider share (basis points)
    "USDC Mudarabah Pool",
    "MDP-USDC"
);

// Deposit capital
MudarabahPool mudarabah = MudarabahPool(pool);
usdc.approve(pool, 1000e6);
mudarabah.deposit(1000e6);

// Deploy to strategy
mudarabah.deployCapital(strategyAddress, 500e6);

Core Concepts

Mudarabah (SCS-1)

Manager-investor profit-sharing model where:

  • Capital provider (Rabb al-Mal) provides capital
  • Manager (Mudarib) manages investments
  • Profits shared by pre-agreed ratio
  • Losses borne by capital provider (except misconduct)

Musharakah (SCS-2)

Joint venture model where:

  • All partners contribute capital
  • Profit ratio can differ from capital ratio
  • Loss ratio MUST equal capital ratio (AAOIFI requirement)

Vault Engine (SCS-3)

ERC-4626 compliant vault with:

  • Epoch-based accounting
  • NAV calculation
  • Strategy management

Enforcement Layer (SCS-4)

Ensures Sharia compliance by:

  • Prohibiting guaranteed returns
  • Preventing fixed-yield structures
  • Validating profit-sharing ratios

AAOIFI Governance (SCS-5)

Implements AAOIFI Governance Standard #3:

  • Sharia Supervisory Board (SSB) oversight
  • Multi-signature approval for investments
  • Prohibited asset screening
  • Financial ratio validation

Documentation

Security

  • Comprehensive test coverage (100%)
  • Fuzz testing (256+ iterations)
  • Invariant testing
  • ReentrancyGuard protection
  • Role-based access control
  • Static analysis via Aderyn in CI
  • External audit recommended before production use

Security Analysis

This project uses Aderyn, a Rust-based Solidity static analyzer by Cyfrin, to automatically detect potential vulnerabilities in the codebase.

Automated CI Checks:

  • Aderyn runs automatically on every push and pull request
  • Builds fail on high-severity findings
  • Analysis reports are available in GitHub Actions logs

Local Analysis (Optional):

Developers can run Aderyn locally for immediate feedback:

# Install Aderyn (requires Rust)
cargo install aderyn

# Run analysis on the project
aderyn .

# View the generated report
cat report.md

For more information, see the Aderyn documentation.

See SECURITY.md for reporting vulnerabilities.

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

MIT License - see LICENSE for details.

Disclaimer

This is reference implementation software. Users must:

  1. Conduct independent Sharia compliance review
  2. Obtain qualified Sharia Supervisory Board approval
  3. Complete security audits before production deployment
  4. Ensure compliance with local regulations

References

Contact

For questions or collaboration: Create an issue