@gnosis.pm/safe-deployments

中文文档
1.19.0发布于 2023/01/18MITTypeScriptCommonJS近 30 天下载 2.4万

Collection of Safe singleton deployments

此软件包已被标记为弃用

WARNING: This project has been renamed to @safe-global/safe-deployments . Please, update your dependencies.

原始使用文档
文档目录4 节
  1. Install
  2. Usage
  3. Notes
  4. License

Gnosis Safe Deployments

npm version

This contract contains a collection of deployments of the contract of the Safe contracts repository.

For each deployment the address on the different networks and the abi files are available. To get an overview of the available versions check the available json assets.

To add additional deployments please follow the deployment steps in the Safe contract repository.

Install

  • npm - npm i @gnosis.pm/safe-deployments
  • yarn - yarn add @gnosis.pm/safe-deployments

Usage

It is possible to directly use the json files in the assets folder that contain the addresses and abi definitions.

An alternative is to use the JavaScript library methods to query the correct deployment. The library supports different methods to get the deployment of a specific contract.

Each of the method takes an optional DeploymentFilter as a parameter.

interface DeploymentFilter {
    version?: string,
    released?: boolean, // Defaults to true if no filter is specified
    network?: string // Chain id of the network
}

The method will return a SingletonDeployment object or undefined if no deployment was found for the specified filter.

interface SingletonDeployment {
    defaultAddress: string, // Address the contract was deployed to by the Gnosis team
    version: string,
    abi: any[],
    networkAddresses: Record<string, string>, // Address of the contract by network
    contractName: string,
    released: boolean // A released version was audited and has a running bug bounty
}
  • Gnosis Safe
const safeSingleton = getSafeSingletonDeployment()

// Returns latest contract version, even if not finally released yet
const safeSingletonNightly = getSafeSingletonDeployment({ released: undefined })

// Returns released contract version for specific network
const safeSingletonGörli = getSafeSingletonDeployment({ network: "5" })

// Returns released contract version for specific version
const safeSingleton100 = getSafeSingletonDeployment({ version: "1.0.0" })

// Version with additional events used on L2 networks
const safeL2Singleton = getSafeL2SingletonDeployment()
  • Factories
const proxyFactory = getProxyFactoryDeployment()
  • Libraries
const multiSendLib = getMultiSendDeployment()

const multiSendCallOnlyLib = getMultiSendCallOnlyDeployment()

const createCallLib = getCreateCallDeployment()
  • Handler
// Returns recommended handler
const fallbackHandler = getFallbackHandlerDeployment()

const callbackHandler = getDefaultCallbackHandlerDeployment()

const compatHandler = getCompatibilityFallbackHandlerDeployment()

Notes

A list of network information can be found at chainid.network

License

This library is released under MIT.

版本与发布记录

@gnosis.pm/safe-deployments 共发布 22 个版本,首次发布于 2021/05/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.19.0latest2023/01/183 年前
1.18.02023/01/063 年前
1.17.02022/11/154 年前
1.16.02022/08/094 年前
1.15.02022/06/074 年前
1.14.02022/05/164 年前

关于 @gnosis.pm/safe-deployments 的常见问题

@gnosis.pm/safe-deployments 是什么?

Collection of Safe singleton deployments注意:该包已被作者标记为弃用——WARNING: This project has been renamed to @safe-global/safe-deployments . Please, update your dependencies.

如何安装 @gnosis.pm/safe-deployments?

在项目目录运行 npm install @gnosis.pm/safe-deployments,或使用 pnpm add / yarn add / bun add。

@gnosis.pm/safe-deployments 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gnosis.pm/safe-deployments 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@gnosis.pm/safe-deployments 可以商用吗?

@gnosis.pm/safe-deployments 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gnosis.pm/safe-deployments 的下载量有多少?

根据 npm 官方下载统计,@gnosis.pm/safe-deployments 在 2026/10/17 – 2026/11/15 这 30 天内被下载 23,968 次,日均约 799 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gnosis.pm/safe-deployments 还在维护吗?

最新版本 1.19.0 发布于 2023/01/18(3 年前);至今共发布 22 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/05/06。作者已将其标记为弃用,新项目建议寻找替代方案。