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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@setprotocol/set-protocol-v2

v0.11.3

Published

## Contracts [Set Protocol](https://setprotocol.com/) is a specification for tokenized asset management strategies on the ethereum blockchain written in the Solidity programming language. We use [Hardhat](https://hardhat.org/) as a development environment

Downloads

200

Readme

Set Protocol V2 Contract Repository

Contracts

Set Protocol is a specification for tokenized asset management strategies on the ethereum blockchain written in the Solidity programming language. We use Hardhat as a development environment for compiling, testing, and deploying our contracts.

Development

To use console.log during Solidity development, follow the guides.

Available Functionality

Run Hardhat EVM

yarn chain

Build Contracts

yarn compile

To speed up compilation, install solc 0.6.10 natively with the following command.

brew install https://raw.githubusercontent.com/ethereum/homebrew-ethereum/06d13a8499801dc3ea4f19b2d24ed2eeb3072ebb/solidity.rb

Generate TypeChain Typings

yarn build

Run Contract Tests

yarn test to run compiled contracts

OR yarn test:clean if contracts have been typings need to be updated

Run Coverage Report for Tests

yarn coverage

Installing from npm

We publish our contracts as well as hardhat and typechain compilation artifacts to npm.

npm install @setprotocol/set-protocol-v2

The distribution also comes with fixtures for mocking and testing SetProtocol's interactions with other protocols including Uniswap, Balancer, Compound (and many more.) To use these you'll need to install the peer dependencies listed in package.json.

Example Usage

import { PerpV2Fixture } from "@setprotocol/set-protocol-v2/dist/utils/fixtures/PerpV2Fixture";
import { getPerpV2Fixture } from "@setprotocol/set-protocol-v2/dist/utils/test";

let perpSetup: PerpV2Fixture;
perpSetup = getPerpV2Fixture(...);

Semantic Release

This repository uses semantic-release to automatically publish in CI on merge to master. To trigger a release, use the following naming convention in your PR description (or in your squash & merge commit description):

  • patch release (e.g 1.0.1 -> 1.0.2): fix(topic): description
    • example: fix(perpV2Viewer): return uint256 instead of int256
  • feature release (e.g 1.1.0 -> 1.2.0): feat(feature_name): description
    • example: feat(PerpV2BasisTrading): Add PerpV2 Basis Trading Module

Contributing

We highly encourage participation from the community to help shape the development of Set. If you are interested in developing on top of Set Protocol or have any questions, please ping us on Discord.

Security

TODO: Independent Audits

Code Coverage

All smart contracts are tested and have 100% line and branch coverage.

Vulnerability Disclosure Policy

The disclosure of security vulnerabilities helps us ensure the security of our users.

How to report a security vulnerability?

If you believe you’ve found a security vulnerability in one of our contracts or platforms, send it to us by emailing [email protected]. Please include the following details with your report:

  • A description of the location and potential impact of the vulnerability.

  • A detailed description of the steps required to reproduce the vulnerability.

Scope

Any vulnerability not previously disclosed by us or our independent auditors in their reports.

Guidelines

We require that all reporters:

  • Make every effort to avoid privacy violations, degradation of user experience, disruption to production systems, and destruction of data during security testing.

  • Use the identified communication channels to report vulnerability information to us.

  • Keep information about any vulnerabilities you’ve discovered confidential between yourself and Set until we’ve had 30 days to resolve the issue.

If you follow these guidelines when reporting an issue to us, we commit to:

  • Not pursue or support any legal action related to your findings.

  • Work with you to understand and resolve the issue quickly (including an initial confirmation of your report within 72 hours of submission).

  • Grant a monetary reward based on the OWASP risk assessment methodology.