Introduction
Orange Bridge is a cross-chain interoperability solution connecting Bitcoin’s BRC-20 tokens and Ethereum’s ERC-20 ecosystem. Its stack includes:
- Smart Contracts for burning/minting ERC-20 representations
- Event Listeners on both Bitcoin and EVM chains
- Token Sending Services for BRC-20 and ERC-20 transfers
- Web DApp UI for user interactions
The team engaged Three Sigma to validate that no logical gaps could lead to fund loss, stuck tokens, or signature forgery in the core bridge contracts.
Scope of the Engagement
- File audited:
orange-bridge-contract
- Team: 1 auditor - 3 days
- Chain: Ethereum
Audit Date: 2024-07-15
Language: Solidity
Type: Code Audit
Results and Findings
Key Critical Issues
No critical issues were identified.
Notable High-Severity Issues
No high-severity issues were identified.
Notable Medium-Severity Issues
Balance check ignores reserved fees
- Description:
Vault.withdraw()
only checks address(this).balance >= amount
, allowing withdrawals to dip into unclaimed fees. - Resolution: Updated to
address(this).balance - totalFees >= amount
, ensuring fee reserves remain intact.
Use of address.transfer
can block withdrawals
- Description:
address.transfer
forwards only 2,300 gas, which can fail under changing gas costs or with contract wallets. - Resolution: Swapped to
address.call{value: amount}("")
with full gas stipends.
Fee comparisons permit overpayment
- Description:
>= fee
checks in BRC20Factory.burn()
and Vault.deposit()
let users overpay and lose the excess, which isn’t tracked. - Resolution: Changed to strict
== fee
to prevent inadvertent overpayment.
Notable Low-Severity Issues
Two-step ownership transfer recommended
- Description: Single-step
Ownable
risks accidental owner changes. - Resolution: Adopted
Ownable2Step
with pendingOwner
and acceptOwnership()
.
Missing token validation
- Description: Factory and Vault accept any token address, risking deposits of invalid tokens.
- Resolution: Added
isBRC20
mapping and guards to ensure only factory-created tokens are handled.
In conclusion
Three Sigma’s three-day review of Orange Bridge uncovered no critical or high-severity flaws. All medium-severity bugs around withdrawals, fee handling, and gas-safe transfers were fixed. Low-severity suggestions and best-practice optimizations—ranging from two-step owner handover to domain-separator resilience—were also implemented. With these updates, Orange Bridge’s contracts are robust, gas-efficient, and ready for secure cross-chain operation.