Skip to content

Commit

Permalink
Remove hardhat
Browse files Browse the repository at this point in the history
  • Loading branch information
odd-amphora authored and peripheralist committed Sep 22, 2021
1 parent 2b43eca commit f03a82d
Show file tree
Hide file tree
Showing 633 changed files with 83 additions and 65,125 deletions.
2 changes: 1 addition & 1 deletion packages/app/.example.env → .example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REACT_APP_INFURA_ID=
REACT_APP_INFURA_NETWORK=localhost
REACT_APP_INFURA_NETWORK=rinkeby
REACT_APP_PINATA_PINNER_KEY=
REACT_APP_PINATA_PINNER_SECRET=
REACT_APP_BLOCKNATIVE_API_KEY=
52 changes: 0 additions & 52 deletions .github/workflows/presubmit.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
packages/subgraph/generated
packages/hardhat/*.txt
**/aws.json

Expand All @@ -14,8 +13,6 @@ packages/hardhat/cache

docker/**/data

packages/subgraph/config/localhost.json

# dependencies
/node_modules
/.pnp
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"editor.tabSize": 2,
"solidity.compileUsingRemoteVersion": "0.8.6",
"solidity.linter": "solhint",
"solidity.solhintRules": {
"avoid-sha3": "error",
"no-inline-assembly": "warn"
},
"solidity.compilerOptimization": 10000
}
141 changes: 26 additions & 115 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,140 +1,51 @@
# 🧃 juicebox.money
# juice-juicehoue

[juicebox.money](https://juicebox.money)
Juicebox frontend application.

Built with [🏗 scaffold-eth](https://github.com/austintgriffith/scaffold-eth)
- Mainnet: https://juicebox.money
- Rinkeby: https://rinkeby.juicebox.money

For a visual overview of how the mechanism works, see the [Fluid Dynamics file on Figma](https://www.figma.com/file/dHsQ7Bt3ryXbZ2sRBAfBq5/Fluid-Dynamics?node-id=0%3A1)
## Usage

---
1. `Create `.env` from `.example.env`.

## Run local
```bash
yarn install
yarn start
```

Serve the app locally and use with a local blockchain.
1. Clone the respository:

In `packages/app`, Create `.env` from `.example.env`, add required `REACT_APP_INFURA_ID`.
```bash
git clone https://github.com/jbx-protocol/juice-juicehouse.git
cd juice-juicehouse
```

```bash
yarn install
```
1. Create an `.env` file in the root directory which mirrors the `.sample.env` file.

> start 👷[Hardhat](https://hardhat.org/) local blockchain:
1. Install dependencies and start the app:

```bash
yarn chain
```
```
yarn install
yarn start
```

> in a second terminal window, deploy contract to local blockchain:
```bash
yarn deploy-local
```

> in a third terminal window, start the app and open http://localhost:3000 to view it
```bash
yarn start
```

🔑 Create wallets links to your app with `yarn wallet` (empty) or `yarn fundedwallet --amount <eth-amount>` (pre-loaded with ETH) and navigate to generated url (http://localhost:3000/pk#\<some-key>)

Note: `yarn fundedwallet` will fail if your local deployer account has a 0 balance. To fund it, first:

- Get account address on local chain using `yarn account`
- Run `yarn send --from 1 --to <deployer-address> --amount 10` to send 10 ETH to deployer account from first auto-generated hardhat account wallet

🔧 Configure 👷[HardHat](https://hardhat.org/config/) by editing `hardhat.config.js` in `packages/hardhat`

> ✨ The [HardHat network](https://hardhat.org/hardhat-network/) provides _stack traces_ and _console.log_ debugging for our contracts ✨
Run `yarn account` to create a local deployer wallet private key. To send ETH to generated wallet on a local chain, run `# yarn send --from <address or account index> --to <receiver address> --amount <ETH amount>`

---

## Deploying contracts

Contracts are located in `packages/hardhat/contracts`.

Each time contracts are deployed, artifacts are copied to:

- `packages/app/src/contracts` where they're used by the frontend

The frontend connects to whichever chain its provider (i.e. Metamask) is using to, and reads the corresponding contract artifacts for that chain. Connecting to a chain that juicebox contracts have not been deployed to will cause the app to fail.

### deploy to local chain

```bash
yarn deploy-local
```

### deploy public chain ropsten

```bash
yarn deploy-rinkeby
```

```bash
yarn deploy-kovan
```

```bash
yarn deploy-mainnet
```

## Frontend .env

Create new `packages/app/.env`, reference `packages/app/.example.env`.

---

## 🔏 Web3 Providers:
## Web3 Providers:

The frontend has two different providers that provide different levels of access to different chains:

`readProvider`: used to read from contracts on network of injected provider (`.env` file points you at testnet or mainnet)

`signingProvider`: your personal wallet, connected to via [Blocknative](https://docs.blocknative.com/onboard).
- `readProvider`: used to read from contracts on network of injected provider (`.env` file points you at testnet or mainnet)
- `signingProvider`: your personal wallet, connected to via [Blocknative](https://docs.blocknative.com/onboard).

---

## Deploying frontend
## Deployment

Frontend deployment is managed automatically through [Fleek](https://app.fleek.co/#/sites/juicebox-kovan).

[kovan.juicebox.money](kovan.juicebox.money) and [rinkeby.juicebox.money](rinkeby.juicebox.money) deploy automatically from `main`.

Automatic deployment does not:

- deploy contracts
[rinkeby.juicebox.money](rinkeby.juicebox.money) deploys automatically from `main`.

## Theme

The app uses the `SemanticTheme` pattern defined in src/models/semantic-theme, which allows mapping style properties to any number of enumerated `ThemeOption`s. These properties are defined in src/constants/theme. Theme styles can be accessed via `ThemeContext` defined in src/contexts/themeContext and instantiated in src/hooks/JuiceTheme, or via CSS root variables.

The app also relies on (antd)[https://ant-design.gitee.io/] components. To make Antd compatible with `SemanticTheme`, overrides are defined in src/styles/antd-overrides.

---

## Contracts

### Tests

Run the Mocha tests:

```sh
$ yarn test
```

## Security

While the code was written with an attention for quality and with extensive test coverage, you shouldn't assume that this library is completely safe to use. The contracts
have not yet been audited by a security researcher. If you discover any security issues, please report them in a DM on Discord.

## Acknowledgements

Juicebox is made possible by Ethereum, and a few libraries made by inspiring developers and teams:

- [OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts)
- Austin Griffith's [Scaffold ETH](https://github.com/austintgriffith/scaffold-eth)
- Paul Razvan Berg's [DS Math](https://github.com/paulrberg/contracts)
- Chainlink's [price oracles](https://github.com/smartcontractkit/chainlink)
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f03a82d

Please sign in to comment.