Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 18 additions & 6 deletions docs/hackathon/liquity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ Follow the steps below to migrate Liquity V2 (BOLD) to the opBNB blockchain.

This guide is based on the original [Liquity V2 Development & Deployment Guide](https://github.com/liquity/bold/blob/main/INSTRUCTIONS.md) and includes additional comments to help you migrate the project to the opBNB blockchain.

## Prerequisites

- Git
- Node.js ≥20
- pnpm
- Foundry toolchain
- BNB for gas on opBNB

## 1. Clone the repository

Clone the Liquity V2 (BOLD) repository:
Clone the [Liquity V2 (BOLD) repository](https://github.com/liquity/bold):

```bash
git clone git@github.com:liquity/bold.git
Expand Down Expand Up @@ -80,7 +88,7 @@ Copy the environment template:
cp .env.template .env
```

### 6.2. Update the deployment script
### 6.2. Update the network preset

Open the file `bold/contracts/utils/deploy-cli.ts` and modify the configuration for the `"mainnet"` preset to target the opBNB network.

Expand All @@ -99,11 +107,13 @@ Replace with:
// network preset: mainnet
if (networkPreset === "mainnet") {
options.chainId ??= 204;
options.deployer ??= "your private key";
options.deployer ??= "<YOUR_PRIVATE_KEY>";
options.rpcUrl ??= "https://opbnb.superprotocol.com/";
}
```

Replace `<YOUR_PRIVATE_KEY>` with your private key **with** the `0x` prefix.

### 6.3. Update the gas configuration

Modify the gas settings to include the priority gas price.
Expand Down Expand Up @@ -132,11 +142,11 @@ if (options.gasPrice) {

Open the file `bold/contracts/script/DeployLiquity2.s.sol` and replace its contents with the updated version provided here:

[DeployLiquity2.s.sol]
[DeployLiquity2.s.sol](/files/DeployLiquity2.s.sol)

This version includes the following modifications:

- Constants updated for the opBNB network (instead of Ethereum mainnet).
- Constants updated for the opBNB network instead of Ethereum mainnet.
- `chainId` changed from `1` to `204`.
- Unused or unavailable assets on opBNB have been omitted.

Expand All @@ -145,9 +155,11 @@ This version includes the following modifications:
Deploy the project to the opBNB mainnet and verify the contracts:

```bash
./deploy mainnet --gas-price 1 --verify --verifier etherscan --etherscan-api-key <api-key> --verifier-url https://api.etherscan.io/v2/api?chainid=204
./deploy mainnet --gas-price 1 --verify --verifier etherscan --etherscan-api-key <ETHERSCAN_API_KEY> --verifier-url https://api.etherscan.io/v2/api?chainid=204
```

Replace `<ETHERSCAN_API_KEY>` with your Etherscan API key. To obtain it, register on [Etherscan](https://etherscan.io/) and generate a new key in the [API Dashboard](https://etherscan.io/apidashboard).

### Notes on verification

During verification, the process may take some time. You might see logs such as:
Expand Down
7 changes: 4 additions & 3 deletions docs/hackathon/venus-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ This example demonstrates a complete migration workflow, from repository setup a

## Prerequisites

- git
- Git
- Yarn 3.2.0
- Node.js >= 18
- Node.js ≥20
- BNB for gas on opBNB

## 1. Clone the repository

Clone the project repository:
Clone the [Venus Protocol oracle repository](https://github.com/VenusProtocol/oracle):

```bash
git clone git@github.com:VenusProtocol/oracle.git
Expand Down
Loading