
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
@towns-protocol/diamond
Advanced tools
A comprehensive toolkit for building modular smart contracts with the EIP-2535 Diamond Standard, including core contracts and optimized building blocks
A comprehensive toolkit for building modular smart contracts with the EIP-2535 Diamond Standard. This package provides both the core Diamond contracts and optimized building blocks to create efficient, upgradeable systems.
This repository provides a robust foundation for building modular and upgradeable smart contract systems using the Diamond pattern. It includes not only the Diamond implementation itself but also reusable primitives and facets that serve as building blocks for your contract systems. The Diamond pattern allows for:
The implementation consists of:
This toolkit provides several reusable components that can be used independently or together:
Each building block is designed to be modular, allowing you to pick and choose the components you need for your specific use case.
This implementation includes optimized facets for various token standards:
The implementation uses custom low-level primitives to maximize gas efficiency:
This repository includes deployment scripts that make it easy to work with the Diamond pattern:
Located in scripts/common/DeployFacet.s.sol
, this script provides optimized deployment utilities for efficient contract deployment. It features:
Example usage:
# Deploy a single facet
CONTRACT_NAME=MyFacet forge script DeployFacet
# Deploy a batch of contracts
# (See scripts/README.md for API details)
Prerequisites:
0x4e59b44847b379578588920cA78FbF26c0B4956C
)0xcA11bde05977b3631167028862bE2a173976CA11
)DeployFacet handles all the complexities of gas optimization and deterministic addressing, making deployments more predictable and cost-effective.
This project uses Foundry for development, testing, and deployment.
# Clone the repository
git clone https://github.com/towns-protocol/diamond.git
cd diamond
# Install dependencies
bun install
forge build
forge test
forge fmt
MIT
This implementation is inspired by the EIP-2535 Diamond Standard and builds upon best practices from the community.
FAQs
A comprehensive toolkit for building modular smart contracts with the EIP-2535 Diamond Standard, including core contracts and optimized building blocks
We found that @towns-protocol/diamond demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.