diff --git a/docs/hackathon/images/liquity-deployment-local.png b/docs/hackathon/images/liquity-deployment-local.png new file mode 100644 index 00000000..704afd88 Binary files /dev/null and b/docs/hackathon/images/liquity-deployment-local.png differ diff --git a/docs/hackathon/images/liquity-deployment.png b/docs/hackathon/images/liquity-deployment.png new file mode 100644 index 00000000..8339a110 Binary files /dev/null and b/docs/hackathon/images/liquity-deployment.png differ diff --git a/docs/hackathon/images/liquity-original-1.png b/docs/hackathon/images/liquity-original-1.png new file mode 100644 index 00000000..bc62bdab Binary files /dev/null and b/docs/hackathon/images/liquity-original-1.png differ diff --git a/docs/hackathon/images/liquity-original-2.png b/docs/hackathon/images/liquity-original-2.png new file mode 100644 index 00000000..7fc9cc22 Binary files /dev/null and b/docs/hackathon/images/liquity-original-2.png differ diff --git a/docs/hackathon/images/venus-implementation.png b/docs/hackathon/images/venus-implementation.png new file mode 100644 index 00000000..8b7184c7 Binary files /dev/null and b/docs/hackathon/images/venus-implementation.png differ diff --git a/docs/hackathon/liquity.md b/docs/hackathon/liquity.md new file mode 100644 index 00000000..e9c625a3 --- /dev/null +++ b/docs/hackathon/liquity.md @@ -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: + + +
+ +## 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 --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: + + +
+ +## 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/). + + +
+
+ + +
+ +::: \ No newline at end of file diff --git a/docs/hackathon/migration-guide.md b/docs/hackathon/migration-guide.md deleted file mode 100644 index 8090378e..00000000 --- a/docs/hackathon/migration-guide.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -id: "migration-guide" -title: "Migration Guide" -slug: "/migration-guide" -sidebar_position: 4 ---- - -The guide will provide general instructions on how to select an open-source decentralized application (dApp) suitable for the [Super Hackathon](https://hackathon.superprotocol.com/) and migrate it to the opBNB blockchain. - -It will be available on October 13, 2025, at 11:00 UTC. \ No newline at end of file diff --git a/docs/hackathon/rules.md b/docs/hackathon/rules.md index a0d4a1bf..f45cc179 100644 --- a/docs/hackathon/rules.md +++ b/docs/hackathon/rules.md @@ -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.). @@ -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/). diff --git a/docs/hackathon/venus-protocol.md b/docs/hackathon/venus-protocol.md new file mode 100644 index 00000000..f6a05950 --- /dev/null +++ b/docs/hackathon/venus-protocol.md @@ -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: + + +
+ +## 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 --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 \ No newline at end of file