Memetroplis ProductionGuideReference

5.4 Cross-Chain Sell Flow

Cross Chain Sell Logic

5.4 Cross-Chain Sell Flow

Scenario: A user on Chain B (BSC) sells tokens that originally came from an Ethereum-launched token.

  1. User Action – Sell (Chain B): The user calls

    sell(token, amount)

    on the BSC TokenFactory, wanting to redeem their tokens for BNB.

  2. Burn on BSC & Message to Ethereum: The BSC TokenFactory takes the tokens from the user and burns them on BSC (reducing BSC’s token supply by that amount). It then prepares a LayerZero message to the Ethereum TokenFactory informing it that $N$ tokens were removed by user X.

  3. Processing on Ethereum: The Ethereum TokenFactory receives the message and updates the global supply $S := S - N$. It calculates the refund amount in the base currency (which in Ethereum’s terms would be ETH). However, since these tokens were originally sold on BSC (or have BNB backing), the actual funds to return are on BSC. The Ethereum factory thus prepares a message back to BSC indicating the amount of BNB to pay out for those N tokens (it might simply echo the original amount the user paid, or calculate based on current curve if partial sells during bonding curve are allowed).

  4. Payout on BSC: The BSC TokenFactory receives the message with the payout info. It then transfers the appropriate amount of BNB from its reserves to the user’s address.

  5. Emit Event: A

    SoldCrosschainMemeToken(srcChainId=1, seller, token, amount=N, payout=Y BNB)

    event is emitted on BSC.

  6. User Receives BNB: The user now has their funds. Their tokens were already burned on BSC in step 2, so their balance went down when they initiated the sell. The global supply on Ethereum is lower, meaning the next buyer (anywhere) sees a slightly lower price due to that sell.

This cross-chain sell ensures that the user gets paid from the chain where the funds are available. If the user had moved tokens from one chain to another, there are scenarios where the TokenFactories might need to route the payout differently or require the user to bridge back first. However, during the bonding phase, it’s expected that most tokens are sold back on the same chain they were bought (since bridging the tokens manually is an advanced use-case that the system doesn’t explicitly require – bridging is implicitly handled by buying/selling on different chains).

5.5 Finalizing and Liquidity Flow