This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
nvv use 20npm install
npm run dev
# or
yarn install
yarn devOpen http://localhost:3000 with your browser to see the result.
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);
}
Secure Cross-Chain Bridge for QubeSwap
This document outlines the final production readiness checklist for QubeBridge, ensuring security, efficiency, and reliability before deployment.
| 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 |
| 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 |
| 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 |
| Category | Status | Implementation Details | Example Events |
|---|---|---|---|
| Events | ✅ Good | Emits comprehensive events for: - Bridge initiations - Validations - Completions - Cancellations - Emergency actions |
BridgeInitiatedBridgeCompletedTransactionCancelled |
| 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 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
- QubeSwap users: To bridge assets between supported chains
- Admins:
- Controller: Manages daily operations (adding tokens/chains, fees)
- Processor: Validates transactions
- Multisig: Handles emergency operations
- 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)
-
Native ETH (use address(0))
-
ERC20 tokens (up to 100 by default)
- Mintable tokens (burn/mint instead of transferring)
Check support with:
- Mintable tokens (burn/mint instead of transferring)
function isSupportedToken(address token) public-
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])
Type Mechanism Liquidity Needed?
Mintable Burn on source, mint on destination ❌ No
Non-mintable Lock in bridge, transfer from pool ✅ Yes
- Holds non-mintable tokens (e.g., USDC, DAI) for bridging
- 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.
