Skip to content

This repository contains reusable, security-focused smart contract modules, inspired by OpenZeppelin’s security patterns, but written from scratch with modern Solidity features.

License

BuildsWithKing/buildswithking-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠ Security Disclaimer

This repository has not been audited.
Use at your own risk. Do not use in production environments without a proper security review.


🔐 BuildsWithKing-Security

GitHub release (latest by date) GitHub GitHub issues GitHub pull requests GitHub stars

A lightweight Solidity security utilities library.

This repository contains reusable, security-focused smart contract modules, inspired by OpenZeppelin’s battle-tested security patterns, rebuilt from scratch with modern Solidity features.


⚡ Why BuildsWithKing-Security?

Instead of just importing libraries, this project is about rebuilding and learning:

  • 🛡 Deep Security Understanding – Writing security primitives line-by-line.
  • Gas-Optimized Patterns – Exploring efficient implementations.
  • 🧪 Rigorous Testing – Unit, fuzz, and invariant tests.
  • 🌍 Open Source Learning – Sharing progress with the community.

🗃 Features

  • 🔒 Reentrancy Protection (ReentrancyGuard)
  • 👑 Ownership & Access Control (Kingable)
  • Modern Gas-Optimized Security Patterns

📦 Available Modules

  • ReentrancyGuard → Prevents reentrant calls
  • Kingable → Custom ownership & access control

🔜 Coming Soon:

  • Pausable → Emergency stop pattern
  • PullPayment → Safer ETH transfers

📦 Installation

You can import contracts directly from GitHub in your Solidity files:

Example: ReentrancyGuard

import "https://github.com/BuildsWithKing/buildswithking-security/blob/main/contracts/security/ReentrancyGuard.sol";

💡 Best Practice: Pin to a specific commit hash for safety:

import "https://github.com/BuildsWithKing/buildswithking-security/blob/<commit-hash>/contracts/security/ReentrancyGuard.sol";

Option 1: Foundry (Recommended)

forge install BuildsWithKing/buildswithking-security

Specific version:

forge install BuildsWithKing/buildswithking-security@v1.3.0

Add this to foundry.toml:

remappings = [
    "buildswithking-security/=lib/buildswithking-security/contracts/"
]

Usage Example:

import {Kingable} from "buildswithking-security/access/core/Kingable.sol";
import {ReentrancyGuard} from "buildswithking-security/security/ReentrancyGuard.sol";

contract MyContract is Kingable, ReentrancyGuard {
    // Your secure logic here
}

Option 2: Manual Clone

git clone --branch v1.3.0 https://github.com/BuildsWithKing/buildswithking-security.git lib/buildswithking-security

Then configure your foundry.toml the same way as above.


🤝 Contributing

Pull requests are welcome! 🚀
If you’d like to add new security modules or improve existing ones, fork the repo and open a PR.

All contributions will be reviewed for security soundness and code quality before merging.


👤 Author

Built and maintained by Michealking (@BuildsWithKing)


📜 License

This project is licensed under the MIT License.


📌 Version

Current stable release: v1.3.0

About

This repository contains reusable, security-focused smart contract modules, inspired by OpenZeppelin’s security patterns, but written from scratch with modern Solidity features.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •