Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #96 from beehive-innovation/2021-09-10-npm-package
Browse files Browse the repository at this point in the history
npm package & remove submodule dependency
  • Loading branch information
marcusnewton authored Sep 20, 2021
2 parents 33fa9b9 + 7d9cfa9 commit 3071217
Show file tree
Hide file tree
Showing 23 changed files with 775 additions and 506 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
uses: actions/checkout@v2
with:
ref: develop
submodules: "recursive"

- name: Install nix
uses: cachix/install-nix-action@v13
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish npm package

on:
create:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}

- name: Install nix
uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Prepack for npm
run: nix-shell --run prepack

- name: Publish to npm
run: nix-shell --run publish
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ bin
!dist/**/artifacts
docs/api
bin
*.tgz
.npmrc
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "contracts/configurable-rights-pool"]
path = contracts/configurable-rights-pool
url = [email protected]:balancer-labs/configurable-rights-pool.git
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,44 @@

Rain Protocol supports fair value capture for intangible or physical assets in a permissionless way in any decentralised environment.

Documentation can be found [here](https://beehive-innovation.github.io/rain-protocol).
## Installation

```console
npm install rain-protocol
```

## Development setup (contributors)
## Usage

### Git submodules
### Importing contracts

As we are wrapping balancer contracts, we have git submodules pointing to their repositories.
```solidity
pragma solidity ^0.6.12;
import "rain-protocol/contracts/ReadWriteTier.sol";
contract MyContract is ReadWriteTier {
...
}
```

When you clone this repository make sure to use `--recurse-submodules`
### Importing contract [artifact](https://hardhat.org/guides/compile-contracts.html#artifacts) (e.g. abi, bytecode)

```typescript
const trustJson = require("rain-protocol/artifacts/Trust.json");
```
git clone --recurse-submodules [email protected]:thedavidmeister/tv-balancer.git

### Using with [TypeChain](https://github.com/dethcrypto/TypeChain)

```typescript
import type { Trust } from "rain-protocol/typechain/Trust";
```

## Documentation

Documentation can be found [here](https://beehive-innovation.github.io/rain-protocol).

## Development setup (for contributors)

### Nix Shell

Install the nix shell if you haven't already.
Expand Down
14 changes: 7 additions & 7 deletions contracts/RedeemableERC20Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ import { Math } from "@openzeppelin/contracts/math/Math.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

import { IBPool } from "./configurable-rights-pool/contracts/IBFactory.sol";
import { BPool } from "./configurable-rights-pool/contracts/test/BPool.sol";
import { IBPool } from "configurable-rights-pool/contracts/IBFactory.sol";
import { BPool } from "configurable-rights-pool/contracts/test/BPool.sol";
import {
RightsManager
} from "./configurable-rights-pool/libraries/RightsManager.sol";
} from "configurable-rights-pool/libraries/RightsManager.sol";
import {
BalancerConstants
} from "./configurable-rights-pool/libraries/BalancerConstants.sol";
} from "configurable-rights-pool/libraries/BalancerConstants.sol";
import {
ConfigurableRightsPool
} from "./configurable-rights-pool/contracts/ConfigurableRightsPool.sol";
} from "configurable-rights-pool/contracts/ConfigurableRightsPool.sol";
import {
CRPFactory
} from "./configurable-rights-pool/contracts/CRPFactory.sol";
} from "configurable-rights-pool/contracts/CRPFactory.sol";
import {
BFactory
} from "./configurable-rights-pool/contracts/test/BFactory.sol";
} from "configurable-rights-pool/contracts/test/BFactory.sol";

import { Phase, Phased } from "./Phased.sol";
import { RedeemableERC20 } from "./RedeemableERC20.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/RedeemableERC20PoolFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
} from "./RedeemableERC20Pool.sol";
import {
CRPFactory
} from "./configurable-rights-pool/contracts/CRPFactory.sol";
} from "configurable-rights-pool/contracts/CRPFactory.sol";
import {
BFactory
} from "./configurable-rights-pool/contracts/test/BFactory.sol";
} from "configurable-rights-pool/contracts/test/BFactory.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { RedeemableERC20 } from "./RedeemableERC20.sol";

Expand Down
4 changes: 2 additions & 2 deletions contracts/Trust.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

import {
CRPFactory
} from "./configurable-rights-pool/contracts/CRPFactory.sol";
} from "configurable-rights-pool/contracts/CRPFactory.sol";
import {
BFactory
} from "./configurable-rights-pool/contracts/test/BFactory.sol";
} from "configurable-rights-pool/contracts/test/BFactory.sol";

import { ITier } from "./tier/ITier.sol";

Expand Down
1 change: 0 additions & 1 deletion contracts/configurable-rights-pool
Submodule configurable-rights-pool deleted from 5bd636
Loading

0 comments on commit 3071217

Please sign in to comment.