Skip to content

mabbleio/mab-bridge-frontend

Repository files navigation

Qube Bridge Frontend | for QubeSwap Dex

A Frontend Bridge for EVM Blockchains (Ethereum, BSC, Qubetics, Avalanche etc...)

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

nvv use 20
npm install
npm run dev
# or
yarn install
yarn dev

Open http://localhost:3000 with your browser to see the result.

Notice:

If you are looking to add your token as an Original Chain
token and Destination token to QubeBridge, make sure it is Mintable/Burnable
first and has the "supportsInterface" function if it doesnt, you can copy the
function code below and add it to your token contract src code.

In Case: If your token on the Origin Chain is not a Mintable/Burnable token,
you will have to deploy a custom token contract on the Destination chain with
the Mintable/Burnable functions along with the "supportsInterface" function.

import "https://github.com/mabbleio/contract-deps/blob/main/interfaces/IMintableERC20.sol";

Step 3: Ensure Mintable Tokens Implement ERC165

All tokens marked as mintable must now implement:

function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
    return
        interfaceId == type(IERC165).interfaceId ||
		interfaceId == type(IMintableERC20).interfaceId ||
        super.supportsInterface(interfaceId);
}

QubeBridge: Production Readiness Checklist

QubeBridge Logo

Secure Cross-Chain Bridge for QubeSwap

This document outlines the final production readiness checklist for QubeBridge, ensuring security, efficiency, and reliability before deployment.


📋 Production Checklist Overview

Security & Correctness

Category Status Implementation Details Verification
Overflow Protection ✅ Fixed Uses OpenZeppelin's Math.mulDiv for all fee calculations to prevent arithmetic overflows Test Cases
Reentrancy ✅ Fixed Implements Checks-Effects-Interactions pattern with ReentrancyGuard on all state-changing functions Audit Report
Access Control ✅ Good Strict role separation with:
- controller (daily operations)
- multisig (emergency actions)
- processor (validation)
AccessControl.sol
Input Validation ✅ Improved Comprehensive validation for:
- Supported tokens/chains
- Minimum amounts
- Destination chain IDs
- Deadline bounds
InputValidationTest.t.sol

Performance Optimizations

Category Status Implementation Details Gas Savings
Gas Optimizations ✅ Applied - Cached array lengths in loops
- unchecked blocks for counter increments
- Minimized storage reads
~15-20% reduction
Redundant Storage ✅ Fixed Removed supportedChainIds[] array (redundant with mapping-based checks) 5,000 gas/slot

Oracle & External Systems

Category Status Implementation Details Config
Oracle Timeouts ✅ Fixed Increased from 45 minutes to 1 hour for better Chainlink Automation reliability oracleTimeout = 3600
Chainlink Support ✅ Good - Configurable per-chain support
- Graceful fallback to manual validation
ChainlinkConfig.sol

Monitoring & Transparency

Category Status Implementation Details Example Events
Events ✅ Good Emits comprehensive events for:
- Bridge initiations
- Validations
- Completions
- Cancellations
- Emergency actions
BridgeInitiated
BridgeCompleted
TransactionCancelled

Attack Mitigations

Category Status Implementation Details Protection Level
Front-Running ✅ Mitigated - 48-hour delay for controller cancellations
- Timelocks on critical operations
- Two-step ownership transfer
High
Replay Attacks ✅ Fixed Nonce system per (user, srcChain, destChain) combination Complete
Unauthorized Access ✅ Fixed All privileged functions use onlyRole modifiers Complete

QubeBridge FAQ

🌉 General Questions

1. What is QubeBridge?

QubeBridge is a private, secure cross-chain bridge operated exclusively by Mabble Protocol for QubeSwap DEX users. It enables:

  • Seamless asset transfers between supported blockchains
  • Off-chain validation via a backend processor
  • Multisig-controlled admin operations for security
  • Chainlink Automation support for supported chains



2. Who can use QubeBridge?

  • QubeSwap users: To bridge assets between supported chains
  • Admins:
    • Controller: Manages daily operations (adding tokens/chains, fees)
    • Processor: Validates transactions
    • Multisig: Handles emergency operations

3. What chains/networks are supported?

  • The bridge is deployed on a source chain (srcChainId)
  • Additional chains can be added by the controller
  • Check supported chains with:
    function getSupportedChainIds() external view returns (uint256[] memory)



4. What tokens are supported?

  • Native ETH (use address(0))

  • ERC20 tokens (up to 100 by default)

    • Mintable tokens (burn/mint instead of transferring)
      Check support with:
function isSupportedToken(address token) public



5. What are the fees?

  • Default fee: 2% (configurable up to 5%)

  • Example: Bridging 100 USDC → 2 USDC fee (sent to feeRecipient)

  • Minimum amount: Enforced per token (e.g., minAmount[token])



6. What's the difference between mintable and non-mintable tokens?

Type                    Mechanism                                                Liquidity Needed?
Mintable              Burn on source, mint on destination           ❌ No
Non-mintable      Lock in bridge, transfer from pool              ✅ Yes



7. What's the liquidity pool for?

Bridge:

  • Holds non-mintable tokens (e.g., USDC, DAI) for bridging

Management:

  • Deposit: depositLiquidity(token, amount) (controller/multisig)
  • Withdraw: withdrawLiquidity(token, amount) (emergency only)



© 2025 Mabble Protocol. All rights reserved.
QubeBridge is a private bridge operated by Mabble Protocol exclusively for QubeSwap Dex.

About

Mabble Bridge Frontend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages