Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/level beyond to alpha #352

Merged
merged 33 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
eadc79c
Fix/buyback otc (#285)
ugolino Oct 24, 2022
631b734
Feature - Performance Table with Price per Share (#282)
bestatigen Oct 26, 2022
fdd6d43
Add Prettier (#283)
bestatigen Oct 26, 2022
b94e3d8
remove error if withdrawalAmount is 0 (#288)
JoshDAO Nov 2, 2022
cd3f034
copy rinkeby deploy folder and rename to goerli (#287)
JoshDAO Nov 2, 2022
8a8a9bc
Remove 11utc copy (#291)
bestatigen Nov 10, 2022
3066dfc
fixed walletconnect (#295)
ugolino Nov 18, 2022
8728ac0
Use correct chainId for Arbitrum (#296)
bestatigen Nov 22, 2022
3ae8d1d
Fix Yield y-axis domain (#298)
bestatigen Nov 30, 2022
0439e00
Fix issue with Yield timestamp order (#299)
bestatigen Dec 2, 2022
e307086
Refresh style of Table (#304)
bestatigen Dec 17, 2022
d6c03fa
Use correct epoch for Cumulative Yield (#306)
bestatigen Dec 17, 2022
a385444
Minor Alpha front-end fixes (#308)
bestatigen Dec 27, 2022
2ba62b0
Move front-end to Goerli (#292)
bestatigen Jan 6, 2023
7dc343f
Only run hardhat on changes to SC code. (#329)
MeanBoyCousin Jan 10, 2023
7bb209f
Performance chart public launch (#321)
MeanBoyCousin Jan 10, 2023
a45aece
Use react-helmet to "noindex, nofollow" every deployment except prod.…
MeanBoyCousin Jan 10, 2023
a712050
Merge pull request #328 from rysk-finance/no-index-testnet-site
MeanBoyCousin Jan 10, 2023
3a3bafd
React 18 (#337)
MeanBoyCousin Jan 13, 2023
bec0368
Bump npm from 8.9.0 to 8.11.0
dependabot[bot] Jan 16, 2023
daaff48
Merge pull request #346 from rysk-finance/dependabot/npm_and_yarn/npm…
MeanBoyCousin Jan 16, 2023
33d8eaa
Yarn workspaces (#338)
MeanBoyCousin Jan 16, 2023
7baece0
Package upgrades and cleaning (#347)
MeanBoyCousin Jan 17, 2023
7a9c3af
Merge branch 'rysk-alpha' of https://github.com/rysk-finance/dynamic-…
kjr217 Jan 18, 2023
29d2820
chore: get branch level with alpha
kjr217 Jan 18, 2023
fe5498a
Merge branch 'rysk-beyond' of https://github.com/rysk-finance/dynamic…
kjr217 Jan 18, 2023
7e0cbde
chore: remove mention of rinkeby
kjr217 Jan 18, 2023
31aa598
chore: fix config bug
kjr217 Jan 18, 2023
bebe4fd
chore: update arbitrum with alchemy provider
kjr217 Jan 18, 2023
da8366a
chore: change arbitrum rpc creation location
kjr217 Jan 18, 2023
0373b3a
Update hardhat.yml
kjr217 Jan 18, 2023
e370fb7
chore: fix arbi rpc
kjr217 Jan 18, 2023
b8ee714
chore: upgrade to dayjs from moments
kjr217 Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 29 additions & 36 deletions .github/workflows/hardhat.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Hardhat full test suite CI
name: Hardhat

on:
push:
branches:
- "**" # matches every branch

push:
paths:
- "packages/contracts/**"
- "package.json"
- ".github/workflows/hardhat.yml"

defaults:
run:
working-directory: ./packages/contracts


jobs:
test:
runs-on: ubuntu-latest
env:
ALCHEMY: ${{ secrets.ALCHEMY }}
TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }}


steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: 16

- name: Node module cache
uses: actions/cache@v2
id: node-cache
with:
path: "**/node_modules"
key: npm-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-v2-
- name: Install dependencies
run: npm install
if: steps.node-cache.outputs.cache-hit != 'true'

- run: npm run compile
- run: npx hardhat test ./test/*.ts
test:
runs-on: ubuntu-latest
env:
ALCHEMY: ${{ secrets.ALCHEMY }}
TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
ARBITRUM: ${{ secrets.ARBITRUM }}
ARBITRUM_GOERLI: ${{ secrets.ARBITRUM_GOERLI }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: "yarn"

- name: Install modules
run: yarn

- name: Compile
run: yarn workspace contracts compile

- name: Test
run: yarn workspace contracts test ./test/*.ts
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Thumbs.db
# Ignore built ts files
dist/**/*

# ignore yarn.lock
yarn.lock
# ignore package-lock
package-lock.json

build/

Expand Down
123 changes: 48 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://github.com/github_username/repo_name">
Expand All @@ -13,115 +12,88 @@
</p>
</p>

<!-- GETTING STARTED -->

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

- npm
At Rysk, we use Yarn for package management with Yarn workspaces. To get started with Yarn if you haven't installed it yet, you can run:

```sh
npm install npm@latest -g
npm install --global yarn
```

### Installation

1. Clone the repo

```sh
git clone
```
```sh
git clone
```

2. Install NPM packages
2. Install packages

```sh
npm install
```

or

```sh
yarn
```
```sh
yarn
```

3. Add environment variables

Create free API keys for alchemy and infura

a. Create /packages/contracts/.env with:

```sh
ALCHEMY_KEY=<your-alchemy-key>
```

b. Create /packages/front-end/.env with:

```sh
REACT_APP_INFURA_KEY=<your-infura-key>
```

4. Start a hardhat node as mainnet fork
You will need to create free API keys for Alchemy and Infura. You can then:

```sh
cd packages/contracts
npm run mainnet-fork
```
- Create `/packages/contracts/.env`
- Add `ALCHEMY=<your-alchemy-key>`
- Create `/packages/front-end/.env`
- Add `REACT_APP_INFURA_KEY=<your-infura-key>`

From a new terminal window
4. Compile contracts

5. Compile contracts
```sh
yarn workspace contracts compile
```

```sh
cd packages/contracts
npm run compile
```
5. Deploy contracts and update ABIs + address

6. Deploy contracts and update ABIs + address
```sh
yarn workspace contracts deploy:localhost
```

```sh
cd packages/contracts
npm run deploy:localhost
```

7. Start the React app
6. Start the front end

```sh
cd packages/front-end
npm run start
```
```sh
yarn workspace front-end start
```

<!-- USAGE EXAMPLES -->
## Usage examples

## Testing Contracts
### Testing Contracts

Complete steps 1 to 3 from above:
Complete steps 1 to 3 from the installation section and then:

Compile all files
1. Compile all files

```sh
npm run compile
```
```sh
yarn workspace contracts compile
```

Run all tests
2. Run all tests

```sh
npx hardhat test
```
```sh
yarn workspace contracts test
```

To run a specific test suite, e.g. LiquidityPool.ts
To run a specific test suite, e.g. `LiquidityPool.ts`

```sh
npx hardhat test test/LiquidityPool.ts
```
```sh
yarn workspace contracts test test/LiquidityPool.ts
```

Run test coverage
Run test coverage

```sh
npm run test-coverage
```
```sh
yarn workspace contracts test-coverage
```

Run foundry fuzzing

Expand All @@ -130,12 +102,13 @@ Run foundry fuzzing

## Contract Architecture

![Rysk Architecture](./images/RyskArchitecture.png) ![Diagram C](./images/DiagramC.png)
![Rysk Architecture](./images/RyskArchitecture.png)
![Diagram C](./images/DiagramC.png)
![Diagram F](./images/DiagramF.png)

## Contract layout

```
```bash
contracts
├── hedging
│ ├── GMXHedgingReactor.sol
Expand Down
5 changes: 0 additions & 5 deletions buildFrontEnd.sh

This file was deleted.

Loading