forked from jbx-protocol/juice-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b43eca
commit f03a82d
Showing
633 changed files
with
83 additions
and
65,125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.