ckoopmann / set-protocol-v2

Set Protocol V2
0 stars 0 forks source link

Coverage Status

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):

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 security@setprotocol.com. Please include the following details with your report:

Scope

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

Guidelines

We require that all reporters:

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