Skip to content

Repository files navigation

Safe Deployments

npm versionCI

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

The addresses on the different networks and the abi files are available for each deployment. To get an overview of the available versions, check the available json assets.

Adding additional deployments:

  1. Follow the deployment steps in the Safe contract repository.
  2. Verify that the addresses match the expected address for each contract. You can find them under the "addresses" mapping in the respective JSON file in the assets folder.
  3. Create a PR adding the new deployment. Example PR can be found here.

Deployments overview

ContractScan is a 3rd party tool that is not maintained by the Safe team

Install

  • npm - npm i @safe-global/safe-deployments
  • yarn - yarn add @safe-global/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 using JavaScript library methods to query the correct deployment. The library supports different methods to get the deployment of a specific contract.

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

interfaceDeploymentFilter{version?: string;released?: boolean;// Defaults to true if no filter is specifiednetwork?: string;// Chain id of the network}

V1 Methods (Single Deployments)

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

exportinterfaceSingletonDeployment{// The default address of the deployment.defaultAddress: string;// Indicates if the deployment is released.released: boolean;// The name of the contract.contractName: string;// The version of the deployment.version: string;// The address & hash of the contract code, where the key is the deployment type.// There could be multiple deployment types: canonical, eip155, zksync// Possible addresses per version:// 1.0.0: canonical// 1.1.1: canonical// 1.2.0: canonical// 1.3.0: canonical, eip155, zksync// 1.4.1: canonical, zksync// Ex: deployments: { "canonical": { "codeHash": "0x1234", "address": "0x5678"}}deployments: Record<string,{address: string;codeHash: string}>;// A record of network addresses, where the key is the network identifier and the value is the address.networkAddresses: Record<string,string>;// The ABI (Application Binary Interface) of the contract.abi: any[];}
  • Safe
constsafeSingleton=getSafeSingletonDeployment();// Returns latest contract version, even if not finally released yetconstsafeSingletonNightly=getSafeSingletonDeployment({released: undefined});// Returns released contract version for specific networkconstsafeSingletonGörli=getSafeSingletonDeployment({network: '5'});// Returns released contract version for specific versionconstsafeSingleton100=getSafeSingletonDeployment({version: '1.0.0'});// Version with additional events used on L2 networksconstsafeL2Singleton=getSafeL2SingletonDeployment();
  • Factories
constproxyFactory=getProxyFactoryDeployment();
  • Libraries
constmultiSendLib=getMultiSendDeployment();constmultiSendCallOnlyLib=getMultiSendCallOnlyDeployment();constcreateCallLib=getCreateCallDeployment();constsignMessageLib=getSignMessageLibDeployment();
  • Fallback Handlers
conststandardFallbackHandler=getFallbackHandlerDeployment();consttokenCallbackHandler=getTokenCallbackHandlerDeployment();constcompatHandler=getCompatibilityFallbackHandlerDeployment();constextensibleFallbackHandler=getExtensibleFallbackHandlerDeployment();

V2 Methods (Multiple Deployments)

We added a new methods that allow multiple deployment addresses for a contract.

Those methods will return a SingletonDeployment object or undefined if no deployment was found for the specified filter. Notice the difference in the networkAddresses field.

exportinterfaceSingletonDeployment{// The default address of the deployment.defaultAddress: string;// Indicates if the deployment is released.released: boolean;// The name of the contract.contractName: string;// The version of the deployment.version: string;// The address & hash of the contract code, where the key is the deployment type.// There could be multiple deployment types: canonical, eip155, zksync// Possible addresses per version:// 1.0.0: canonical// 1.1.1: canonical// 1.2.0: canonical// 1.3.0: canonical, eip155, zksync// 1.4.1: canonical, zksync// Ex: deployments: { "canonical": { "codeHash": "0x1234", "address": "0x5678"}}deployments: Record<string,{address: string;codeHash: string}>;// A record of network addresses, where the key is the network identifier and the value is the address.networkAddresses: Record<string,string|string[]>;// The ABI (Application Binary Interface) of the contract.abi: any[];}
  • Safe
constsafeSingleton=getSafeSingletonDeployments();// Returns latest contract version, even if not finally released yetconstsafeSingletonNightly=getSafeSingletonDeployments({released: undefined});// Returns released contract version for specific networkconstsafeSingletonGörli=getSafeSingletonDeployments({network: '5'});// Returns released contract version for specific versionconstsafeSingleton100=getSafeSingletonDeployments({version: '1.0.0'});// Version with additional events used on L2 networksconstsafeL2Singleton=getSafeL2SingletonDeployments();
  • Factories
constproxyFactory=getProxyFactoryDeployments();
  • Libraries
constmultiSendLib=getMultiSendDeployments();constmultiSendCallOnlyLib=getMultiSendCallOnlyDeployments();constcreateCallLib=getCreateCallDeployments();constsignMessageLib=getSignMessageLibDeployments();
  • Handler
conststandardFallbackHandler=getFallbackHandlerDeployments();consttokenCallbackHandler=getTokenCallbackHandlerDeployments();constcompatHandler=getCompatibilityFallbackHandlerDeployments();constextensibleFallbackHandler=getExtensibleFallbackHandlerDeployments();

Release Cycle

safe-deployments release cycle is once per month, except for urgent issues that require immediate attention.

Notes

  • v1 supports only one address per network, while v2 allows multiple addresses per network. To maintain compatibility with v1, the address order in v2 is arranged so that the first address matches the one used in v1.

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

License

This library is released under MIT.

About

A collection of Safe singleton deployments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages