Skip to content
Merged

main #372

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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hackathon/images/liquity-deployment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hackathon/images/liquity-original-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hackathon/images/liquity-original-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/hackathon/images/venus-implementation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
205 changes: 205 additions & 0 deletions docs/hackathon/liquity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
---
id: "liquity"
title: "Example: Liquity"
slug: "/liquity"
sidebar_position: 6
---

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.

## 1. Clone the repository

Clone the Liquity V2 (BOLD) repository:

```bash
git clone git@github.com:liquity/bold.git
```

## 2. Install dependencies

Install the required packages:

```bash
pnpm install
```

## 3. Set up the contracts environment

Navigate to the contracts folder and install the dependencies required for Forge:

```bash
cd contracts && forge install
```

## 4. Build the contracts

Compile the smart contracts:

```bash
forge build
```

## 5. Test deployment locally

Before deploying to opBNB, test the setup by deploying to a local blockchain.

### 5.1. Start a local node

Open a new terminal window and run:

```bash
anvil
```

### 5.2. Deploy locally

From the `contracts/` folder, execute:

```bash
./deploy local --open-demo-troves
```

### 5.3. Example output

Below is an example of partial console output:

<img src={require('./images/liquity-deployment-local.png').default} width="auto" height="auto" border="1"/>
<br/>

## 6. Configure for opBNB Deployment

Now that local deployment works, let’s prepare the project for deployment to the opBNB mainnet.

### 6.1. Create the environment file

Copy the environment template:

```bash
cp .env.template .env
```

### 6.2. Update the deployment script

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

Original code:

```ts
// network preset: mainnet
if (networkPreset === "mainnet") {
options.chainId ??= 1;
}
```

Replace with:

```ts
// network preset: mainnet
if (networkPreset === "mainnet") {
options.chainId ??= 204;
options.deployer ??= "your private key";
options.rpcUrl ??= "https://opbnb.superprotocol.com/";
}
```

### 6.3. Update the gas configuration

Modify the gas settings to include the priority gas price.

Original code:

```ts
if (options.gasPrice) {
forgeArgs.push("--with-gas-price");
forgeArgs.push(options.gasPrice);
}
```

Replace with:

```ts
if (options.gasPrice) {
forgeArgs.push("--with-gas-price");
forgeArgs.push(options.gasPrice);
forgeArgs.push("--priority-gas-price");
forgeArgs.push(options.gasPrice);
}
```

## 7. Update the deployment script

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

[DeployLiquity2.s.sol]

This version includes the following modifications:

- 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.

