DittoBridge Contract

https://bscscan.com/address/0xdF11367EE135C8fb95b70769437FccB63D59092c

Implementation Notes

Our bridge contract DittoBridge is a secure EIP-712–based withdrawal bridge adapted from industry-standard OpenZeppelin components and inspired by designs such as Polygon FxPortal and Immutable X’s off-chain custody bridges. It enables seamless transfers between Ditto’s off-chain ledger and the on-chain DITTO token contract.

The bridge validates signed withdrawal permits issued by the backend using EIP-712 structured data signatures, ensuring tamper-resistant verification and replay protection. Deposits are emitted as on-chain events, allowing the backend to credit users’ off-chain balances.

The contract is implemented entirely with audited OpenZeppelin modules and does not introduce any new or unaudited logic beyond glue code connecting these modules.


Key Components


What We Changed vs Reference Designs (and Why)

  1. Simplified architecture: We removed message-passing layers (e.g., child/parent state sync) and implemented a single-chain bridge focused on off-chain balance verification.
  2. Added EIP-712 withdrawal slips: Our version explicitly binds each slip to (user, amount, nonce, expiry), with backend signer rotation for operational security.
  3. Added deposit event tracking: Each user deposit emits a DepositCompleted event with a hashed external reference (e.g., Telegram ID) for the backend to process credits deterministically.
  4. Vault controls:
  5. Pausable safety: All external flows (deposit and withdraw) are guarded by whenNotPaused.