Skip to main content
Bebop has introduced the BebopRouter 0xBeb0009ACa35087ce7cCF11637E24dd1Aad3bf2A contract, which now wraps BebopSettlement extending its functionality.

Do you need to migrate?

With Standard approvals, no changes are required if your integration already reads these fields from the quote response. Confirm both:
  • Approvals. You approve the approvalTarget from the quote response, not a hardcoded address. See Token approvals.
  • Broadcast. You send the returned tx object as-is; tx.to already targets the correct contract.
If you hardcoded the BebopSettlement address anywhere (for approvals or as the transaction target), switch to reading approvalTarget and tx from the quote response.

Reading the calldata

With Standard approvals, Bebop returns calldata ready to broadcast in tx.data. It calls the router’s swap function:
For a concrete reference, see this example transaction.

Permit2 self-execution

BebopRouter supports Permit2 self-execution for ERC-20 sell tokens.
1

Request a quote

Add gasless=false&approval_type=Permit2 to your quote request. Set taker_address to the user who owns the tokens, not your wrapper contract.
2

Approve Permit2

If needed, approve quote.approvalTarget on the sell token for at least quote.toSign.permitted.amount. For this flow, approvalTarget is the Permit2 contract.
3

Sign the permit

Have the taker sign quote.toSign as the EIP-712 message using the Permit2 witness types. Use the domain { name: "Permit2", chainId: quote.chainId, verifyingContract: quote.approvalTarget } without a version. Keep spender as returned: it is BebopRouter, not your wrapper.
4

Add the signature and submit

The returned tx.data calls settle with an empty userSignature. With an ethers v6 Interface for BebopRouter, replace that final argument:
Simulate the completed transaction before submission. Then broadcast the updated quote.tx, or call quote.tx.to from your wrapper with the updated calldata.