## 8. Deploy and verify on opBNB

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
```

### Notes on verification

During verification, the process may take some time. You might see logs such as:

```
Warning: Verification is still pending...; waiting 15 seconds before trying again (7 tries remaining)
```

Be patient and do not interrupt the process. Verification will complete automatically.

You might also encounter a warning like:

```
Warning: We haven't found any matching bytecode for the following contracts: [0xc3bec8e3f6035d49744b667dd688abd554f6201d].
```

This simply means one auxiliary contract was not verified; the primary contracts, including `PriceFeed`, are verified successfully.

### Example output

Below is an example of a successful deployment log:

<img src={require('./images/liquity-deployment.png').default} width="auto" height="auto" border="1"/>
<br/>

## 9. Locate the required contract address

From the deployment results, find and copy the address of the `PriceFeed` contract:

```
PriceFeed 0xc4efab6547e6fea2735df3b7654c92ef6ff900b0
```

## 10. Submit Your Project

Once the contract is verified, submit your migrated project through the [Super Hackathon webpage](https://hackathon.superprotocol.com/).

Provide the following information:

- Original network: `1`
- Original contract address: `0xCC5F8102eb670c89a4a3c567C13851260303c24F`
- New opBNB contract address: your `PriceFeed` contract address

:::note

The original contract address can be found on [liquity.app](https://liquity.app/).

<img src={require('./images/liquity-original-1.png').default} width="auto" height="auto" border="1"/>
<br/>
<br/>

<img src={require('./images/liquity-original-2.png').default} width="auto" height="auto" border="1"/>
<br/>

:::
10 changes: 0 additions & 10 deletions docs/hackathon/migration-guide.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/hackathon/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ sidebar_position: 2

The original dApp must already use Chainlink Data Feeds in its on-chain logic. See the [list of supported data feeds](/hackathon/data-feeds).

The interface methods (`latestAnswer`, `getAnswer`, `latestRound`, `getRoundData`, `latestRoundData`) must be called from a smart contract (.sol file). If they are called from the frontend (.ts, .js, .tsx, or .jsx files), the dApp will not be accepted.

The dApp must be open-source and have been publicly deployed before September 1, 2025, on Ethereum, Polygon, or BNB Chain.

The chosen dApp’s original smart contracts must be verified on a public block explorer (e.g., Etherscan, BscScan, etc.).
Expand All @@ -35,8 +37,6 @@ Teams must use their own infrastructure for deployment and testing, including RP

Only verified contracts will be accepted—both the original and the migrated versions must be verified on a public block explorer so their source code can be automatically analyzed.

We will provide [instructions](/hackathon/migration-guide) on deploying dApps to opBNB and connecting data feeds on October 13, 2025, at 11:00 UTC.

## Submitting projects

Projects must be submitted through the official [Super Hackathon webpage](https://hackathon.superprotocol.com/).
Expand Down
125 changes: 125 additions & 0 deletions docs/hackathon/venus-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
id: "venus-protocol"
title: "Example: Venus Protocol"
slug: "/venus-protocol"
sidebar_position: 5
---

Follow the steps below to migrate the Venus Protocol Oracle to the opBNB blockchain.

This example demonstrates a complete migration workflow, from repository setup and deployment to contract verification and submission.

## 1. Clone the repository

Clone the project repository:

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

## 2. Install dependencies

Navigate to the cloned repository and install all required dependencies:

```bash
yarn
```

## 3. Configure the environment

### 3.1. Create a `.env` file

```bash
cp .env.example .env
```

### 3.2. Set environment variables

Open the newly created `.env` file and configure the following:

- `DEPLOYER_PRIVATE_KEY`: your private key without the `0x` prefix
- `ETHERSCAN_API_KEY`: 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).

## 4. Verify the environment

Run tests to ensure your environment is properly configured:

```bash
npx hardhat test
```

## 5. Clean existing deployments

Remove any previous deployment data to ensure a clean migration:

```bash
cd deployments/opbnbmainnet && rm -rf ./*
```

## 6. Deploy to opBNB mainnet

Deploy the contract to the opBNB mainnet:

```bash
npx hardhat deploy --network opbnbmainnet --tags "deploy"
```

## 7. Review deployment logs

After successful deployment, review the terminal output:

<img src={require('./images/venus-implementation.png').default} width="auto" height="auto" border="1"/>
<br/>

## 8. Save the implementation address

Locate and copy the deployed address of your contract: `ChainlinkOracle_Implementation`

You will need this address for the verification and submission steps.

## 9. Update your Hardhat configuration

Update the Hardhat configuration to include the correct opBNB network parameters:

In the `hardhat.config.ts` file, find the section under `etherscan.customChains` for `network: "opbnbmainnet"` and replace it with the following:

```ts
{
network: "opbnbmainnet",
chainId: 204,
urls: {
apiURL: 'https://api.etherscan.io/v2/api?chainid=204',
browserURL: 'https://opbnb.bscscan.com/',
},
},
```

## 10. Run verification

Run the verification command:

```bash
npx hardhat verify <ChainlinkOracle_Implementation-address> --network opbnbmainnet
```

## 11. Check the verified contract

After verification, you can view your contract on [opbnb.bscscan.com](https://opbnb.bscscan.com/).

For example: [opbnb.bscscan.com/address/0x6DA2Fe3A44dc2837e1ffc450339Ae107AE1AC2B0\#code](https://opbnb.bscscan.com/address/0x6DA2Fe3A44dc2837e1ffc450339Ae107AE1AC2B0#code)

## 12. Submit the migration

To complete the migration, you’ll need both the original and new contract addresses.

### 10.1. Locate the original deployment

In the cloned repository, open `oracle/deployments/ethereum/ChainlinkOracle_Implementation.json`. Inside, find the original Chainlink Oracle address, for example: `0x36EFe8716fa2ff9f59D528d154D89054581866A5`.

### 10.2. Submit the project

Go to the [Super Hackathon webpage](https://hackathon.superprotocol.com/) and fill out the submission form:

- Original network: `1`
- Original contract address `0x36EFe8716fa2ff9f59D528d154D89054581866A5`
- New opBNB contract address: your `ChainlinkOracle_Implementation` address