Skip to content

Commit

Permalink
Add LUSD bonds feature
Browse files Browse the repository at this point in the history
  • Loading branch information
edmulraney committed Aug 19, 2022
1 parent 448b179 commit 8441132
Show file tree
Hide file tree
Showing 95 changed files with 159,096 additions and 151 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ node_modules

# Don't track NPM lockfile (we use Yarn)
package-lock.json

# Don't track hardhat mainnet fork cache
cache

# ngrok config is individual to each dev
ngrok.config.yml
147,236 changes: 147,236 additions & 0 deletions .yarn/releases/yarn-1.19.2.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


yarn-path ".yarn/releases/yarn-1.19.2.cjs"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Visit [liquity.org](https://www.liquity.org) to find out more and join the discu
- [Start a local blockchain and deploy the contracts](#start-a-local-blockchain-and-deploy-the-contracts)
- [Start dev-frontend in development mode](#start-dev-frontend-in-development-mode)
- [Start dev-frontend in demo mode](#start-dev-frontend-in-demo-mode)
- [Start dev-frontend against a mainnet fork RPC node](#start-dev-frontend-against-a-mainnet-fork-rpc-node)
- [Build dev-frontend for production](#build-dev-frontend-for-production)
- [Configuring your custom frontend](#configuring-your-custom-dev-ui)
- [Running a frontend with Docker](#running-dev-ui-with-docker)
Expand Down Expand Up @@ -1534,6 +1535,24 @@ When you no longer need the demo mode, press Ctrl+C in the terminal then run:
yarn stop-demo
```

#### Start dev-frontend against a mainnet fork RPC node

This will start a hardhat mainnet forked RPC node at the block number configured in `hardhat.config.mainnet-fork.ts`, so you need to make sure you're not running a hardhat node on port 8545 already.

You'll need an Alchemy API key to create the fork.

```
ALCHEMY_API_KEY=enter_your_key_here yarn start-fork:rpc-node
```

```
yarn start-demo:dev-frontend
```

This spawns a modified version of dev-frontend that ignores MetaMask, and directly uses the local blockchain node. Every time the page is reloaded (at http://localhost:3000). Additionally, transactions are automatically signed, so you no longer need to accept wallet confirmations. This lets you play around with Liquity more freely.

When you no longer need the forked frontend mode, press Ctrl+C.

#### Build dev-frontend for production

In a freshly cloned & installed monorepo, or if you have only modified code inside the dev-frontend package:
Expand Down
25 changes: 25 additions & 0 deletions hardhat.config.mainnet-fork.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { HardhatUserConfig } from "hardhat/config";

const alchemyApiKey = process.env.ALCHEMY_API_KEY;

const config: HardhatUserConfig = {
solidity: "0.7.3",
networks: {
hardhat: {
chainId: 1,
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}`,
blockNumber: 14705200
},
accounts: [
{
privateKey: "0x4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7",
balance: "100000000000000000000000"
}
],
initialBaseFeePerGas: 0
}
}
};

export default config;
13 changes: 13 additions & 0 deletions ngrok.config.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "2"
region: "eu"
web_addr: 127.0.0.1:41356
tunnels:
web:
addr: 32318
proto: http
schemes: [http]
host_header: rewrite
rpc:
addr: 8545
proto: http
schemes: [http]
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
"build:dev-frontend": "yarn workspace @liquity/dev-frontend build",
"build:subgraph": "yarn workspace @liquity/subgraph build",
"deploy": "yarn workspace @liquity/lib-ethers hardhat deploy",
"deploy:chicken-bonds": "yarn --cwd ../ChickenBond deploy-fork compile publish:local",
"watch:chicken-bonds": "yarn --cwd ../ChickenBond watch",
"link:chicken-bonds": "yarn workspace @liquity/dev-frontend link:chicken-bonds",
"unlink:chicken-bonds": "yarn workspace @liquity/dev-frontend unlink:chicken-bonds",
"docs": "run-s docs:*",
"docs:collect-sdk-apis": "node scripts/collect-sdk-apis.js",
"docs:api-documenter": "api-documenter generate -i temp/sdk-apis -o docs/sdk",
Expand Down Expand Up @@ -76,6 +80,8 @@
"start-demo:dev-chain": "yarn start-dev-chain",
"start-demo:dev-frontend": "yarn workspace @liquity/dev-frontend start-demo",
"stop-demo": "yarn stop-dev-chain",
"start-fork": "hardhat --config hardhat.config.mainnet-fork.ts node",
"start-tunnel": "./scripts/start-local-tunnel.sh",
"test": "run-s test:*",
"test:lib-base": "yarn workspace @liquity/lib-base test",
"test:lib-ethers": "yarn workspace @liquity/lib-ethers test",
Expand All @@ -94,6 +100,7 @@
"@commitlint/config-conventional": "^12.0.1",
"@microsoft/api-documenter": "^7.12.6",
"fs-extra": "^9.1.0",
"hardhat": "^2.9.6",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.2",
"semantic-release": "^17.4.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"BLUSD_AMM_ADDRESS": "0xC1Ce2957B033227Bf6Da8ff5961adF5730462f2F",
"BLUSD_AMM_STAKING_ADDRESS": "0x3EEd7D3468E2F3aB10FD758aC005eAb100265a9c",
"BLUSD_TOKEN_ADDRESS": "0x246Cb09151fEA4a8107FfD6354C517babB830692",
"BOND_NFT_ADDRESS": "0x996aBC077399769794B99bdc6316EB5591C50bCC",
"CHICKEN_BOND_MANAGER_ADDRESS": "0xA289111CC4b306E3F5F15c654D4c318B3dA51813",
"LUSD_OVERRIDE_ADDRESS": "0x600df0dE0c53d890a3BB532d4983882d7368faF0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { BOND_NFT_ADDRESS, CHICKEN_BOND_MANAGER_ADDRESS, BLUSD_TOKEN_ADDRESS, BLUSD_AMM_ADDRESS, BLUSD_AMM_STAKING_ADDRESS, LUSD_OVERRIDE_ADDRESS, } from './addresses.json';
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LUSD_OVERRIDE_ADDRESS = exports.BLUSD_AMM_STAKING_ADDRESS = exports.BLUSD_AMM_ADDRESS = exports.BLUSD_TOKEN_ADDRESS = exports.CHICKEN_BOND_MANAGER_ADDRESS = exports.BOND_NFT_ADDRESS = void 0;
var addresses_json_1 = require("./addresses.json");
Object.defineProperty(exports, "BOND_NFT_ADDRESS", { enumerable: true, get: function () { return addresses_json_1.BOND_NFT_ADDRESS; } });
Object.defineProperty(exports, "CHICKEN_BOND_MANAGER_ADDRESS", { enumerable: true, get: function () { return addresses_json_1.CHICKEN_BOND_MANAGER_ADDRESS; } });
Object.defineProperty(exports, "BLUSD_TOKEN_ADDRESS", { enumerable: true, get: function () { return addresses_json_1.BLUSD_TOKEN_ADDRESS; } });
Object.defineProperty(exports, "BLUSD_AMM_ADDRESS", { enumerable: true, get: function () { return addresses_json_1.BLUSD_AMM_ADDRESS; } });
Object.defineProperty(exports, "BLUSD_AMM_STAKING_ADDRESS", { enumerable: true, get: function () { return addresses_json_1.BLUSD_AMM_STAKING_ADDRESS; } });
Object.defineProperty(exports, "LUSD_OVERRIDE_ADDRESS", { enumerable: true, get: function () { return addresses_json_1.LUSD_OVERRIDE_ADDRESS; } });
Loading

0 comments on commit 8441132

Please sign in to comment.