GithubHelp home page GithubHelp logo

pinkdiamond1 / safe-modules-deployments Goto Github PK

View Code? Open in Web Editor NEW

This project forked from safe-global/safe-modules-deployments

0.0 1.0 0.0 24 KB

License: MIT License

JavaScript 20.70% TypeScript 79.30%

safe-modules-deployments's Introduction

Gnosis Safe Modules Deployments

npm version

This contract contains a collection of deployments of audited contracts from the Safe modules 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 module folder in the Safe modules repository.

Install

  • npm - npm i @gnosis.pm/safe-modules-deployments
  • yarn - yarn add @gnosis.pm/safe-modules-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 {
  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
}
  • Allowance Module
const allowanceModule = getAllowanceModuleDeployment();

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

// Returns released contract version for specific network
const allowanceModuleGörli = getAllowanceModuleDeployment({ network: '5' });

// Returns released contract version for specific version
const allowanceModule010 = getAllowanceModuleDeployment({ version: '0.1.0' });

Notes

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

License

This library is released under MIT.

safe-modules-deployments's People

Contributors

mmv08 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.