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

@vanityx/createx_guard

v1.0.0

Published

A library for calculating CREATEX factory guard salts.

Readme

@vanityx/createx_guard

English | 中文


一个轻量级的 CreateX 守卫盐计算工具库。

用于处理以下复杂的 CreateX 盐值哈希逻辑:

  • Permissioned deployments(权限部署)
  • Cross-chain redeployments(跨链重部署)
  • Standard deployments(标准部署)

具体保护规则参考 CreateX 盐值规则

安装

pnpm add @vanityx/createx_guard

使用

高级接口:getGuardedSalt

校验输入并根据盐的结构自动推断保护标志。

  • 检查前 20 字节是否匹配 msg.sender
  • 检查第 21 字节是否启用跨链保护。
  • 在需要时校验 chainId 是否提供。
import { getGuardedSalt } from '@vanityx/createx_guard'

const guardedSalt = getGuardedSalt({
  salt: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee010000000000000000000000',
  msgSender: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
  chainId: 1,
})

低级接口:computeGuardedSalt

执行纯计算,不进行校验,提供配置视为启用保护。如果你已经解析了标志位或想跳过安全检查,请使用此接口。

[!WARNING]

仅当你完全理解 CreateX 盐值规则并已正确设置参数时才使用此接口,否则可能导致非预期地址、部署失败或其他风险。

import { computeGuardedSalt } from '@vanityx/createx_guard'

const guardedSalt = computeGuardedSalt({
  salt: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee010000000000000000000000',
  permissioned: { msgSender: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' },
  crosschain: { chainId: 1 },
})

盐值规则参考

简单来说,permissioned 将会通过原始盐值的前 20 字节与 msg.sender 进行匹配,而 crosschain 则通过第 21 字节的标志位来启用。使用 getGuardedSalt 计算将会根据上述规则自动校验相应的保护,并处理 revert 情况。使用 computeGuardedSalt 则需要你自己确保输入的正确性。根据这些规则,部署可以分为以下几类:

╔═════════════════╦══════╦══════╦════════╗
║ Sender \ XChain ║  on  ║  off ║   na   ║
╠═════════════════╬══════╬══════╬════════╣
║       self      ║ pass ║ pass ║        ║
╠═════════════════╬══════╬══════╣ revert ║
║       zero      ║ pass ║      ║        ║
╠═════════════════╬══════╝ pass ╚════════╣
║       any       ║                      ║
╚═════════════════╩══════════════════════╝